From 3f62800a5f0f9e602a5efaefd3b49b711fa2a84f Mon Sep 17 00:00:00 2001 From: Wille Marcel Date: Wed, 21 Sep 2022 09:28:17 -0300 Subject: [PATCH] Updates --- asset-manifest.json | 8 ++++---- index.html | 2 +- ... precache-manifest.c440cc3767bd0c2379857fc91cb9d86b.js | 8 ++++---- service-worker.js | 2 +- .../js/{main.a3b4e0f0.chunk.js => main.0631e5da.chunk.js} | 4 ++-- ...n.a3b4e0f0.chunk.js.map => main.0631e5da.chunk.js.map} | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) rename precache-manifest.15b58fae62581f664a227c308780e387.js => precache-manifest.c440cc3767bd0c2379857fc91cb9d86b.js (88%) rename static/js/{main.a3b4e0f0.chunk.js => main.0631e5da.chunk.js} (99%) rename static/js/{main.a3b4e0f0.chunk.js.map => main.0631e5da.chunk.js.map} (99%) diff --git a/asset-manifest.json b/asset-manifest.json index 942c3815..934388f6 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,8 +1,8 @@ { "files": { "main.css": "https://osmcha.org/static/css/main.2bb5fb54.chunk.css", - "main.js": "https://osmcha.org/static/js/main.a3b4e0f0.chunk.js", - "main.js.map": "https://osmcha.org/static/js/main.a3b4e0f0.chunk.js.map", + "main.js": "https://osmcha.org/static/js/main.0631e5da.chunk.js", + "main.js.map": "https://osmcha.org/static/js/main.0631e5da.chunk.js.map", "runtime-main.js": "https://osmcha.org/static/js/runtime-main.f55e874f.js", "runtime-main.js.map": "https://osmcha.org/static/js/runtime-main.f55e874f.js.map", "static/css/2.e6a3113b.chunk.css": "https://osmcha.org/static/css/2.e6a3113b.chunk.css", @@ -11,7 +11,7 @@ "static/js/3.18209c6b.chunk.js": "https://osmcha.org/static/js/3.18209c6b.chunk.js", "static/js/3.18209c6b.chunk.js.map": "https://osmcha.org/static/js/3.18209c6b.chunk.js.map", "index.html": "https://osmcha.org/index.html", - "precache-manifest.15b58fae62581f664a227c308780e387.js": "https://osmcha.org/precache-manifest.15b58fae62581f664a227c308780e387.js", + "precache-manifest.c440cc3767bd0c2379857fc91cb9d86b.js": "https://osmcha.org/precache-manifest.c440cc3767bd0c2379857fc91cb9d86b.js", "service-worker.js": "https://osmcha.org/service-worker.js", "static/css/2.e6a3113b.chunk.css.map": "https://osmcha.org/static/css/2.e6a3113b.chunk.css.map", "static/css/main.2bb5fb54.chunk.css.map": "https://osmcha.org/static/css/main.2bb5fb54.chunk.css.map", @@ -27,6 +27,6 @@ "static/css/2.e6a3113b.chunk.css", "static/js/2.df8bbe99.chunk.js", "static/css/main.2bb5fb54.chunk.css", - "static/js/main.a3b4e0f0.chunk.js" + "static/js/main.0631e5da.chunk.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index 568ebcda..9ecb3e94 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -OSMCha
\ No newline at end of file +OSMCha
\ No newline at end of file diff --git a/precache-manifest.15b58fae62581f664a227c308780e387.js b/precache-manifest.c440cc3767bd0c2379857fc91cb9d86b.js similarity index 88% rename from precache-manifest.15b58fae62581f664a227c308780e387.js rename to precache-manifest.c440cc3767bd0c2379857fc91cb9d86b.js index 0a96deef..03ffed40 100644 --- a/precache-manifest.15b58fae62581f664a227c308780e387.js +++ b/precache-manifest.c440cc3767bd0c2379857fc91cb9d86b.js @@ -1,6 +1,6 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ { - "revision": "fec9f0cf7db7f92ceb5a826c81ca9f9c", + "revision": "c5e53710be41ef5e5eb3286f1565c07b", "url": "https://osmcha.org/index.html" }, { @@ -8,7 +8,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ "url": "https://osmcha.org/static/css/2.e6a3113b.chunk.css" }, { - "revision": "1aa20d15438a2b7dd4be", + "revision": "b2bae240088f68c1a286", "url": "https://osmcha.org/static/css/main.2bb5fb54.chunk.css" }, { @@ -28,8 +28,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ "url": "https://osmcha.org/static/js/3.18209c6b.chunk.js.LICENSE.txt" }, { - "revision": "1aa20d15438a2b7dd4be", - "url": "https://osmcha.org/static/js/main.a3b4e0f0.chunk.js" + "revision": "b2bae240088f68c1a286", + "url": "https://osmcha.org/static/js/main.0631e5da.chunk.js" }, { "revision": "8b55a39660420e713d22", diff --git a/service-worker.js b/service-worker.js index b608b58b..fe5090f4 100644 --- a/service-worker.js +++ b/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( - "https://osmcha.org/precache-manifest.15b58fae62581f664a227c308780e387.js" + "https://osmcha.org/precache-manifest.c440cc3767bd0c2379857fc91cb9d86b.js" ); self.addEventListener('message', (event) => { diff --git a/static/js/main.a3b4e0f0.chunk.js b/static/js/main.0631e5da.chunk.js similarity index 99% rename from static/js/main.a3b4e0f0.chunk.js rename to static/js/main.0631e5da.chunk.js index 58f62f47..8e1b97df 100644 --- a/static/js/main.a3b4e0f0.chunk.js +++ b/static/js/main.0631e5da.chunk.js @@ -1,2 +1,2 @@ -(this["webpackJsonposmcha-frontend"]=this["webpackJsonposmcha-frontend"]||[]).push([[0],{110:function(e,t,a){e.exports=a.p+"static/media/banner.ed2bb0d2.png"},111:function(e,t,a){e.exports=a.p+"static/media/work_flow.195ff4f9.png"},119:function(e,t,a){e.exports=a(211)},141:function(e,t,a){},163:function(e,t,a){},211:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),s=a(21),o=a.n(s),c=a(16),l=a(14),i=a(82),u=a(102),p=a.n(u),m=a(112),d=!1,h=!1,g=!0,f=!1,b="https://staging.osmcha.org/api/v1";g&&(b="https://osmcha.org/api/v1"),window.debug_info=function(){return"isDev=".concat(d.toString()," isStaging=").concat(h.toString()," isProd=").concat(g.toString()," isLocal=").concat(f.toString()," stack=").concat("PRODUCTION"," appVersion=").concat("0.85.0"," url=").concat(b)};var v=b,y={};d&&(y.basename="/osmcha-frontend");var E=Object(m.a)(y),x=a(51),k=a(5),O=a(35);function A(e){try{return localStorage.getItem(e)||null}catch(t){return console.warn("Could not read from localStorage."),null}}function j(e,t){try{localStorage.setItem(e,t)}catch(a){console.warn("Could not write to localStorage.")}}function w(e){try{localStorage.removeItem(e)}catch(t){console.warn("Could not delete from localStorage.")}}var N=a(12),C=a.n(N),I=a(13),T=a(2),S=a(85),_=a.n(S),D="pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJjam10OXpmc2YwMXI5M3BqeTRiMDBqMHVyIn0.LIcIDe3TZLSDdTWDoojzNg",M="".concat(v,"/social-auth/"),P="https://www.openstreetmap.org/oauth/authorize";function F(e){return"object"===typeof e?JSON.stringify(e):e}function U(e){return e.ok?e:e.json().then((function(t){if(401===e.status)throw new Error("Authentication error. Sign in again and repeat the operation.");if(401===e.status)throw new Error("Operation not allowed.");if(404===e.status)throw new Error("Resource not found.");if(t&&t.detail)throw new Error(t.detail);if(e.statusText)throw new Error(e.statusText);return Promise.reject("network request failed")}))}function H(e,t,a){var n={};return a.forEach((function(e,t){if(k.Iterable.isIterable(e)){var a=e;n[t]=a.filter((function(e){return k.Iterable.isIterable(e)&&""!==e.get("value")})).map((function(e){return F(e.get("value"))})).join(",")}})),fetch("".concat(v,"/aoi/"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({name:t,filters:n})}).then(U).then((function(e){return e.json()}))}function L(e,t){return fetch("".concat(v,"/aoi/").concat(t,"/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function R(e){return null==e?Promise.resolve():fetch("".concat(v,"/aoi/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function B(e,t,a,n){var r={};return n.forEach((function(e,t){if(k.Iterable.isIterable(e)){var a=e;r[t]=a.filter((function(e){return k.Iterable.isIterable(e)&&""!==e.get("value")})).map((function(e){return F(e.get("value"))})).join(",")}})),fetch("".concat(v,"/aoi/").concat(t,"/"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({name:a,filters:r})}).then(U).then((function(e){return e.json()}))}function G(e,t){return fetch("".concat(v,"/aoi/").concat(t,"/"),{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U)}function V(e,t,a){return _.a.post(M).type("form").send({oauth_token:e}).send({oauth_verifier:a}).send({oauth_token_secret:t}).then((function(e){return e.body})).catch((function(e){return console.error(e),Promise.reject(e)}))}function W(){return _.a.post(M).type("form").then((function(e){return e.body})).catch((function(e){return console.error(e),Promise.reject(e)}))}function z(e){return fetch("".concat(v,"/users/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function J(e,t,a,n){return fetch("".concat(v,"/users/"),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({message_good:t,message_bad:a,comment_feature:n})}).then(U).then((function(e){return e.json()}))}function Y(e,t){return fetch("".concat("https://raw.githubusercontent.com/mapbox/osmcha-frontend/status/status.json"),{method:"GET"}).then(U).then((function(e){return e.json()}))}function K(e,t){return fetch("".concat(v,"/changesets/").concat(e,"/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:t?"Token ".concat(t):""}}).then(U).then((function(e){return e.json()}))}function Q(e,t,a){var n;return n=-1===a?"".concat(v,"/changesets/").concat(e,"/uncheck/"):"".concat(v,"/changesets/").concat(e,"/").concat(a?"set-harmful":"set-good","/"),fetch(n,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:t?"Token ".concat(t):""}}).then(U).then((function(e){return e.json()}))}var q=function(e){var t=new FormData;return Object.keys(e).forEach((function(a){t.append(a,e[a])})),t};function X(e,t,a){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Number.isNaN(parseInt(a.value,10)))throw new Error("tag is not a valid number");return fetch("".concat(v,"/changesets/").concat(e,"/tags/").concat(a.value,"/"),{method:n?"DELETE":"POST",headers:{"Content-Type":"application/json",Authorization:t?"Token ".concat(t):""},body:q({tag_pk:a,id:e})}).then(U).then((function(e){return e.json()}))}function Z(e,t,a){return fetch("".concat(v,"/changesets/").concat(e,"/comment/"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:t?"Token ".concat(t):""},body:JSON.stringify({comment:a})}).then(U).then((function(e){return e.json()}))}function $(e){return fetch("".concat(v,"/blacklisted-users/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function ee(e,t){return fetch("".concat(v,"/blacklisted-users/").concat(t,"/"),{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U)}function te(e,t){return fetch("".concat(v,"/blacklisted-users/"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({username:t.watchlist_user.username,uid:t.watchlist_user.uid})}).then(U).then((function(e){return e.json()}))}var ae=a(36),ne=C.a.mark(ce),re=C.a.mark(le);function se(e){var t=e.kind,a=void 0===t?"error":t,n=e.error,r=e.title,s=e.dismiss,o=void 0===s||s,c=e.autoDismiss,l=void 0===c?5:c,i=e.position,u=void 0===i?"tr":i,p=e.description,m=void 0===p?"Please reload the application. If it still doesnt work please refer to usage guide.":p,d=e.callback,h=e.callbackArgs,g=e.callbackLabel;return n&&n.message&&(m=n.message),n&&n.name&&(r=n.name),"error"===a&&(l=10),{type:"INIT_MODAL",payload:{kind:a,error:n,callbackLabel:g,title:r,dismiss:o,autoDismiss:l,position:u,description:m},callback:d,callbackArgs:h}}function oe(e,t){return Object(I.a)({type:e},t)}function ce(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.h)("INIT_MODAL",le);case 2:case"end":return e.stop()}}),ne)}function le(e){var t,a,n,r,s,o,c;return C.a.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return t=e.payload,a=e.callback,n=e.callbackArgs,r=(new Date).getTime()+parseInt(1e3*Math.random(),10),t.uid=r,l.next=5,Object(T.e)(oe("SHOW_MODAL",t));case 5:if(a){l.next=7;break}return l.abrupt("return");case 7:return l.next=10,Object(T.g)(["ACTIVATE_MODAL_CALLBACK","DISMISS_MODAL"]);case 10:if(s=l.sent,o=s.type,c=s.uid,"DISMISS_MODAL"!==o||r!==c){l.next=15;break}return l.abrupt("return");case 15:if("ACTIVATE_MODAL_CALLBACK"!==o||r!==c){l.next=21;break}return l.next=18,Object(T.b)(O.b,500);case 18:return l.next=20,Object(T.e)(a.apply(void 0,Object(ae.a)(n)));case 20:return l.abrupt("return");case 21:l.next=7;break;case 23:case"end":return l.stop()}}),re)}function ie(e,t){return fetch("".concat(v,"/whitelist-user/").concat(t,"/"),{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U)}function ue(e,t){return fetch("".concat(v,"/whitelist-user/"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({whitelist_user:t})}).then(U).then((function(e){return e.json()}))}var pe=C.a.mark(ke),me=C.a.mark(Oe),de=C.a.mark(Ae),he="TRUSTEDLIST.define",ge="TRUSTEDLIST.add",fe="TRUSTEDLIST.remove",be="TRUSTEDLIST.clear";function ve(e,t){return Object(I.a)({type:e},t)}var ye=function(e){return e.auth.get("token")},Ee=function(e){return ve(ge,{trustedlist_user:e})},xe=function(e){return ve(fe,{trustedlist_user:e})};function ke(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.h)(ge,Oe),Object(T.h)(fe,Ae)]);case 2:case"end":return e.stop()}}),pe)}function Oe(e){var t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(T.f)(ye);case 3:return t=a.sent,a.next=6,Object(T.b)(ue,t,e.trustedlist_user);case 6:return a.next=8,Object(T.e)(se({title:"Success",description:"User ".concat(e.trustedlist_user," added to your Trusted Users list."),kind:"success"}));case 8:a.next=15;break;case 10:return a.prev=10,a.t0=a.catch(0),console.error(a.t0),a.next=15,Object(T.e)(se({error:a.t0}));case 15:case"end":return a.stop()}}),me,null,[[0,10]])}function Ae(e){var t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(T.f)(ye);case 3:return t=a.sent,a.next=6,Object(T.b)(ie,t,e.trustedlist_user);case 6:return a.next=8,Object(T.e)(se({title:"Success",description:"User ".concat(e.trustedlist_user," removed from your Trusted Users list."),kind:"success"}));case 8:a.next=15;break;case 10:return a.prev=10,a.t0=a.catch(0),console.error(a.t0),a.next=15,Object(T.e)(se({error:a.t0}));case 15:case"end":return a.stop()}}),de,null,[[0,10]])}var je=C.a.mark(Fe),we=C.a.mark(Ue),Ne=C.a.mark(He),Ce="WATCHLIST.define",Ie="WATCHLIST.add",Te="WATCHLIST.remove",Se="WATCHLIST.clear";function _e(e,t){return Object(I.a)({type:e},t)}var De=function(e){return e.auth.get("token")},Me=function(e,t){return _e(Ie,{watchlist_user:e,uid:t})},Pe=function(e){return _e(Te,{watchlist_user:e})};function Fe(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.h)(Ie,Ue),Object(T.h)(Te,He)]);case 2:case"end":return e.stop()}}),je)}function Ue(e){var t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(T.f)(De);case 3:return t=a.sent,a.next=6,Object(T.b)(te,t,e);case 6:return a.next=8,Object(T.e)(se({title:"Success",description:"User ".concat(e.watchlist_user.username," (").concat(e.watchlist_user.uid,") added to your watchlist."),kind:"success"}));case 8:a.next=15;break;case 10:return a.prev=10,a.t0=a.catch(0),console.error(a.t0),a.next=15,Object(T.e)(se({error:a.t0}));case 15:case"end":return a.stop()}}),we,null,[[0,10]])}function He(e){var t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(T.f)(De);case 3:return t=a.sent,a.next=6,Object(T.b)(ee,t,e.watchlist_user);case 6:return a.next=8,Object(T.e)(se({title:"Success",description:"User ".concat(e.watchlist_user," removed from your watchlist."),kind:"success"}));case 8:a.next=15;break;case 10:return a.prev=10,a.t0=a.catch(0),console.error(a.t0),a.next=15,Object(T.e)(se({error:a.t0}));case 15:case"end":return a.stop()}}),Ne,null,[[0,10]])}var Le=a(17),Re=a(214),Be=a(219);function Ge(e){if(function(){if(!k.Map.isMap(e))return!1;var t=!0;return e.forEach((function(e,a){k.List.isList(e)?e.forEach((function(e){k.Map.isMap(e)&&e.has("label")&&e.has("value")||(t=!1),k.Map.isMap(e)||(t=!1)})):t=!1})),t}())return!0;throw new Error("The filters that you applied were not correct.")}function Ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=Object(Re.default)(Object(Be.a)(new Date,{days:2+e}),"yyyy-MM-dd");return Object(k.fromJS)({date__gte:[{label:t,value:t}]})}function We(e){return!e||e.has("date__gte")||e.has("date__lte")||(e=1===e.count()&&(e.has("users")||e.has("uids"))?e.merge(Ve(28)):e.merge(Ve())),e&&!e.has("date__lte")&&(e=e.merge(function(){var e=new Date,t=Object(Re.default)(Object(Be.a)(new Date(e.getTime()+60*e.getTimezoneOffset()*1e3),{minutes:5}),"yyyy-MM-dd HH:mm");return Object(k.fromJS)({date__lte:[{label:"",value:t}]})}())),e}function ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(k.Map)(),a=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,s="";(t=We(t)).forEach((function(e,t){if(k.Iterable.isIterable(e)){var a=e.filter((function(e){return k.Iterable.isIterable(e)&&""!==e.get("value")})).map((function(e){return F(e.get("value"))})).join(",");""!==a&&(s+="&".concat(t,"=").concat(encodeURIComponent(a)))}}));var o="".concat(v,"/changesets/?").concat(n?"page_size=".concat(75,"&page=").concat(e+1):"page=".concat(e+1,"&page_size=").concat(75)).concat(s);return r&&(o="".concat(v,"/aoi/").concat(r,"/changesets/?").concat(n?"page_size=".concat(75,"&page=").concat(e+1):"page=".concat(e+1,"&page_size=").concat(75))),fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:a?"Token ".concat(a):""}}).then((function(e){return 401===e.status?Promise.reject(Error("Authentication error. Sign in again and repeat the operation.")):403===e.status?Promise.reject(Error("Operation not allowed.")):e.status>=400&&e.status<600?Promise.reject(Error("Bad request. Please check your filters or your network connection.")):e.json()}))}var Je=a(86);function Ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={};try{(t=Object(Je.parse)(e)).filters&&(t.filters=JSON.parse(t.filters))}catch(a){console.error(a)}finally{return Object(k.fromJS)(t)}}function Ke(e,t){return t&&0!==Object.keys(t).length?Object(Je.stringify)({[e]:JSON.stringify(t)}):""}function Qe(e){return fetch("".concat(v,"/suspicion-reasons/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function qe(e){return fetch("".concat(v,"/tags/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}var Xe=C.a.mark(ct),Ze=C.a.mark(lt),$e=C.a.mark(it),et=C.a.mark(ut),tt="AOI.clear",at="AOI.fetched",nt="AOI.create",rt="AOI.update",st="AOI.loading";function ot(e,t){return Object(I.a)({type:e},t)}function ct(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.i)(rt,ut),Object(T.i)(nt,it)]);case 2:case"end":return e.stop()}}),Xe)}function lt(e){var t,a,n,r,s,o;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,Object(T.e)(ot(st,{loading:!0}));case 2:return c.next=4,Object(T.f)($a);case 4:return t=c.sent,c.next=7,Object(T.b)(L,t,e);case 7:return a=c.sent,c.next=10,Object(T.b)(Qe,t);case 10:return n=c.sent,c.next=13,Object(T.b)(qe,t);case 13:return r=c.sent,s=Object(k.fromJS)(a),c.next=17,Object(T.e)(ot(at,{aoi:s}));case 17:return o=(o=s.getIn(["properties","filters"],Object(k.Map)())).map((function(e,t){if("reasons"===t)return Object(k.fromJS)(e.split(",").map((function(e){return{value:e,label:n.filter((function(t){return t.id===Number(e)}))[0].name}})));if("tags"===t)return Object(k.fromJS)(e.split(",").map((function(e){return{value:e,label:r.filter((function(t){return t.id===Number(e)}))[0].name}})));try{if(JSON.parse(e)&&JSON.parse(e).hasOwnProperty("coordinates"))return Object(k.fromJS)([{value:JSON.parse(e),label:JSON.parse(e)}]);throw SyntaxError}catch(s){var a=e.split(",");return Object(k.fromJS)(a.map((function(e){return{value:e,label:e}})))}})),c.abrupt("return",o);case 20:case"end":return c.stop()}}),Ze)}function it(e){var t,a,n,r,s,o;return C.a.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return t=e.name,a=e.filters,l.prev=1,l.next=4,Object(T.e)(ot(st,{loading:!0}));case 4:return l.next=6,Object(T.f)($a);case 6:return n=l.sent,l.next=9,Object(T.b)(H,n,t,a);case 9:return r=l.sent,s=Object(k.fromJS)(r),l.next=13,Object(T.e)(ot(at,{aoi:s}));case 13:return l.next=15,Object(T.f)(pt);case 15:return o=l.sent,l.next=18,Object(T.e)(Object(c.c)(Object(I.a)(Object(I.a)({},o),{},{pathname:o.pathname,search:"aoi=".concat(r.id)})));case 18:l.next=25;break;case 20:return l.prev=20,l.t0=l.catch(1),console.error(l.t0),l.next=25,Object(T.e)(se({error:l.t0}));case 25:case"end":return l.stop()}}),$e,null,[[1,20]])}function ut(e){var t,a,n,r,s,o;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=e.aoiId,a=e.name,n=e.filters,c.prev=1,c.next=4,Object(T.e)(ot(st,{loading:!0}));case 4:return c.next=6,Object(T.f)($a);case 6:return r=c.sent,c.next=9,Object(T.b)(B,r,t,a,n);case 9:return s=c.sent,o=Object(k.fromJS)(s),c.next=13,Object(T.e)(ot(at,{aoi:o}));case 13:return c.next=15,Object(T.b)(Ge,n);case 15:return c.next=17,Object(T.e)(ot(bt.set,{filters:n}));case 17:return c.next=19,Object(T.e)(ot(ft.fetch,{pageIndex:0,aoiId:t,filters:n}));case 19:c.next=26;break;case 21:return c.prev=21,c.t0=c.catch(1),console.error(c.t0),c.next=26,Object(T.e)(se({error:c.t0}));case 26:case"end":return c.stop()}}),et,null,[[1,21]])}var pt=function(e){return e.routing.location},mt=C.a.mark(Et),dt=C.a.mark(xt),ht=C.a.mark(kt),gt=C.a.mark(Ot),ft={fetch:"CHANGESETS_PAGE_FETCH",fetched:"CHANGESETS_PAGE_FETCHED",modify:"CHANGESETS_PAGE_MODIFY_CHANGESET",loading:"CHANGESETS_PAGE_LOADING",error:"CHANGESETS_PAGE_ERROR",checkNew:"CHANGESETS_PAGE_CHECK_NEW_CHANGESETS",updateNewCount:"CHANGESETS_PAGE_UPDATE_NEW_COUNT",checkNewLoading:"CHANGESETS_PAGE_CHECK_NEW_LOADING"},bt={set:"FILTERS_SET",apply:"FILTERS_APPLY"};function vt(e,t){return Object(I.a)({type:e},t)}var yt=function(e,t){return vt(bt.apply,{filters:e,pathname:t})};function Et(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([xt(),Object(T.i)(bt.apply,kt)]);case 2:case"end":return e.stop()}}),mt)}function xt(){var e,t,a,n;return C.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=3,Object(T.g)(c.b);case 3:if(a=r.sent,n=a.payload,t!==n.search){r.next=7;break}return r.abrupt("continue",0);case 7:if(t=n.search,!e){r.next=11;break}return r.next=11,Object(T.c)(e);case 11:return r.next=13,Object(T.d)(Ot,n);case 13:e=r.sent,r.next=0;break;case 16:case"end":return r.stop()}}),dt)}function kt(e){var t,a,n,r;return C.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t=e.filters,a=e.pathname,n=Ke("filters",t.toJS()),s.next=4,Object(T.f)(At);case 4:return r=s.sent,s.next=7,Object(T.e)(Object(c.c)(Object(I.a)(Object(I.a)({},r),{},{pathname:a||r.pathname,search:n})));case 7:case"end":return s.stop()}}),ht)}function Ot(e){var t,a,n,r;return C.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(s.prev=0,t=Ye(e.search).toObject(),a=t.filters,n=t.aoi,a||(a=Object(k.Map)()),!n){s.next=9;break}return s.next=6,Object(T.b)(lt,n);case 6:a=s.sent,s.next=11;break;case 9:return s.next=11,Object(T.e)(vt(tt));case 11:return s.next=13,Object(T.b)(Ge,a);case 13:return s.next=15,Object(T.e)(vt(bt.set,{filters:a}));case 15:if(!n){s.next=20;break}return s.next=18,Object(T.e)(vt(ft.fetch,{pageIndex:0,filters:a,aoiId:n}));case 18:s.next=22;break;case 20:return s.next=22,Object(T.e)(vt(ft.fetch,{pageIndex:0,filters:a}));case 22:s.next=33;break;case 24:return s.prev=24,s.t0=s.catch(0),console.error(s.t0),s.next=29,Object(T.f)(At);case 29:return(r=s.sent).search="",s.next=33,Object(T.a)([Object(T.e)(se({error:s.t0})),Object(T.e)(Object(c.c)(r))]);case 33:case"end":return s.stop()}}),gt,null,[[0,24]])}var At=function(e){return e.routing.location},jt=function(e){return e.filters.get("filters")},wt=C.a.mark(Bt),Nt=C.a.mark(zt),Ct=C.a.mark(Yt),It=C.a.mark(Kt),Tt="CHANGESETS_PAGE_FETCH",St="CHANGESETS_PAGE_FETCHED",_t="CHANGESETS_PAGE_MODIFY_CHANGESET",Dt="CHANGESETS_PAGE_LOADING",Mt="CHANGESETS_PAGE_ERROR",Pt="CHANGESETS_PAGE_CHECK_NEW_CHANGESETS",Ft="CHANGESETS_PAGE_UPDATE_NEW_COUNT",Ut="CHANGESETS_PAGE_CHECK_NEW_LOADING";function Ht(e,t){return Object(I.a)({type:e},t)}var Lt=function(e,t){return Ht(Tt,{pageIndex:e,nocache:t})},Rt=function(e){return Ht(Pt,{nocache:e})};function Bt(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.i)(Tt,zt),Object(T.i)(_t,Yt),Object(T.i)(Pt,Kt)]);case 2:case"end":return e.stop()}}),wt)}var Gt=function(e){return[e.changesetsPage.getIn(["pageIndex"],0)]},Vt=function(e){return e.auth.get("token")},Wt=function(e){return e.aoi.getIn(["aoi","id"])};function zt(e){var t,a,n,r,s,o,c;return C.a.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(t=e.pageIndex,a=e.nocache,n=e.filters,r=e.aoiId,n){l.next=5;break}return l.next=4,Object(T.f)(jt);case 4:n=l.sent;case 5:if(r){l.next=9;break}return l.next=8,Object(T.f)(Wt);case 8:r=l.sent;case 9:return l.next=11,Object(T.f)(Gt);case 11:return s=l.sent,null==t&&(t=s),l.next=15,Object(T.e)(Ht(Dt,{pageIndex:t}));case 15:return l.prev=15,l.next=18,Object(T.f)(Vt);case 18:if(o=l.sent,!r){l.next=25;break}return l.next=22,Object(T.b)(ze,t,n,o,a,r);case 22:c=l.sent,l.next=28;break;case 25:return l.next=27,Object(T.b)(ze,t,n,o,a);case 27:c=l.sent;case 28:return l.next=30,Object(T.e)(Ht(St,{data:Object(k.fromJS)(c),pageIndex:t}));case 30:l.next=39;break;case 32:return l.prev=32,l.t0=l.catch(15),l.next=36,Object(T.e)(Ht(Mt,{pageIndex:s,error:l.t0}));case 36:return l.t0.name="Failed to load page ".concat(t),l.next=39,Object(T.e)(se({error:l.t0,callback:Ht,callbackLabel:"Retry",callbackArgs:[Tt,{pageIndex:t}]}));case 39:case"end":return l.stop()}}),Nt,null,[[15,32]])}var Jt=function(e){return[e.changesetsPage.getIn(["currentPage"],Object(k.Map)()),e.changesetsPage.getIn(["pageIndex"],0)]};function Yt(e){var t,a,n,r,s,o,c,l;return C.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.changesetId,a=e.changeset,i.prev=1,i.next=4,Object(T.f)(Jt);case 4:if(n=i.sent,r=Object(Le.a)(n,2),s=r[0],o=r[1],c=s.get("features"),!((l=c.findIndex((function(e){return e.get("id")===t})))>-1)){i.next=16;break}return s=s.setIn(["features",l],a),i.next=14,Object(T.e)(Ht(St,{data:s,pageIndex:o}));case 14:return i.next=16,Object(T.e)(Ht(Pt));case 16:i.next=21;break;case 18:i.prev=18,i.t0=i.catch(1),console.error(i.t0);case 21:case"end":return i.stop()}}),Ct,null,[[1,18]])}function Kt(e){var t,a,n,r,s,o,c,l,i,u;return C.a.wrap((function(p){for(;;)switch(p.prev=p.next){case 0:return t=e.nocache,p.prev=1,p.next=4,Object(T.e)(Ht(Ut));case 4:return p.next=6,Object(T.b)(O.b,3e3+2e3*Math.random());case 6:return p.next=8,Object(T.f)((function(e){return[e.filters.get("filters"),e.changesetsPage.get("pageIndex"),e.auth.get("token"),e.aoi.get("aoi").get("id")]}));case 8:return a=p.sent,n=Object(Le.a)(a,4),r=n[0],s=n[1],o=n[2],c=n[3],p.next=16,Object(T.b)(ze,s,r,o,t,c);case 16:return l=p.sent,p.next=19,Object(T.f)((function(e){return e.changesetsPage.get("currentPage")}));case 19:return i=p.sent,u=0,i&&(l=Object(k.fromJS)(l.features.map((function(e){return e.id}))).toSet(),i=i.get("features").map((function(e){return e.get("id")})).toSet(),u=l.subtract(i).size),p.next=24,Object(T.e)(Ht(Ft,{diff:u}));case 24:p.next=29;break;case 26:p.prev=26,p.t0=p.catch(1),console.error(p.t0);case 29:case"end":return p.stop()}}),It,null,[[1,26]])}var Qt,qt={kind:"error",title:"Sign in required",description:"This action requires you to sign in first."};function Xt(e){return Qt?Promise.resolve(Qt[e]):a.e(3).then(a.bind(null,222)).then((function(t){return(Qt=t)[e]})).catch((function(e){console.error(e),console.log("Failed to load module changeset-map")}))}var Zt=a(97);function $t(e,t,a){var n=Object(Zt.a)(t.pathname,a);return n?n.params[e]:null}function ea(e){var t=parseInt($t("id",e,"/changesets/:id"),10);return!t||Number.isNaN(t)?null:t}function ta(e){var t=parseInt($t("id",e,"/:id"),10);return!t||Number.isNaN(t)?null:t}var aa=C.a.mark(Oa),na=C.a.mark(Aa),ra=C.a.mark(ja),sa=C.a.mark(Ia),oa=C.a.mark(_a),ca=C.a.mark(Da),la=C.a.mark(Ma),ia="CHANGESET.fetch",ua="CHANGESET.fetched",pa="CHANGESET.change",ma="CHANGESET.loading",da="CHANGESET.error",ha="CHANGESET_MODIFY.modify",ga="CHANGESET_MODIFY.harmful",fa="CHANGESET_MODIFY.revert",ba="CHANGESET_MODIFY.tag",va="CHANGESET_MAP.fetched",ya="CHANGESET_MAP.loading",Ea="CHANGESET_MAP.change",xa="CHANGESET_MAP.error";function ka(e,t){return Object(I.a)({type:e},t)}function Oa(){var e,t,a,n,r;return C.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=3,Object(T.g)(c.b);case 3:return a=s.sent,n=a.payload,s.next=7,Object(T.b)(Aa,n);case 7:if(!(r=s.sent)){s.next=21;break}if(!e){s.next=12;break}return s.next=12,Object(T.c)(e);case 12:if(!t){s.next=15;break}return s.next=15,Object(T.c)(t);case 15:return s.next=17,Object(T.d)(Ia,r);case 17:return e=s.sent,s.next=20,Object(T.d)(_a,r);case 20:t=s.sent;case 21:s.next=0;break;case 23:case"end":return s.stop()}}),aa)}function Aa(e){var t,a;return C.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(t=ta(e))){n.next=5;break}return n.next=4,Object(T.e)(Object(c.d)(Object(I.a)(Object(I.a)({},e),{},{pathname:"/changesets/"+t})));case 4:return n.abrupt("return",!1);case 5:if(a=ea(e)){n.next=8;break}return n.abrupt("return",!1);case 8:return n.next=10,Object(T.f)((function(e){return!e.changeset.get("errorChangeset")&&!e.changeset.get("errorChangesetMap")&&e.changeset.get("changesetId")}));case 10:if(n.sent===a){n.next=13;break}return n.abrupt("return",a);case 13:case"end":return n.stop()}}),na)}function ja(){var e,t,a,n,r,s,o,c,l,i;return C.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=3,Object(T.g)([ga,ba]);case 3:return e=u.sent,u.next=6,Object(T.f)((function(e){return{token:e.auth.get("token"),username:e.auth.getIn(["userDetails","username"])}}));case 6:if(t=u.sent,a=t.token,n=t.username,a){u.next=13;break}return u.next=12,Object(T.e)(se(Object(I.a)({},qt)));case 12:return u.abrupt("continue",0);case 13:if(r=e.changesetId,s=e.oldChangeset){u.next=16;break}return u.abrupt("continue",0);case 16:o=void 0,u.prev=17,u.t0=e.type,u.next=u.t0===ga?21:u.t0===ba?26:31;break;case 21:return c=e.harmful,u.next=24,Object(T.b)(Da,{changesetId:r,oldChangeset:s,token:a,harmful:c,username:n});case 24:return o=u.sent,u.abrupt("break",32);case 26:return l=e.tag,i=e.remove,u.next=29,Object(T.b)(Ma,{changesetId:r,oldChangeset:s,token:a,tag:l,remove:i});case 29:return o=u.sent,u.abrupt("break",32);case 31:return u.abrupt("continue",0);case 32:u.next=40;break;case 34:return u.prev=34,u.t1=u.catch(17),u.next=38,Object(T.e)(ka(fa,{changesetId:r,changeset:s}));case 38:return u.next=40,Object(T.e)(se({error:u.t1}));case 40:if(!o){u.next=43;break}return u.next=43,Object(T.e)(ka(_t,{changesetId:r,changeset:o}));case 43:u.next=0;break;case 45:case"end":return u.stop()}}),ra,null,[[17,34]])}var wa=function(e){return e.changeset.getIn(["changesets"],Object(k.Map)())},Na=function(e){return e.auth.get("token")},Ca=function(e){return e.routing.location};function Ia(e){var t,a,n,r;return C.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,Object(T.f)(wa);case 2:if(t=s.sent,!(a=t.get(e))){s.next=8;break}return s.next=7,Object(T.e)(ka(pa,{changesetId:e}));case 7:return s.abrupt("return");case 8:return s.next=10,Object(T.e)(ka(ma,{changesetId:e}));case 10:return s.prev=10,s.next=13,Object(T.f)(Na);case 13:return n=s.sent,s.next=16,Object(T.b)(K,e,n);case 16:return a=s.sent,s.next=19,Object(T.e)(ka(ua,{data:Object(k.fromJS)(a),changesetId:e}));case 19:s.next=31;break;case 21:return s.prev=21,s.t0=s.catch(10),s.next=25,Object(T.e)(ka(da,{changesetId:e,error:s.t0}));case 25:return s.next=27,Object(T.f)(Ca);case 27:return r=s.sent,s.t0.name="Changeset:".concat(e," failed"),s.next=31,Object(T.e)(se({error:s.t0,callback:c.c,callbackArgs:[r],callbackLabel:"Retry"}));case 31:case"end":return s.stop()}}),sa,null,[[10,21]])}function Ta(e){return Xt("getChangeset").then((function(t){return t(e)}))}var Sa=function(e){return e.changeset.getIn(["changesetMap"],Object(k.Map)())};function _a(e){var t,a,n;return C.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(T.f)(Sa);case 2:if(t=r.sent,!(a=t.get(e))){r.next=8;break}return r.next=7,Object(T.e)(ka(Ea,{changesetId:e}));case 7:return r.abrupt("return");case 8:return r.next=10,Object(T.e)(ka(ya,{changesetId:e}));case 10:return r.prev=10,r.next=13,Object(T.b)(Ta,e);case 13:return a=r.sent,r.next=16,Object(T.e)(ka(va,{data:a,changesetId:e}));case 16:r.next=28;break;case 18:return r.prev=18,r.t0=r.catch(10),r.next=22,Object(T.e)(ka(xa,{changesetId:e,error:r.t0}));case 22:return r.next=24,Object(T.f)(Ca);case 24:return n=r.sent,r.t0.name="Changeset:".concat(e," Map failed"),r.next=28,Object(T.e)(se({error:r.t0,callback:c.c,callbackArgs:[n],callbackLabel:"Retry"}));case 28:case"end":return r.stop()}}),oa,null,[[10,18]])}function Da(e){var t,a,n,r,s,o;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=e.changesetId,a=e.oldChangeset,n=e.token,r=e.harmful,s=e.username,o=a.setIn(["properties","check_user"],-1===r?null:s).setIn(["properties","checked"],-1!==r).setIn(["properties","harmful"],-1===r?null:r),c.next=4,Object(T.e)(ka(ha,{changesetId:t,changeset:o}));case 4:return c.next=6,Object(T.b)(Q,t,n,r);case 6:return c.abrupt("return",o);case 7:case"end":return c.stop()}}),ca)}function Ma(e){var t,a,n,r,s,o,c,l;return C.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=e.changesetId,a=e.oldChangeset,n=e.token,r=e.tag,s=e.remove,!a.getIn(["properties","checked"])){i.next=11;break}return o=a,s?((c=a.getIn(["properties","tags"])).forEach((function(e,t){e.get("id")===r.value&&(l=t)})),o=a.setIn(["properties","tags"],c.delete(l))):(c=a.getIn(["properties","tags"]),o=a.setIn(["properties","tags"],c.push((new k.Map).set("id",r.value).set("name",r.label)))),i.next=6,Object(T.e)(ka(ha,{changesetId:t,changeset:o}));case 6:return i.next=8,Object(T.b)(X,t,n,r,s);case 8:return i.abrupt("return",o);case 11:throw new Error("Only allowed on checked changesets");case 12:case"end":return i.stop()}}),la)}var Pa=C.a.mark(nn),Fa=C.a.mark(rn),Ua=C.a.mark(sn),Ha=C.a.mark(on),La=C.a.mark(cn),Ra="AUTH_POST_SOCIAL_TOKEN",Ba="AUTH_SAVE_OAUTH_OBJ",Ga="AUTH_GET_FINAL_TOKEN",Va="AUTH_SAVE_TOKEN",Wa="AUTH_LOGOUT",za="AUTH_CLEAR_SESSION",Ja="AUTH_LOGIN_ERROR",Ya="AUTH_USER_DETAILS",Ka="AUTH_CLEAR_USER_DETAILS",Qa="UPDATE_USER_DETAILS";function qa(e,t){return Object(I.a)({type:e},t)}var Xa=function(e){return qa(Ga,{oauth_verifier:e})},Za=function(){return qa(Wa)},$a=function(e){return e.auth.get("token")},en=function(e){return e.routing.location},tn=function(e){return e.changeset.get("changesetId")},an=O.b;function nn(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.i)(Qa,cn)]);case 2:case"end":return e.stop()}}),Pa)}function rn(){var e,t,a,n,r,s,o,c,l;return C.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e=1e3,i.next=3,Object(T.f)($a);case 3:t=i.sent;case 4:if(i.prev=5,t){i.next=10;break}return i.next=9,Object(T.b)(on);case 9:t=i.sent;case 10:return i.t0=k.fromJS,i.next=13,Object(T.b)(z,t);case 13:return i.t1=i.sent,a=(0,i.t0)(i.t1),n=a.get("whitelists"),i.t2=k.fromJS,i.next=19,Object(T.b)($,t);case 19:return i.t3=i.sent,r=(0,i.t2)(i.t3),i.t4=k.fromJS,i.next=24,Object(T.b)(Y);case 24:return i.t5=i.sent,s=(0,i.t4)(i.t5),i.next=28,Object(T.e)(qa(he,{trustedlist:n}));case 28:return i.next=30,Object(T.e)(qa(Ce,{watchlist:r}));case 30:return i.next=32,Object(T.e)(qa(Ya,{userDetails:a}));case 32:return i.next=34,Object(T.f)(Gt);case 34:if(!(o=i.sent)){i.next=38;break}return i.next=38,Object(T.e)(qa(Tt,{pageIndex:o}));case 38:return i.next=40,Object(T.f)(tn);case 40:if(!(c=i.sent)){i.next=47;break}return i.next=44,Object(T.b)(K,c,t);case 44:return l=i.sent,i.next=47,Object(T.e)(qa(ua,{data:Object(k.fromJS)(l),changesetId:c}));case 47:if("success"===s.get("status")){i.next=50;break}return i.next=50,Object(T.e)(se({title:"OSMCha Status",description:s.get("message"),kind:s.get("status"),autoDismiss:20,position:"bc"}));case 50:return i.next=52,Object(T.g)(Wa);case 52:return e=1e3,t=void 0,i.next=56,Object(T.b)(sn);case 56:return i.next=58,Object(T.b)(an,e);case 58:i.next=78;break;case 60:return i.prev=60,i.t6=i.catch(5),console.log(i.t6),i.next=65,Object(T.e)(qa(Ja,i.t6));case 65:return i.next=67,Object(T.b)(an,e/2);case 67:return i.t6.name="Error",i.next=70,Object(T.e)(se({error:i.t6,kind:"warning"}));case 70:return i.next=72,Object(T.g)(Wa);case 72:return e*=4,t=void 0,i.next=76,Object(T.b)(sn);case 76:return i.next=78,Object(T.b)(an,e);case 78:i.next=4;break;case 80:case"end":return i.stop()}}),Fa,null,[[5,60]])}function sn(){var e,t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Object(T.b)(w,"token");case 2:return a.next=4,Object(T.b)(w,"oauth_token");case 4:return a.next=6,Object(T.b)(w,"oauth_token_secret");case 6:return a.next=8,Object(T.e)(qa(za));case 8:return a.next=10,Object(T.e)(qa(be));case 10:return a.next=12,Object(T.f)(Gt);case 12:if(!(e=a.sent)){a.next=16;break}return a.next=16,Object(T.e)(qa(Tt,{pageIndex:e}));case 16:return a.next=18,Object(T.e)(qa(Ka));case 18:return a.next=20,Object(T.f)(en);case 20:return t=a.sent,a.next=23,Object(T.e)(Object(c.c)(Object(I.a)(Object(I.a)({},t),{},{pathname:"/"})));case 23:case"end":return a.stop()}}),Ua)}function on(){var e,t,a,n,r,s,o;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,Object(T.b)(W);case 2:return e=c.sent,t=e.oauth_token,a=e.oauth_token_secret,c.next=7,Object(T.e)(qa(Ba,{oauth_token:t,oauth_token_secret:a}));case 7:return c.next=9,Object(T.g)(Ga);case 9:return n=c.sent,r=n.oauth_verifier,c.next=13,Object(T.b)(V,t,a,r);case 13:if(s=c.sent,(o=s.token)&&""!==o){c.next=17;break}throw new Error("invalid token");case 17:return c.next=19,Object(T.b)(j,"token",o);case 19:return c.next=21,Object(T.b)(j,"oauth_token",t);case 21:return c.next=23,Object(T.b)(j,"oauth_token_secret",a);case 23:return c.next=25,Object(T.e)(qa(Va,{token:o,oauth_verifier:r}));case 25:return c.abrupt("return",o);case 26:case"end":return c.stop()}}),Ha)}function cn(e){var t,a,n,r,s;return C.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return t=e.message_good,a=e.message_bad,n=e.comment_feature,o.prev=1,o.next=4,Object(T.f)($a);case 4:if(!(r=o.sent)){o.next=15;break}return o.t0=k.fromJS,o.next=9,Object(T.b)(J,r,t,a,n);case 9:return o.t1=o.sent,s=(0,o.t0)(o.t1),o.next=13,Object(T.e)(qa(Ya,{userDetails:s}));case 13:return o.next=15,Object(T.e)(se({kind:"success",title:"User updated",description:"Your user preferences were updated successfully"}));case 15:o.next=22;break;case 17:return o.prev=17,o.t2=o.catch(1),console.error(o.t2),o.next=22,Object(T.e)(se({error:o.t2}));case 22:case"end":return o.stop()}}),La,null,[[1,17]])}var ln=Object(k.fromJS)({oAuthToken:null,oAuthTokenSecret:null,error:null,token:null,userDetails:null});var un=Object(k.fromJS)({pageIndex:0,currentPage:null,loading:!1,error:null,diff:0,diffLoading:!1});var pn=Object(k.fromJS)({changesetId:null,changesets:new k.Map,loading:!1,errorChangeset:null,changesetMap:new k.Map,loadingChangesetMap:!1,errorChangesetMap:null});var mn=Object(k.fromJS)({error:null,kind:null,duration:null,title:null,dismiss:!0,autoDismiss:5,position:"tr",description:null,uid:null});var dn=Object(k.fromJS)({filters:{},aoi:{},loading:!1,error:null});var hn="SET_STYLE";var gn=function(e){return t=hn,a={style:e},Object(I.a)({type:t},a);var t,a},fn=Object(k.fromJS)({style:"satellite"});var bn=Object(k.fromJS)({trustedlist:null,loading:!1});var vn=Object(k.fromJS)({watchlist:Object(k.List)(),loading:!1});var yn=Object(k.fromJS)({aoi:{},loading:!1,error:null});var En=C.a.mark(xn);function xn(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Bt(),Et(),ct(),Oa(),rn(),nn(),ja(),ce(),ke(),Fe()]);case 2:case"end":return e.stop()}}),En)}var kn=Object(x.c)({changesetsPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:un,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ft:return e.set("diff",t.diff).set("diffLoading",!1);case Ut:return e.set("diffLoading",!0);case Dt:return e.set("pageIndex",t.pageIndex).set("loading",!0).set("diff",0).set("diffLoading",!1).set("error",null);case St:return e.set("currentPage",t.data).set("pageIndex",t.pageIndex).set("loading",!1).set("error",null);case Mt:return e.set("pageIndex",t.pageIndex).set("diff",0).set("loading",!1).set("error",t.error);default:return e}},changeset:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case pa:return e.set("changesetId",t.changesetId).set("loading",!1).set("errorChangeset",null).set("errorChangesetMap",null);case ma:return e.set("changesetId",t.changesetId).set("loading",!0).set("errorChangeset",null);case ua:var a=e.get("changesets").set(t.changesetId,t.data);return e.set("changesets",a).set("changesetId",t.changesetId).set("loading",!1).set("errorChangeset",null);case da:return e.set("changesetId",t.changesetId).set("loading",!1).set("errorChangeset",t.error);case Ea:return e.set("changesetId",t.changesetId).set("errorChangesetMap",null).set("loadingChangesetMap",!1);case va:var n=e.get("changesetMap").set(t.changesetId,t.data);return e.set("changesetMap",n).set("changesetId",t.changesetId).set("loadingChangesetMap",!1).set("errorChangesetMap",null);case ya:return e.set("changesetId",t.changesetId).set("loadingChangesetMap",!0).set("errorChangesetMap",null);case xa:return e.set("changesetId",t.changesetId).set("loadingChangesetMap",!1).set("errorChangesetMap",t.error);case ha:var r=e.get("changesets").set(t.changesetId,t.changeset);return e.set("changesets",r);case fa:var s=e.get("changesets").set(t.changesetId,t.changeset);return e.set("changesets",s).set("errorChangeset",t.error);default:return e}},filters:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case bt.set:return e.set("filters",t.filters).set("loading",!1);default:return e}},mapControls:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case hn:return e.set("style",t.style);default:return e}},aoi:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case st:return e.set("loading",!0);case tt:return e.set("aoi",Object(k.Map)()).set("loading",!1).set("error",null);case at:return e.set("loading",!1).set("error",null).set("aoi",t.aoi);default:return e}},routing:c.f,auth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ln,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ba:return e.set("oAuthToken",t.oauth_token).set("oAuthTokenSecret",t.oauth_token_secret).set("error",null);case Va:return e.set("token",t.token).set("error",null);case za:return Object(k.fromJS)({error:e.get("error")});case Ja:return e.set("error",t.error);case Ya:return e.set("userDetails",t.userDetails);case Ka:return e.set("userDetails",Object(k.Map)());default:return e}},modal:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_MODAL":return e.set("kind",t.kind).set("error",t.error).set("callbackLabel",t.callbackLabel).set("title",t.title).set("dismiss",t.dismiss).set("uid",t.uid).set("autoDismiss",t.autoDismiss).set("position",t.position).set("description",t.description);default:return e}},trustedlist:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case he:return e.set("trustedlist",t.trustedlist).set("loading",!1);case ge:return e.set("trustedlist",e.get("trustedlist").concat([t.trustedlist_user])).set("loading",!1);case fe:return e.set("trustedlist",e.get("trustedlist").filter((function(e){return e!==t.trustedlist_user}))).set("loading",!1);case be:return e.set("trustedlist",Object(k.Map)()).set("loading",!1);default:return e}},watchlist:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce:return e.set("watchlist",t.watchlist).set("loading",!1);case Ie:return e.set("watchlist",e.get("watchlist").concat([Object(k.fromJS)(t.watchlist_user)])).set("loading",!1);case Te:return e.set("watchlist",e.get("watchlist").filter((function(e){return e.get("uid")!==t.watchlist_user}))).set("loading",!1);case Se:return e.set("watchlist",Object(k.Map)()).set("loading",!1);default:return e}}}),On=Object(O.a)(),An=[On,Object(c.e)(E)],jn=x.a.apply(void 0,An),wn={auth:Object(k.Map)({token:A("token"),oAuthToken:A("oauth_token"),oAuthTokenSecret:A("oauth_token_secret"),error:null})},Nn=Object(x.d)(kn,wn,jn);On.run(xn);a(141),a(142),a(143),a(144);var Cn,In=a(7),Tn=a(10),Sn=a(9),_n=a(8);function Dn(e){Cn&&Cn.pageview(e)}function Mn(e){Cn&&Cn.event(e)}function Pn(e){return e.displayName||e.name||"Component"}function Fn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authentication",t=arguments.length>1?arguments[1]:void 0,a=500,n=600,r=[["width",a],["height",n],["left",window.innerWidth.width/2-a/2],["top",window.innerHeight.height/2-n/2]].map((function(e){return e.join("=")})).join(","),s=window.open("about:blank",e,r);s&&(s.location=t)}function Un(e,t,a){var n=new CustomEvent(e,{detail:t});(a||document.body).dispatchEvent(n)}function Hn(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}g&&(Cn=a(82));function Ln(){return new Promise((function(e,t){window.authComplete=function(t){var a=function(e){var t={};return e.split("&").forEach((function(e){var a=e.split("="),n=Object(Le.a)(a,2),r=n[0],s=n[1];t[decodeURIComponent(r)]=decodeURIComponent(s)||null})),t}(t.split("?")[1]);return delete window.authComplete,e(a)}}))}function Rn(e){var t=!1;return{promise:new Promise((function(a,n){e.then((function(e){return t?n({isCanceled:!0}):a(e)})).catch((function(e){return n(t?{isCanceled:!0}:e)}))})),cancel:function(){t=!0}}}function Bn(e){return Rn(new Promise((function(t){return setTimeout(t,e)})))}var Gn=function(){return window.innerWidth<=800},Vn=a(114),Wn=a(50),zn=a.n(Wn),Jn=a(33),Yn=a.n(Jn),Kn=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){return Object(In.a)(this,a),t.apply(this,arguments)}return Object(Tn.a)(a,[{key:"render",value:function(){return r.a.createElement("div",{className:"relative h-auto mt3 scroll-auto ".concat(this.props.className)},r.a.createElement("div",{style:this.props.style,className:"fixed block flex-parent flex-parent--column pb12 flex-parent--center-cross "},this.props.children))}}]),a}(r.a.PureComponent),Qn=a(213),qn=a(221);function Xn(e){var t=e.showZero;return r.a.createElement("div",{className:"flex-parent flex-parent--row flex-parent--wrap ".concat(e.className)},(e.create>-1||t)&&r.a.createElement("div",{className:"cmap-bg-create color-white inline-block px6 txt-s txt-bold round unround-r"},e.create),(e.modify>-1||t)&&r.a.createElement("div",{className:"cmap-bg-modify-old color-white inline-block px6 txt-s txt-bold unround"},e.modify),(e.delete>-1||t)&&r.a.createElement("div",{className:"cmap-bg-delete color-white inline-block px6 txt-s txt-bold round unround-l"},e.delete))}var Zn=a(60),$n=a.n(Zn);function er(e){var t=e.url;return r.a.createElement("a",{className:"link",href:t,target:"_blank",rel:"noopener noreferrer"},t)}function tr(e){var t=e.text;return r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",title:"Translate",href:"http://translate.google.com/#auto/en/".concat(encodeURIComponent(t)),className:"btn btn--xs border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition pl12 pr6"},"Translate",r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle pb3 pl3"},r.a.createElement("use",{xlinkHref:"#icon-share"})))}function ar(e){var t=e.reasons,a=e.userFlag,n=e.underline,s=e.color,o=n?"txt-underline-dotted":"";return r.a.createElement("span",{className:"mb3"},t.map((function(e,t){return r.a.createElement(nr,{key:t,text:e.get("name"),color:s,extraClass:o})})),a&&r.a.createElement(nr,{text:a,color:"purple",extraClass:o}))}var nr=function(e){var t=e.text,a=e.color,n=e.extraClass;return r.a.createElement("span",{className:"mr6"},r.a.createElement("span",{className:"color-".concat(a,"-dark inline-block bg-").concat(a,"-faint px6 txt-s txt-bold ").concat(n)},t))},rr=function(e){var t=e.property,a=e.value,n=e.imageryMatch,s=e.sourceMatch;return r.a.createElement("div",{key:t,className:"col"},r.a.createElement("strong",{title:t,className:"wmax180 txt-s txt-uppercase txt-truncate"},t),r.a.createElement("span",{className:"wmax180 txt-break-word txt-s"},a),"imagery"===t&&r.a.createElement("span",null,r.a.createElement("br",null),n.map((function(e,t){return r.a.createElement("a",{href:e,key:t,className:"color-blue"},Array.isArray(e.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/gim))?e.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/gim)[0]:r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle "},r.a.createElement("use",{xlinkHref:"#icon-share"})))}))),"source"===t&&r.a.createElement("span",null,r.a.createElement("br",null),s.map((function(e,t){return r.a.createElement("a",{href:s,title:s,key:t,className:"color-blue",target:"_blank",rel:"noopener noreferrer"},Array.isArray(e.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/gim))?e.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/gim)[0]:r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle "},r.a.createElement("use",{xlinkHref:"#icon-share"})))}))))},sr=function(e){var t=e.limit,a=e.properties,n=e.imageryMatch,s=e.sourceMatch;return Object.entries(a).map((function(e){var t=Object(Le.a)(e,2),a=t[0],o=t[1];return r.a.createElement(rr,{key:a,property:a,value:o,imageryMatch:n,sourceMatch:s})})).slice(t,t+2)};function or(e){var t=e.properties,a=e.changesetId,s=t.get("source"),o=t.get("imagery_used"),c=t.get("editor"),l=t.get("metadata"),i=t.get("reasons"),u=t.get("comment"),p=new RegExp(/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/gim),m=[];s&&s.indexOf("{switch:a,b,c}.")>-1&&(s=s.replace("{switch:a,b,c}.","")),s&&s.match(p)&&(m=s.match(p),s=s.replace(p,""));var d=[];o&&o.match(p)&&(d=o.match(p),o=o.replace(p,""));var h={};h="Not reported"===o?{editor:c,source:s,imagery:o}:{editor:c,imagery:o,source:s},Array.from(l,(function(e){var t=Object(Le.a)(e,2),a=t[0],n=t[1];a.startsWith("ideditor")||a.startsWith("resolved")||a.startsWith("warnings")||(h[a]=n)}));var g=Object.keys(h).length,f=Object(n.useState)(0),b=Object(Le.a)(f,2),v=b[0],y=b[1];return r.a.createElement("div",null,r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--start flex-parent--wrap py12"},r.a.createElement("div",{className:"flex-parent flex-parent--row flex-parent--wrap mb3"},r.a.createElement("p",{className:"flex-child txt-subhead txt-l txt-break-url ".concat(u?"":"color-gray txt-em")},r.a.createElement($n.a,{text:u||"".concat(a," does not have a comment.")},r.a.createElement(er,null)))),r.a.createElement("div",{className:"flex-parent"},r.a.createElement(tr,{text:u}))),r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--start flex-parent--wrap "},r.a.createElement(ar,{reasons:i,color:"blue"})),r.a.createElement("div",{className:"grid pt12 pb6"},v>0&&r.a.createElement("button",{className:"wmax12 mr6",onClick:function(){return y(v-2)},title:"Previous changeset properties"},r.a.createElement("svg",{className:"icon"},r.a.createElement("use",{xlinkHref:"#icon-chevron-left"}))),r.a.createElement(sr,{properties:h,limit:v,imageryMatch:d,sourceMatch:m}),v+20&&r.a.createElement("span",{className:"txt-s txt-em"},"\xa0(",n," edits)"),"\xa0created\xa0",Object(qn.a)(i,{addSuffix:!0})))),r.a.createElement(or,{changesetId:a,properties:t}))})),ir=a(89),ur=a(62),pr=a.n(ur),mr=a(87),dr=a.n(mr),hr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s-1&&(e="https://"+e.slice(5)),r.a.createElement("div",{className:"p6 flex-parent flex-parent--center-main"},r.a.createElement("span",{style:{background:"url(".concat(this.state.loaded?this.props.url:dr.a,") center center / ").concat(this.props.size,"px no-repeat")},className:"flex-child flex-child--no-shrink border border--2 border--gray h".concat(this.props.size," w").concat(this.props.size," bg-darken25 clip round-full")}),r.a.createElement("img",{alt:"",className:"none",src:this.props.url,onLoad:this.handleImageLoaded.bind(this),onError:this.handleImageErrored.bind(this)}))}}]),a}(r.a.PureComponent),gr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s1)throw new Error("verify array is big")},e.handleVerifyClear=function(){var t=-1!==e.props.trustedlist.indexOf(e.props.user.get("name"));-1!==e.props.watchlist.map((function(e){return e.get("uid")})).indexOf(e.props.user.get("uid"))?e.props.removeFromWatchlist(e.props.user.get("uid")):t&&e.props.removeFromTrustedlist(e.props.user.get("name"))},e}return Object(Tn.a)(a,[{key:"render",value:function(){var e=this;return this.props.watchlist.map((function(e){return e.get("uid")})).includes(this.props.user.get("uid"))?r.a.createElement("div",{className:"flex-parent-inline"},r.a.createElement("span",{className:"btn btn--s border border--1 round color-gray transition pl12 pr6 bg-lighten50 border--red-light"},r.a.createElement("span",null,r.a.createElement("svg",{className:"icon inline-block align-middle pr3 pb3 w18 h18 color-gray"},r.a.createElement("use",{xlinkHref:"#icon-alert"})),"Watchlisted user"),r.a.createElement("svg",{onClick:function(){return e.props.removeFromWatchlist(e.props.user.get("uid"))},className:"icon inline-block align-middle pl6 w24 h24 pointer color-gray"},r.a.createElement("use",{xlinkHref:"#icon-close"})))):this.props.trustedlist&&this.props.trustedlist.includes(this.props.user.get("name"))?r.a.createElement("div",{className:"flex-parent-inline"},r.a.createElement("span",{className:"btn btn--s border border--1 round color-gray transition pl12 pr6 bg-lighten50 border--yellow"},r.a.createElement("span",null,r.a.createElement("svg",{className:"icon inline-block align-middle pr3 pb3 w18 h18 color-gray"},r.a.createElement("use",{xlinkHref:"#icon-star"})),"Trusted user"),r.a.createElement("svg",{onClick:function(t){return e.props.removeFromTrustedlist(e.props.user.get("name"))},className:"icon inline-block align-middle pl6 w24 h24 pointer color-gray"},r.a.createElement("use",{xlinkHref:"#icon-close"})))):r.a.createElement("div",{className:"select-container"},r.a.createElement(kr,{eventTypes:["click","touchend"],value:[],onAdd:function(){},onRemove:function(){},options:[{value:!1,label:"Add to your watchlist"},{value:!0,label:"Add to your trusted users list"}],onChange:this.handleVerify,display:"Trust / Watch user",position:"left"}))}}]),a}(r.a.PureComponent);Or=Object(l.b)((function(e,t){return{trustedlist:e.trustedlist.get("trustedlist"),watchlist:e.watchlist.get("watchlist")}}),{addToWatchlist:Me,removeFromWatchlist:Pe,addToTrustedlist:Ee,removeFromTrustedlist:xe})(Or);var Ar=function(e){var t=e.userName,a=e.linkClasses,n=e.children;if(!t)return null;var s="https://www.openstreetmap.org/user/".concat(t);return r.a.createElement("a",{href:s,target:"_blank",rel:"noopener noreferrer",title:"Open in OSM",className:a||"mx3 btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition"},n)},jr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){return Object(In.a)(this,a),t.apply(this,arguments)}return Object(Tn.a)(a,[{key:"getHarmfulObject",value:function(){return this.props.harmful?{label:"Show Bad only",value:!0}:{label:"Show Good only",value:!1}}},{key:"getLinkContent",value:function(){if(this.props.harmful)return"".concat(this.props.userDetails.get("harmful_changesets")," Bad");var e=this.props.userDetails.get("checked_changesets")-this.props.userDetails.get("harmful_changesets");return"".concat(e," Good")}},{key:"render",value:function(){return r.a.createElement(ir.a,{className:"txt-underline-on-hover txt-bold pointer color-gray",to:{search:Ke("filters",{uids:[{label:this.props.userDetails.get("uid"),value:this.props.userDetails.get("uid")}],harmful:[this.getHarmfulObject()],date__gte:[{label:"",value:""}]}),pathname:"/"}},this.getLinkContent())}}]),a}(r.a.PureComponent),wr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){return Object(In.a)(this,a),t.apply(this,arguments)}return Object(Tn.a)(a,[{key:"renderUidFilterLink",value:function(){return r.a.createElement(ir.a,{className:"txt-underline-on-hover txt-bold pointer color-gray",to:{search:Ke("filters",{uids:[{label:this.props.userDetails.get("uid"),value:this.props.userDetails.get("uid")}],date__gte:[{label:"",value:""}]}),pathname:"/"}},"".concat(this.props.userDetails.get("count")," edits"))}},{key:"render",value:function(){var e=new pr.a.Converter({noHeaderId:!0,simplifiedAutoLink:!0}).makeHtml(this.props.userDetails.get("description")||""),t=this.props.userDetails.get("accountCreated")?Object(qn.a)(Object(Qn.default)(this.props.userDetails.get("accountCreated"),"yyyy-MM-dd'T'HH:mm:ssX",new Date),{addSuffix:!0}):"";return r.a.createElement("div",{className:"px12 py6"},r.a.createElement("h2",{className:"txt-m txt-uppercase txt-bold mr6 mb3"},"User"," ",this.props.userDetails.get("uid")&&"/ ".concat(this.props.userDetails.get("uid"))),this.props.userDetails.get("name")?r.a.createElement("div",{className:"flex-parent flex-parent--column align-items--center justify--space-between mb6"},r.a.createElement("div",null,r.a.createElement(hr,{size:96,url:this.props.userDetails.get("img")}),r.a.createElement("div",{className:"mt6 txt-bold color-gray align-center"},this.props.userDetails.get("name"))),r.a.createElement("div",null,r.a.createElement("p",{className:"txt-s color-gray align-center"},"Joined ".concat(t," | "),this.props.userDetails.get("count")?this.renderUidFilterLink():"".concat(this.props.userDetails.get("changesets_in_osmcha")," edits registered on OSMCha"))),r.a.createElement("div",null,r.a.createElement("p",{className:"txt-s color-gray align-center"},r.a.createElement(jr,{userDetails:this.props.userDetails,harmful:!0}),"\xa0and\xa0",r.a.createElement(jr,{userDetails:this.props.userDetails,harmful:!1}),"\xa0changesets")),r.a.createElement("div",{className:"mt6"},r.a.createElement(Or,{user:this.props.userDetails})),r.a.createElement("div",{className:"mt12"},r.a.createElement(ir.a,{className:"mx3 btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition",to:{search:Ke("filters",{users:[{label:this.props.userDetails.get("name"),value:this.props.userDetails.get("name")}],date__gte:[{label:"",value:""}]}),pathname:"/"}},"OSMCha"),r.a.createElement(Ar,{userName:this.props.userDetails.get("name")},"OSM"),r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",title:"Open in HDYC",className:"mx3 btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition",href:"https://hdyc.neis-one.org/?".concat(this.props.userDetails.get("name"))},"HDYC"),r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",title:"Open in Missing Maps",className:"mx3 btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition",href:"https://www.missingmaps.org/users/#/".concat(this.props.userDetails.get("name"))},"Missing Maps")),this.props.whosThat.size>1&&r.a.createElement("div",{className:"txt-s color-gray"},"Past usernames: \xa0",this.props.whosThat.slice(0,-1).map((function(e,t){return r.a.createElement("span",{key:t,className:"txt-em"},e,"\xa0")}))),r.a.createElement("div",{className:"mt12"},r.a.createElement("p",{className:"txt-subhead txt-s txt-break-url user-description",dangerouslySetInnerHTML:{__html:e}}))):r.a.createElement("div",{className:"flex-parent flex-parent--column align-items--center justify--space-between mb6"},r.a.createElement("div",null,r.a.createElement(hr,{size:96,url:this.props.userDetails.get("img")}),r.a.createElement("div",{className:"mt6 txt-bold color-gray align-center"},this.props.userDetails.get("name"))),r.a.createElement("div",{className:"flex-parent flex-parent--column mt6 mb3"},r.a.createElement(gr,{text:"Sign in to see the user details"}))))}}]),a}(r.a.PureComponent),Nr=a(31),Cr=a.n(Nr),Ir=function(e){var t=e.height,a=e.className;return r.a.createElement("div",{style:{height:t||"auto"},className:"".concat(a," flex-parent flex-parent--column flex-parent--center-cross flex-parent--center-main flex-child--grow")},r.a.createElement("div",{className:"flex-child loading"}))};function Tr(){return r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross bg-gray-faint hfull-55"},r.a.createElement("div",{className:"flex-child flex-child--grow"},"\xa0"),r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross"},r.a.createElement("svg",{className:"icon h160 w160 inline-block align-middle pb3"},r.a.createElement("use",{xlinkHref:"#icon-osm"}))),r.a.createElement("div",{className:"flex-parent flex-parent--column align-center txt-l txt-bold pt12"},"Sign in with your OpenStreetMap account to use OSMCha."),r.a.createElement("div",{className:"flex-parent flex-parent--column align-center txt-l pt36"},r.a.createElement(gr,{className:"border--darken5 border--darken25-on-hover bg-gray-light color-gray-dark",text:"Sign in"})),r.a.createElement("div",{className:"flex-child flex-child--grow"},"\xa0"))}a(165);var Sr,_r,Dr,Mr,Pr,Fr=700,Ur=500;function Hr(e){e&&Dr&&Dr.emit("selectFeature","node|way",e)}var Lr=Cr()((function(){var e=document.getElementById("container");e&&_r&&(Mr?Promise.resolve(Mr):Promise.all([Xt("render"),Xt("getMapInstance")]).then((function(e){return Mr=e[0],Pr=e[1],Mr}))).then((function(t){t&&(Dr=t(e,Sr,{width:Fr+"px",height:Math.max(400,Ur)+"px",data:_r,disableSidebar:!0}))}))}),250),Rr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0&&r.a.createElement("strong",{className:"bg-blue-faint color-blue-dark mx6 px6 py3 txt-s round"},n.size)),0===n.size?r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross mb12"},r.a.createElement("svg",{className:"icon icon--xxl color-darken25"},r.a.createElement("use",{xlinkHref:"#icon-alert"})),r.a.createElement("p",{className:"txt-m"},"No features were flagged for ".concat(a,"."))):r.a.createElement("table",{className:"table osmcha-custom-table my12"},r.a.createElement("thead",null,r.a.createElement("tr",{className:"txt-s txt-uppercase"},r.a.createElement("th",null,"OSM Id"),r.a.createElement("th",null,"Name"),r.a.createElement("th",null,"Reasons"),r.a.createElement("th",null,"Actions"))),r.a.createElement("tbody",null,n.map((function(e,a){return r.a.createElement(Br,{key:a,data:e,changesetReasons:t.get("reasons")})}))))))}var Vr=function(e){var t=e.isActive,a=e.setOpenAll;return r.a.createElement("div",{className:"inline-block fr"},r.a.createElement("button",{className:"txt-s txt-underline pointer",onClick:function(){return a(!t)},role:"switch","aria-checked":t,tabIndex:"0"},t?"Close all":"Open all"))},Wr=function(e){var t=e.isOpen;return r.a.createElement(r.a.Fragment,null,t?r.a.createElement("svg",{className:"icon h18 w18 inline-block",style:{verticalAlign:"text-bottom"}},r.a.createElement("use",{xlinkHref:"#icon-chevron-down"})):r.a.createElement("svg",{className:"icon h18 w18 inline-block",style:{verticalAlign:"text-bottom"}},r.a.createElement("use",{xlinkHref:"#icon-chevron-right"})))};function zr(e){return Object.keys(e).map((function(t){return e[t]}))}function Jr(e){var t=new Map,a=e.map((function(e){return function(e,t){var a=Object.keys(t.properties.tags),n=Object.keys(e.properties.tags),r=n.filter((function(e){return!a.includes(e)})),s=a.filter((function(e){return!n.includes(e)})),o=n.filter((function(e){return!r.includes(e)&&!s.includes(e)})).filter((function(a){return e.properties.tags[a]!==t.properties.tags[a]})),c=new Map;return c.set("id",e.properties.id).set("type",e.properties.type).set("addedTags",r.map((function(t){return["Added tag ".concat(t),e.properties.tags[t]]}))).set("deletedTags",s.map((function(e){return["Deleted tag ".concat(e),t.properties.tags[e]]}))).set("changedValues",o.map((function(a){return["Changed value of tag ".concat(a),[t.properties.tags[a],e.properties.tags[a]]]}))),c}(e[0],e[1])})),n=["addedTags","changedValues","deletedTags"];return a.map((function(e){return n.map((function(a){return e.get(a).forEach((function(a){t.get(a[0])?t.set(a[0],t.get(a[0]).concat([{id:e.get("id"),type:e.get("type"),value:a[1]}])):t.set(a[0],[{id:e.get("id"),type:e.get("type"),value:a[1]}])}))}))})),t}function Yr(e){var t=e.id,a=e.type;return r.a.createElement("li",null,r.a.createElement("span",{className:"pointer txt-bold-on-hover",role:"button",tabIndex:"0",onFocus:function(){return Hr(t)}},a," ",t))}function Kr(e){var t=e.value,a=e.type;if(a.startsWith("Added"))return r.a.createElement("span",{className:"txt-code cmap-bg-create-light"},t);if(a.startsWith("Deleted"))return r.a.createElement("span",{className:"txt-code cmap-bg-delete-light"},t);if(a.startsWith("Changed")){var n=Object(Le.a)(t,2),s=n[0],o=n[1];return r.a.createElement("span",null,r.a.createElement("span",{className:"txt-code cmap-bg-modify-old-light"},s),r.a.createElement("strong",null," \u279c "),r.a.createElement("span",{className:"txt-code cmap-bg-modify-new-light"},o))}return r.a.createElement("div",null)}var Qr=function(e){var t=e.opened,a=e.tag,s=e.features,o=Object(n.useState)(t),c=Object(Le.a)(o,2),l=c[0],i=c[1],u=new k.OrderedSet(s.map((function(e){return e.value}))),p=a.lastIndexOf(" ")+1;return Object(n.useEffect)((function(){return i(t)}),[t]),r.a.createElement("div",null,r.a.createElement("button",{className:"pointer",tabIndex:"0","aria-pressed":l,onClick:function(){return i(!l)}},r.a.createElement(Wr,{isOpen:l}),r.a.createElement("span",{className:"txt-bold"},a.slice(0,p)),r.a.createElement("span",{className:"txt-code"},a.slice(p)),r.a.createElement("strong",{className:"bg-blue-faint color-blue-dark mx6 px6 py3 txt-s round"},s.length)),u.map((function(e,t){return r.a.createElement("div",{className:"ml18 py3",style:{display:l?"block":"none"},key:t},r.a.createElement(Kr,{value:e,type:a}),r.a.createElement("ul",{className:"ml6"},s.filter((function(t){return t.value===e})).map((function(e,t){return r.a.createElement(Yr,{id:e.id,type:e.type,value:e.value,key:t})}))))})))},qr=function(e){var t=e.changes,a=e.openAll;return r.a.createElement(r.a.Fragment,null,t.length?t.map((function(e,t){return r.a.createElement(Qr,{key:t,tag:e[0],features:e[1],opened:a})})):r.a.createElement("span",null,"No tags were changed in this changeset."))},Xr=Object(l.b)((function(e,t){return{changes:e.changeset.get("changesetMap")}}))((function(e){var t=e.changesetId,a=e.changes,s=Object(n.useState)([]),o=Object(Le.a)(s,2),c=o[0],l=o[1],i=Object(n.useState)(!1),u=Object(Le.a)(i,2),p=u[0],m=u[1];return Object(n.useEffect)((function(){var e=[];a&&a.get(t)&&(Jr(zr(a.get(t).featureMap).filter((function(e){return 2===e.length&&"modify"===e[0].properties.action}))).forEach((function(t,a){return e.push([a,t])})),l(e.sort()))}),[a,t]),r.a.createElement("div",{className:"px12 py6"},r.a.createElement("div",{className:"pb6"},r.a.createElement("h2",{className:"inline txt-m txt-uppercase txt-bold mr6 mb3"},"Tag changes"),c.length?r.a.createElement(Vr,{isActive:p,setOpenAll:m}):null),a.get(t)?r.a.createElement(qr,{changes:c,openAll:p}):r.a.createElement(Ir,{className:"pt18"}))}));var Zr=function(e){var t=e.opened,a=e.tag,s=e.features,o=Object(n.useState)(t),c=Object(Le.a)(o,2),l=c[0],i=c[1];return Object(n.useEffect)((function(){return i(t)}),[t]),r.a.createElement("div",null,r.a.createElement("button",{className:"pointer",tabIndex:"0","aria-pressed":l,onClick:function(){return i(!l)}},r.a.createElement(Wr,{isOpen:l}),r.a.createElement("span",{className:"txt-bold"},{create:"Created",modify:"Modified Relations",delete:"Deleted"}[a]),r.a.createElement("strong",{className:"bg-blue-faint color-blue-dark mx6 px6 py3 txt-s round"},s.length)),r.a.createElement("ul",{className:"cmap-vlist",style:{display:l?"block":"none"}},s.map((function(e,t){return r.a.createElement(Yr,{id:e.id,type:e.type,key:t})}))))},$r=Object(l.b)((function(e,t){return{changes:e.changeset.get("changesetMap")}}))((function(e){var t=e.changesetId,a=e.changes,s=Object(n.useState)([]),o=Object(Le.a)(s,2),c=o[0],l=o[1],i=Object(n.useState)(!1),u=Object(Le.a)(i,2),p=u[0],m=u[1];return Object(n.useEffect)((function(){var e=[];a&&a.get(t)&&(function(e){var t=new Map;return e=e.map((function(e){return e[0]})),["create","delete"].map((function(a){return t.set(a,e.filter((function(e){return e.properties.action===a})).map((function(e){return{id:e.properties.id,type:e.properties.type}})))})),t.set("modify",e.filter((function(e){return"modify"===e.properties.action})).filter((function(e){return"relation"===e.properties.type})).map((function(e){return{id:e.properties.id,type:e.properties.type}}))),t}(zr(a.get(t).featureMap)).forEach((function(t,a){return e.push([a,t])})),l(e.filter((function(e){return e[1].length}))))}),[a,t]),r.a.createElement("div",{className:"px12 py6"},r.a.createElement("div",{className:"pb6"},r.a.createElement("h2",{className:"inline txt-m txt-uppercase txt-bold mr6 mb3"},"Other features"),c.length?r.a.createElement(Vr,{isActive:p,setOpenAll:m}):null),a.get(t)?c.length?c.map((function(e,t){return r.a.createElement(Zr,{key:t,tag:e[0],features:e[1],opened:p})})):r.a.createElement("span",null,"No created and deleted features in this changeset."):r.a.createElement(Ir,{className:"pt18"}))}));var es=function(e){var t=e.tag,a=e.features,s=e.opened,o=Object(n.useState)(s),c=Object(Le.a)(o,2),l=c[0],i=c[1];return Object(n.useEffect)((function(){return i(s)}),[s]),r.a.createElement("div",null,r.a.createElement("button",{className:"pointer",tabIndex:"0","aria-pressed":l,onClick:function(){return i(!l)}},r.a.createElement(Wr,{isOpen:l}),r.a.createElement("span",{className:"txt-bold"},{node:"Nodes",way:"Ways",relation:"Relations"}[t]),r.a.createElement("strong",{className:"bg-blue-faint color-blue-dark mx6 px6 py3 txt-s round"},a.length)),r.a.createElement("ul",{className:"cmap-vlist",style:{display:l?"block":"none"}},a.map((function(e,t){return r.a.createElement(Yr,{id:e.id,key:t})}))))},ts=Object(l.b)((function(e,t){return{changes:e.changeset.get("changesetMap")}}))((function(e){var t=e.changesetId,a=e.changes,s=Object(n.useState)([]),o=Object(Le.a)(s,2),c=o[0],l=o[1],i=Object(n.useState)(!1),u=Object(Le.a)(i,2),p=u[0],m=u[1];return Object(n.useEffect)((function(){var e=[];a&&a.get(t)&&(function(e){var t=new Map;return["node","way","relation"].map((function(a){return t.set(a,e.filter((function(e){return"modify"===e[0].properties.action})).filter((function(e){return e[0].properties.type===a})).filter((function(e){return JSON.stringify(e[0].geometry)!==JSON.stringify(e[1].geometry)})).map((function(e){return{id:e[0].properties.id}})))})),t}(zr(a.get(t).featureMap)).forEach((function(t,a){return e.push([a,t])})),l(e.filter((function(e){return e[1].length}))))}),[a,t]),r.a.createElement("div",{className:"px12 py6"},r.a.createElement("div",{className:"pb6"},r.a.createElement("h2",{className:"inline txt-m txt-uppercase txt-bold mr6 mb3"},"Geometry Changes"),c.length?r.a.createElement(Vr,{isActive:p,setOpenAll:m}):null),a.get(t)?c.length?c.map((function(e,t){return r.a.createElement(es,{key:t,tag:e[0],features:e[1],opened:p})})):r.a.createElement("span",null,"No geometry changes in this changeset."):r.a.createElement(Ir,{className:"pt18"}))})),as=function(e){var t=e.children,a=(e.pullDown,e.pullUp,e.className),n=e.style,s=e.bg;return r.a.createElement("div",{className:"mb3 z4 bg-gray-faint ".concat(a," "),style:n},r.a.createElement("div",{className:"".concat(s," scroll-styled scroll-auto hmax360"),style:{minHeight:"248px"}},t))},ns=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0;""!==this.state.value||null===e.changesetIsHarmful||t||(e.changesetIsHarmful?this.setState({value:e.userDetails.get("message_bad")}):this.setState({value:e.userDetails.get("message_good")}))}},{key:"render",value:function(){var e=this;return r.a.createElement("div",null,this.props.token&&r.a.createElement("div",{className:"flex-parent flex-parent--column mt6 mb3"},this.state.success&&r.a.createElement("div",{className:"bg-green-faint color-green inline-block px6 py3 txt-s align-center round my12"},r.a.createElement("strong",null,"Comment successfully posted."),r.a.createElement("br",null),r.a.createElement("span",null,"It will appear on OSMCha after some minutes.")),this.state.error&&r.a.createElement("div",{className:"bg-red-faint color-red-dark inline-block px6 py3 txt-s align-center round my12"},r.a.createElement("strong",null,"It was not possible to post your comment.")),r.a.createElement("div",{className:"grid grid--gut12"},r.a.createElement("div",{className:"col col--12"},r.a.createElement("textarea",{placeholder:"Provide constructive feedback to the mapper with a changeset comment.",className:"textarea",ref:function(t){e.clicked&&(t&&t.select(),e.clicked=!1)},value:this.state.value,onChange:this.onChange}),r.a.createElement("div",{className:"pt6 fr"},r.a.createElement(yr,{className:"input wmax120",onClick:this.handleSubmit},"Post Comment"))))))}}]),a}(r.a.PureComponent),rs=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){return Object(In.a)(this,a),t.apply(this,arguments)}return Object(Tn.a)(a,[{key:"renderComments",value:function(){var e=this.props,t=e.discussions,a=e.changesetAuthor;return 0===t.size?r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross mb12"},r.a.createElement("svg",{className:"icon icon--xxl color-darken25"},r.a.createElement("use",{xlinkHref:"#icon-contact"})),r.a.createElement("p",{className:"txt-m"},"No discussions, yet.")):r.a.createElement("div",{className:""},t.map((function(e,t){return r.a.createElement("div",{key:t,className:"flex-parent flex-parent--column justify--space-between border border--gray-light round p6 my6 mt12"},r.a.createElement("div",{className:"flex-parent flex-parent--row justify--space-between txt-s "},r.a.createElement("span",null,"By"," ",r.a.createElement("strong",null,r.a.createElement(Ar,{userName:e.get("user"),linkClasses:"txt-underline-on-hover pointer"},e.get("user"))," "),a===e.get("user")&&r.a.createElement("span",{style:{color:"#aaa"}},"(changeset author)")),r.a.createElement("span",null,Object(qn.a)(Object(Qn.default)(e.get("date"),"yyyy-MM-dd'T'HH:mm:ssX",new Date),{addSuffix:!0}))),r.a.createElement("div",{className:"flex-parent flex-parent--column mt6 mb3"},r.a.createElement("p",{className:"txt-break-url"},r.a.createElement($n.a,{text:e.get("text")},r.a.createElement(er,null)))),r.a.createElement("div",{className:"flex-parent justify--flex-end"},r.a.createElement(tr,{text:e.get("text")})))})))}},{key:"render",value:function(){var e=this.props,t=e.discussions,a=e.changesetId,n=e.changesetIsHarmful,s=e.changesetAuthor;return r.a.createElement("div",{className:"px12 py6"},r.a.createElement("h2",{className:"txt-m mr6 mb3"},r.a.createElement("span",{className:"txt-uppercase txt-bold"},"Discussions "),"for changeset by ",s),this.props.token?this.renderComments():r.a.createElement("div",null,r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross mb12"},r.a.createElement("svg",{className:"icon icon--xxl color-darken25"},r.a.createElement("use",{xlinkHref:"#icon-contact"}))),r.a.createElement("div",{className:"flex-parent flex-parent--inline flex-parent--center-main mt6 mb3"},r.a.createElement(gr,{text:"Sign in to read and post comments"}))),this.props.token&&r.a.createElement("div",{className:"flex-parent flex-parent--column justify--space-between my6 mt12"},r.a.createElement(ns,{changesetId:a,changesetIsHarmful:n,discussions:t,token:this.props.token,userDetails:this.props.userDetails})))}}]),a}(r.a.PureComponent);rs=Object(l.b)((function(e){return{token:e.auth.get("token"),userDetails:e.auth.get("userDetails")}}))(rs);var ss=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;sMicrosoft Corporation'}},layers:[{id:"bing",type:"raster",source:"bing-tiles",minzoom:0,maxzoom:22}]};Xt("getMapInstance").then((function(t){return t&&t()&&t().renderMap(e)}))},e.toggleOsm=function(){var e={version:8,sources:{"osm-tiles":{type:"raster",tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png","https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256,attribution:'\xa9 OpenStreetMap contributors'}},layers:[{id:"osm",type:"raster",source:"osm-tiles",minzoom:0,maxzoom:22}]};Xt("getMapInstance").then((function(t){return t&&t()&&t().renderMap(e)}))},e}return Object(Tn.a)(a,[{key:"render",value:function(){return r.a.createElement("div",{className:"px12 py6"},r.a.createElement("h2",{className:"txt-m txt-uppercase txt-bold mr6 mb3"},"Map Controls"),r.a.createElement("section",{className:"cmap-filter-action-section cmap-pt3"},r.a.createElement("h6",{className:"cmap-heading pointer txt-bold"},"Filter by actions"),r.a.createElement("ul",{className:"cmap-hlist"},r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"added",defaultChecked:"true",id:"cmap-layer-selector-added",onChange:this.onChange}),r.a.createElement("span",{className:"cmap-label-text"},"Added"),r.a.createElement("span",{className:"cmap-color-box cmap-color-added"}))),r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"modified",defaultChecked:"true",onChange:this.onChange,id:"cmap-layer-selector-modified"}),r.a.createElement("span",{className:"cmap-label-text"},"Modified"),r.a.createElement("span",{className:"cmap-color-box cmap-color-modified-old"}),r.a.createElement("span",{className:"cmap-unicode"},"\u2192"),r.a.createElement("span",{className:"cmap-color-box cmap-color-modified-new"}))),r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"deleted",defaultChecked:"true",onChange:this.onChange,id:"cmap-layer-selector-deleted"}),r.a.createElement("span",{className:"cmap-label-text"},"Deleted"),r.a.createElement("span",{className:"cmap-color-box cmap-color-deleted"}))))),r.a.createElement("section",{className:"cmap-filter-type-section"},r.a.createElement("h6",{className:"cmap-heading pointer txt-bold"},"Filter by type"),r.a.createElement("ul",{className:"cmap-hlist"},r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"nodes",defaultChecked:"true",id:"cmap-type-selector-nodes",onChange:this.onChange}),r.a.createElement("span",{className:"cmap-label-text"},"Nodes"))),r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"ways",defaultChecked:"true",id:"cmap-type-selector-ways",onChange:this.onChange}),r.a.createElement("span",{className:"cmap-label-text"},"Ways"))),r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"relations",defaultChecked:"true",id:"cmap-type-selector-relations",onChange:this.onChange}),r.a.createElement("span",{className:"cmap-label-text"},"Relations"))))),r.a.createElement("section",{className:"cmap-map-style-section cmap-pb3"},r.a.createElement("h6",{className:"cmap-heading pointer txt-bold"},"Map style"),r.a.createElement(kr,{eventTypes:["click","touchend"],value:this.props.style,onAdd:function(){},onRemove:function(){},options:this.layerOptions,onChange:this.onLayerChange,display:this.getLayerDropdownDisplay(this.props.style),position:"left"})))}}]),a}(r.a.PureComponent);function os(e){var t=e.active,a=e.onClick,n=e.children,s=e.className;return r.a.createElement("span",{className:"".concat(s," mx6 cursor-pointer txt-s inline-block txt-bold round p6 transition color-darken75\n ").concat(t?"bg-gray-faint":"bg-white-on-hover bg-lighten50"),onClick:a},n)}ss=Object(l.b)((function(e,t){return{style:e.mapControls.get("style")}}),{updateStyle:gn})(ss);var cs={label:"FILTER_BINDING",bindings:["\\"]},ls={label:"HELP_BINDING",bindings:["/","?"]},is={label:"NEXT_CHANGESET",bindings:["down","right"]},us={label:"PREV_CHANGESET",bindings:["up","left"]},ps={label:"REFRESH_CHANGESETS",bindings:["R","r"]},ms={label:"CHANGESET_DETAILS_DETAILS",bindings:["1"]},ds={label:"CHANGESET_DETAILS_SUSPICIOUS",bindings:["2"]},hs={label:"CHANGESET_DETAILS_TAGS",bindings:["3"]},gs={label:"CHANGESET_DETAILS_GEOMETRY_CHANGES",bindings:["4"]},fs={label:"CHANGESET_DETAILS_OTHER_FEATURES",bindings:["5"]},bs={label:"CHANGESET_DETAILS_DISCUSSIONS",bindings:["6"]},vs={label:"CHANGESET_DETAILS_USER",bindings:["7"]},ys={label:"CHANGESET_DETAILS_MAP",bindings:["8"]},Es={label:"VERIFY_GOOD",bindings:["G","g"]},xs={label:"VERIFY_BAD",bindings:["B","b"]},ks={label:"VERIFY_CLEAR",bindings:["C","c","u","U"]},Os={label:"OPEN_IN_JOSM",bindings:["J","j"]},As={label:"OPEN_IN_ID",bindings:["I","i"]},js={label:"OPEN_IN_OSM",bindings:["O","o"]},ws={label:"OPEN_IN_LEVEL0",bindings:["L","l"]},Ns={label:"OPEN_IN_ACHAVI",bindings:["V","v"]},Cs={label:"OPEN_IN_HDYC",bindings:["H","h"]},Is={label:"FILTER_BY_USER",bindings:["A","a"]};function Ts(e){var t=e.bindingsState,a=e.features,n=e.discussions,s=e.toggleDetails,o=e.toggleFeatures,c=e.toggleOtherFeatures,l=e.toggleGeometryChanges,i=e.toggleTags,u=e.toggleDiscussions,p=e.toggleUser,m=e.toggleMapOptions;return r.a.createElement(Kn,{style:{marginTop:8,marginLeft:5}},r.a.createElement(os,{active:t.get(ms.label),onClick:s,className:"unround-r unround-bl"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle "},r.a.createElement("use",{xlinkHref:"#icon-eye"}))),r.a.createElement(os,{active:t.get(ds.label),onClick:o,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle ".concat(a&&0===a.size?"color-darken25":"color-black")},r.a.createElement("use",{xlinkHref:"#icon-alert"}))),r.a.createElement(os,{active:t.get(hs.label),onClick:i,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-hash"}))),r.a.createElement(os,{active:t.get(gs.label),onClick:l,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-point-line"}))),r.a.createElement(os,{active:t.get(fs.label),onClick:c,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-plus"}))),r.a.createElement(os,{active:t.get(bs.label),onClick:u,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle ".concat(0===n.size?"color-darken25":"color-black")},r.a.createElement("use",{xlinkHref:"#icon-contact"}))),r.a.createElement(os,{active:t.get(vs.label),onClick:p,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-user"}))),r.a.createElement(os,{active:t.get(ys.label),onClick:m,className:"unround-r unround-tl"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-map"}))))}function Ss(e,t,a){var n,s;return s=n=function(n){Object(Sn.a)(o,n);var s=Object(_n.a)(o);function o(){var e;Object(In.a)(this,o);for(var t=arguments.length,a=new Array(t),n=0;n/g,replace:'
    '},{type:"output",regex:/\/g,replace:'
  • '},{type:"output",regex:/img src=/g,replace:'img\n class="py12 my12 border border--gray-light border--2"\n style="margin-left: auto;\n margin-right: auto;\n display: block;\n " src='}]});Hs.setFlavor("github"),Hs.setOption("simpleLineBreaks",!1);var Ls=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s=3?Zs(t,e.state.queryType).then((function(e){if(!Array.isArray(e))return a(null,{options:[]});var t=e.map((function(e){return{label:e.display_name,value:e.geojson}}));return a(null,{options:t})})).catch((function(e){return a(e,null)})):a(null,{options:[]})},e.onChangeLocal=function(t){if(t){e.draw.deleteAll();var a=Object(Js.a)(t.value)/Math.pow(10,6)<1e3?.01:.1,n=Object(Ks.a)(t.value,{tolerance:a,highQuality:!0});e.updateMap(Object(Qs.a)(n,{precision:6,coordinates:2}))}},e.handleQueryTypeChange=function(t){e.setState({queryType:t})},e.renderSelect=function(){var t=e.props,a=t.name,n=t.placeholder,s=t.value;return r.a.createElement(Bs.a,{name:a,className:"",value:s,loadOptions:Cr()((function(t,a){return e.getAsyncOptions(t,a)}),500),onChange:e.onChangeLocal,placeholder:n})},e}return Object(Tn.a)(a,[{key:"updateMap",value:function(e){this.map.getSource("feature")?this.map.getSource("feature").setData(e):this.map.addSource("feature",{type:"geojson",data:{type:"Feature",geometry:e}}),void 0===this.map.getLayer("geometry")&&this.map.addLayer({id:"geometry",type:"fill",source:"feature",paint:{"fill-color":"#088","fill-opacity":.6}}),this.setState({geometry:e}),this.props.onChange(this.props.name,Object(k.fromJS)([{label:e,value:e}]));var t=Object(Ys.a)(e);this.map.fitBounds([t.slice(0,2),t.slice(2)],{padding:20})}},{key:"componentDidMount",value:function(){var e=this;Xt("getGL").then((function(t){if(t){var a=t();a.accessToken=D;var n=new a.Map({container:"geometry-map",style:"mapbox://styles/mapbox/light-v9"});e.map=n,e.draw=new Xs.a({displayControlsDefault:!1,controls:{polygon:!0}}),n.addControl(e.draw),n.on("draw.create",e.drawingUpdate),n.on("draw.modechange",e.clearBeforeDraw),n.on("draw.delete",e.drawingUpdate),n.on("draw.update",e.drawingUpdate),n.on("style.load",(function(){try{e.updateMap(e.props.value.get("0").get("value").toJS())}catch(t){TypeError}}))}}))}},{key:"render",value:function(){return r.a.createElement("div",null,r.a.createElement("div",{className:"grid grid--gut12"},r.a.createElement("div",{className:"col col--4"},r.a.createElement(Bs.c,{onChange:this.handleQueryTypeChange,options:this.queryTypeOptions,simpleValue:!0,value:this.state.queryType,placeholder:"Place Type"})),r.a.createElement("div",{className:"col col--8 pl3"},this.renderSelect())),r.a.createElement("div",{className:"grid grid--gut12 pt6"},r.a.createElement("div",{className:"col col--12 map-select"},r.a.createElement("div",{id:"geometry-map"},r.a.createElement("button",{onClick:this.clearMap,className:"pointer z5 mx1 my1 inline-block px6 py3 txt-s bg-white txt-bold round absolute fl",style:{zIndex:2}},"Clear All")))))}}]),a}(r.a.PureComponent);function eo(e){var t=e.display,a=e.children,n=e.description,s=e.handleFocus,o=void 0===s?function(){}:s,c=e.name,l=e.hasValue,i=Gn();return r.a.createElement("div",{className:"ml3 my12 flex-parent flex-parent--column",onClick:function(){return o(c)},onFocus:function(){return o(c)}},r.a.createElement("div",{className:"flex-parent flex-parent--row flex-parent--center-cross mt12 mb6 "},r.a.createElement("span",{className:"relative"},l&&r.a.createElement("svg",{style:{left:-18,top:-9},className:"absolute icon inline-block align-middle color-blue"},r.a.createElement("use",{xlinkHref:"#icon-circle"}))),r.a.createElement("strong",{className:"txt-truncate pointer"},t,"\xa0")),r.a.createElement("div",{className:"grid"},r.a.createElement("span",{className:"col col--6-mxl col--6-ml col--12-mm col--12"},a),!i&&r.a.createElement("span",{className:"col col--3-mxl col--3-ml col--1-mm"},r.a.createElement("span",{className:"desc block relative ml12 wmin120"},r.a.createElement(Yn.a,{transitionName:"filters-desc",transitionAppearTimeout:300,transitionEnterTimeout:300,transitionLeaveTimeout:200},n&&r.a.createElement("span",{key:0,className:"absolute wmin300 bg-white",style:{marginTop:-5}},n))))))}var to=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s1)throw new Error("filter select array is big")},e}return Object(Tn.a)(a,[{key:"componentDidMount",value:function(){this.getAois()}},{key:"componentWillUnmount",value:function(){this.getAoisPromise&&this.getAoisPromise.cancel()}},{key:"getAois",value:function(){var e=this;this.props.token&&(this.getAoisPromise=Rn(R(this.props.token)),this.getAoisPromise.promise.then((function(t){var a=t.features.map((function(e){return{label:e.properties.name,value:e.id}}));e.setState({aoiList:a})})).catch((function(e){return console.log(e)})))}},{key:"renderRssLink",value:function(){if(this.props.aoiId)return r.a.createElement("a",{className:"txt--s pl6",href:"".concat(v,"/aoi/").concat(this.props.aoiId,"/changesets/feed/"),title:"RSS Feed"},r.a.createElement("svg",{className:"icon icon--s mt-neg3 inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-rss"})))}},{key:"renderAoiLink",value:function(){var e=this;if(this.props.aoiId)return r.a.createElement("div",{className:"txt--s pl6 pointer inline",onClick:function(t){return navigator.clipboard.writeText("".concat(v.replace("/api/v1",""),"/?aoi=").concat(e.props.aoiId))},title:"Copy filter URL"},r.a.createElement("svg",{className:"icon icon--s mt-neg3 inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-link"})))}},{key:"renderFilterInfo",value:function(){var e=r.a.createElement(kr,{display:"My Filters",options:this.state.aoiList,onChange:this.onAoiSelect,value:[],onAdd:function(){},onRemove:function(){},position:"left"});if(this.props.token&&this.state.aoiList.length)return r.a.createElement("span",null,e)}},{key:"render",value:function(){var e="";return this.props.token&&(e=r.a.createElement(po,{name:this.props.aoiName,aoiId:this.props.aoiId,aoiList:this.state.aoiList,createAOI:this.props.createAOI,updateAOI:this.props.updateAOI})),r.a.createElement("header",{className:"h55 hmin55 flex-parent px30 bg-gray-faint flex-parent--center-cross justify--space-between color-gray border-b border--gray-light border--1"},r.a.createElement("span",{className:"txt-s color-gray--dark"},this.renderFilterInfo()),r.a.createElement("span",{className:"txt-l txt-bold color-gray--dark"},r.a.createElement("span",null,"Filters",this.props.aoiId&&r.a.createElement("span",null," / ",this.props.aoiName),this.renderAoiLink(),this.renderRssLink())),r.a.createElement("span",{className:"txt-l color-gray--dark"},e,r.a.createElement(yr,{className:"border--0 bg-transparent",onClick:this.props.handleClear},"Reset"),r.a.createElement(yr,{onClick:this.props.handleApply,className:"mx3"},"Apply"),r.a.createElement(ir.a,{to:{search:this.props.search,pathname:"/"},className:"mx3 pointer"},r.a.createElement("svg",{className:"icon icon--m inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-close"})))))}}]),a}(r.a.Component);mo=Object(l.b)((function(e,t){return{location:t.location}}),{push:c.c})(mo);var ho=Object(k.fromJS)({date__gte:[{label:"",value:""}]}),go=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s7e3)e.props.modal({kind:"error",title:"Use Save Filter",description:"Your filter is too big to be applied. You need to Save your Filter to be able to see the results."});else{if(Object(k.is)(e.state.filters,e.props.filters))return void e.props.push(Object(I.a)(Object(I.a)({},e.props.location),{},{pathname:"/"}));e.props.applyFilters(e.state.filters,"/"),e.sendToAnalytics(),Bn(3e3).promise.then((function(){return e.props.checkForNewChangesets(!0)}))}},e.sendToAnalytics=function(){e.state.filters.forEach((function(e,t){e.forEach((function(e){Mn({category:"Filters",action:t,label:e.get("label")})}))}))},e.handleChange=function(t,a){var n=e.state.filters;return n="date__gte"===t&&null==a?n.merge(ho):null==a?n.delete(t):n.set(t,a),e.setState({filters:n})},e.handleToggleAll=function(t,a){var n=e.state.filters;return n="all_"===t.slice(0,4)?n.delete(t.slice(4)):n.delete("all_"+t),n=a?n.set(t,a):n.delete(t),e.setState({filters:n})},e.replaceFiltersState=function(t){e.setState({filters:t})},e.handleClear=function(){e.props.applyFilters(new k.Map,"/")},e.loadAoiId=function(t){e.props.push(Object(I.a)(Object(I.a)({},e.props.location),{},{search:"aoi=".concat(t)}))},e.getAOIName=function(){return e.props.loading?"":e.props.aoi.getIn(["properties","name"],"unnamed *")},e.getAOIId=function(t){return e.props.loading?"":e.props.aoi.get("id")},e.removeAOI=function(t){t===e.props.aoi.get("id")&&e.handleClear(),G(e.props.token,t).catch((function(e){return console.error(e)}))},e.createAOI=function(t){e.props.applyCreateAOI(t,e.state.filters)},e.updateAOI=function(t,a){e.props.applyUpdateAOI(t,a,e.state.filters)},e}return Object(Tn.a)(a,[{key:"componentWillReceiveProps",value:function(e){Object(k.is)(this.props.filters,e.filters)||this.setState({filters:e.filters})}},{key:"render",value:function(){var e=Gn();return r.a.createElement("div",{className:"flex-parent flex-parent--column changesets-filters bg-white ".concat(e?"viewport-full":"")},r.a.createElement(mo,{createAOI:this.createAOI,updateAOI:this.updateAOI,removeAOI:this.removeAOI,loading:this.props.loading,token:this.props.token,aoiName:this.getAOIName(),aoiId:this.props.loading?"":this.props.aoi.get("id"),loadAoiId:this.loadAoiId,handleApply:this.handleApply,handleClear:this.handleClear,search:this.props.location.search}),r.a.createElement(uo,{loading:this.props.loading,filters:this.state.filters,active:this.state.active,handleFocus:this.handleFocus,handleChange:this.handleChange,handleToggleAll:this.handleToggleAll,replaceFiltersState:this.replaceFiltersState,token:this.props.token}))}}]),a}(r.a.PureComponent);go=Object(l.b)((function(e,t){return{filters:e.filters.get("filters"),aoi:e.aoi.get("aoi"),loading:e.filters.get("loading"),features:e.changesetsPage.getIn(["currentPage","features"]),location:t.location,token:e.auth.get("token")}}),{checkForNewChangesets:Rt,applyFilters:yt,applyCreateAOI:function(e,t){return ot(nt,{name:e,filters:t})},applyUpdateAOI:function(e,t,a){return ot(rt,{aoiId:e,name:t,filters:a})},push:c.c,modal:se})(go);var fo=a(115);function bo(e){var t=e.count;return r.a.createElement("span",{className:"mr6",title:"".concat(t," comment").concat(t>1?"s":"")},r.a.createElement("span",null,t),r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle color-darken25"},r.a.createElement("use",{xlinkHref:"#icon-contact"})))}var vo=a(45),yo=a.n(vo),Eo=a(46),xo=a.n(Eo);function ko(e){var t=e.changesetId,a=(e.date,e.properties);return r.a.createElement("span",{className:"flex-parent flex-parent--row justify--space-between txt-light txt-s color-gray"},r.a.createElement("span",null,r.a.createElement(ir.a,{to:{search:window.location.search,pathname:"/changesets/".concat(t)},className:"txt-underline-on-hover"},r.a.createElement("span",{className:"mr6"},t)),a.get("checked")?r.a.createElement(ir.a,{to:{search:Ke("filters",{users:[{label:a.get("check_user"),value:a.get("check_user")}],date__gte:[{label:"",value:""}]}),pathname:"/"},title:"See ".concat(a.get("check_user"),"'s changesets"),className:"txt-underline-on-hover"},a.get("harmful")?r.a.createElement("img",{src:xo.a,alt:"Marked as bad",className:"icon inline-block"}):r.a.createElement("img",{src:yo.a,alt:"Marked as good",className:"icon inline-block"}),a.get("check_user")&&r.a.createElement("span",{className:"pl6"},"by ".concat(a.get("check_user")))):null),r.a.createElement("span",{className:"flex-parent flex-parent--row"},a.get("comments_count")>0&&r.a.createElement(bo,{count:a.get("comments_count")}),r.a.createElement(Xn,{showZero:!0,className:"mr3",create:a.get("create"),modify:a.get("modify"),delete:a.get("delete")})))}function Oo(e){var t=e.reasons,a=e.comment,n=e.tags;return r.a.createElement("span",{className:"flex-parent flex-parent--column"},r.a.createElement("p",{className:"flex-child truncate-3-lines my6 txt-break-url"},a),r.a.createElement(ar,{reasons:t,color:"blue"}),r.a.createElement(ar,{reasons:n,color:"red"}))}var Ao=Object(l.b)((function(e,t){return{trustedlist:e.trustedlist.get("trustedlist"),watchlisted:e.watchlist.get("watchlist")}}))((function(e){var t=e.properties,a=(e.wasOpen,e.date),n=e.trustedlist,s=e.watchlisted,o=cr(t.get("user"),t.get("uid"),n,s),c=Object(Le.a)(o,2),l=c[0],i=c[1];return r.a.createElement("div",null,r.a.createElement("span",{className:"flex-parent flex-parent--row justify--space-between align-items--center"},r.a.createElement("strong",{className:"txt-m mt3 mr6"},t.get("user")||r.a.createElement("i",null,"OSM User"),l&&r.a.createElement("svg",{className:"icon inline-block align-middle pl3 w18 h18 color-yellow"},r.a.createElement("use",{xlinkHref:"#icon-star"})),i&&r.a.createElement("svg",{className:"icon inline-block align-middle pl3 w18 h18 color-red"},r.a.createElement("use",{xlinkHref:"#icon-alert"}))),r.a.createElement("span",{className:"txt-s mr3"},"\xa0",Object(qn.a)(Object(Qn.default)(a,"yyyy-MM-dd'T'HH:mm:ssX",new Date),{addSuffix:!0}))))})),jo=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s=l,pageIndex:n+1,active:!1,getChangesetsPage:s}))}var Io=a(220);function To(e){var t=e.filters,a=e.handleFilterOrderBy,n=e.location,s=e.diffLoading,o=e.diff,c=e.currentPage,l=e.reloadCurrentPage,i=[],u=co.filter((function(e){return"order_by"===e.name}))[0].options;return t.get("order_by")&&u.forEach((function(e){t.getIn(["order_by",0,"value"])===e.value&&i.push(e)})),r.a.createElement("div",null,r.a.createElement("header",{className:"px12 hmin36 border-b border--gray-light bg-gray-faint txt-s flex-parent justify--space-between align-items--center"},r.a.createElement(kr,{onAdd:function(){},onRemove:function(){},onChange:a,value:i,options:co.filter((function(e){return"order_by"===e.name}))[0].options,display:i[0]&&i[0].label||"Order by",position:"left"}),r.a.createElement(Io.a,{activeStyle:{fontWeight:"bold"},to:{search:n.search,pathname:n.pathname.indexOf("/filters")>-1?"/":"/filters"}},r.a.createElement(yr,{className:"mx3"},"Filters ",t.size>0&&"(".concat(t.size,")")))),r.a.createElement("header",{className:"px12 border-l border-b border-b--1 border--gray-light px12 py6 ".concat(o>0?"bg-darken10":"bg-gray-faint"," flex-child align-items--center")},r.a.createElement("span",{className:"flex-parent flex-parent--row justify--space-between color-gray txt-s txt-bold"},r.a.createElement("span",null,c&&c.getIn(["count"],0).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")||0," ","changesets."),r.a.createElement("span",{className:"flex-parent flex-parent--row"},s?r.a.createElement("span",{className:"loading loading--s inline"}):r.a.createElement(yr,{className:"mx3 btn--xs",iconName:"rotate",onClick:l},o>0?"".concat(o," new"):"")))))}var So,_o=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0?" (".concat(e.length,")"):""),position:"right"}):null}}]),a}(r.a.PureComponent);function Mo(e){var t=e.className,a=e.title,n=e.titleClassName,s=void 0===n?"":n,o=e.buttons,c=e.buttonsClassName,l=void 0===c?"":c,i=Gn();return r.a.createElement("nav",{className:"\n ".concat(i?"h40":"h55 flex-parent--center-cross","\n flex-parent px12 py6 bg-gray-dark justify--space-between ").concat(t,"\n ")},r.a.createElement("div",{className:"flex-child flex-child--grow ".concat(s)},a||""),r.a.createElement("div",{className:"flex-child ".concat(l)},o))}function Po(e){var t=e.changeset,a=e.options,n=(e.className,e.onChange),s=(e.value,e.onClear),o=(e.username,e.checkUser);if(t.getIn(["properties","checked"])){var c=t.getIn(["properties","harmful"]);return r.a.createElement("div",{className:"flex-parent align-items--center btn btn--s border border--1 round color-gray transition pl12 pr6 ".concat(c?"bg-lighten50 border--red-light":"bg-lighten50 border--green-light"),style:{maxWidth:"100px"}},r.a.createElement("img",{src:c?xo.a:yo.a,alt:"Marked as ".concat(c?"bad":"good"),className:"icon inline-block w14 h14"}),r.a.createElement("span",{className:"ml6",style:{flex:"1",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},o?r.a.createElement(r.a.Fragment,null,o):r.a.createElement("em",null,"Verified")),r.a.createElement("svg",{onClick:s,className:"icon inline-block align-middle pl3 w18 h18 pointer color-gray"},r.a.createElement("use",{xlinkHref:"#icon-close"})))}return r.a.createElement("div",{className:"select-container"},r.a.createElement(kr,{eventTypes:["click","touchend"],value:[],onAdd:function(){},onRemove:function(){},options:a,onChange:n,display:"Verify",position:"right"}))}function Fo(e){Xt("getMapInstance").then((function(e){return e&&e()&&e().map})).then((function(t){var a;if(e&&"iD"===e[0].value&&(a="https://www.openstreetmap.org/edit?editor=id&"),e&&"RapiD"===e[0].value&&(a="https://mapwith.ai/rapid?"),a){var n=t.getCenter(),r=t.getZoom();window.open("editor - OSMCha").location.href="".concat(a,"#map=").concat(r,"/").concat(n.lat,"/").concat(n.lng)}}))}function Uo(e){var t=e.display,a=e.changesetId,n=(e.coordinates,e.className),s=Gn(),o=[{label:"Achavi",value:"Achavi",href:"https://overpass-api.de/achavi/?changeset=".concat(a,"&relations=true")},{label:"iD",value:"iD"},{label:"JOSM",value:"JOSM",href:"http://127.0.0.1:8111/import?url=https://www.openstreetmap.org/api/0.6/changeset/".concat(a,"/download")},{label:"Level0",value:"Level0",href:"http://level0.osmz.ru/?url=changeset/".concat(a)},{label:"RapiD",value:"RapiD"}];return s&&o.unshift({label:"OSM.org",value:"OSM.org",href:"https://www.openstreetmap.org/changeset/".concat(a)}),r.a.createElement("div",{className:"select-container ".concat(n)},r.a.createElement(kr,{onAdd:function(){},onRemove:function(){},value:[],onChange:Fo,options:o,display:t,position:"left"}))}var Ho=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s1)throw new Error("verify array is big")},e.handleVerifyClear=function(){e.props.handleChangesetModifyHarmful(e.props.changesetId,e.props.currentChangeset,-1)},e.isChecked=function(){return e.props.currentChangeset&&e.props.currentChangeset.getIn(["properties","checked"])},e}return Object(Tn.a)(a,[{key:"componentWillReceiveProps",value:function(e){if(this.props.currentChangeset){var t=e.lastKeyStroke;if(!Object(k.is)(this.props.lastKeyStroke,t))switch(t.keySeq().first()){case xs.label:this.props.handleChangesetModifyHarmful(this.props.changesetId,this.props.currentChangeset,!0);break;case ks.label:this.props.handleChangesetModifyHarmful(this.props.changesetId,this.props.currentChangeset,-1);break;case Es.label:this.props.handleChangesetModifyHarmful(this.props.changesetId,this.props.currentChangeset,!1);break;case Os.label:if(!this.props.changesetId)return;var a="http://127.0.0.1:8111/import?url=https://www.openstreetmap.org/api/0.6/changeset/".concat(this.props.changesetId,"/download");window.open(a,"_blank");break;case As.label:if(!this.props.changesetId||!this.props.currentChangeset)return;var n=this.props.currentChangeset.getIn(["geometry","coordinates",0,0]),r="https://www.openstreetmap.org/edit?changeset=".concat(this.props.changesetId,"#map=15/").concat(n&&n.get("1"),"/").concat(n&&n.get("0"));window.open(r,"_blank");break;case js.label:if(!this.props.changesetId)return;var s="https://www.openstreetmap.org/changeset/".concat(this.props.changesetId);window.open(s,"_blank");break;case ws.label:if(!this.props.changesetId)return;var o="http://level0.osmz.ru/?url=changeset/".concat(this.props.changesetId);window.open(o,"_blank");break;case Ns.label:if(!this.props.changesetId)return;var c="https://overpass-api.de/achavi/?changeset=".concat(this.props.changesetId);window.open(c,"_blank");break;case Cs.label:var l=this.props.currentChangeset.getIn(["properties","user"],""),i="https://hdyc.neis-one.org/?".concat(l);window.open(i,"_blank");break;default:return}}}},{key:"render",value:function(){var e=this,t=Gn();return r.a.createElement(Mo,{className:"bg-gray-faint color-gray border-b border--gray-light border--1 ".concat(t?"":"px30"),title:r.a.createElement("div",{className:"flex-parent flex-parent--row flex-parent--wrap ".concat(t?"align-items--center":"")},t&&r.a.createElement(ir.a,{to:{search:window.location.search,pathname:"/"},style:t?{fontSize:"1.4em"}:{fontSize:"1.7em"},className:"color-gray mr3"},r.a.createElement("button",{style:{fontSize:t&&"1.1em"},className:"btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition pt0 pb6 pl6 pr6 mr2"},"\u2630")," "),!t&&r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"txt-l color-gray--dark"},r.a.createElement("strong",null,"Changeset:")," ",this.props.changesetId,r.a.createElement("span",{className:"mr6"},r.a.createElement("span",{className:"txt--s pl6 pointer",onClick:function(t){return navigator.clipboard.writeText("".concat(v.replace("/api/v1",""),"/changesets/").concat(e.props.changesetId))},title:"Copy OSMCha Changeset URL"},r.a.createElement("svg",{className:"icon icon--s mt-neg3 ml3 inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-link"}))),r.a.createElement("a",{href:"https://www.openstreetmap.org/changeset/".concat(this.props.changesetId),target:"_blank",rel:"noopener noreferrer",title:"See on OSM"},r.a.createElement("svg",{className:"icon icon--s mt-neg3 ml3 inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-share"})))))),r.a.createElement(Uo,{changesetId:this.props.changesetId,coordinates:this.props.currentChangeset&&this.props.currentChangeset.getIn(["geometry","coordinates",0,0]),display:t?"".concat(this.isChecked()?"":"Changeset"," ").concat(this.props.changesetId):"Open with"})),buttonsClassName:"flex-parent",buttons:this.props.currentChangeset&&r.a.createElement(r.a.Fragment,null,this.props.currentChangeset.getIn(["properties","check_user"])&&r.a.createElement(Do,{changesetId:this.props.changesetId,currentChangeset:this.props.currentChangeset,disabled:!1,handleChangesetModifyTag:this.props.handleChangesetModifyTag}),r.a.createElement(Po,{changeset:this.props.currentChangeset,placeholder:"Verify",value:[],onChange:this.handleVerify,onClear:this.handleVerifyClear,username:this.props.username,checkUser:this.props.currentChangeset.getIn(["properties","check_user"]),options:[{value:!1,label:"Good"},{value:!0,label:"Bad"}],className:"select--s"}))})}}]),a}(r.a.PureComponent);Ho=Ss(!1,[xs,Es,ks,Os,As,js,ws,Ns,Cs],Ho),Ho=Object(l.b)((function(e,t){return{location:t.location,changesetId:parseInt(e.changeset.get("changesetId"),10),currentChangeset:e.changeset.getIn(["changesets",parseInt(e.changeset.get("changesetId"),10)]),username:e.auth.getIn(["userDetails","username"])}}),{handleChangesetModifyTag:function(e,t,a,n){return ka(ba,{oldChangeset:t,changesetId:e,tag:a,remove:n})},handleChangesetModifyHarmful:function(e,t,a){return ka(ga,{oldChangeset:t,changesetId:e,harmful:a})}})(Ho);var Lo=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s1)throw new Error("filter select array is big")},e}return Object(Tn.a)(a,[{key:"renderUserMenuOptions",value:function(){var e=this.props.username;return r.a.createElement(kr,{display:e?r.a.createElement("span",{className:"wmax180 align-middle inline-block txt-truncate"},e):"User",options:[{label:"Account settings",url:"/user"},{label:"My changesets",url:"/my-changesets"},{label:"My reviews",url:"/my-reviews"},{label:"My saved filters",url:"/saved-filters"},{label:"My teams",url:"/teams"},{label:"My trusted users list",url:"/trusted-users"},{label:"My watchlist",url:"/watchlist"},{label:"Logout",url:"/logout"}],onChange:this.onUserMenuSelect,value:[],onAdd:function(){},onRemove:function(){},position:"right"})}},{key:"render",value:function(){var e=Gn();return r.a.createElement(r.a.Fragment,null,r.a.createElement(Mo,{className:"navbar-logo bg-gray-faint border-b border--gray-light border--1",title:r.a.createElement(ir.a,{to:{search:window.location.search,pathname:"/"},style:e?{fontSize:"1.4em"}:{fontSize:"1.7em"},className:"color-gray"},r.a.createElement("strong",{className:"color-blue"},"OSM"),"Cha"),buttons:r.a.createElement("div",{className:"flex-parent flex-parent--row"},r.a.createElement(ir.a,{className:"pr3 pointer",to:{search:window.location.search,pathname:"/about"}},r.a.createElement("svg",{className:"icon icon--m inline-block align-middle color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-question"}))),this.props.token?r.a.createElement("div",{className:"pointer"},this.renderUserMenuOptions()):r.a.createElement(yr,{onClick:this.handleLoginClick,disable:!this.props.oAuthToken,iconName:"osm"},"Sign in"))}))}}]),a}(r.a.PureComponent);Lo=Object(l.b)((function(e,t){return{location:e.routing.location,changesetId:parseInt(e.changeset.get("changesetId"),10),currentChangeset:e.changeset.getIn(["changesets",parseInt(e.changeset.get("changesetId"),10)]),oAuthToken:e.auth.get("oAuthToken"),token:e.auth.get("token"),username:e.auth.getIn(["userDetails","username"]),avatar:e.auth.getIn(["userDetails","avatar"])}}),{getOAuthToken:function(){return qa(Ra)},getFinalToken:Xa,logUserOut:Za,push:c.c})(Lo);var Ro=a(109),Bo=a.n(Ro),Go=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0&&0===e.state.username.length?e.fetchUid(e.state.uid).then((function(e){return{uid:e.user.id.toString(),username:e.user.display_name}})).then((function(t){return e.setState({username:t.username,uid:t.uid,verified:!0,isValidUsername:!0,isValidUid:!0})})).catch((function(t){return e.setState({isValidUid:!1,verified:!1})})):e.state.username.length>0&&0===e.state.uid.length?e.fetchUsername(e.state.username).then((function(t){return{uid:t.toString(),username:e.state.username}})).then((function(e){return e})).then((function(t){return e.setState({username:t.username,uid:t.uid,verified:!0,isValidUsername:!0,isValidUid:!0})})).catch((function(t){return e.setState({isValidUsername:!1,verified:!1})})):e.state.uid.length>0&&e.state.username.length>0&&Promise.all([e.fetchUid(e.state.uid).then((function(e){return{uid:e.id,username:e.name}})),e.fetchUsername(e.state.username).then((function(e){return{uid:e.id,username:e.name}}))]).then((function(t){t[0].uid===t[1].uid&&t[0].username===t[1].username?(window.alert("The user is valid"),e.setState({verified:!0})):e.setState({isValidUsername:!1,isValidUid:!1})})).catch((function(t){return e.setState({isValidUsername:!1,isValidUid:!1})}))},e.onAdd=function(){var t=e.state.username,a=e.state.uid;t&&t.length>0&&a&&a.length>0?e.props.onSave(t,a):e.setState({isValidUsername:!1,isValidUid:!1})},e}return Object(Tn.a)(a,[{key:"render",value:function(){return r.a.createElement("span",{className:"flex-parent flex-parent--row"},r.a.createElement("input",{className:"input ".concat(this.state.isValidUsername?"":"border border--1 border--red"),value:this.state.username,onChange:this.setUsername,placeholder:"Username",type:"text"}),r.a.createElement("input",{className:"input ".concat(this.state.isValidUid?"":"border border--1 border--red"),value:this.state.uid,onChange:this.setUid,placeholder:"UID",type:"text"}),r.a.createElement(yr,{className:"btn max120 ml12 ",onClick:this.verifyInput},this.state.verified?"Verified":"Verify"),r.a.createElement(yr,{className:"btn wmax120 ml12 ".concat(this.state.verified?"btn--green":""),onClick:this.onAdd},"Add"))}}]),a}(r.a.Component),$o=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0&&(e.props.onSave(t),e.setState({username:""}))},e}return Object(Tn.a)(a,[{key:"render",value:function(){var e=this;return r.a.createElement("span",{className:"flex-parent flex-parent--row"},r.a.createElement("input",{className:"input",onChange:function(t){return e.setState({username:t.target.value})},placeholder:"Username",type:"text"}),r.a.createElement(yr,{className:"btn wmax120 ml12",onClick:this.onAdd},"Add"))}}]),a}(r.a.Component),ec=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0?(e=e.keySeq().sort((function(e,t){return e.localeCompare(t)})).join(","),Dn("/?filters=".concat(e))):Dn("/")}}},{key:"render",value:function(){return Gn()?r.a.createElement(gc,null):r.a.createElement(xc,null)}}]),a}(n.Component);i.default.initialize("UA-100686765-1",{gaOptions:{anonymizeIp:!0,screenResolution:"".concat(window.screen.availWidth,"X").concat(window.screen.availHeight),appName:"PRODUCTION"}}),p.a.config("https://5637ef87f5794e2fb9e1e5fe9119688d@sentry.io/175926",{release:"0.85.0",environment:"production",debug:d}).install(),o.a.render(r.a.createElement(l.a,{store:Nn},r.a.createElement(c.a,{history:E},r.a.createElement(kc,null))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},45:function(e,t,a){e.exports=a.p+"static/media/thumbs-up.13d765c5.svg"},46:function(e,t,a){e.exports=a.p+"static/media/thumbs-down.7e04a82a.svg"},56:function(e){e.exports=JSON.parse('[{"name":"date","icontains":false,"all":false,"range":true,"display":"Date","type":"date","description":"Set the date range to view changesets created during that duration.","placeholder":"YYYY-MM-DD"},{"name":"comment","icontains":true,"all":false,"range":false,"display":"Comment","type":"text","description":" Filter changesets that mention a particular keyword in its comment. This is not case-sensitive.","placeholder":"Enter a keyword like hotosm, import or fixme"},{"name":"geometry","icontains":false,"range":false,"all":false,"display":"Location","type":"location","description":"Filter changesets whose bbox intersect with a location boundary.","placeholder":"Type a place on the world"},{"name":"in_bbox","icontains":false,"all":false,"range":false,"display":"Bounding Box (BBox)","type":"map","description":"Scroll","placeholder":"Pan to the location of interest in the map"},{"name":"area_lt","icontains":false,"range":false,"all":false,"display":"BBox size bound","type":"number","description":"Filter changesets that have a bbox area lower than X times the area of your BBox or geometry filter. For example, if the geometry you defined in your filter has an area of 1 degree and you set the \'BBox size bound\' to 2, it will filter the changesets whose bbox area is lower than 2 degrees.","placeholder":"Upper bound of bbox area"},{"name":"tag_changes","icontains":false,"all":false,"range":false,"display":"OSM features tags","cache":true,"type":"text_comma","description":"Filter changesets using OSM tag values. Example: highway=footway. Use an asterisk to filter any value for a key, example: amenity=*","placeholder":"building=yes, amenity=*, highway=primary"},{"name":"is_suspect","icontains":false,"range":false,"all":false,"display":"Show Flagged","type":"radio","options":[{"label":"Yes","value":"True"},{"label":"No","value":"False"}],"description":"Choose to view only changesets that have been flagged, not flagged, or all. Read more about automated flagging on our About page.","placeholder":"yes / no"},{"name":"reasons","icontains":false,"range":false,"all":true,"data_url":"suspicion-reasons","display":"Reasons for Flagging","type":"text_comma","description":"Select one or multiple reasons that a changeset might be flagged for.","placeholder":"Start typing to pick reasons"},{"name":"checked_&_harmful","icontains":false,"range":false,"all":false,"display":"Review Status","type":"meta","metaOf":["harmful","checked"],"options":[{"label":"Bad only","value":{"harmful":[{"label":"Show Bad only","value":"True"}]}},{"label":"Good only","value":{"harmful":[{"label":"Show Good only","value":"False"}]}},{"label":"Both Good or Bad","value":{"checked":[{"label":"Both Good or Bad","value":"True"}]}},{"label":"Not Reviewed","value":{"checked":[{"label":"Not Reviewed","value":"False"}]}}],"placeholder":"Filter by the type of review","description":"Filter for changesets that have been manually reviewed and marked (either good or bad)"},{"name":"check_date","icontains":false,"all":false,"range":true,"display":"Review Date","type":"date","description":"Set the date range to view changesets reviewed within that duration.","placeholder":"YYYY-MM-DD"},{"name":"checked_by","icontains":false,"all":false,"range":false,"display":"Reviewed by","cache":true,"type":"text_comma","description":"Filter changesets that were reviewed by a user. Start typing to select one or more users. This filter requires authentication to work.","placeholder":"Enter OSM usernames"},{"name":"tags","icontains":false,"range":false,"all":true,"display":"Tags","type":"text_comma","data_url":"tags","description":"Filter changesets that have one or more manually assigned Tags. Start typing to select tags.","placeholder":"Add tags"},{"name":"users","icontains":false,"all":false,"range":false,"display":"Users","cache":true,"type":"text_comma","description":"Show changesets created by the users. Start typing to select one or more users.","placeholder":"Enter OSM usernames"},{"name":"uids","icontains":false,"all":false,"range":false,"display":"User ids","cache":true,"type":"text_comma","description":"Show changesets created by users filtering by their OSM user ids. Start typing to select one or more uids.","placeholder":"Enter OSM user ids"},{"name":"hide_whitelist","icontains":false,"range":false,"all":false,"display":"Hide trusted users","type":"radio","options":[{"label":"Yes","value":"True"},{"label":"No","value":"False"}],"description":"If Yes, it will exclude the changesets created by users that you added to your trusted users list","placeholder":"Exclude changesets created by trusted users"},{"name":"blacklist","icontains":false,"range":false,"all":false,"display":"Watchlisted users","type":"radio","options":[{"label":"Yes","value":"True"},{"label":"No","value":"False"}],"description":"If Yes, it will Filter changesets created by users that you added to your Watchlist.","placeholder":"Filter changesets created by users from your Watchlist"},{"name":"mapping_teams","icontains":false,"all":false,"range":false,"display":"Mapping teams","data_url":"mapping-team","type":"text_comma","description":"Show changesets created by users that are part of a Mapping Team. Start typing to select one or more teams.","placeholder":"Enter mapping teams"},{"name":"exclude_teams","icontains":false,"all":false,"range":false,"display":"Hide mapping teams","data_url":"mapping-team","type":"text_comma","description":"Exclude changesets created by users that are part of a Mapping Team. Start typing to select one or more teams.","placeholder":"Enter mapping teams"},{"name":"exclude_trusted_teams","icontains":false,"range":false,"all":false,"display":"Hide verified mapping teams","type":"radio","options":[{"label":"Yes","value":"True"},{"label":"No","value":"False"}],"description":"If Yes, it will exclude the changesets created by users that are part of verified mapping teams","placeholder":"Exclude changesets created by users from verified teams"},{"name":"create","icontains":false,"all":false,"range":true,"display":"Objects Created","type":"number","description":"Filter changesets whose number of elements created are greater than or equal to and/or lesser than or equal to a number.","placeholder":"eg. 500"},{"name":"modify","icontains":false,"all":false,"range":true,"display":"Objects Modified","type":"number","description":"Filter changesets whose number of elements modified are greater than or equal to and/or lesser than or equal to a number.","placeholder":"eg. 500"},{"name":"delete","icontains":false,"all":false,"range":true,"display":"Objects Deleted","type":"number","description":"Filter changesets whose number of elements deleted are greater than or equal to and/or lesser than or equal to a number.","placeholder":"eg. 500"},{"name":"comments_count","icontains":false,"all":false,"range":true,"display":"Number of comments","type":"number","description":"Filter changesets whose number of comments are greater than or equal to and/or lesser than or equal to a number.","placeholder":"eg. 3"},{"name":"source","icontains":true,"all":false,"range":false,"display":"Source","type":"text","description":"Filter changesets by text in its source field. This is not case-sensitive.","placeholder":"eg. Bing, Local"},{"name":"editor","icontains":true,"all":false,"range":false,"display":"Editor","type":"text","description":"Filter changesets by editor used. This is not case-sensitive.","placeholder":"eg. iD, JOSM"},{"name":"imagery_used","icontains":true,"all":false,"range":false,"display":"Imagery used","type":"text","description":"Filter changesets by text in its imagery_used field. This is not case-sensitive.","placeholder":"eg. Bing, Mapbox"},{"name":"ids","icontains":false,"range":false,"all":false,"display":"Changeset IDs","type":"text_comma","description":"Filter changesets by its ID. Use commas to search for more than one id.","placeholder":"Enter Changeset IDs"},{"name":"metadata","icontains":false,"all":false,"range":false,"display":"Other metadata","type":"text","description":"Filter changesets by any other metadata that is not present on the fields above. You can combine more than one filter, separated by commas.","placeholder":"eg. changesets_count__max=50,hashtags=#hotosm-project"},{"name":"order_by","icontains":false,"range":false,"all":false,"display":"Order by","type":"radio","options":[{"label":"Ascending ID","value":"id"},{"label":"Ascending Date","value":"date"},{"label":"Ascending check date","value":"check_date"},{"label":"Ascending object created","value":"create"},{"label":"Ascending object modified","value":"modify"},{"label":"Ascending object deleted","value":"delete"},{"label":"Ascending number of comments","value":"comments_count"},{"label":"Descending ID","value":"-id"},{"label":"Descending Date","value":"-date"},{"label":"Descending check date","value":"-check_date"},{"label":"Descending object created","value":"-create"},{"label":"Descending object modified","value":"-modify"},{"label":"Descending object deleted","value":"-delete"},{"label":"Descending number of comments","value":"-comments_count"}],"description":"Order changesets by one of the following fields: id, date, check_date, create, modify, delete or number of comments.","placeholder":"Asceding/Descending "},{"name":"powerfull_editor","ignore":true,"icontains":false,"range":false,"all":false,"display":"Powerful editor","type":"text","description":"Filter changesets that were created using a software editor considered powerful (those that allow to create, modify or delete data in a batch).","placeholder":""}]')},87:function(e,t){e.exports="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/AAAAF5jcHJ0AAABXAAAAAt3dHB0AAABaAAAABRia3B0AAABfAAAABRyWFlaAAABkAAAABRnWFlaAAABpAAAABRiWFlaAAABuAAAABRyVFJDAAABzAAAAEBnVFJDAAABzAAAAEBiVFJDAAABzAAAAEBkZXNjAAAAAAAAAANjMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0ZXh0AAAAAElYAABYWVogAAAAAAAA9tYAAQAAAADTLVhZWiAAAAAAAAADFgAAAzMAAAKkWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPY3VydgAAAAAAAAAaAAAAywHJA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K4MgPUAcH8689JBY4GBk4FADa6fRrRnnExHyp092/+tXNAgMMjIyMivQoNYsSAuDGB0BHA/KgDpKKYjo6hlYMD3ByKfQBmX17Haxbjyx4VfU/4V5rcXM1w+6Rs+g7D6CtLWJGe+cHogCj+dYVABRRRQAUUUUAW7e5mt33Rtj1HY/UV6VY3sd1FuHDDhl9D/hXlVbujyMl8gHRwVP86AP/2Q=="}},[[119,1,2]]]); -//# sourceMappingURL=main.a3b4e0f0.chunk.js.map \ No newline at end of file +(this["webpackJsonposmcha-frontend"]=this["webpackJsonposmcha-frontend"]||[]).push([[0],{110:function(e,t,a){e.exports=a.p+"static/media/banner.ed2bb0d2.png"},111:function(e,t,a){e.exports=a.p+"static/media/work_flow.195ff4f9.png"},119:function(e,t,a){e.exports=a(211)},141:function(e,t,a){},163:function(e,t,a){},211:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),s=a(21),o=a.n(s),c=a(16),l=a(14),i=a(82),u=a(102),p=a.n(u),m=a(112),d=!1,h=!1,g=!0,f=!1,b="https://staging.osmcha.org/api/v1";g&&(b="https://osmcha.org/api/v1"),window.debug_info=function(){return"isDev=".concat(d.toString()," isStaging=").concat(h.toString()," isProd=").concat(g.toString()," isLocal=").concat(f.toString()," stack=").concat("PRODUCTION"," appVersion=").concat("0.85.1"," url=").concat(b)};var v=b,y={};d&&(y.basename="/osmcha-frontend");var E=Object(m.a)(y),x=a(51),k=a(5),O=a(35);function A(e){try{return localStorage.getItem(e)||null}catch(t){return console.warn("Could not read from localStorage."),null}}function j(e,t){try{localStorage.setItem(e,t)}catch(a){console.warn("Could not write to localStorage.")}}function w(e){try{localStorage.removeItem(e)}catch(t){console.warn("Could not delete from localStorage.")}}var N=a(12),C=a.n(N),I=a(13),T=a(2),S=a(85),_=a.n(S),D="pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJjam10OXpmc2YwMXI5M3BqeTRiMDBqMHVyIn0.LIcIDe3TZLSDdTWDoojzNg",M="".concat(v,"/social-auth/"),P="https://www.openstreetmap.org/oauth/authorize";function F(e){return"object"===typeof e?JSON.stringify(e):e}function U(e){return e.ok?e:e.json().then((function(t){if(401===e.status)throw new Error("Authentication error. Sign in again and repeat the operation.");if(401===e.status)throw new Error("Operation not allowed.");if(404===e.status)throw new Error("Resource not found.");if(t&&t.detail)throw new Error(t.detail);if(e.statusText)throw new Error(e.statusText);return Promise.reject("network request failed")}))}function H(e,t,a){var n={};return a.forEach((function(e,t){if(k.Iterable.isIterable(e)){var a=e;n[t]=a.filter((function(e){return k.Iterable.isIterable(e)&&""!==e.get("value")})).map((function(e){return F(e.get("value"))})).join(",")}})),fetch("".concat(v,"/aoi/"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({name:t,filters:n})}).then(U).then((function(e){return e.json()}))}function L(e,t){return fetch("".concat(v,"/aoi/").concat(t,"/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function R(e){return null==e?Promise.resolve():fetch("".concat(v,"/aoi/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function B(e,t,a,n){var r={};return n.forEach((function(e,t){if(k.Iterable.isIterable(e)){var a=e;r[t]=a.filter((function(e){return k.Iterable.isIterable(e)&&""!==e.get("value")})).map((function(e){return F(e.get("value"))})).join(",")}})),fetch("".concat(v,"/aoi/").concat(t,"/"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({name:a,filters:r})}).then(U).then((function(e){return e.json()}))}function G(e,t){return fetch("".concat(v,"/aoi/").concat(t,"/"),{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U)}function V(e,t,a){return _.a.post(M).type("form").send({oauth_token:e}).send({oauth_verifier:a}).send({oauth_token_secret:t}).then((function(e){return e.body})).catch((function(e){return console.error(e),Promise.reject(e)}))}function W(){return _.a.post(M).type("form").then((function(e){return e.body})).catch((function(e){return console.error(e),Promise.reject(e)}))}function z(e){return fetch("".concat(v,"/users/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function J(e,t,a,n){return fetch("".concat(v,"/users/"),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({message_good:t,message_bad:a,comment_feature:n})}).then(U).then((function(e){return e.json()}))}function Y(e,t){return fetch("".concat("https://raw.githubusercontent.com/mapbox/osmcha-frontend/status/status.json"),{method:"GET"}).then(U).then((function(e){return e.json()}))}function K(e,t){return fetch("".concat(v,"/changesets/").concat(e,"/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:t?"Token ".concat(t):""}}).then(U).then((function(e){return e.json()}))}function Q(e,t,a){var n;return n=-1===a?"".concat(v,"/changesets/").concat(e,"/uncheck/"):"".concat(v,"/changesets/").concat(e,"/").concat(a?"set-harmful":"set-good","/"),fetch(n,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:t?"Token ".concat(t):""}}).then(U).then((function(e){return e.json()}))}var q=function(e){var t=new FormData;return Object.keys(e).forEach((function(a){t.append(a,e[a])})),t};function X(e,t,a){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Number.isNaN(parseInt(a.value,10)))throw new Error("tag is not a valid number");return fetch("".concat(v,"/changesets/").concat(e,"/tags/").concat(a.value,"/"),{method:n?"DELETE":"POST",headers:{"Content-Type":"application/json",Authorization:t?"Token ".concat(t):""},body:q({tag_pk:a,id:e})}).then(U).then((function(e){return e.json()}))}function Z(e,t,a){return fetch("".concat(v,"/changesets/").concat(e,"/comment/"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:t?"Token ".concat(t):""},body:JSON.stringify({comment:a})}).then(U).then((function(e){return e.json()}))}function $(e){return fetch("".concat(v,"/blacklisted-users/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function ee(e,t){return fetch("".concat(v,"/blacklisted-users/").concat(t,"/"),{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U)}function te(e,t){return fetch("".concat(v,"/blacklisted-users/"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({username:t.watchlist_user.username,uid:t.watchlist_user.uid})}).then(U).then((function(e){return e.json()}))}var ae=a(36),ne=C.a.mark(ce),re=C.a.mark(le);function se(e){var t=e.kind,a=void 0===t?"error":t,n=e.error,r=e.title,s=e.dismiss,o=void 0===s||s,c=e.autoDismiss,l=void 0===c?5:c,i=e.position,u=void 0===i?"tr":i,p=e.description,m=void 0===p?"Please reload the application. If it still doesnt work please refer to usage guide.":p,d=e.callback,h=e.callbackArgs,g=e.callbackLabel;return n&&n.message&&(m=n.message),n&&n.name&&(r=n.name),"error"===a&&(l=10),{type:"INIT_MODAL",payload:{kind:a,error:n,callbackLabel:g,title:r,dismiss:o,autoDismiss:l,position:u,description:m},callback:d,callbackArgs:h}}function oe(e,t){return Object(I.a)({type:e},t)}function ce(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.h)("INIT_MODAL",le);case 2:case"end":return e.stop()}}),ne)}function le(e){var t,a,n,r,s,o,c;return C.a.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return t=e.payload,a=e.callback,n=e.callbackArgs,r=(new Date).getTime()+parseInt(1e3*Math.random(),10),t.uid=r,l.next=5,Object(T.e)(oe("SHOW_MODAL",t));case 5:if(a){l.next=7;break}return l.abrupt("return");case 7:return l.next=10,Object(T.g)(["ACTIVATE_MODAL_CALLBACK","DISMISS_MODAL"]);case 10:if(s=l.sent,o=s.type,c=s.uid,"DISMISS_MODAL"!==o||r!==c){l.next=15;break}return l.abrupt("return");case 15:if("ACTIVATE_MODAL_CALLBACK"!==o||r!==c){l.next=21;break}return l.next=18,Object(T.b)(O.b,500);case 18:return l.next=20,Object(T.e)(a.apply(void 0,Object(ae.a)(n)));case 20:return l.abrupt("return");case 21:l.next=7;break;case 23:case"end":return l.stop()}}),re)}function ie(e,t){return fetch("".concat(v,"/whitelist-user/").concat(t,"/"),{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U)}function ue(e,t){return fetch("".concat(v,"/whitelist-user/"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""},body:JSON.stringify({whitelist_user:t})}).then(U).then((function(e){return e.json()}))}var pe=C.a.mark(ke),me=C.a.mark(Oe),de=C.a.mark(Ae),he="TRUSTEDLIST.define",ge="TRUSTEDLIST.add",fe="TRUSTEDLIST.remove",be="TRUSTEDLIST.clear";function ve(e,t){return Object(I.a)({type:e},t)}var ye=function(e){return e.auth.get("token")},Ee=function(e){return ve(ge,{trustedlist_user:e})},xe=function(e){return ve(fe,{trustedlist_user:e})};function ke(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.h)(ge,Oe),Object(T.h)(fe,Ae)]);case 2:case"end":return e.stop()}}),pe)}function Oe(e){var t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(T.f)(ye);case 3:return t=a.sent,a.next=6,Object(T.b)(ue,t,e.trustedlist_user);case 6:return a.next=8,Object(T.e)(se({title:"Success",description:"User ".concat(e.trustedlist_user," added to your Trusted Users list."),kind:"success"}));case 8:a.next=15;break;case 10:return a.prev=10,a.t0=a.catch(0),console.error(a.t0),a.next=15,Object(T.e)(se({error:a.t0}));case 15:case"end":return a.stop()}}),me,null,[[0,10]])}function Ae(e){var t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(T.f)(ye);case 3:return t=a.sent,a.next=6,Object(T.b)(ie,t,e.trustedlist_user);case 6:return a.next=8,Object(T.e)(se({title:"Success",description:"User ".concat(e.trustedlist_user," removed from your Trusted Users list."),kind:"success"}));case 8:a.next=15;break;case 10:return a.prev=10,a.t0=a.catch(0),console.error(a.t0),a.next=15,Object(T.e)(se({error:a.t0}));case 15:case"end":return a.stop()}}),de,null,[[0,10]])}var je=C.a.mark(Fe),we=C.a.mark(Ue),Ne=C.a.mark(He),Ce="WATCHLIST.define",Ie="WATCHLIST.add",Te="WATCHLIST.remove",Se="WATCHLIST.clear";function _e(e,t){return Object(I.a)({type:e},t)}var De=function(e){return e.auth.get("token")},Me=function(e,t){return _e(Ie,{watchlist_user:e,uid:t})},Pe=function(e){return _e(Te,{watchlist_user:e})};function Fe(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.h)(Ie,Ue),Object(T.h)(Te,He)]);case 2:case"end":return e.stop()}}),je)}function Ue(e){var t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(T.f)(De);case 3:return t=a.sent,a.next=6,Object(T.b)(te,t,e);case 6:return a.next=8,Object(T.e)(se({title:"Success",description:"User ".concat(e.watchlist_user.username," (").concat(e.watchlist_user.uid,") added to your watchlist."),kind:"success"}));case 8:a.next=15;break;case 10:return a.prev=10,a.t0=a.catch(0),console.error(a.t0),a.next=15,Object(T.e)(se({error:a.t0}));case 15:case"end":return a.stop()}}),we,null,[[0,10]])}function He(e){var t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(T.f)(De);case 3:return t=a.sent,a.next=6,Object(T.b)(ee,t,e.watchlist_user);case 6:return a.next=8,Object(T.e)(se({title:"Success",description:"User ".concat(e.watchlist_user," removed from your watchlist."),kind:"success"}));case 8:a.next=15;break;case 10:return a.prev=10,a.t0=a.catch(0),console.error(a.t0),a.next=15,Object(T.e)(se({error:a.t0}));case 15:case"end":return a.stop()}}),Ne,null,[[0,10]])}var Le=a(17),Re=a(214),Be=a(219);function Ge(e){if(function(){if(!k.Map.isMap(e))return!1;var t=!0;return e.forEach((function(e,a){k.List.isList(e)?e.forEach((function(e){k.Map.isMap(e)&&e.has("label")&&e.has("value")||(t=!1),k.Map.isMap(e)||(t=!1)})):t=!1})),t}())return!0;throw new Error("The filters that you applied were not correct.")}function Ve(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=Object(Re.default)(Object(Be.a)(new Date,{days:2+e}),"yyyy-MM-dd");return Object(k.fromJS)({date__gte:[{label:t,value:t}]})}function We(e){return!e||e.has("date__gte")||e.has("date__lte")||(e=1===e.count()&&(e.has("users")||e.has("uids"))?e.merge(Ve(28)):e.merge(Ve())),e&&!e.has("date__lte")&&(e=e.merge(function(){var e=new Date,t=Object(Re.default)(Object(Be.a)(new Date(e.getTime()+60*e.getTimezoneOffset()*1e3),{minutes:5}),"yyyy-MM-dd HH:mm");return Object(k.fromJS)({date__lte:[{label:"",value:t}]})}())),e}function ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(k.Map)(),a=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,s="";(t=We(t)).forEach((function(e,t){if(k.Iterable.isIterable(e)){var a=e.filter((function(e){return k.Iterable.isIterable(e)&&""!==e.get("value")})).map((function(e){return F(e.get("value"))})).join(",");""!==a&&(s+="&".concat(t,"=").concat(encodeURIComponent(a)))}}));var o="".concat(v,"/changesets/?").concat(n?"page_size=".concat(25,"&page=").concat(e+1):"page=".concat(e+1,"&page_size=").concat(25)).concat(s);return r&&(o="".concat(v,"/aoi/").concat(r,"/changesets/?").concat(n?"page_size=".concat(25,"&page=").concat(e+1):"page=".concat(e+1,"&page_size=").concat(25))),fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:a?"Token ".concat(a):""}}).then((function(e){return 401===e.status?Promise.reject(Error("Authentication error. Sign in again and repeat the operation.")):403===e.status?Promise.reject(Error("Operation not allowed.")):e.status>=400&&e.status<600?Promise.reject(Error("Bad request. Please check your filters or your network connection.")):e.json()}))}var Je=a(86);function Ye(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={};try{(t=Object(Je.parse)(e)).filters&&(t.filters=JSON.parse(t.filters))}catch(a){console.error(a)}finally{return Object(k.fromJS)(t)}}function Ke(e,t){return t&&0!==Object.keys(t).length?Object(Je.stringify)({[e]:JSON.stringify(t)}):""}function Qe(e){return fetch("".concat(v,"/suspicion-reasons/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}function qe(e){return fetch("".concat(v,"/tags/"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:e?"Token ".concat(e):""}}).then(U).then((function(e){return e.json()}))}var Xe=C.a.mark(ct),Ze=C.a.mark(lt),$e=C.a.mark(it),et=C.a.mark(ut),tt="AOI.clear",at="AOI.fetched",nt="AOI.create",rt="AOI.update",st="AOI.loading";function ot(e,t){return Object(I.a)({type:e},t)}function ct(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.i)(rt,ut),Object(T.i)(nt,it)]);case 2:case"end":return e.stop()}}),Xe)}function lt(e){var t,a,n,r,s,o;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,Object(T.e)(ot(st,{loading:!0}));case 2:return c.next=4,Object(T.f)($a);case 4:return t=c.sent,c.next=7,Object(T.b)(L,t,e);case 7:return a=c.sent,c.next=10,Object(T.b)(Qe,t);case 10:return n=c.sent,c.next=13,Object(T.b)(qe,t);case 13:return r=c.sent,s=Object(k.fromJS)(a),c.next=17,Object(T.e)(ot(at,{aoi:s}));case 17:return o=(o=s.getIn(["properties","filters"],Object(k.Map)())).map((function(e,t){if("reasons"===t)return Object(k.fromJS)(e.split(",").map((function(e){return{value:e,label:n.filter((function(t){return t.id===Number(e)}))[0].name}})));if("tags"===t)return Object(k.fromJS)(e.split(",").map((function(e){return{value:e,label:r.filter((function(t){return t.id===Number(e)}))[0].name}})));try{if(JSON.parse(e)&&JSON.parse(e).hasOwnProperty("coordinates"))return Object(k.fromJS)([{value:JSON.parse(e),label:JSON.parse(e)}]);throw SyntaxError}catch(s){var a=e.split(",");return Object(k.fromJS)(a.map((function(e){return{value:e,label:e}})))}})),c.abrupt("return",o);case 20:case"end":return c.stop()}}),Ze)}function it(e){var t,a,n,r,s,o;return C.a.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:return t=e.name,a=e.filters,l.prev=1,l.next=4,Object(T.e)(ot(st,{loading:!0}));case 4:return l.next=6,Object(T.f)($a);case 6:return n=l.sent,l.next=9,Object(T.b)(H,n,t,a);case 9:return r=l.sent,s=Object(k.fromJS)(r),l.next=13,Object(T.e)(ot(at,{aoi:s}));case 13:return l.next=15,Object(T.f)(pt);case 15:return o=l.sent,l.next=18,Object(T.e)(Object(c.c)(Object(I.a)(Object(I.a)({},o),{},{pathname:o.pathname,search:"aoi=".concat(r.id)})));case 18:l.next=25;break;case 20:return l.prev=20,l.t0=l.catch(1),console.error(l.t0),l.next=25,Object(T.e)(se({error:l.t0}));case 25:case"end":return l.stop()}}),$e,null,[[1,20]])}function ut(e){var t,a,n,r,s,o;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=e.aoiId,a=e.name,n=e.filters,c.prev=1,c.next=4,Object(T.e)(ot(st,{loading:!0}));case 4:return c.next=6,Object(T.f)($a);case 6:return r=c.sent,c.next=9,Object(T.b)(B,r,t,a,n);case 9:return s=c.sent,o=Object(k.fromJS)(s),c.next=13,Object(T.e)(ot(at,{aoi:o}));case 13:return c.next=15,Object(T.b)(Ge,n);case 15:return c.next=17,Object(T.e)(ot(bt.set,{filters:n}));case 17:return c.next=19,Object(T.e)(ot(ft.fetch,{pageIndex:0,aoiId:t,filters:n}));case 19:c.next=26;break;case 21:return c.prev=21,c.t0=c.catch(1),console.error(c.t0),c.next=26,Object(T.e)(se({error:c.t0}));case 26:case"end":return c.stop()}}),et,null,[[1,21]])}var pt=function(e){return e.routing.location},mt=C.a.mark(Et),dt=C.a.mark(xt),ht=C.a.mark(kt),gt=C.a.mark(Ot),ft={fetch:"CHANGESETS_PAGE_FETCH",fetched:"CHANGESETS_PAGE_FETCHED",modify:"CHANGESETS_PAGE_MODIFY_CHANGESET",loading:"CHANGESETS_PAGE_LOADING",error:"CHANGESETS_PAGE_ERROR",checkNew:"CHANGESETS_PAGE_CHECK_NEW_CHANGESETS",updateNewCount:"CHANGESETS_PAGE_UPDATE_NEW_COUNT",checkNewLoading:"CHANGESETS_PAGE_CHECK_NEW_LOADING"},bt={set:"FILTERS_SET",apply:"FILTERS_APPLY"};function vt(e,t){return Object(I.a)({type:e},t)}var yt=function(e,t){return vt(bt.apply,{filters:e,pathname:t})};function Et(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([xt(),Object(T.i)(bt.apply,kt)]);case 2:case"end":return e.stop()}}),mt)}function xt(){var e,t,a,n;return C.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=3,Object(T.g)(c.b);case 3:if(a=r.sent,n=a.payload,t!==n.search){r.next=7;break}return r.abrupt("continue",0);case 7:if(t=n.search,!e){r.next=11;break}return r.next=11,Object(T.c)(e);case 11:return r.next=13,Object(T.d)(Ot,n);case 13:e=r.sent,r.next=0;break;case 16:case"end":return r.stop()}}),dt)}function kt(e){var t,a,n,r;return C.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return t=e.filters,a=e.pathname,n=Ke("filters",t.toJS()),s.next=4,Object(T.f)(At);case 4:return r=s.sent,s.next=7,Object(T.e)(Object(c.c)(Object(I.a)(Object(I.a)({},r),{},{pathname:a||r.pathname,search:n})));case 7:case"end":return s.stop()}}),ht)}function Ot(e){var t,a,n,r;return C.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(s.prev=0,t=Ye(e.search).toObject(),a=t.filters,n=t.aoi,a||(a=Object(k.Map)()),!n){s.next=9;break}return s.next=6,Object(T.b)(lt,n);case 6:a=s.sent,s.next=11;break;case 9:return s.next=11,Object(T.e)(vt(tt));case 11:return s.next=13,Object(T.b)(Ge,a);case 13:return s.next=15,Object(T.e)(vt(bt.set,{filters:a}));case 15:if(!n){s.next=20;break}return s.next=18,Object(T.e)(vt(ft.fetch,{pageIndex:0,filters:a,aoiId:n}));case 18:s.next=22;break;case 20:return s.next=22,Object(T.e)(vt(ft.fetch,{pageIndex:0,filters:a}));case 22:s.next=33;break;case 24:return s.prev=24,s.t0=s.catch(0),console.error(s.t0),s.next=29,Object(T.f)(At);case 29:return(r=s.sent).search="",s.next=33,Object(T.a)([Object(T.e)(se({error:s.t0})),Object(T.e)(Object(c.c)(r))]);case 33:case"end":return s.stop()}}),gt,null,[[0,24]])}var At=function(e){return e.routing.location},jt=function(e){return e.filters.get("filters")},wt=C.a.mark(Bt),Nt=C.a.mark(zt),Ct=C.a.mark(Yt),It=C.a.mark(Kt),Tt="CHANGESETS_PAGE_FETCH",St="CHANGESETS_PAGE_FETCHED",_t="CHANGESETS_PAGE_MODIFY_CHANGESET",Dt="CHANGESETS_PAGE_LOADING",Mt="CHANGESETS_PAGE_ERROR",Pt="CHANGESETS_PAGE_CHECK_NEW_CHANGESETS",Ft="CHANGESETS_PAGE_UPDATE_NEW_COUNT",Ut="CHANGESETS_PAGE_CHECK_NEW_LOADING";function Ht(e,t){return Object(I.a)({type:e},t)}var Lt=function(e,t){return Ht(Tt,{pageIndex:e,nocache:t})},Rt=function(e){return Ht(Pt,{nocache:e})};function Bt(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.i)(Tt,zt),Object(T.i)(_t,Yt),Object(T.i)(Pt,Kt)]);case 2:case"end":return e.stop()}}),wt)}var Gt=function(e){return[e.changesetsPage.getIn(["pageIndex"],0)]},Vt=function(e){return e.auth.get("token")},Wt=function(e){return e.aoi.getIn(["aoi","id"])};function zt(e){var t,a,n,r,s,o,c;return C.a.wrap((function(l){for(;;)switch(l.prev=l.next){case 0:if(t=e.pageIndex,a=e.nocache,n=e.filters,r=e.aoiId,n){l.next=5;break}return l.next=4,Object(T.f)(jt);case 4:n=l.sent;case 5:if(r){l.next=9;break}return l.next=8,Object(T.f)(Wt);case 8:r=l.sent;case 9:return l.next=11,Object(T.f)(Gt);case 11:return s=l.sent,null==t&&(t=s),l.next=15,Object(T.e)(Ht(Dt,{pageIndex:t}));case 15:return l.prev=15,l.next=18,Object(T.f)(Vt);case 18:if(o=l.sent,!r){l.next=25;break}return l.next=22,Object(T.b)(ze,t,n,o,a,r);case 22:c=l.sent,l.next=28;break;case 25:return l.next=27,Object(T.b)(ze,t,n,o,a);case 27:c=l.sent;case 28:return l.next=30,Object(T.e)(Ht(St,{data:Object(k.fromJS)(c),pageIndex:t}));case 30:l.next=39;break;case 32:return l.prev=32,l.t0=l.catch(15),l.next=36,Object(T.e)(Ht(Mt,{pageIndex:s,error:l.t0}));case 36:return l.t0.name="Failed to load page ".concat(t),l.next=39,Object(T.e)(se({error:l.t0,callback:Ht,callbackLabel:"Retry",callbackArgs:[Tt,{pageIndex:t}]}));case 39:case"end":return l.stop()}}),Nt,null,[[15,32]])}var Jt=function(e){return[e.changesetsPage.getIn(["currentPage"],Object(k.Map)()),e.changesetsPage.getIn(["pageIndex"],0)]};function Yt(e){var t,a,n,r,s,o,c,l;return C.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return t=e.changesetId,a=e.changeset,i.prev=1,i.next=4,Object(T.f)(Jt);case 4:if(n=i.sent,r=Object(Le.a)(n,2),s=r[0],o=r[1],c=s.get("features"),!((l=c.findIndex((function(e){return e.get("id")===t})))>-1)){i.next=16;break}return s=s.setIn(["features",l],a),i.next=14,Object(T.e)(Ht(St,{data:s,pageIndex:o}));case 14:return i.next=16,Object(T.e)(Ht(Pt));case 16:i.next=21;break;case 18:i.prev=18,i.t0=i.catch(1),console.error(i.t0);case 21:case"end":return i.stop()}}),Ct,null,[[1,18]])}function Kt(e){var t,a,n,r,s,o,c,l,i,u;return C.a.wrap((function(p){for(;;)switch(p.prev=p.next){case 0:return t=e.nocache,p.prev=1,p.next=4,Object(T.e)(Ht(Ut));case 4:return p.next=6,Object(T.b)(O.b,3e3+2e3*Math.random());case 6:return p.next=8,Object(T.f)((function(e){return[e.filters.get("filters"),e.changesetsPage.get("pageIndex"),e.auth.get("token"),e.aoi.get("aoi").get("id")]}));case 8:return a=p.sent,n=Object(Le.a)(a,4),r=n[0],s=n[1],o=n[2],c=n[3],p.next=16,Object(T.b)(ze,s,r,o,t,c);case 16:return l=p.sent,p.next=19,Object(T.f)((function(e){return e.changesetsPage.get("currentPage")}));case 19:return i=p.sent,u=0,i&&(l=Object(k.fromJS)(l.features.map((function(e){return e.id}))).toSet(),i=i.get("features").map((function(e){return e.get("id")})).toSet(),u=l.subtract(i).size),p.next=24,Object(T.e)(Ht(Ft,{diff:u}));case 24:p.next=29;break;case 26:p.prev=26,p.t0=p.catch(1),console.error(p.t0);case 29:case"end":return p.stop()}}),It,null,[[1,26]])}var Qt,qt={kind:"error",title:"Sign in required",description:"This action requires you to sign in first."};function Xt(e){return Qt?Promise.resolve(Qt[e]):a.e(3).then(a.bind(null,222)).then((function(t){return(Qt=t)[e]})).catch((function(e){console.error(e),console.log("Failed to load module changeset-map")}))}var Zt=a(97);function $t(e,t,a){var n=Object(Zt.a)(t.pathname,a);return n?n.params[e]:null}function ea(e){var t=parseInt($t("id",e,"/changesets/:id"),10);return!t||Number.isNaN(t)?null:t}function ta(e){var t=parseInt($t("id",e,"/:id"),10);return!t||Number.isNaN(t)?null:t}var aa=C.a.mark(Oa),na=C.a.mark(Aa),ra=C.a.mark(ja),sa=C.a.mark(Ia),oa=C.a.mark(_a),ca=C.a.mark(Da),la=C.a.mark(Ma),ia="CHANGESET.fetch",ua="CHANGESET.fetched",pa="CHANGESET.change",ma="CHANGESET.loading",da="CHANGESET.error",ha="CHANGESET_MODIFY.modify",ga="CHANGESET_MODIFY.harmful",fa="CHANGESET_MODIFY.revert",ba="CHANGESET_MODIFY.tag",va="CHANGESET_MAP.fetched",ya="CHANGESET_MAP.loading",Ea="CHANGESET_MAP.change",xa="CHANGESET_MAP.error";function ka(e,t){return Object(I.a)({type:e},t)}function Oa(){var e,t,a,n,r;return C.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=3,Object(T.g)(c.b);case 3:return a=s.sent,n=a.payload,s.next=7,Object(T.b)(Aa,n);case 7:if(!(r=s.sent)){s.next=21;break}if(!e){s.next=12;break}return s.next=12,Object(T.c)(e);case 12:if(!t){s.next=15;break}return s.next=15,Object(T.c)(t);case 15:return s.next=17,Object(T.d)(Ia,r);case 17:return e=s.sent,s.next=20,Object(T.d)(_a,r);case 20:t=s.sent;case 21:s.next=0;break;case 23:case"end":return s.stop()}}),aa)}function Aa(e){var t,a;return C.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(t=ta(e))){n.next=5;break}return n.next=4,Object(T.e)(Object(c.d)(Object(I.a)(Object(I.a)({},e),{},{pathname:"/changesets/"+t})));case 4:return n.abrupt("return",!1);case 5:if(a=ea(e)){n.next=8;break}return n.abrupt("return",!1);case 8:return n.next=10,Object(T.f)((function(e){return!e.changeset.get("errorChangeset")&&!e.changeset.get("errorChangesetMap")&&e.changeset.get("changesetId")}));case 10:if(n.sent===a){n.next=13;break}return n.abrupt("return",a);case 13:case"end":return n.stop()}}),na)}function ja(){var e,t,a,n,r,s,o,c,l,i;return C.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=3,Object(T.g)([ga,ba]);case 3:return e=u.sent,u.next=6,Object(T.f)((function(e){return{token:e.auth.get("token"),username:e.auth.getIn(["userDetails","username"])}}));case 6:if(t=u.sent,a=t.token,n=t.username,a){u.next=13;break}return u.next=12,Object(T.e)(se(Object(I.a)({},qt)));case 12:return u.abrupt("continue",0);case 13:if(r=e.changesetId,s=e.oldChangeset){u.next=16;break}return u.abrupt("continue",0);case 16:o=void 0,u.prev=17,u.t0=e.type,u.next=u.t0===ga?21:u.t0===ba?26:31;break;case 21:return c=e.harmful,u.next=24,Object(T.b)(Da,{changesetId:r,oldChangeset:s,token:a,harmful:c,username:n});case 24:return o=u.sent,u.abrupt("break",32);case 26:return l=e.tag,i=e.remove,u.next=29,Object(T.b)(Ma,{changesetId:r,oldChangeset:s,token:a,tag:l,remove:i});case 29:return o=u.sent,u.abrupt("break",32);case 31:return u.abrupt("continue",0);case 32:u.next=40;break;case 34:return u.prev=34,u.t1=u.catch(17),u.next=38,Object(T.e)(ka(fa,{changesetId:r,changeset:s}));case 38:return u.next=40,Object(T.e)(se({error:u.t1}));case 40:if(!o){u.next=43;break}return u.next=43,Object(T.e)(ka(_t,{changesetId:r,changeset:o}));case 43:u.next=0;break;case 45:case"end":return u.stop()}}),ra,null,[[17,34]])}var wa=function(e){return e.changeset.getIn(["changesets"],Object(k.Map)())},Na=function(e){return e.auth.get("token")},Ca=function(e){return e.routing.location};function Ia(e){var t,a,n,r;return C.a.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,Object(T.f)(wa);case 2:if(t=s.sent,!(a=t.get(e))){s.next=8;break}return s.next=7,Object(T.e)(ka(pa,{changesetId:e}));case 7:return s.abrupt("return");case 8:return s.next=10,Object(T.e)(ka(ma,{changesetId:e}));case 10:return s.prev=10,s.next=13,Object(T.f)(Na);case 13:return n=s.sent,s.next=16,Object(T.b)(K,e,n);case 16:return a=s.sent,s.next=19,Object(T.e)(ka(ua,{data:Object(k.fromJS)(a),changesetId:e}));case 19:s.next=31;break;case 21:return s.prev=21,s.t0=s.catch(10),s.next=25,Object(T.e)(ka(da,{changesetId:e,error:s.t0}));case 25:return s.next=27,Object(T.f)(Ca);case 27:return r=s.sent,s.t0.name="Changeset:".concat(e," failed"),s.next=31,Object(T.e)(se({error:s.t0,callback:c.c,callbackArgs:[r],callbackLabel:"Retry"}));case 31:case"end":return s.stop()}}),sa,null,[[10,21]])}function Ta(e){return Xt("getChangeset").then((function(t){return t(e)}))}var Sa=function(e){return e.changeset.getIn(["changesetMap"],Object(k.Map)())};function _a(e){var t,a,n;return C.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(T.f)(Sa);case 2:if(t=r.sent,!(a=t.get(e))){r.next=8;break}return r.next=7,Object(T.e)(ka(Ea,{changesetId:e}));case 7:return r.abrupt("return");case 8:return r.next=10,Object(T.e)(ka(ya,{changesetId:e}));case 10:return r.prev=10,r.next=13,Object(T.b)(Ta,e);case 13:return a=r.sent,r.next=16,Object(T.e)(ka(va,{data:a,changesetId:e}));case 16:r.next=28;break;case 18:return r.prev=18,r.t0=r.catch(10),r.next=22,Object(T.e)(ka(xa,{changesetId:e,error:r.t0}));case 22:return r.next=24,Object(T.f)(Ca);case 24:return n=r.sent,r.t0.name="Changeset:".concat(e," Map failed"),r.next=28,Object(T.e)(se({error:r.t0,callback:c.c,callbackArgs:[n],callbackLabel:"Retry"}));case 28:case"end":return r.stop()}}),oa,null,[[10,18]])}function Da(e){var t,a,n,r,s,o;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=e.changesetId,a=e.oldChangeset,n=e.token,r=e.harmful,s=e.username,o=a.setIn(["properties","check_user"],-1===r?null:s).setIn(["properties","checked"],-1!==r).setIn(["properties","harmful"],-1===r?null:r),c.next=4,Object(T.e)(ka(ha,{changesetId:t,changeset:o}));case 4:return c.next=6,Object(T.b)(Q,t,n,r);case 6:return c.abrupt("return",o);case 7:case"end":return c.stop()}}),ca)}function Ma(e){var t,a,n,r,s,o,c,l;return C.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=e.changesetId,a=e.oldChangeset,n=e.token,r=e.tag,s=e.remove,!a.getIn(["properties","checked"])){i.next=11;break}return o=a,s?((c=a.getIn(["properties","tags"])).forEach((function(e,t){e.get("id")===r.value&&(l=t)})),o=a.setIn(["properties","tags"],c.delete(l))):(c=a.getIn(["properties","tags"]),o=a.setIn(["properties","tags"],c.push((new k.Map).set("id",r.value).set("name",r.label)))),i.next=6,Object(T.e)(ka(ha,{changesetId:t,changeset:o}));case 6:return i.next=8,Object(T.b)(X,t,n,r,s);case 8:return i.abrupt("return",o);case 11:throw new Error("Only allowed on checked changesets");case 12:case"end":return i.stop()}}),la)}var Pa=C.a.mark(nn),Fa=C.a.mark(rn),Ua=C.a.mark(sn),Ha=C.a.mark(on),La=C.a.mark(cn),Ra="AUTH_POST_SOCIAL_TOKEN",Ba="AUTH_SAVE_OAUTH_OBJ",Ga="AUTH_GET_FINAL_TOKEN",Va="AUTH_SAVE_TOKEN",Wa="AUTH_LOGOUT",za="AUTH_CLEAR_SESSION",Ja="AUTH_LOGIN_ERROR",Ya="AUTH_USER_DETAILS",Ka="AUTH_CLEAR_USER_DETAILS",Qa="UPDATE_USER_DETAILS";function qa(e,t){return Object(I.a)({type:e},t)}var Xa=function(e){return qa(Ga,{oauth_verifier:e})},Za=function(){return qa(Wa)},$a=function(e){return e.auth.get("token")},en=function(e){return e.routing.location},tn=function(e){return e.changeset.get("changesetId")},an=O.b;function nn(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Object(T.i)(Qa,cn)]);case 2:case"end":return e.stop()}}),Pa)}function rn(){var e,t,a,n,r,s,o,c,l;return C.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return e=1e3,i.next=3,Object(T.f)($a);case 3:t=i.sent;case 4:if(i.prev=5,t){i.next=10;break}return i.next=9,Object(T.b)(on);case 9:t=i.sent;case 10:return i.t0=k.fromJS,i.next=13,Object(T.b)(z,t);case 13:return i.t1=i.sent,a=(0,i.t0)(i.t1),n=a.get("whitelists"),i.t2=k.fromJS,i.next=19,Object(T.b)($,t);case 19:return i.t3=i.sent,r=(0,i.t2)(i.t3),i.t4=k.fromJS,i.next=24,Object(T.b)(Y);case 24:return i.t5=i.sent,s=(0,i.t4)(i.t5),i.next=28,Object(T.e)(qa(he,{trustedlist:n}));case 28:return i.next=30,Object(T.e)(qa(Ce,{watchlist:r}));case 30:return i.next=32,Object(T.e)(qa(Ya,{userDetails:a}));case 32:return i.next=34,Object(T.f)(Gt);case 34:if(!(o=i.sent)){i.next=38;break}return i.next=38,Object(T.e)(qa(Tt,{pageIndex:o}));case 38:return i.next=40,Object(T.f)(tn);case 40:if(!(c=i.sent)){i.next=47;break}return i.next=44,Object(T.b)(K,c,t);case 44:return l=i.sent,i.next=47,Object(T.e)(qa(ua,{data:Object(k.fromJS)(l),changesetId:c}));case 47:if("success"===s.get("status")){i.next=50;break}return i.next=50,Object(T.e)(se({title:"OSMCha Status",description:s.get("message"),kind:s.get("status"),autoDismiss:20,position:"bc"}));case 50:return i.next=52,Object(T.g)(Wa);case 52:return e=1e3,t=void 0,i.next=56,Object(T.b)(sn);case 56:return i.next=58,Object(T.b)(an,e);case 58:i.next=78;break;case 60:return i.prev=60,i.t6=i.catch(5),console.log(i.t6),i.next=65,Object(T.e)(qa(Ja,i.t6));case 65:return i.next=67,Object(T.b)(an,e/2);case 67:return i.t6.name="Error",i.next=70,Object(T.e)(se({error:i.t6,kind:"warning"}));case 70:return i.next=72,Object(T.g)(Wa);case 72:return e*=4,t=void 0,i.next=76,Object(T.b)(sn);case 76:return i.next=78,Object(T.b)(an,e);case 78:i.next=4;break;case 80:case"end":return i.stop()}}),Fa,null,[[5,60]])}function sn(){var e,t;return C.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Object(T.b)(w,"token");case 2:return a.next=4,Object(T.b)(w,"oauth_token");case 4:return a.next=6,Object(T.b)(w,"oauth_token_secret");case 6:return a.next=8,Object(T.e)(qa(za));case 8:return a.next=10,Object(T.e)(qa(be));case 10:return a.next=12,Object(T.f)(Gt);case 12:if(!(e=a.sent)){a.next=16;break}return a.next=16,Object(T.e)(qa(Tt,{pageIndex:e}));case 16:return a.next=18,Object(T.e)(qa(Ka));case 18:return a.next=20,Object(T.f)(en);case 20:return t=a.sent,a.next=23,Object(T.e)(Object(c.c)(Object(I.a)(Object(I.a)({},t),{},{pathname:"/"})));case 23:case"end":return a.stop()}}),Ua)}function on(){var e,t,a,n,r,s,o;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,Object(T.b)(W);case 2:return e=c.sent,t=e.oauth_token,a=e.oauth_token_secret,c.next=7,Object(T.e)(qa(Ba,{oauth_token:t,oauth_token_secret:a}));case 7:return c.next=9,Object(T.g)(Ga);case 9:return n=c.sent,r=n.oauth_verifier,c.next=13,Object(T.b)(V,t,a,r);case 13:if(s=c.sent,(o=s.token)&&""!==o){c.next=17;break}throw new Error("invalid token");case 17:return c.next=19,Object(T.b)(j,"token",o);case 19:return c.next=21,Object(T.b)(j,"oauth_token",t);case 21:return c.next=23,Object(T.b)(j,"oauth_token_secret",a);case 23:return c.next=25,Object(T.e)(qa(Va,{token:o,oauth_verifier:r}));case 25:return c.abrupt("return",o);case 26:case"end":return c.stop()}}),Ha)}function cn(e){var t,a,n,r,s;return C.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return t=e.message_good,a=e.message_bad,n=e.comment_feature,o.prev=1,o.next=4,Object(T.f)($a);case 4:if(!(r=o.sent)){o.next=15;break}return o.t0=k.fromJS,o.next=9,Object(T.b)(J,r,t,a,n);case 9:return o.t1=o.sent,s=(0,o.t0)(o.t1),o.next=13,Object(T.e)(qa(Ya,{userDetails:s}));case 13:return o.next=15,Object(T.e)(se({kind:"success",title:"User updated",description:"Your user preferences were updated successfully"}));case 15:o.next=22;break;case 17:return o.prev=17,o.t2=o.catch(1),console.error(o.t2),o.next=22,Object(T.e)(se({error:o.t2}));case 22:case"end":return o.stop()}}),La,null,[[1,17]])}var ln=Object(k.fromJS)({oAuthToken:null,oAuthTokenSecret:null,error:null,token:null,userDetails:null});var un=Object(k.fromJS)({pageIndex:0,currentPage:null,loading:!1,error:null,diff:0,diffLoading:!1});var pn=Object(k.fromJS)({changesetId:null,changesets:new k.Map,loading:!1,errorChangeset:null,changesetMap:new k.Map,loadingChangesetMap:!1,errorChangesetMap:null});var mn=Object(k.fromJS)({error:null,kind:null,duration:null,title:null,dismiss:!0,autoDismiss:5,position:"tr",description:null,uid:null});var dn=Object(k.fromJS)({filters:{},aoi:{},loading:!1,error:null});var hn="SET_STYLE";var gn=function(e){return t=hn,a={style:e},Object(I.a)({type:t},a);var t,a},fn=Object(k.fromJS)({style:"satellite"});var bn=Object(k.fromJS)({trustedlist:null,loading:!1});var vn=Object(k.fromJS)({watchlist:Object(k.List)(),loading:!1});var yn=Object(k.fromJS)({aoi:{},loading:!1,error:null});var En=C.a.mark(xn);function xn(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(T.a)([Bt(),Et(),ct(),Oa(),rn(),nn(),ja(),ce(),ke(),Fe()]);case 2:case"end":return e.stop()}}),En)}var kn=Object(x.c)({changesetsPage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:un,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ft:return e.set("diff",t.diff).set("diffLoading",!1);case Ut:return e.set("diffLoading",!0);case Dt:return e.set("pageIndex",t.pageIndex).set("loading",!0).set("diff",0).set("diffLoading",!1).set("error",null);case St:return e.set("currentPage",t.data).set("pageIndex",t.pageIndex).set("loading",!1).set("error",null);case Mt:return e.set("pageIndex",t.pageIndex).set("diff",0).set("loading",!1).set("error",t.error);default:return e}},changeset:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case pa:return e.set("changesetId",t.changesetId).set("loading",!1).set("errorChangeset",null).set("errorChangesetMap",null);case ma:return e.set("changesetId",t.changesetId).set("loading",!0).set("errorChangeset",null);case ua:var a=e.get("changesets").set(t.changesetId,t.data);return e.set("changesets",a).set("changesetId",t.changesetId).set("loading",!1).set("errorChangeset",null);case da:return e.set("changesetId",t.changesetId).set("loading",!1).set("errorChangeset",t.error);case Ea:return e.set("changesetId",t.changesetId).set("errorChangesetMap",null).set("loadingChangesetMap",!1);case va:var n=e.get("changesetMap").set(t.changesetId,t.data);return e.set("changesetMap",n).set("changesetId",t.changesetId).set("loadingChangesetMap",!1).set("errorChangesetMap",null);case ya:return e.set("changesetId",t.changesetId).set("loadingChangesetMap",!0).set("errorChangesetMap",null);case xa:return e.set("changesetId",t.changesetId).set("loadingChangesetMap",!1).set("errorChangesetMap",t.error);case ha:var r=e.get("changesets").set(t.changesetId,t.changeset);return e.set("changesets",r);case fa:var s=e.get("changesets").set(t.changesetId,t.changeset);return e.set("changesets",s).set("errorChangeset",t.error);default:return e}},filters:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case bt.set:return e.set("filters",t.filters).set("loading",!1);default:return e}},mapControls:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case hn:return e.set("style",t.style);default:return e}},aoi:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case st:return e.set("loading",!0);case tt:return e.set("aoi",Object(k.Map)()).set("loading",!1).set("error",null);case at:return e.set("loading",!1).set("error",null).set("aoi",t.aoi);default:return e}},routing:c.f,auth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ln,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ba:return e.set("oAuthToken",t.oauth_token).set("oAuthTokenSecret",t.oauth_token_secret).set("error",null);case Va:return e.set("token",t.token).set("error",null);case za:return Object(k.fromJS)({error:e.get("error")});case Ja:return e.set("error",t.error);case Ya:return e.set("userDetails",t.userDetails);case Ka:return e.set("userDetails",Object(k.Map)());default:return e}},modal:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_MODAL":return e.set("kind",t.kind).set("error",t.error).set("callbackLabel",t.callbackLabel).set("title",t.title).set("dismiss",t.dismiss).set("uid",t.uid).set("autoDismiss",t.autoDismiss).set("position",t.position).set("description",t.description);default:return e}},trustedlist:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case he:return e.set("trustedlist",t.trustedlist).set("loading",!1);case ge:return e.set("trustedlist",e.get("trustedlist").concat([t.trustedlist_user])).set("loading",!1);case fe:return e.set("trustedlist",e.get("trustedlist").filter((function(e){return e!==t.trustedlist_user}))).set("loading",!1);case be:return e.set("trustedlist",Object(k.Map)()).set("loading",!1);default:return e}},watchlist:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce:return e.set("watchlist",t.watchlist).set("loading",!1);case Ie:return e.set("watchlist",e.get("watchlist").concat([Object(k.fromJS)(t.watchlist_user)])).set("loading",!1);case Te:return e.set("watchlist",e.get("watchlist").filter((function(e){return e.get("uid")!==t.watchlist_user}))).set("loading",!1);case Se:return e.set("watchlist",Object(k.Map)()).set("loading",!1);default:return e}}}),On=Object(O.a)(),An=[On,Object(c.e)(E)],jn=x.a.apply(void 0,An),wn={auth:Object(k.Map)({token:A("token"),oAuthToken:A("oauth_token"),oAuthTokenSecret:A("oauth_token_secret"),error:null})},Nn=Object(x.d)(kn,wn,jn);On.run(xn);a(141),a(142),a(143),a(144);var Cn,In=a(7),Tn=a(10),Sn=a(9),_n=a(8);function Dn(e){Cn&&Cn.pageview(e)}function Mn(e){Cn&&Cn.event(e)}function Pn(e){return e.displayName||e.name||"Component"}function Fn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Authentication",t=arguments.length>1?arguments[1]:void 0,a=500,n=600,r=[["width",a],["height",n],["left",window.innerWidth.width/2-a/2],["top",window.innerHeight.height/2-n/2]].map((function(e){return e.join("=")})).join(","),s=window.open("about:blank",e,r);s&&(s.location=t)}function Un(e,t,a){var n=new CustomEvent(e,{detail:t});(a||document.body).dispatchEvent(n)}function Hn(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}g&&(Cn=a(82));function Ln(){return new Promise((function(e,t){window.authComplete=function(t){var a=function(e){var t={};return e.split("&").forEach((function(e){var a=e.split("="),n=Object(Le.a)(a,2),r=n[0],s=n[1];t[decodeURIComponent(r)]=decodeURIComponent(s)||null})),t}(t.split("?")[1]);return delete window.authComplete,e(a)}}))}function Rn(e){var t=!1;return{promise:new Promise((function(a,n){e.then((function(e){return t?n({isCanceled:!0}):a(e)})).catch((function(e){return n(t?{isCanceled:!0}:e)}))})),cancel:function(){t=!0}}}function Bn(e){return Rn(new Promise((function(t){return setTimeout(t,e)})))}var Gn=function(){return window.innerWidth<=800},Vn=a(114),Wn=a(50),zn=a.n(Wn),Jn=a(33),Yn=a.n(Jn),Kn=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){return Object(In.a)(this,a),t.apply(this,arguments)}return Object(Tn.a)(a,[{key:"render",value:function(){return r.a.createElement("div",{className:"relative h-auto mt3 scroll-auto ".concat(this.props.className)},r.a.createElement("div",{style:this.props.style,className:"fixed block flex-parent flex-parent--column pb12 flex-parent--center-cross "},this.props.children))}}]),a}(r.a.PureComponent),Qn=a(213),qn=a(221);function Xn(e){var t=e.showZero;return r.a.createElement("div",{className:"flex-parent flex-parent--row flex-parent--wrap ".concat(e.className)},(e.create>-1||t)&&r.a.createElement("div",{className:"cmap-bg-create color-white inline-block px6 txt-s txt-bold round unround-r"},e.create),(e.modify>-1||t)&&r.a.createElement("div",{className:"cmap-bg-modify-old color-white inline-block px6 txt-s txt-bold unround"},e.modify),(e.delete>-1||t)&&r.a.createElement("div",{className:"cmap-bg-delete color-white inline-block px6 txt-s txt-bold round unround-l"},e.delete))}var Zn=a(60),$n=a.n(Zn);function er(e){var t=e.url;return r.a.createElement("a",{className:"link",href:t,target:"_blank",rel:"noopener noreferrer"},t)}function tr(e){var t=e.text;return r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",title:"Translate",href:"http://translate.google.com/#auto/en/".concat(encodeURIComponent(t)),className:"btn btn--xs border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition pl12 pr6"},"Translate",r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle pb3 pl3"},r.a.createElement("use",{xlinkHref:"#icon-share"})))}function ar(e){var t=e.reasons,a=e.userFlag,n=e.underline,s=e.color,o=n?"txt-underline-dotted":"";return r.a.createElement("span",{className:"mb3"},t.map((function(e,t){return r.a.createElement(nr,{key:t,text:e.get("name"),color:s,extraClass:o})})),a&&r.a.createElement(nr,{text:a,color:"purple",extraClass:o}))}var nr=function(e){var t=e.text,a=e.color,n=e.extraClass;return r.a.createElement("span",{className:"mr6"},r.a.createElement("span",{className:"color-".concat(a,"-dark inline-block bg-").concat(a,"-faint px6 txt-s txt-bold ").concat(n)},t))},rr=function(e){var t=e.property,a=e.value,n=e.imageryMatch,s=e.sourceMatch;return r.a.createElement("div",{key:t,className:"col"},r.a.createElement("strong",{title:t,className:"wmax180 txt-s txt-uppercase txt-truncate"},t),r.a.createElement("span",{className:"wmax180 txt-break-word txt-s"},a),"imagery"===t&&r.a.createElement("span",null,r.a.createElement("br",null),n.map((function(e,t){return r.a.createElement("a",{href:e,key:t,className:"color-blue"},Array.isArray(e.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/gim))?e.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/gim)[0]:r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle "},r.a.createElement("use",{xlinkHref:"#icon-share"})))}))),"source"===t&&r.a.createElement("span",null,r.a.createElement("br",null),s.map((function(e,t){return r.a.createElement("a",{href:s,title:s,key:t,className:"color-blue",target:"_blank",rel:"noopener noreferrer"},Array.isArray(e.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/gim))?e.match(/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)/gim)[0]:r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle "},r.a.createElement("use",{xlinkHref:"#icon-share"})))}))))},sr=function(e){var t=e.limit,a=e.properties,n=e.imageryMatch,s=e.sourceMatch;return Object.entries(a).map((function(e){var t=Object(Le.a)(e,2),a=t[0],o=t[1];return r.a.createElement(rr,{key:a,property:a,value:o,imageryMatch:n,sourceMatch:s})})).slice(t,t+2)};function or(e){var t=e.properties,a=e.changesetId,s=t.get("source"),o=t.get("imagery_used"),c=t.get("editor"),l=t.get("metadata"),i=t.get("reasons"),u=t.get("comment"),p=new RegExp(/(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])/gim),m=[];s&&s.indexOf("{switch:a,b,c}.")>-1&&(s=s.replace("{switch:a,b,c}.","")),s&&s.match(p)&&(m=s.match(p),s=s.replace(p,""));var d=[];o&&o.match(p)&&(d=o.match(p),o=o.replace(p,""));var h={};h="Not reported"===o?{editor:c,source:s,imagery:o}:{editor:c,imagery:o,source:s},Array.from(l,(function(e){var t=Object(Le.a)(e,2),a=t[0],n=t[1];a.startsWith("ideditor")||a.startsWith("resolved")||a.startsWith("warnings")||(h[a]=n)}));var g=Object.keys(h).length,f=Object(n.useState)(0),b=Object(Le.a)(f,2),v=b[0],y=b[1];return r.a.createElement("div",null,r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--start flex-parent--wrap py12"},r.a.createElement("div",{className:"flex-parent flex-parent--row flex-parent--wrap mb3"},r.a.createElement("p",{className:"flex-child txt-subhead txt-l txt-break-url ".concat(u?"":"color-gray txt-em")},r.a.createElement($n.a,{text:u||"".concat(a," does not have a comment.")},r.a.createElement(er,null)))),r.a.createElement("div",{className:"flex-parent"},r.a.createElement(tr,{text:u}))),r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--start flex-parent--wrap "},r.a.createElement(ar,{reasons:i,color:"blue"})),r.a.createElement("div",{className:"grid pt12 pb6"},v>0&&r.a.createElement("button",{className:"wmax12 mr6",onClick:function(){return y(v-2)},title:"Previous changeset properties"},r.a.createElement("svg",{className:"icon"},r.a.createElement("use",{xlinkHref:"#icon-chevron-left"}))),r.a.createElement(sr,{properties:h,limit:v,imageryMatch:d,sourceMatch:m}),v+20&&r.a.createElement("span",{className:"txt-s txt-em"},"\xa0(",n," edits)"),"\xa0created\xa0",Object(qn.a)(i,{addSuffix:!0})))),r.a.createElement(or,{changesetId:a,properties:t}))})),ir=a(89),ur=a(62),pr=a.n(ur),mr=a(87),dr=a.n(mr),hr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s-1&&(e="https://"+e.slice(5)),r.a.createElement("div",{className:"p6 flex-parent flex-parent--center-main"},r.a.createElement("span",{style:{background:"url(".concat(this.state.loaded?this.props.url:dr.a,") center center / ").concat(this.props.size,"px no-repeat")},className:"flex-child flex-child--no-shrink border border--2 border--gray h".concat(this.props.size," w").concat(this.props.size," bg-darken25 clip round-full")}),r.a.createElement("img",{alt:"",className:"none",src:this.props.url,onLoad:this.handleImageLoaded.bind(this),onError:this.handleImageErrored.bind(this)}))}}]),a}(r.a.PureComponent),gr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s1)throw new Error("verify array is big")},e.handleVerifyClear=function(){var t=-1!==e.props.trustedlist.indexOf(e.props.user.get("name"));-1!==e.props.watchlist.map((function(e){return e.get("uid")})).indexOf(e.props.user.get("uid"))?e.props.removeFromWatchlist(e.props.user.get("uid")):t&&e.props.removeFromTrustedlist(e.props.user.get("name"))},e}return Object(Tn.a)(a,[{key:"render",value:function(){var e=this;return this.props.watchlist.map((function(e){return e.get("uid")})).includes(this.props.user.get("uid"))?r.a.createElement("div",{className:"flex-parent-inline"},r.a.createElement("span",{className:"btn btn--s border border--1 round color-gray transition pl12 pr6 bg-lighten50 border--red-light"},r.a.createElement("span",null,r.a.createElement("svg",{className:"icon inline-block align-middle pr3 pb3 w18 h18 color-gray"},r.a.createElement("use",{xlinkHref:"#icon-alert"})),"Watchlisted user"),r.a.createElement("svg",{onClick:function(){return e.props.removeFromWatchlist(e.props.user.get("uid"))},className:"icon inline-block align-middle pl6 w24 h24 pointer color-gray"},r.a.createElement("use",{xlinkHref:"#icon-close"})))):this.props.trustedlist&&this.props.trustedlist.includes(this.props.user.get("name"))?r.a.createElement("div",{className:"flex-parent-inline"},r.a.createElement("span",{className:"btn btn--s border border--1 round color-gray transition pl12 pr6 bg-lighten50 border--yellow"},r.a.createElement("span",null,r.a.createElement("svg",{className:"icon inline-block align-middle pr3 pb3 w18 h18 color-gray"},r.a.createElement("use",{xlinkHref:"#icon-star"})),"Trusted user"),r.a.createElement("svg",{onClick:function(t){return e.props.removeFromTrustedlist(e.props.user.get("name"))},className:"icon inline-block align-middle pl6 w24 h24 pointer color-gray"},r.a.createElement("use",{xlinkHref:"#icon-close"})))):r.a.createElement("div",{className:"select-container"},r.a.createElement(kr,{eventTypes:["click","touchend"],value:[],onAdd:function(){},onRemove:function(){},options:[{value:!1,label:"Add to your watchlist"},{value:!0,label:"Add to your trusted users list"}],onChange:this.handleVerify,display:"Trust / Watch user",position:"left"}))}}]),a}(r.a.PureComponent);Or=Object(l.b)((function(e,t){return{trustedlist:e.trustedlist.get("trustedlist"),watchlist:e.watchlist.get("watchlist")}}),{addToWatchlist:Me,removeFromWatchlist:Pe,addToTrustedlist:Ee,removeFromTrustedlist:xe})(Or);var Ar=function(e){var t=e.userName,a=e.linkClasses,n=e.children;if(!t)return null;var s="https://www.openstreetmap.org/user/".concat(t);return r.a.createElement("a",{href:s,target:"_blank",rel:"noopener noreferrer",title:"Open in OSM",className:a||"mx3 btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition"},n)},jr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){return Object(In.a)(this,a),t.apply(this,arguments)}return Object(Tn.a)(a,[{key:"getHarmfulObject",value:function(){return this.props.harmful?{label:"Show Bad only",value:!0}:{label:"Show Good only",value:!1}}},{key:"getLinkContent",value:function(){if(this.props.harmful)return"".concat(this.props.userDetails.get("harmful_changesets")," Bad");var e=this.props.userDetails.get("checked_changesets")-this.props.userDetails.get("harmful_changesets");return"".concat(e," Good")}},{key:"render",value:function(){return r.a.createElement(ir.a,{className:"txt-underline-on-hover txt-bold pointer color-gray",to:{search:Ke("filters",{uids:[{label:this.props.userDetails.get("uid"),value:this.props.userDetails.get("uid")}],harmful:[this.getHarmfulObject()],date__gte:[{label:"",value:""}]}),pathname:"/"}},this.getLinkContent())}}]),a}(r.a.PureComponent),wr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){return Object(In.a)(this,a),t.apply(this,arguments)}return Object(Tn.a)(a,[{key:"renderUidFilterLink",value:function(){return r.a.createElement(ir.a,{className:"txt-underline-on-hover txt-bold pointer color-gray",to:{search:Ke("filters",{uids:[{label:this.props.userDetails.get("uid"),value:this.props.userDetails.get("uid")}],date__gte:[{label:"",value:""}]}),pathname:"/"}},"".concat(this.props.userDetails.get("count")," edits"))}},{key:"render",value:function(){var e=new pr.a.Converter({noHeaderId:!0,simplifiedAutoLink:!0}).makeHtml(this.props.userDetails.get("description")||""),t=this.props.userDetails.get("accountCreated")?Object(qn.a)(Object(Qn.default)(this.props.userDetails.get("accountCreated"),"yyyy-MM-dd'T'HH:mm:ssX",new Date),{addSuffix:!0}):"";return r.a.createElement("div",{className:"px12 py6"},r.a.createElement("h2",{className:"txt-m txt-uppercase txt-bold mr6 mb3"},"User"," ",this.props.userDetails.get("uid")&&"/ ".concat(this.props.userDetails.get("uid"))),this.props.userDetails.get("name")?r.a.createElement("div",{className:"flex-parent flex-parent--column align-items--center justify--space-between mb6"},r.a.createElement("div",null,r.a.createElement(hr,{size:96,url:this.props.userDetails.get("img")}),r.a.createElement("div",{className:"mt6 txt-bold color-gray align-center"},this.props.userDetails.get("name"))),r.a.createElement("div",null,r.a.createElement("p",{className:"txt-s color-gray align-center"},"Joined ".concat(t," | "),this.props.userDetails.get("count")?this.renderUidFilterLink():"".concat(this.props.userDetails.get("changesets_in_osmcha")," edits registered on OSMCha"))),r.a.createElement("div",null,r.a.createElement("p",{className:"txt-s color-gray align-center"},r.a.createElement(jr,{userDetails:this.props.userDetails,harmful:!0}),"\xa0and\xa0",r.a.createElement(jr,{userDetails:this.props.userDetails,harmful:!1}),"\xa0changesets")),r.a.createElement("div",{className:"mt6"},r.a.createElement(Or,{user:this.props.userDetails})),r.a.createElement("div",{className:"mt12"},r.a.createElement(ir.a,{className:"mx3 btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition",to:{search:Ke("filters",{users:[{label:this.props.userDetails.get("name"),value:this.props.userDetails.get("name")}],date__gte:[{label:"",value:""}]}),pathname:"/"}},"OSMCha"),r.a.createElement(Ar,{userName:this.props.userDetails.get("name")},"OSM"),r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",title:"Open in HDYC",className:"mx3 btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition",href:"https://hdyc.neis-one.org/?".concat(this.props.userDetails.get("name"))},"HDYC"),r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",title:"Open in Missing Maps",className:"mx3 btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition",href:"https://www.missingmaps.org/users/#/".concat(this.props.userDetails.get("name"))},"Missing Maps")),this.props.whosThat.size>1&&r.a.createElement("div",{className:"txt-s color-gray"},"Past usernames: \xa0",this.props.whosThat.slice(0,-1).map((function(e,t){return r.a.createElement("span",{key:t,className:"txt-em"},e,"\xa0")}))),r.a.createElement("div",{className:"mt12"},r.a.createElement("p",{className:"txt-subhead txt-s txt-break-url user-description",dangerouslySetInnerHTML:{__html:e}}))):r.a.createElement("div",{className:"flex-parent flex-parent--column align-items--center justify--space-between mb6"},r.a.createElement("div",null,r.a.createElement(hr,{size:96,url:this.props.userDetails.get("img")}),r.a.createElement("div",{className:"mt6 txt-bold color-gray align-center"},this.props.userDetails.get("name"))),r.a.createElement("div",{className:"flex-parent flex-parent--column mt6 mb3"},r.a.createElement(gr,{text:"Sign in to see the user details"}))))}}]),a}(r.a.PureComponent),Nr=a(31),Cr=a.n(Nr),Ir=function(e){var t=e.height,a=e.className;return r.a.createElement("div",{style:{height:t||"auto"},className:"".concat(a," flex-parent flex-parent--column flex-parent--center-cross flex-parent--center-main flex-child--grow")},r.a.createElement("div",{className:"flex-child loading"}))};function Tr(){return r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross bg-gray-faint hfull-55"},r.a.createElement("div",{className:"flex-child flex-child--grow"},"\xa0"),r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross"},r.a.createElement("svg",{className:"icon h160 w160 inline-block align-middle pb3"},r.a.createElement("use",{xlinkHref:"#icon-osm"}))),r.a.createElement("div",{className:"flex-parent flex-parent--column align-center txt-l txt-bold pt12"},"Sign in with your OpenStreetMap account to use OSMCha."),r.a.createElement("div",{className:"flex-parent flex-parent--column align-center txt-l pt36"},r.a.createElement(gr,{className:"border--darken5 border--darken25-on-hover bg-gray-light color-gray-dark",text:"Sign in"})),r.a.createElement("div",{className:"flex-child flex-child--grow"},"\xa0"))}a(165);var Sr,_r,Dr,Mr,Pr,Fr=700,Ur=500;function Hr(e){e&&Dr&&Dr.emit("selectFeature","node|way",e)}var Lr=Cr()((function(){var e=document.getElementById("container");e&&_r&&(Mr?Promise.resolve(Mr):Promise.all([Xt("render"),Xt("getMapInstance")]).then((function(e){return Mr=e[0],Pr=e[1],Mr}))).then((function(t){t&&(Dr=t(e,Sr,{width:Fr+"px",height:Math.max(400,Ur)+"px",data:_r,disableSidebar:!0}))}))}),250),Rr=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0&&r.a.createElement("strong",{className:"bg-blue-faint color-blue-dark mx6 px6 py3 txt-s round"},n.size)),0===n.size?r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross mb12"},r.a.createElement("svg",{className:"icon icon--xxl color-darken25"},r.a.createElement("use",{xlinkHref:"#icon-alert"})),r.a.createElement("p",{className:"txt-m"},"No features were flagged for ".concat(a,"."))):r.a.createElement("table",{className:"table osmcha-custom-table my12"},r.a.createElement("thead",null,r.a.createElement("tr",{className:"txt-s txt-uppercase"},r.a.createElement("th",null,"OSM Id"),r.a.createElement("th",null,"Name"),r.a.createElement("th",null,"Reasons"),r.a.createElement("th",null,"Actions"))),r.a.createElement("tbody",null,n.map((function(e,a){return r.a.createElement(Br,{key:a,data:e,changesetReasons:t.get("reasons")})}))))))}var Vr=function(e){var t=e.isActive,a=e.setOpenAll;return r.a.createElement("div",{className:"inline-block fr"},r.a.createElement("button",{className:"txt-s txt-underline pointer",onClick:function(){return a(!t)},role:"switch","aria-checked":t,tabIndex:"0"},t?"Close all":"Open all"))},Wr=function(e){var t=e.isOpen;return r.a.createElement(r.a.Fragment,null,t?r.a.createElement("svg",{className:"icon h18 w18 inline-block",style:{verticalAlign:"text-bottom"}},r.a.createElement("use",{xlinkHref:"#icon-chevron-down"})):r.a.createElement("svg",{className:"icon h18 w18 inline-block",style:{verticalAlign:"text-bottom"}},r.a.createElement("use",{xlinkHref:"#icon-chevron-right"})))};function zr(e){return Object.keys(e).map((function(t){return e[t]}))}function Jr(e){var t=new Map,a=e.map((function(e){return function(e,t){var a=Object.keys(t.properties.tags),n=Object.keys(e.properties.tags),r=n.filter((function(e){return!a.includes(e)})),s=a.filter((function(e){return!n.includes(e)})),o=n.filter((function(e){return!r.includes(e)&&!s.includes(e)})).filter((function(a){return e.properties.tags[a]!==t.properties.tags[a]})),c=new Map;return c.set("id",e.properties.id).set("type",e.properties.type).set("addedTags",r.map((function(t){return["Added tag ".concat(t),e.properties.tags[t]]}))).set("deletedTags",s.map((function(e){return["Deleted tag ".concat(e),t.properties.tags[e]]}))).set("changedValues",o.map((function(a){return["Changed value of tag ".concat(a),[t.properties.tags[a],e.properties.tags[a]]]}))),c}(e[0],e[1])})),n=["addedTags","changedValues","deletedTags"];return a.map((function(e){return n.map((function(a){return e.get(a).forEach((function(a){t.get(a[0])?t.set(a[0],t.get(a[0]).concat([{id:e.get("id"),type:e.get("type"),value:a[1]}])):t.set(a[0],[{id:e.get("id"),type:e.get("type"),value:a[1]}])}))}))})),t}function Yr(e){var t=e.id,a=e.type;return r.a.createElement("li",null,r.a.createElement("span",{className:"pointer txt-bold-on-hover",role:"button",tabIndex:"0",onFocus:function(){return Hr(t)}},a," ",t))}function Kr(e){var t=e.value,a=e.type;if(a.startsWith("Added"))return r.a.createElement("span",{className:"txt-code cmap-bg-create-light"},t);if(a.startsWith("Deleted"))return r.a.createElement("span",{className:"txt-code cmap-bg-delete-light"},t);if(a.startsWith("Changed")){var n=Object(Le.a)(t,2),s=n[0],o=n[1];return r.a.createElement("span",null,r.a.createElement("span",{className:"txt-code cmap-bg-modify-old-light"},s),r.a.createElement("strong",null," \u279c "),r.a.createElement("span",{className:"txt-code cmap-bg-modify-new-light"},o))}return r.a.createElement("div",null)}var Qr=function(e){var t=e.opened,a=e.tag,s=e.features,o=Object(n.useState)(t),c=Object(Le.a)(o,2),l=c[0],i=c[1],u=new k.OrderedSet(s.map((function(e){return e.value}))),p=a.lastIndexOf(" ")+1;return Object(n.useEffect)((function(){return i(t)}),[t]),r.a.createElement("div",null,r.a.createElement("button",{className:"pointer",tabIndex:"0","aria-pressed":l,onClick:function(){return i(!l)}},r.a.createElement(Wr,{isOpen:l}),r.a.createElement("span",{className:"txt-bold"},a.slice(0,p)),r.a.createElement("span",{className:"txt-code"},a.slice(p)),r.a.createElement("strong",{className:"bg-blue-faint color-blue-dark mx6 px6 py3 txt-s round"},s.length)),u.map((function(e,t){return r.a.createElement("div",{className:"ml18 py3",style:{display:l?"block":"none"},key:t},r.a.createElement(Kr,{value:e,type:a}),r.a.createElement("ul",{className:"ml6"},s.filter((function(t){return t.value===e})).map((function(e,t){return r.a.createElement(Yr,{id:e.id,type:e.type,value:e.value,key:t})}))))})))},qr=function(e){var t=e.changes,a=e.openAll;return r.a.createElement(r.a.Fragment,null,t.length?t.map((function(e,t){return r.a.createElement(Qr,{key:t,tag:e[0],features:e[1],opened:a})})):r.a.createElement("span",null,"No tags were changed in this changeset."))},Xr=Object(l.b)((function(e,t){return{changes:e.changeset.get("changesetMap")}}))((function(e){var t=e.changesetId,a=e.changes,s=Object(n.useState)([]),o=Object(Le.a)(s,2),c=o[0],l=o[1],i=Object(n.useState)(!1),u=Object(Le.a)(i,2),p=u[0],m=u[1];return Object(n.useEffect)((function(){var e=[];a&&a.get(t)&&(Jr(zr(a.get(t).featureMap).filter((function(e){return 2===e.length&&"modify"===e[0].properties.action}))).forEach((function(t,a){return e.push([a,t])})),l(e.sort()))}),[a,t]),r.a.createElement("div",{className:"px12 py6"},r.a.createElement("div",{className:"pb6"},r.a.createElement("h2",{className:"inline txt-m txt-uppercase txt-bold mr6 mb3"},"Tag changes"),c.length?r.a.createElement(Vr,{isActive:p,setOpenAll:m}):null),a.get(t)?r.a.createElement(qr,{changes:c,openAll:p}):r.a.createElement(Ir,{className:"pt18"}))}));var Zr=function(e){var t=e.opened,a=e.tag,s=e.features,o=Object(n.useState)(t),c=Object(Le.a)(o,2),l=c[0],i=c[1];return Object(n.useEffect)((function(){return i(t)}),[t]),r.a.createElement("div",null,r.a.createElement("button",{className:"pointer",tabIndex:"0","aria-pressed":l,onClick:function(){return i(!l)}},r.a.createElement(Wr,{isOpen:l}),r.a.createElement("span",{className:"txt-bold"},{create:"Created",modify:"Modified Relations",delete:"Deleted"}[a]),r.a.createElement("strong",{className:"bg-blue-faint color-blue-dark mx6 px6 py3 txt-s round"},s.length)),r.a.createElement("ul",{className:"cmap-vlist",style:{display:l?"block":"none"}},s.map((function(e,t){return r.a.createElement(Yr,{id:e.id,type:e.type,key:t})}))))},$r=Object(l.b)((function(e,t){return{changes:e.changeset.get("changesetMap")}}))((function(e){var t=e.changesetId,a=e.changes,s=Object(n.useState)([]),o=Object(Le.a)(s,2),c=o[0],l=o[1],i=Object(n.useState)(!1),u=Object(Le.a)(i,2),p=u[0],m=u[1];return Object(n.useEffect)((function(){var e=[];a&&a.get(t)&&(function(e){var t=new Map;return e=e.map((function(e){return e[0]})),["create","delete"].map((function(a){return t.set(a,e.filter((function(e){return e.properties.action===a})).map((function(e){return{id:e.properties.id,type:e.properties.type}})))})),t.set("modify",e.filter((function(e){return"modify"===e.properties.action})).filter((function(e){return"relation"===e.properties.type})).map((function(e){return{id:e.properties.id,type:e.properties.type}}))),t}(zr(a.get(t).featureMap)).forEach((function(t,a){return e.push([a,t])})),l(e.filter((function(e){return e[1].length}))))}),[a,t]),r.a.createElement("div",{className:"px12 py6"},r.a.createElement("div",{className:"pb6"},r.a.createElement("h2",{className:"inline txt-m txt-uppercase txt-bold mr6 mb3"},"Other features"),c.length?r.a.createElement(Vr,{isActive:p,setOpenAll:m}):null),a.get(t)?c.length?c.map((function(e,t){return r.a.createElement(Zr,{key:t,tag:e[0],features:e[1],opened:p})})):r.a.createElement("span",null,"No created and deleted features in this changeset."):r.a.createElement(Ir,{className:"pt18"}))}));var es=function(e){var t=e.tag,a=e.features,s=e.opened,o=Object(n.useState)(s),c=Object(Le.a)(o,2),l=c[0],i=c[1];return Object(n.useEffect)((function(){return i(s)}),[s]),r.a.createElement("div",null,r.a.createElement("button",{className:"pointer",tabIndex:"0","aria-pressed":l,onClick:function(){return i(!l)}},r.a.createElement(Wr,{isOpen:l}),r.a.createElement("span",{className:"txt-bold"},{node:"Nodes",way:"Ways",relation:"Relations"}[t]),r.a.createElement("strong",{className:"bg-blue-faint color-blue-dark mx6 px6 py3 txt-s round"},a.length)),r.a.createElement("ul",{className:"cmap-vlist",style:{display:l?"block":"none"}},a.map((function(e,t){return r.a.createElement(Yr,{id:e.id,key:t})}))))},ts=Object(l.b)((function(e,t){return{changes:e.changeset.get("changesetMap")}}))((function(e){var t=e.changesetId,a=e.changes,s=Object(n.useState)([]),o=Object(Le.a)(s,2),c=o[0],l=o[1],i=Object(n.useState)(!1),u=Object(Le.a)(i,2),p=u[0],m=u[1];return Object(n.useEffect)((function(){var e=[];a&&a.get(t)&&(function(e){var t=new Map;return["node","way","relation"].map((function(a){return t.set(a,e.filter((function(e){return"modify"===e[0].properties.action})).filter((function(e){return e[0].properties.type===a})).filter((function(e){return JSON.stringify(e[0].geometry)!==JSON.stringify(e[1].geometry)})).map((function(e){return{id:e[0].properties.id}})))})),t}(zr(a.get(t).featureMap)).forEach((function(t,a){return e.push([a,t])})),l(e.filter((function(e){return e[1].length}))))}),[a,t]),r.a.createElement("div",{className:"px12 py6"},r.a.createElement("div",{className:"pb6"},r.a.createElement("h2",{className:"inline txt-m txt-uppercase txt-bold mr6 mb3"},"Geometry Changes"),c.length?r.a.createElement(Vr,{isActive:p,setOpenAll:m}):null),a.get(t)?c.length?c.map((function(e,t){return r.a.createElement(es,{key:t,tag:e[0],features:e[1],opened:p})})):r.a.createElement("span",null,"No geometry changes in this changeset."):r.a.createElement(Ir,{className:"pt18"}))})),as=function(e){var t=e.children,a=(e.pullDown,e.pullUp,e.className),n=e.style,s=e.bg;return r.a.createElement("div",{className:"mb3 z4 bg-gray-faint ".concat(a," "),style:n},r.a.createElement("div",{className:"".concat(s," scroll-styled scroll-auto hmax360"),style:{minHeight:"248px"}},t))},ns=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0;""!==this.state.value||null===e.changesetIsHarmful||t||(e.changesetIsHarmful?this.setState({value:e.userDetails.get("message_bad")}):this.setState({value:e.userDetails.get("message_good")}))}},{key:"render",value:function(){var e=this;return r.a.createElement("div",null,this.props.token&&r.a.createElement("div",{className:"flex-parent flex-parent--column mt6 mb3"},this.state.success&&r.a.createElement("div",{className:"bg-green-faint color-green inline-block px6 py3 txt-s align-center round my12"},r.a.createElement("strong",null,"Comment successfully posted."),r.a.createElement("br",null),r.a.createElement("span",null,"It will appear on OSMCha after some minutes.")),this.state.error&&r.a.createElement("div",{className:"bg-red-faint color-red-dark inline-block px6 py3 txt-s align-center round my12"},r.a.createElement("strong",null,"It was not possible to post your comment.")),r.a.createElement("div",{className:"grid grid--gut12"},r.a.createElement("div",{className:"col col--12"},r.a.createElement("textarea",{placeholder:"Provide constructive feedback to the mapper with a changeset comment.",className:"textarea",ref:function(t){e.clicked&&(t&&t.select(),e.clicked=!1)},value:this.state.value,onChange:this.onChange}),r.a.createElement("div",{className:"pt6 fr"},r.a.createElement(yr,{className:"input wmax120",onClick:this.handleSubmit},"Post Comment"))))))}}]),a}(r.a.PureComponent),rs=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){return Object(In.a)(this,a),t.apply(this,arguments)}return Object(Tn.a)(a,[{key:"renderComments",value:function(){var e=this.props,t=e.discussions,a=e.changesetAuthor;return 0===t.size?r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross mb12"},r.a.createElement("svg",{className:"icon icon--xxl color-darken25"},r.a.createElement("use",{xlinkHref:"#icon-contact"})),r.a.createElement("p",{className:"txt-m"},"No discussions, yet.")):r.a.createElement("div",{className:""},t.map((function(e,t){return r.a.createElement("div",{key:t,className:"flex-parent flex-parent--column justify--space-between border border--gray-light round p6 my6 mt12"},r.a.createElement("div",{className:"flex-parent flex-parent--row justify--space-between txt-s "},r.a.createElement("span",null,"By"," ",r.a.createElement("strong",null,r.a.createElement(Ar,{userName:e.get("user"),linkClasses:"txt-underline-on-hover pointer"},e.get("user"))," "),a===e.get("user")&&r.a.createElement("span",{style:{color:"#aaa"}},"(changeset author)")),r.a.createElement("span",null,Object(qn.a)(Object(Qn.default)(e.get("date"),"yyyy-MM-dd'T'HH:mm:ssX",new Date),{addSuffix:!0}))),r.a.createElement("div",{className:"flex-parent flex-parent--column mt6 mb3"},r.a.createElement("p",{className:"txt-break-url"},r.a.createElement($n.a,{text:e.get("text")},r.a.createElement(er,null)))),r.a.createElement("div",{className:"flex-parent justify--flex-end"},r.a.createElement(tr,{text:e.get("text")})))})))}},{key:"render",value:function(){var e=this.props,t=e.discussions,a=e.changesetId,n=e.changesetIsHarmful,s=e.changesetAuthor;return r.a.createElement("div",{className:"px12 py6"},r.a.createElement("h2",{className:"txt-m mr6 mb3"},r.a.createElement("span",{className:"txt-uppercase txt-bold"},"Discussions "),"for changeset by ",s),this.props.token?this.renderComments():r.a.createElement("div",null,r.a.createElement("div",{className:"flex-parent flex-parent--column flex-parent--center-cross mb12"},r.a.createElement("svg",{className:"icon icon--xxl color-darken25"},r.a.createElement("use",{xlinkHref:"#icon-contact"}))),r.a.createElement("div",{className:"flex-parent flex-parent--inline flex-parent--center-main mt6 mb3"},r.a.createElement(gr,{text:"Sign in to read and post comments"}))),this.props.token&&r.a.createElement("div",{className:"flex-parent flex-parent--column justify--space-between my6 mt12"},r.a.createElement(ns,{changesetId:a,changesetIsHarmful:n,discussions:t,token:this.props.token,userDetails:this.props.userDetails})))}}]),a}(r.a.PureComponent);rs=Object(l.b)((function(e){return{token:e.auth.get("token"),userDetails:e.auth.get("userDetails")}}))(rs);var ss=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;sMicrosoft Corporation'}},layers:[{id:"bing",type:"raster",source:"bing-tiles",minzoom:0,maxzoom:22}]};Xt("getMapInstance").then((function(t){return t&&t()&&t().renderMap(e)}))},e.toggleOsm=function(){var e={version:8,sources:{"osm-tiles":{type:"raster",tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png","https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256,attribution:'\xa9 OpenStreetMap contributors'}},layers:[{id:"osm",type:"raster",source:"osm-tiles",minzoom:0,maxzoom:22}]};Xt("getMapInstance").then((function(t){return t&&t()&&t().renderMap(e)}))},e}return Object(Tn.a)(a,[{key:"render",value:function(){return r.a.createElement("div",{className:"px12 py6"},r.a.createElement("h2",{className:"txt-m txt-uppercase txt-bold mr6 mb3"},"Map Controls"),r.a.createElement("section",{className:"cmap-filter-action-section cmap-pt3"},r.a.createElement("h6",{className:"cmap-heading pointer txt-bold"},"Filter by actions"),r.a.createElement("ul",{className:"cmap-hlist"},r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"added",defaultChecked:"true",id:"cmap-layer-selector-added",onChange:this.onChange}),r.a.createElement("span",{className:"cmap-label-text"},"Added"),r.a.createElement("span",{className:"cmap-color-box cmap-color-added"}))),r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"modified",defaultChecked:"true",onChange:this.onChange,id:"cmap-layer-selector-modified"}),r.a.createElement("span",{className:"cmap-label-text"},"Modified"),r.a.createElement("span",{className:"cmap-color-box cmap-color-modified-old"}),r.a.createElement("span",{className:"cmap-unicode"},"\u2192"),r.a.createElement("span",{className:"cmap-color-box cmap-color-modified-new"}))),r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"deleted",defaultChecked:"true",onChange:this.onChange,id:"cmap-layer-selector-deleted"}),r.a.createElement("span",{className:"cmap-label-text"},"Deleted"),r.a.createElement("span",{className:"cmap-color-box cmap-color-deleted"}))))),r.a.createElement("section",{className:"cmap-filter-type-section"},r.a.createElement("h6",{className:"cmap-heading pointer txt-bold"},"Filter by type"),r.a.createElement("ul",{className:"cmap-hlist"},r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"nodes",defaultChecked:"true",id:"cmap-type-selector-nodes",onChange:this.onChange}),r.a.createElement("span",{className:"cmap-label-text"},"Nodes"))),r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"ways",defaultChecked:"true",id:"cmap-type-selector-ways",onChange:this.onChange}),r.a.createElement("span",{className:"cmap-label-text"},"Ways"))),r.a.createElement("li",null,r.a.createElement("label",{className:"cmap-hlist-item cmap-noselect cmap-pointer"},r.a.createElement("input",{type:"checkbox",value:"relations",defaultChecked:"true",id:"cmap-type-selector-relations",onChange:this.onChange}),r.a.createElement("span",{className:"cmap-label-text"},"Relations"))))),r.a.createElement("section",{className:"cmap-map-style-section cmap-pb3"},r.a.createElement("h6",{className:"cmap-heading pointer txt-bold"},"Map style"),r.a.createElement(kr,{eventTypes:["click","touchend"],value:this.props.style,onAdd:function(){},onRemove:function(){},options:this.layerOptions,onChange:this.onLayerChange,display:this.getLayerDropdownDisplay(this.props.style),position:"left"})))}}]),a}(r.a.PureComponent);function os(e){var t=e.active,a=e.onClick,n=e.children,s=e.className;return r.a.createElement("span",{className:"".concat(s," mx6 cursor-pointer txt-s inline-block txt-bold round p6 transition color-darken75\n ").concat(t?"bg-gray-faint":"bg-white-on-hover bg-lighten50"),onClick:a},n)}ss=Object(l.b)((function(e,t){return{style:e.mapControls.get("style")}}),{updateStyle:gn})(ss);var cs={label:"FILTER_BINDING",bindings:["\\"]},ls={label:"HELP_BINDING",bindings:["/","?"]},is={label:"NEXT_CHANGESET",bindings:["down","right"]},us={label:"PREV_CHANGESET",bindings:["up","left"]},ps={label:"REFRESH_CHANGESETS",bindings:["R","r"]},ms={label:"CHANGESET_DETAILS_DETAILS",bindings:["1"]},ds={label:"CHANGESET_DETAILS_SUSPICIOUS",bindings:["2"]},hs={label:"CHANGESET_DETAILS_TAGS",bindings:["3"]},gs={label:"CHANGESET_DETAILS_GEOMETRY_CHANGES",bindings:["4"]},fs={label:"CHANGESET_DETAILS_OTHER_FEATURES",bindings:["5"]},bs={label:"CHANGESET_DETAILS_DISCUSSIONS",bindings:["6"]},vs={label:"CHANGESET_DETAILS_USER",bindings:["7"]},ys={label:"CHANGESET_DETAILS_MAP",bindings:["8"]},Es={label:"VERIFY_GOOD",bindings:["G","g"]},xs={label:"VERIFY_BAD",bindings:["B","b"]},ks={label:"VERIFY_CLEAR",bindings:["C","c","u","U"]},Os={label:"OPEN_IN_JOSM",bindings:["J","j"]},As={label:"OPEN_IN_ID",bindings:["I","i"]},js={label:"OPEN_IN_OSM",bindings:["O","o"]},ws={label:"OPEN_IN_LEVEL0",bindings:["L","l"]},Ns={label:"OPEN_IN_ACHAVI",bindings:["V","v"]},Cs={label:"OPEN_IN_HDYC",bindings:["H","h"]},Is={label:"FILTER_BY_USER",bindings:["A","a"]};function Ts(e){var t=e.bindingsState,a=e.features,n=e.discussions,s=e.toggleDetails,o=e.toggleFeatures,c=e.toggleOtherFeatures,l=e.toggleGeometryChanges,i=e.toggleTags,u=e.toggleDiscussions,p=e.toggleUser,m=e.toggleMapOptions;return r.a.createElement(Kn,{style:{marginTop:8,marginLeft:5}},r.a.createElement(os,{active:t.get(ms.label),onClick:s,className:"unround-r unround-bl"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle "},r.a.createElement("use",{xlinkHref:"#icon-eye"}))),r.a.createElement(os,{active:t.get(ds.label),onClick:o,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle ".concat(a&&0===a.size?"color-darken25":"color-black")},r.a.createElement("use",{xlinkHref:"#icon-alert"}))),r.a.createElement(os,{active:t.get(hs.label),onClick:i,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-hash"}))),r.a.createElement(os,{active:t.get(gs.label),onClick:l,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-point-line"}))),r.a.createElement(os,{active:t.get(fs.label),onClick:c,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-plus"}))),r.a.createElement(os,{active:t.get(bs.label),onClick:u,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle ".concat(0===n.size?"color-darken25":"color-black")},r.a.createElement("use",{xlinkHref:"#icon-contact"}))),r.a.createElement(os,{active:t.get(vs.label),onClick:p,className:"unround"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-user"}))),r.a.createElement(os,{active:t.get(ys.label),onClick:m,className:"unround-r unround-tl"},r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle"},r.a.createElement("use",{xlinkHref:"#icon-map"}))))}function Ss(e,t,a){var n,s;return s=n=function(n){Object(Sn.a)(o,n);var s=Object(_n.a)(o);function o(){var e;Object(In.a)(this,o);for(var t=arguments.length,a=new Array(t),n=0;n/g,replace:'
      '},{type:"output",regex:/\/g,replace:'
    • '},{type:"output",regex:/img src=/g,replace:'img\n class="py12 my12 border border--gray-light border--2"\n style="margin-left: auto;\n margin-right: auto;\n display: block;\n " src='}]});Hs.setFlavor("github"),Hs.setOption("simpleLineBreaks",!1);var Ls=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s=3?Zs(t,e.state.queryType).then((function(e){if(!Array.isArray(e))return a(null,{options:[]});var t=e.map((function(e){return{label:e.display_name,value:e.geojson}}));return a(null,{options:t})})).catch((function(e){return a(e,null)})):a(null,{options:[]})},e.onChangeLocal=function(t){if(t){e.draw.deleteAll();var a=Object(Js.a)(t.value)/Math.pow(10,6)<1e3?.01:.1,n=Object(Ks.a)(t.value,{tolerance:a,highQuality:!0});e.updateMap(Object(Qs.a)(n,{precision:6,coordinates:2}))}},e.handleQueryTypeChange=function(t){e.setState({queryType:t})},e.renderSelect=function(){var t=e.props,a=t.name,n=t.placeholder,s=t.value;return r.a.createElement(Bs.a,{name:a,className:"",value:s,loadOptions:Cr()((function(t,a){return e.getAsyncOptions(t,a)}),500),onChange:e.onChangeLocal,placeholder:n})},e}return Object(Tn.a)(a,[{key:"updateMap",value:function(e){this.map.getSource("feature")?this.map.getSource("feature").setData(e):this.map.addSource("feature",{type:"geojson",data:{type:"Feature",geometry:e}}),void 0===this.map.getLayer("geometry")&&this.map.addLayer({id:"geometry",type:"fill",source:"feature",paint:{"fill-color":"#088","fill-opacity":.6}}),this.setState({geometry:e}),this.props.onChange(this.props.name,Object(k.fromJS)([{label:e,value:e}]));var t=Object(Ys.a)(e);this.map.fitBounds([t.slice(0,2),t.slice(2)],{padding:20})}},{key:"componentDidMount",value:function(){var e=this;Xt("getGL").then((function(t){if(t){var a=t();a.accessToken=D;var n=new a.Map({container:"geometry-map",style:"mapbox://styles/mapbox/light-v9"});e.map=n,e.draw=new Xs.a({displayControlsDefault:!1,controls:{polygon:!0}}),n.addControl(e.draw),n.on("draw.create",e.drawingUpdate),n.on("draw.modechange",e.clearBeforeDraw),n.on("draw.delete",e.drawingUpdate),n.on("draw.update",e.drawingUpdate),n.on("style.load",(function(){try{e.updateMap(e.props.value.get("0").get("value").toJS())}catch(t){TypeError}}))}}))}},{key:"render",value:function(){return r.a.createElement("div",null,r.a.createElement("div",{className:"grid grid--gut12"},r.a.createElement("div",{className:"col col--4"},r.a.createElement(Bs.c,{onChange:this.handleQueryTypeChange,options:this.queryTypeOptions,simpleValue:!0,value:this.state.queryType,placeholder:"Place Type"})),r.a.createElement("div",{className:"col col--8 pl3"},this.renderSelect())),r.a.createElement("div",{className:"grid grid--gut12 pt6"},r.a.createElement("div",{className:"col col--12 map-select"},r.a.createElement("div",{id:"geometry-map"},r.a.createElement("button",{onClick:this.clearMap,className:"pointer z5 mx1 my1 inline-block px6 py3 txt-s bg-white txt-bold round absolute fl",style:{zIndex:2}},"Clear All")))))}}]),a}(r.a.PureComponent);function eo(e){var t=e.display,a=e.children,n=e.description,s=e.handleFocus,o=void 0===s?function(){}:s,c=e.name,l=e.hasValue,i=Gn();return r.a.createElement("div",{className:"ml3 my12 flex-parent flex-parent--column",onClick:function(){return o(c)},onFocus:function(){return o(c)}},r.a.createElement("div",{className:"flex-parent flex-parent--row flex-parent--center-cross mt12 mb6 "},r.a.createElement("span",{className:"relative"},l&&r.a.createElement("svg",{style:{left:-18,top:-9},className:"absolute icon inline-block align-middle color-blue"},r.a.createElement("use",{xlinkHref:"#icon-circle"}))),r.a.createElement("strong",{className:"txt-truncate pointer"},t,"\xa0")),r.a.createElement("div",{className:"grid"},r.a.createElement("span",{className:"col col--6-mxl col--6-ml col--12-mm col--12"},a),!i&&r.a.createElement("span",{className:"col col--3-mxl col--3-ml col--1-mm"},r.a.createElement("span",{className:"desc block relative ml12 wmin120"},r.a.createElement(Yn.a,{transitionName:"filters-desc",transitionAppearTimeout:300,transitionEnterTimeout:300,transitionLeaveTimeout:200},n&&r.a.createElement("span",{key:0,className:"absolute wmin300 bg-white",style:{marginTop:-5}},n))))))}var to=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s1)throw new Error("filter select array is big")},e}return Object(Tn.a)(a,[{key:"componentDidMount",value:function(){this.getAois()}},{key:"componentWillUnmount",value:function(){this.getAoisPromise&&this.getAoisPromise.cancel()}},{key:"getAois",value:function(){var e=this;this.props.token&&(this.getAoisPromise=Rn(R(this.props.token)),this.getAoisPromise.promise.then((function(t){var a=t.features.map((function(e){return{label:e.properties.name,value:e.id}}));e.setState({aoiList:a})})).catch((function(e){return console.log(e)})))}},{key:"renderRssLink",value:function(){if(this.props.aoiId)return r.a.createElement("a",{className:"txt--s pl6",href:"".concat(v,"/aoi/").concat(this.props.aoiId,"/changesets/feed/"),title:"RSS Feed"},r.a.createElement("svg",{className:"icon icon--s mt-neg3 inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-rss"})))}},{key:"renderAoiLink",value:function(){var e=this;if(this.props.aoiId)return r.a.createElement("div",{className:"txt--s pl6 pointer inline",onClick:function(t){return navigator.clipboard.writeText("".concat(v.replace("/api/v1",""),"/?aoi=").concat(e.props.aoiId))},title:"Copy filter URL"},r.a.createElement("svg",{className:"icon icon--s mt-neg3 inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-link"})))}},{key:"renderFilterInfo",value:function(){var e=r.a.createElement(kr,{display:"My Filters",options:this.state.aoiList,onChange:this.onAoiSelect,value:[],onAdd:function(){},onRemove:function(){},position:"left"});if(this.props.token&&this.state.aoiList.length)return r.a.createElement("span",null,e)}},{key:"render",value:function(){var e="";return this.props.token&&(e=r.a.createElement(po,{name:this.props.aoiName,aoiId:this.props.aoiId,aoiList:this.state.aoiList,createAOI:this.props.createAOI,updateAOI:this.props.updateAOI})),r.a.createElement("header",{className:"h55 hmin55 flex-parent px30 bg-gray-faint flex-parent--center-cross justify--space-between color-gray border-b border--gray-light border--1"},r.a.createElement("span",{className:"txt-s color-gray--dark"},this.renderFilterInfo()),r.a.createElement("span",{className:"txt-l txt-bold color-gray--dark"},r.a.createElement("span",null,"Filters",this.props.aoiId&&r.a.createElement("span",null," / ",this.props.aoiName),this.renderAoiLink(),this.renderRssLink())),r.a.createElement("span",{className:"txt-l color-gray--dark"},e,r.a.createElement(yr,{className:"border--0 bg-transparent",onClick:this.props.handleClear},"Reset"),r.a.createElement(yr,{onClick:this.props.handleApply,className:"mx3"},"Apply"),r.a.createElement(ir.a,{to:{search:this.props.search,pathname:"/"},className:"mx3 pointer"},r.a.createElement("svg",{className:"icon icon--m inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-close"})))))}}]),a}(r.a.Component);mo=Object(l.b)((function(e,t){return{location:t.location}}),{push:c.c})(mo);var ho=Object(k.fromJS)({date__gte:[{label:"",value:""}]}),go=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s7e3)e.props.modal({kind:"error",title:"Use Save Filter",description:"Your filter is too big to be applied. You need to Save your Filter to be able to see the results."});else{if(Object(k.is)(e.state.filters,e.props.filters))return void e.props.push(Object(I.a)(Object(I.a)({},e.props.location),{},{pathname:"/"}));e.props.applyFilters(e.state.filters,"/"),e.sendToAnalytics(),Bn(3e3).promise.then((function(){return e.props.checkForNewChangesets(!0)}))}},e.sendToAnalytics=function(){e.state.filters.forEach((function(e,t){e.forEach((function(e){Mn({category:"Filters",action:t,label:e.get("label")})}))}))},e.handleChange=function(t,a){var n=e.state.filters;return n="date__gte"===t&&null==a?n.merge(ho):null==a?n.delete(t):n.set(t,a),e.setState({filters:n})},e.handleToggleAll=function(t,a){var n=e.state.filters;return n="all_"===t.slice(0,4)?n.delete(t.slice(4)):n.delete("all_"+t),n=a?n.set(t,a):n.delete(t),e.setState({filters:n})},e.replaceFiltersState=function(t){e.setState({filters:t})},e.handleClear=function(){e.props.applyFilters(new k.Map,"/")},e.loadAoiId=function(t){e.props.push(Object(I.a)(Object(I.a)({},e.props.location),{},{search:"aoi=".concat(t)}))},e.getAOIName=function(){return e.props.loading?"":e.props.aoi.getIn(["properties","name"],"unnamed *")},e.getAOIId=function(t){return e.props.loading?"":e.props.aoi.get("id")},e.removeAOI=function(t){t===e.props.aoi.get("id")&&e.handleClear(),G(e.props.token,t).catch((function(e){return console.error(e)}))},e.createAOI=function(t){e.props.applyCreateAOI(t,e.state.filters)},e.updateAOI=function(t,a){e.props.applyUpdateAOI(t,a,e.state.filters)},e}return Object(Tn.a)(a,[{key:"componentWillReceiveProps",value:function(e){Object(k.is)(this.props.filters,e.filters)||this.setState({filters:e.filters})}},{key:"render",value:function(){var e=Gn();return r.a.createElement("div",{className:"flex-parent flex-parent--column changesets-filters bg-white ".concat(e?"viewport-full":"")},r.a.createElement(mo,{createAOI:this.createAOI,updateAOI:this.updateAOI,removeAOI:this.removeAOI,loading:this.props.loading,token:this.props.token,aoiName:this.getAOIName(),aoiId:this.props.loading?"":this.props.aoi.get("id"),loadAoiId:this.loadAoiId,handleApply:this.handleApply,handleClear:this.handleClear,search:this.props.location.search}),r.a.createElement(uo,{loading:this.props.loading,filters:this.state.filters,active:this.state.active,handleFocus:this.handleFocus,handleChange:this.handleChange,handleToggleAll:this.handleToggleAll,replaceFiltersState:this.replaceFiltersState,token:this.props.token}))}}]),a}(r.a.PureComponent);go=Object(l.b)((function(e,t){return{filters:e.filters.get("filters"),aoi:e.aoi.get("aoi"),loading:e.filters.get("loading"),features:e.changesetsPage.getIn(["currentPage","features"]),location:t.location,token:e.auth.get("token")}}),{checkForNewChangesets:Rt,applyFilters:yt,applyCreateAOI:function(e,t){return ot(nt,{name:e,filters:t})},applyUpdateAOI:function(e,t,a){return ot(rt,{aoiId:e,name:t,filters:a})},push:c.c,modal:se})(go);var fo=a(115);function bo(e){var t=e.count;return r.a.createElement("span",{className:"mr6",title:"".concat(t," comment").concat(t>1?"s":"")},r.a.createElement("span",null,t),r.a.createElement("svg",{className:"icon h18 w18 inline-block align-middle color-darken25"},r.a.createElement("use",{xlinkHref:"#icon-contact"})))}var vo=a(45),yo=a.n(vo),Eo=a(46),xo=a.n(Eo);function ko(e){var t=e.changesetId,a=(e.date,e.properties);return r.a.createElement("span",{className:"flex-parent flex-parent--row justify--space-between txt-light txt-s color-gray"},r.a.createElement("span",null,r.a.createElement(ir.a,{to:{search:window.location.search,pathname:"/changesets/".concat(t)},className:"txt-underline-on-hover"},r.a.createElement("span",{className:"mr6"},t)),a.get("checked")?r.a.createElement(ir.a,{to:{search:Ke("filters",{users:[{label:a.get("check_user"),value:a.get("check_user")}],date__gte:[{label:"",value:""}]}),pathname:"/"},title:"See ".concat(a.get("check_user"),"'s changesets"),className:"txt-underline-on-hover"},a.get("harmful")?r.a.createElement("img",{src:xo.a,alt:"Marked as bad",className:"icon inline-block"}):r.a.createElement("img",{src:yo.a,alt:"Marked as good",className:"icon inline-block"}),a.get("check_user")&&r.a.createElement("span",{className:"pl6"},"by ".concat(a.get("check_user")))):null),r.a.createElement("span",{className:"flex-parent flex-parent--row"},a.get("comments_count")>0&&r.a.createElement(bo,{count:a.get("comments_count")}),r.a.createElement(Xn,{showZero:!0,className:"mr3",create:a.get("create"),modify:a.get("modify"),delete:a.get("delete")})))}function Oo(e){var t=e.reasons,a=e.comment,n=e.tags;return r.a.createElement("span",{className:"flex-parent flex-parent--column"},r.a.createElement("p",{className:"flex-child truncate-3-lines my6 txt-break-url"},a),r.a.createElement(ar,{reasons:t,color:"blue"}),r.a.createElement(ar,{reasons:n,color:"red"}))}var Ao=Object(l.b)((function(e,t){return{trustedlist:e.trustedlist.get("trustedlist"),watchlisted:e.watchlist.get("watchlist")}}))((function(e){var t=e.properties,a=(e.wasOpen,e.date),n=e.trustedlist,s=e.watchlisted,o=cr(t.get("user"),t.get("uid"),n,s),c=Object(Le.a)(o,2),l=c[0],i=c[1];return r.a.createElement("div",null,r.a.createElement("span",{className:"flex-parent flex-parent--row justify--space-between align-items--center"},r.a.createElement("strong",{className:"txt-m mt3 mr6"},t.get("user")||r.a.createElement("i",null,"OSM User"),l&&r.a.createElement("svg",{className:"icon inline-block align-middle pl3 w18 h18 color-yellow"},r.a.createElement("use",{xlinkHref:"#icon-star"})),i&&r.a.createElement("svg",{className:"icon inline-block align-middle pl3 w18 h18 color-red"},r.a.createElement("use",{xlinkHref:"#icon-alert"}))),r.a.createElement("span",{className:"txt-s mr3"},"\xa0",Object(qn.a)(Object(Qn.default)(a,"yyyy-MM-dd'T'HH:mm:ssX",new Date),{addSuffix:!0}))))})),jo=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s=l,pageIndex:n+1,active:!1,getChangesetsPage:s}))}var Io=a(220);function To(e){var t=e.filters,a=e.handleFilterOrderBy,n=e.location,s=e.diffLoading,o=e.diff,c=e.currentPage,l=e.reloadCurrentPage,i=[],u=co.filter((function(e){return"order_by"===e.name}))[0].options;return t.get("order_by")&&u.forEach((function(e){t.getIn(["order_by",0,"value"])===e.value&&i.push(e)})),r.a.createElement("div",null,r.a.createElement("header",{className:"px12 hmin36 border-b border--gray-light bg-gray-faint txt-s flex-parent justify--space-between align-items--center"},r.a.createElement(kr,{onAdd:function(){},onRemove:function(){},onChange:a,value:i,options:co.filter((function(e){return"order_by"===e.name}))[0].options,display:i[0]&&i[0].label||"Order by",position:"left"}),r.a.createElement(Io.a,{activeStyle:{fontWeight:"bold"},to:{search:n.search,pathname:n.pathname.indexOf("/filters")>-1?"/":"/filters"}},r.a.createElement(yr,{className:"mx3"},"Filters ",t.size>0&&"(".concat(t.size,")")))),r.a.createElement("header",{className:"px12 border-l border-b border-b--1 border--gray-light px12 py6 ".concat(o>0?"bg-darken10":"bg-gray-faint"," flex-child align-items--center")},r.a.createElement("span",{className:"flex-parent flex-parent--row justify--space-between color-gray txt-s txt-bold"},r.a.createElement("span",null,c&&c.getIn(["count"],0).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")||0," ","changesets."),r.a.createElement("span",{className:"flex-parent flex-parent--row"},s?r.a.createElement("span",{className:"loading loading--s inline"}):r.a.createElement(yr,{className:"mx3 btn--xs",iconName:"rotate",onClick:l},o>0?"".concat(o," new"):"")))))}var So,_o=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0?" (".concat(e.length,")"):""),position:"right"}):null}}]),a}(r.a.PureComponent);function Mo(e){var t=e.className,a=e.title,n=e.titleClassName,s=void 0===n?"":n,o=e.buttons,c=e.buttonsClassName,l=void 0===c?"":c,i=Gn();return r.a.createElement("nav",{className:"\n ".concat(i?"h40":"h55 flex-parent--center-cross","\n flex-parent px12 py6 bg-gray-dark justify--space-between ").concat(t,"\n ")},r.a.createElement("div",{className:"flex-child flex-child--grow ".concat(s)},a||""),r.a.createElement("div",{className:"flex-child ".concat(l)},o))}function Po(e){var t=e.changeset,a=e.options,n=(e.className,e.onChange),s=(e.value,e.onClear),o=(e.username,e.checkUser);if(t.getIn(["properties","checked"])){var c=t.getIn(["properties","harmful"]);return r.a.createElement("div",{className:"flex-parent align-items--center btn btn--s border border--1 round color-gray transition pl12 pr6 ".concat(c?"bg-lighten50 border--red-light":"bg-lighten50 border--green-light"),style:{maxWidth:"100px"}},r.a.createElement("img",{src:c?xo.a:yo.a,alt:"Marked as ".concat(c?"bad":"good"),className:"icon inline-block w14 h14"}),r.a.createElement("span",{className:"ml6",style:{flex:"1",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},o?r.a.createElement(r.a.Fragment,null,o):r.a.createElement("em",null,"Verified")),r.a.createElement("svg",{onClick:s,className:"icon inline-block align-middle pl3 w18 h18 pointer color-gray"},r.a.createElement("use",{xlinkHref:"#icon-close"})))}return r.a.createElement("div",{className:"select-container"},r.a.createElement(kr,{eventTypes:["click","touchend"],value:[],onAdd:function(){},onRemove:function(){},options:a,onChange:n,display:"Verify",position:"right"}))}function Fo(e){Xt("getMapInstance").then((function(e){return e&&e()&&e().map})).then((function(t){var a;if(e&&"iD"===e[0].value&&(a="https://www.openstreetmap.org/edit?editor=id&"),e&&"RapiD"===e[0].value&&(a="https://mapwith.ai/rapid?"),a){var n=t.getCenter(),r=t.getZoom();window.open("editor - OSMCha").location.href="".concat(a,"#map=").concat(r,"/").concat(n.lat,"/").concat(n.lng)}}))}function Uo(e){var t=e.display,a=e.changesetId,n=(e.coordinates,e.className),s=Gn(),o=[{label:"Achavi",value:"Achavi",href:"https://overpass-api.de/achavi/?changeset=".concat(a,"&relations=true")},{label:"iD",value:"iD"},{label:"JOSM",value:"JOSM",href:"http://127.0.0.1:8111/import?url=https://www.openstreetmap.org/api/0.6/changeset/".concat(a,"/download")},{label:"Level0",value:"Level0",href:"http://level0.osmz.ru/?url=changeset/".concat(a)},{label:"RapiD",value:"RapiD"}];return s&&o.unshift({label:"OSM.org",value:"OSM.org",href:"https://www.openstreetmap.org/changeset/".concat(a)}),r.a.createElement("div",{className:"select-container ".concat(n)},r.a.createElement(kr,{onAdd:function(){},onRemove:function(){},value:[],onChange:Fo,options:o,display:t,position:"left"}))}var Ho=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s1)throw new Error("verify array is big")},e.handleVerifyClear=function(){e.props.handleChangesetModifyHarmful(e.props.changesetId,e.props.currentChangeset,-1)},e.isChecked=function(){return e.props.currentChangeset&&e.props.currentChangeset.getIn(["properties","checked"])},e}return Object(Tn.a)(a,[{key:"componentWillReceiveProps",value:function(e){if(this.props.currentChangeset){var t=e.lastKeyStroke;if(!Object(k.is)(this.props.lastKeyStroke,t))switch(t.keySeq().first()){case xs.label:this.props.handleChangesetModifyHarmful(this.props.changesetId,this.props.currentChangeset,!0);break;case ks.label:this.props.handleChangesetModifyHarmful(this.props.changesetId,this.props.currentChangeset,-1);break;case Es.label:this.props.handleChangesetModifyHarmful(this.props.changesetId,this.props.currentChangeset,!1);break;case Os.label:if(!this.props.changesetId)return;var a="http://127.0.0.1:8111/import?url=https://www.openstreetmap.org/api/0.6/changeset/".concat(this.props.changesetId,"/download");window.open(a,"_blank");break;case As.label:if(!this.props.changesetId||!this.props.currentChangeset)return;var n=this.props.currentChangeset.getIn(["geometry","coordinates",0,0]),r="https://www.openstreetmap.org/edit?changeset=".concat(this.props.changesetId,"#map=15/").concat(n&&n.get("1"),"/").concat(n&&n.get("0"));window.open(r,"_blank");break;case js.label:if(!this.props.changesetId)return;var s="https://www.openstreetmap.org/changeset/".concat(this.props.changesetId);window.open(s,"_blank");break;case ws.label:if(!this.props.changesetId)return;var o="http://level0.osmz.ru/?url=changeset/".concat(this.props.changesetId);window.open(o,"_blank");break;case Ns.label:if(!this.props.changesetId)return;var c="https://overpass-api.de/achavi/?changeset=".concat(this.props.changesetId);window.open(c,"_blank");break;case Cs.label:var l=this.props.currentChangeset.getIn(["properties","user"],""),i="https://hdyc.neis-one.org/?".concat(l);window.open(i,"_blank");break;default:return}}}},{key:"render",value:function(){var e=this,t=Gn();return r.a.createElement(Mo,{className:"bg-gray-faint color-gray border-b border--gray-light border--1 ".concat(t?"":"px30"),title:r.a.createElement("div",{className:"flex-parent flex-parent--row flex-parent--wrap ".concat(t?"align-items--center":"")},t&&r.a.createElement(ir.a,{to:{search:window.location.search,pathname:"/"},style:t?{fontSize:"1.4em"}:{fontSize:"1.7em"},className:"color-gray mr3"},r.a.createElement("button",{style:{fontSize:t&&"1.1em"},className:"btn btn--s border border--1 border--darken5 border--darken25-on-hover round bg-darken10 bg-darken5-on-hover color-gray transition pt0 pb6 pl6 pr6 mr2"},"\u2630")," "),!t&&r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"txt-l color-gray--dark"},r.a.createElement("strong",null,"Changeset:")," ",this.props.changesetId,r.a.createElement("span",{className:"mr6"},r.a.createElement("span",{className:"txt--s pl6 pointer",onClick:function(t){return navigator.clipboard.writeText("".concat(v.replace("/api/v1",""),"/changesets/").concat(e.props.changesetId))},title:"Copy OSMCha Changeset URL"},r.a.createElement("svg",{className:"icon icon--s mt-neg3 ml3 inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-link"}))),r.a.createElement("a",{href:"https://www.openstreetmap.org/changeset/".concat(this.props.changesetId),target:"_blank",rel:"noopener noreferrer",title:"See on OSM"},r.a.createElement("svg",{className:"icon icon--s mt-neg3 ml3 inline-block align-middle bg-gray-faint color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-share"})))))),r.a.createElement(Uo,{changesetId:this.props.changesetId,coordinates:this.props.currentChangeset&&this.props.currentChangeset.getIn(["geometry","coordinates",0,0]),display:t?"".concat(this.isChecked()?"":"Changeset"," ").concat(this.props.changesetId):"Open with"})),buttonsClassName:"flex-parent",buttons:this.props.currentChangeset&&r.a.createElement(r.a.Fragment,null,this.props.currentChangeset.getIn(["properties","check_user"])&&r.a.createElement(Do,{changesetId:this.props.changesetId,currentChangeset:this.props.currentChangeset,disabled:!1,handleChangesetModifyTag:this.props.handleChangesetModifyTag}),r.a.createElement(Po,{changeset:this.props.currentChangeset,placeholder:"Verify",value:[],onChange:this.handleVerify,onClear:this.handleVerifyClear,username:this.props.username,checkUser:this.props.currentChangeset.getIn(["properties","check_user"]),options:[{value:!1,label:"Good"},{value:!0,label:"Bad"}],className:"select--s"}))})}}]),a}(r.a.PureComponent);Ho=Ss(!1,[xs,Es,ks,Os,As,js,ws,Ns,Cs],Ho),Ho=Object(l.b)((function(e,t){return{location:t.location,changesetId:parseInt(e.changeset.get("changesetId"),10),currentChangeset:e.changeset.getIn(["changesets",parseInt(e.changeset.get("changesetId"),10)]),username:e.auth.getIn(["userDetails","username"])}}),{handleChangesetModifyTag:function(e,t,a,n){return ka(ba,{oldChangeset:t,changesetId:e,tag:a,remove:n})},handleChangesetModifyHarmful:function(e,t,a){return ka(ga,{oldChangeset:t,changesetId:e,harmful:a})}})(Ho);var Lo=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s1)throw new Error("filter select array is big")},e}return Object(Tn.a)(a,[{key:"renderUserMenuOptions",value:function(){var e=this.props.username;return r.a.createElement(kr,{display:e?r.a.createElement("span",{className:"wmax180 align-middle inline-block txt-truncate"},e):"User",options:[{label:"Account settings",url:"/user"},{label:"My changesets",url:"/my-changesets"},{label:"My reviews",url:"/my-reviews"},{label:"My saved filters",url:"/saved-filters"},{label:"My teams",url:"/teams"},{label:"My trusted users list",url:"/trusted-users"},{label:"My watchlist",url:"/watchlist"},{label:"Logout",url:"/logout"}],onChange:this.onUserMenuSelect,value:[],onAdd:function(){},onRemove:function(){},position:"right"})}},{key:"render",value:function(){var e=Gn();return r.a.createElement(r.a.Fragment,null,r.a.createElement(Mo,{className:"navbar-logo bg-gray-faint border-b border--gray-light border--1",title:r.a.createElement(ir.a,{to:{search:window.location.search,pathname:"/"},style:e?{fontSize:"1.4em"}:{fontSize:"1.7em"},className:"color-gray"},r.a.createElement("strong",{className:"color-blue"},"OSM"),"Cha"),buttons:r.a.createElement("div",{className:"flex-parent flex-parent--row"},r.a.createElement(ir.a,{className:"pr3 pointer",to:{search:window.location.search,pathname:"/about"}},r.a.createElement("svg",{className:"icon icon--m inline-block align-middle color-darken25 color-darken50-on-hover transition"},r.a.createElement("use",{xlinkHref:"#icon-question"}))),this.props.token?r.a.createElement("div",{className:"pointer"},this.renderUserMenuOptions()):r.a.createElement(yr,{onClick:this.handleLoginClick,disable:!this.props.oAuthToken,iconName:"osm"},"Sign in"))}))}}]),a}(r.a.PureComponent);Lo=Object(l.b)((function(e,t){return{location:e.routing.location,changesetId:parseInt(e.changeset.get("changesetId"),10),currentChangeset:e.changeset.getIn(["changesets",parseInt(e.changeset.get("changesetId"),10)]),oAuthToken:e.auth.get("oAuthToken"),token:e.auth.get("token"),username:e.auth.getIn(["userDetails","username"]),avatar:e.auth.getIn(["userDetails","avatar"])}}),{getOAuthToken:function(){return qa(Ra)},getFinalToken:Xa,logUserOut:Za,push:c.c})(Lo);var Ro=a(109),Bo=a.n(Ro),Go=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0&&0===e.state.username.length?e.fetchUid(e.state.uid).then((function(e){return{uid:e.user.id.toString(),username:e.user.display_name}})).then((function(t){return e.setState({username:t.username,uid:t.uid,verified:!0,isValidUsername:!0,isValidUid:!0})})).catch((function(t){return e.setState({isValidUid:!1,verified:!1})})):e.state.username.length>0&&0===e.state.uid.length?e.fetchUsername(e.state.username).then((function(t){return{uid:t.toString(),username:e.state.username}})).then((function(e){return e})).then((function(t){return e.setState({username:t.username,uid:t.uid,verified:!0,isValidUsername:!0,isValidUid:!0})})).catch((function(t){return e.setState({isValidUsername:!1,verified:!1})})):e.state.uid.length>0&&e.state.username.length>0&&Promise.all([e.fetchUid(e.state.uid).then((function(e){return{uid:e.id,username:e.name}})),e.fetchUsername(e.state.username).then((function(e){return{uid:e.id,username:e.name}}))]).then((function(t){t[0].uid===t[1].uid&&t[0].username===t[1].username?(window.alert("The user is valid"),e.setState({verified:!0})):e.setState({isValidUsername:!1,isValidUid:!1})})).catch((function(t){return e.setState({isValidUsername:!1,isValidUid:!1})}))},e.onAdd=function(){var t=e.state.username,a=e.state.uid;t&&t.length>0&&a&&a.length>0?e.props.onSave(t,a):e.setState({isValidUsername:!1,isValidUid:!1})},e}return Object(Tn.a)(a,[{key:"render",value:function(){return r.a.createElement("span",{className:"flex-parent flex-parent--row"},r.a.createElement("input",{className:"input ".concat(this.state.isValidUsername?"":"border border--1 border--red"),value:this.state.username,onChange:this.setUsername,placeholder:"Username",type:"text"}),r.a.createElement("input",{className:"input ".concat(this.state.isValidUid?"":"border border--1 border--red"),value:this.state.uid,onChange:this.setUid,placeholder:"UID",type:"text"}),r.a.createElement(yr,{className:"btn max120 ml12 ",onClick:this.verifyInput},this.state.verified?"Verified":"Verify"),r.a.createElement(yr,{className:"btn wmax120 ml12 ".concat(this.state.verified?"btn--green":""),onClick:this.onAdd},"Add"))}}]),a}(r.a.Component),$o=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0&&(e.props.onSave(t),e.setState({username:""}))},e}return Object(Tn.a)(a,[{key:"render",value:function(){var e=this;return r.a.createElement("span",{className:"flex-parent flex-parent--row"},r.a.createElement("input",{className:"input",onChange:function(t){return e.setState({username:t.target.value})},placeholder:"Username",type:"text"}),r.a.createElement(yr,{className:"btn wmax120 ml12",onClick:this.onAdd},"Add"))}}]),a}(r.a.Component),ec=function(e){Object(Sn.a)(a,e);var t=Object(_n.a)(a);function a(){var e;Object(In.a)(this,a);for(var n=arguments.length,r=new Array(n),s=0;s0?(e=e.keySeq().sort((function(e,t){return e.localeCompare(t)})).join(","),Dn("/?filters=".concat(e))):Dn("/")}}},{key:"render",value:function(){return Gn()?r.a.createElement(gc,null):r.a.createElement(xc,null)}}]),a}(n.Component);i.default.initialize("UA-100686765-1",{gaOptions:{anonymizeIp:!0,screenResolution:"".concat(window.screen.availWidth,"X").concat(window.screen.availHeight),appName:"PRODUCTION"}}),p.a.config("https://5637ef87f5794e2fb9e1e5fe9119688d@sentry.io/175926",{release:"0.85.1",environment:"production",debug:d}).install(),o.a.render(r.a.createElement(l.a,{store:Nn},r.a.createElement(c.a,{history:E},r.a.createElement(kc,null))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},45:function(e,t,a){e.exports=a.p+"static/media/thumbs-up.13d765c5.svg"},46:function(e,t,a){e.exports=a.p+"static/media/thumbs-down.7e04a82a.svg"},56:function(e){e.exports=JSON.parse('[{"name":"date","icontains":false,"all":false,"range":true,"display":"Date","type":"date","description":"Set the date range to view changesets created during that duration.","placeholder":"YYYY-MM-DD"},{"name":"comment","icontains":true,"all":false,"range":false,"display":"Comment","type":"text","description":" Filter changesets that mention a particular keyword in its comment. This is not case-sensitive.","placeholder":"Enter a keyword like hotosm, import or fixme"},{"name":"geometry","icontains":false,"range":false,"all":false,"display":"Location","type":"location","description":"Filter changesets whose bbox intersect with a location boundary.","placeholder":"Type a place on the world"},{"name":"in_bbox","icontains":false,"all":false,"range":false,"display":"Bounding Box (BBox)","type":"map","description":"Scroll","placeholder":"Pan to the location of interest in the map"},{"name":"area_lt","icontains":false,"range":false,"all":false,"display":"BBox size bound","type":"number","description":"Filter changesets that have a bbox area lower than X times the area of your BBox or geometry filter. For example, if the geometry you defined in your filter has an area of 1 degree and you set the \'BBox size bound\' to 2, it will filter the changesets whose bbox area is lower than 2 degrees.","placeholder":"Upper bound of bbox area"},{"name":"tag_changes","icontains":false,"all":false,"range":false,"display":"OSM features tags","cache":true,"type":"text_comma","description":"Filter changesets using OSM tag values. Example: highway=footway. Use an asterisk to filter any value for a key, example: amenity=*","placeholder":"building=yes, amenity=*, highway=primary"},{"name":"is_suspect","icontains":false,"range":false,"all":false,"display":"Show Flagged","type":"radio","options":[{"label":"Yes","value":"True"},{"label":"No","value":"False"}],"description":"Choose to view only changesets that have been flagged, not flagged, or all. Read more about automated flagging on our About page.","placeholder":"yes / no"},{"name":"reasons","icontains":false,"range":false,"all":true,"data_url":"suspicion-reasons","display":"Reasons for Flagging","type":"text_comma","description":"Select one or multiple reasons that a changeset might be flagged for.","placeholder":"Start typing to pick reasons"},{"name":"checked_&_harmful","icontains":false,"range":false,"all":false,"display":"Review Status","type":"meta","metaOf":["harmful","checked"],"options":[{"label":"Bad only","value":{"harmful":[{"label":"Show Bad only","value":"True"}]}},{"label":"Good only","value":{"harmful":[{"label":"Show Good only","value":"False"}]}},{"label":"Both Good or Bad","value":{"checked":[{"label":"Both Good or Bad","value":"True"}]}},{"label":"Not Reviewed","value":{"checked":[{"label":"Not Reviewed","value":"False"}]}}],"placeholder":"Filter by the type of review","description":"Filter for changesets that have been manually reviewed and marked (either good or bad)"},{"name":"check_date","icontains":false,"all":false,"range":true,"display":"Review Date","type":"date","description":"Set the date range to view changesets reviewed within that duration.","placeholder":"YYYY-MM-DD"},{"name":"checked_by","icontains":false,"all":false,"range":false,"display":"Reviewed by","cache":true,"type":"text_comma","description":"Filter changesets that were reviewed by a user. Start typing to select one or more users. This filter requires authentication to work.","placeholder":"Enter OSM usernames"},{"name":"tags","icontains":false,"range":false,"all":true,"display":"Tags","type":"text_comma","data_url":"tags","description":"Filter changesets that have one or more manually assigned Tags. Start typing to select tags.","placeholder":"Add tags"},{"name":"users","icontains":false,"all":false,"range":false,"display":"Users","cache":true,"type":"text_comma","description":"Show changesets created by the users. Start typing to select one or more users.","placeholder":"Enter OSM usernames"},{"name":"uids","icontains":false,"all":false,"range":false,"display":"User ids","cache":true,"type":"text_comma","description":"Show changesets created by users filtering by their OSM user ids. Start typing to select one or more uids.","placeholder":"Enter OSM user ids"},{"name":"hide_whitelist","icontains":false,"range":false,"all":false,"display":"Hide trusted users","type":"radio","options":[{"label":"Yes","value":"True"},{"label":"No","value":"False"}],"description":"If Yes, it will exclude the changesets created by users that you added to your trusted users list","placeholder":"Exclude changesets created by trusted users"},{"name":"blacklist","icontains":false,"range":false,"all":false,"display":"Watchlisted users","type":"radio","options":[{"label":"Yes","value":"True"},{"label":"No","value":"False"}],"description":"If Yes, it will Filter changesets created by users that you added to your Watchlist.","placeholder":"Filter changesets created by users from your Watchlist"},{"name":"mapping_teams","icontains":false,"all":false,"range":false,"display":"Mapping teams","data_url":"mapping-team","type":"text_comma","description":"Show changesets created by users that are part of a Mapping Team. Start typing to select one or more teams.","placeholder":"Enter mapping teams"},{"name":"exclude_teams","icontains":false,"all":false,"range":false,"display":"Hide mapping teams","data_url":"mapping-team","type":"text_comma","description":"Exclude changesets created by users that are part of a Mapping Team. Start typing to select one or more teams.","placeholder":"Enter mapping teams"},{"name":"exclude_trusted_teams","icontains":false,"range":false,"all":false,"display":"Hide verified mapping teams","type":"radio","options":[{"label":"Yes","value":"True"},{"label":"No","value":"False"}],"description":"If Yes, it will exclude the changesets created by users that are part of verified mapping teams","placeholder":"Exclude changesets created by users from verified teams"},{"name":"create","icontains":false,"all":false,"range":true,"display":"Objects Created","type":"number","description":"Filter changesets whose number of elements created are greater than or equal to and/or lesser than or equal to a number.","placeholder":"eg. 500"},{"name":"modify","icontains":false,"all":false,"range":true,"display":"Objects Modified","type":"number","description":"Filter changesets whose number of elements modified are greater than or equal to and/or lesser than or equal to a number.","placeholder":"eg. 500"},{"name":"delete","icontains":false,"all":false,"range":true,"display":"Objects Deleted","type":"number","description":"Filter changesets whose number of elements deleted are greater than or equal to and/or lesser than or equal to a number.","placeholder":"eg. 500"},{"name":"comments_count","icontains":false,"all":false,"range":true,"display":"Number of comments","type":"number","description":"Filter changesets whose number of comments are greater than or equal to and/or lesser than or equal to a number.","placeholder":"eg. 3"},{"name":"source","icontains":true,"all":false,"range":false,"display":"Source","type":"text","description":"Filter changesets by text in its source field. This is not case-sensitive.","placeholder":"eg. Bing, Local"},{"name":"editor","icontains":true,"all":false,"range":false,"display":"Editor","type":"text","description":"Filter changesets by editor used. This is not case-sensitive.","placeholder":"eg. iD, JOSM"},{"name":"imagery_used","icontains":true,"all":false,"range":false,"display":"Imagery used","type":"text","description":"Filter changesets by text in its imagery_used field. This is not case-sensitive.","placeholder":"eg. Bing, Mapbox"},{"name":"ids","icontains":false,"range":false,"all":false,"display":"Changeset IDs","type":"text_comma","description":"Filter changesets by its ID. Use commas to search for more than one id.","placeholder":"Enter Changeset IDs"},{"name":"metadata","icontains":false,"all":false,"range":false,"display":"Other metadata","type":"text","description":"Filter changesets by any other metadata that is not present on the fields above. You can combine more than one filter, separated by commas.","placeholder":"eg. changesets_count__max=50,hashtags=#hotosm-project"},{"name":"order_by","icontains":false,"range":false,"all":false,"display":"Order by","type":"radio","options":[{"label":"Ascending ID","value":"id"},{"label":"Ascending Date","value":"date"},{"label":"Ascending check date","value":"check_date"},{"label":"Ascending object created","value":"create"},{"label":"Ascending object modified","value":"modify"},{"label":"Ascending object deleted","value":"delete"},{"label":"Ascending number of comments","value":"comments_count"},{"label":"Descending ID","value":"-id"},{"label":"Descending Date","value":"-date"},{"label":"Descending check date","value":"-check_date"},{"label":"Descending object created","value":"-create"},{"label":"Descending object modified","value":"-modify"},{"label":"Descending object deleted","value":"-delete"},{"label":"Descending number of comments","value":"-comments_count"}],"description":"Order changesets by one of the following fields: id, date, check_date, create, modify, delete or number of comments.","placeholder":"Asceding/Descending "},{"name":"powerfull_editor","ignore":true,"icontains":false,"range":false,"all":false,"display":"Powerful editor","type":"text","description":"Filter changesets that were created using a software editor considered powerful (those that allow to create, modify or delete data in a batch).","placeholder":""}]')},87:function(e,t){e.exports="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/AAAAF5jcHJ0AAABXAAAAAt3dHB0AAABaAAAABRia3B0AAABfAAAABRyWFlaAAABkAAAABRnWFlaAAABpAAAABRiWFlaAAABuAAAABRyVFJDAAABzAAAAEBnVFJDAAABzAAAAEBiVFJDAAABzAAAAEBkZXNjAAAAAAAAAANjMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB0ZXh0AAAAAElYAABYWVogAAAAAAAA9tYAAQAAAADTLVhZWiAAAAAAAAADFgAAAzMAAAKkWFlaIAAAAAAAAG+iAAA49QAAA5BYWVogAAAAAAAAYpkAALeFAAAY2lhZWiAAAAAAAAAkoAAAD4QAALbPY3VydgAAAAAAAAAaAAAAywHJA2MFkghrC/YQPxVRGzQh8SmQMhg7kkYFUXdd7WtwegWJsZp8rGm/fdPD6TD////bAEMAAgMDAwQDBAUFBAYGBgYGCAgHBwgIDQkKCQoJDRMMDgwMDgwTERQRDxEUER4YFRUYHiMdHB0jKiUlKjUyNUVFXP/bAEMBAgMDAwQDBAUFBAYGBgYGCAgHBwgIDQkKCQoJDRMMDgwMDgwTERQRDxEUER4YFRUYHiMdHB0jKiUlKjUyNUVFXP/AABEIAEAAQAMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AP2YooooAKKz7u8ito9z9T0UdSa4eXWb1z8pCD0Az+poA9IorzeLWb1D8xDj0Ix+oruLS8iuY9ydR1U9QaANCiiigAooooA8v1Scy3snPCHaPwrHq3d/8fU//XRv51UoAK2NLnMV7Hzw52n8ax6t2n/H1B/10X+dAHrtFFFABRRTHdEUszBQO5OBQBwOs2jJOZgPlfr7N/8AXrmK9En1ixAK4MgPUAcH8689JBY4GBk4FADa6fRrRnnExHyp092/+tXNAgMMjIyMivQoNYsSAuDGB0BHA/KgDpKKYjo6hlYMD3ByKfQBmX17Haxbjyx4VfU/4V5rcXM1w+6Rs+g7D6CtLWJGe+cHogCj+dYVABRRRQAUUUUAW7e5mt33Rtj1HY/UV6VY3sd1FuHDDhl9D/hXlVbujyMl8gHRwVP86AP/2Q=="}},[[119,1,2]]]); +//# sourceMappingURL=main.0631e5da.chunk.js.map \ No newline at end of file diff --git a/static/js/main.a3b4e0f0.chunk.js.map b/static/js/main.0631e5da.chunk.js.map similarity index 99% rename from static/js/main.a3b4e0f0.chunk.js.map rename to static/js/main.0631e5da.chunk.js.map index db0664cc..ffd20af1 100644 --- a/static/js/main.a3b4e0f0.chunk.js.map +++ b/static/js/main.0631e5da.chunk.js.map @@ -1 +1 @@ -{"version":3,"sources":["assets/banner.png","assets/work_flow.png","config/index.js","store/history.js","utils/safe_storage.js","config/constants.js","network/aoi.js","network/auth.js","network/status.js","network/changeset.js","network/osmcha_watchlist.js","store/modal_actions.js","network/osmcha_trustedlist.js","store/trustedlist_actions.js","store/watchlist_actions.js","utils/filters.js","network/changesets_page.js","utils/query_params.js","network/reasons_tags.js","store/aoi_actions.js","store/filters_actions.js","store/changesets_page_actions.js","config/notifications.js","utils/cmap.js","utils/routing.js","store/changeset_actions.js","store/auth_actions.js","store/auth_reducer.js","store/changesets_page_reducer.js","store/changeset_reducer.js","store/modal_reducer.js","store/filters_reducer.js","store/map_controls_actions.js","store/map_controls_reducer.js","store/trustedlist_reducer.js","store/blacklist_reducer.js","store/aoi_reducer.js","store/sagas.js","store/index.js","utils/analytics.js","utils/component.js","utils/create_popup.js","utils/dispatch_event.js","utils/element_in_view.js","utils/handle_popup_callback.js","utils/promise.js","utils/isMobile.js","components/changeset/floater.js","components/create_delete_modify.js","components/assembly_anchor.js","components/changeset/translate_button.js","components/reasons.js","components/changeset/property.js","components/changeset/property_list.js","components/changeset/details.js","hooks/UseIsUserListed.js","components/changeset/header.js","components/avatar.js","components/changeset/sign_in_button.js","components/button.js","components/dropdown.js","components/changeset/trust_watch_user.js","components/changeset/user_osm_link.js","components/changeset/user.js","components/loading.js","components/sign_in.js","views/map.js","components/changeset/features.js","components/open_all.js","components/expand_item_icon.js","components/changeset/tag_changes.js","components/changeset/other_features.js","components/changeset/geometry_changes.js","components/changeset/box.js","components/changeset/comment.js","components/changeset/discussions.js","components/changeset/map_options.js","components/changeset/control.js","config/bindings.js","components/changeset/control_layout.js","components/keyboard_enhancer.js","components/fetch_data_enhancer.js","network/openstreetmap.js","network/whosthat.js","components/changeset/index.js","views/changeset.js","views/about.js","views/stats.js","components/filters/radio.js","components/filters/text.js","components/filters/multi_select.js","network/nominatim.js","components/filters/location.js","components/filters/wrapper.js","components/filters/meta.js","components/filters/date.js","components/bbox_picker.js","components/loading_enhancer.js","components/filters/filters_list.js","components/filters/filters_header.js","views/filters.js","components/list/comments.js","components/list/secondary_line.js","components/list/primary_line.js","components/list/title.js","components/list/row.js","components/list/index.js","components/list/page_range.js","components/list/footer.js","components/list/header.js","utils/number_with_commas.js","components/changeset/tags.js","views/changesets_list.js","components/navbar.js","components/changeset/verify.js","components/changeset/open_in.js","views/navbar_changeset.js","views/navbar_sidebar.js","views/modal.js","components/user/details.js","views/user.js","components/secondary_pages_header.js","components/customURL.js","components/user/block_markup.js","views/saved_filters.js","components/user/watchlist_user.js","components/user/trustedlist_user.js","components/user/save_user.js","views/trusted_users.js","views/watchlist.js","network/mapping_team.js","components/teams/new_team.js","views/teams.js","views/edit_team.js","AppMobile.js","views/home.js","AppDesktop.js","app.js","index.js","serviceworker.js","assets/thumbs-up.svg","assets/thumbs-down.svg","components/user.jpg"],"names":["module","exports","isDev","process","isStaging","isProd","isLocal","url","window","debug_info","toString","API_URL","historyConfig","basename","history","createBrowserHistory","getItem","key","localStorage","err","console","warn","setItem","value","removeItem","mapboxAccessToken","osmchaSocialTokenUrl","osmAuthUrl","getString","input","JSON","stringify","handleErrors","response","ok","json","then","r","status","Error","detail","statusText","Promise","reject","createAOI","token","name","filters","serverFilters","forEach","v","k","Iterable","isIterable","filter","x","get","map","join","fetch","method","headers","Authorization","body","res","fetchAOI","aoiId","fetchAllAOIs","resolve","updateAOI","deleteAOI","postFinalTokensOSMCha","oauth_token","oauth_token_secret","oauth_verifier","request","post","type","send","catch","e","error","postTokensOSMCha","fetchUserDetails","updateUserDetails","message_good","message_bad","comment_feature","getStatus","fetchChangeset","id","setHarmful","harmful","createForm","obj","formData","FormData","Object","keys","append","setTag","tag","remove","Number","isNaN","parseInt","tag_pk","postComment","comment","fetchWatchList","deleteFromWatchList","uid","postUserToWatchList","data","username","watchlist_user","watchModal","handleModal","modal","kind","title","dismiss","autoDismiss","position","description","callback","callbackArgs","callbackLabel","message","payload","action","takeEvery","uidOriginal","Date","getTime","Math","random","put","take","call","delay","deleteFromTrustedList","postUserToTrustedList","whitelist_user","watchTrustedlist","addToTrustedlistSaga","removeFromTrustedlistSaga","TRUSTEDLIST","tokenSelector","state","auth","addToTrustedlist","trustedlist_user","removeFromTrustedlist","all","select","watchWatchlist","addToWatchlistSaga","removeFromWatchlistSaga","WATCHLIST","addToWatchlist","removeFromWatchlist","validateFilters","Map","isMap","valid","List","isList","vv","has","test","getDefaultFromDate","extraDays","defaultDate","format","sub","days","fromJS","date__gte","label","appendDefaultDate","count","merge","now","getTimezoneOffset","minutes","date__lte","getDefaultToDate","fetchChangesetsPage","pageIndex","nocache","flatFilters","filterJoined","encodeURIComponent","getSearchObj","searchParam","result","parse","getObjAsQueryParam","length","fetchReasons","fetchTags","watchAOI","fetchAOISaga","createAOISaga","updateAOISaga","AOI","takeLatest","loading","reasons","tags","aoi","getIn","split","o","i","hasOwnProperty","SyntaxError","options","locationSelector","location","push","pathname","search","FILTERS","set","CHANGESETS_PAGE","routing","watchFilters","watchLocationChange","applyFilterSaga","filtersSaga","fetched","modify","checkNew","updateNewCount","checkNewLoading","apply","applyFilters","LOCATION_CHANGE","lastSearchString","lastTask","cancel","fork","toJS","toObject","filtersSelector","watchChangesetsPage","fetchChangesetsPageSaga","modifyChangesetPageSaga","checkForNewChangesetsSaga","getChangesetsPage","checkForNewChangesets","pageIndexSelector","changesetsPage","aoiIdSelector","oldPageIndex","thisPage","currentPageAndIndexSelector","changesetId","changeset","currentPage","features","index","findIndex","f","setIn","newData","oldData","diff","toSet","subtract","size","cmap","importChangesetMap","m","log","getParam","param","path","match","matchPath","params","getChangesetIdFromLocation","checkForLegacyURL","watchChangeset","shouldUpdateSaga","watchModifyChangeset","fetchChangesetAction","fetchChangesetMapAction","setHarmfulAction","setTagActions","CHANGESET","CHANGESET_MODIFY","CHANGESET_MAP","changesetTask","changesetMapTask","legacy","replace","modifyAction","notifications","oldChangeset","newChangeset","changesetsSelector","changesets","changesetMapModule","getCMapData","changesetMapSelector","changesetMaps","changesetMap","existingTags","t","delete","watchUserDetails","watchAuth","logoutFlow","authTokenFlow","updateUserDetailsSaga","AUTH","getFinalToken","logUserOut","changesetIdSelector","delayPromise","delayBy","userDetails","trustedlist","watchlist","undefined","initialState","oAuthToken","oAuthTokenSecret","changesetsInitial","diffLoading","initial","errorChangeset","loadingChangesetMap","errorChangesetMap","duration","filtersInitial","MAPCONTROLS","updateStyle","style","mapControlsInitial","aoiInitial","rootSaga","reducers","combineReducers","mapControls","routerReducer","concat","item","sagaMiddleware","createSagaMiddleware","middlewares","routerMiddleware","appliedMiddlewares","applyMiddleware","persistedState","safeStorage","store","createStore","run","sagas","ReactGA","gaPageView","page","pageview","gaSendEvent","event","getDisplayName","WrappedComponent","displayName","createPopup","width","height","settings","innerWidth","innerHeight","popup","open","dispatchEvent","messageId","payLoad","target","CustomEvent","document","elementInViewport","element","rect","getBoundingClientRect","top","left","bottom","right","require","handlePopupCallback","rej","authComplete","creds","queryString","query","pair","decodeURIComponent","parseQueryString","cancelablePromise","promise","hasCanceled_","val","isCanceled","interval","setTimeout","isMobile","Floater","className","this","props","children","React","PureComponent","CreateDeleteModify","showZero","create","AssemblyAnchor","href","rel","TranslateButton","text","xlinkHref","Reasons","userFlag","underline","color","extraClass","Reason","Property","property","imageryMatch","sourceMatch","Array","isArray","PropertyList","limit","properties","entries","slice","Details","source","imagery","editor","metadata","urlRegex","RegExp","indexOf","propertiesObj","from","p","startsWith","useState","leftLimit","setLeftLimit","onClick","useIsUserListed","isInTrustedlist","setIsInTrustedlist","isInWatchlist","setIsInWatchlist","useEffect","user","Header","connect","watchlisted","userEditCount","toggleUser","date","destroy","dir","formatDistanceToNow","addSuffix","Avatar","loaded","setState","nextProps","Placeholder","background","alt","src","onLoad","handleImageLoaded","bind","onError","handleImageErrored","SignInButton","handleLoginClick","oAuthObj","extraClasses","getChangeset","Button","iconName","disabled","DropdownContent","isActive","handleClick","onChange","ourObj","isRemove","onRemove","newArray","multi","onAdd","toggleDropdown","styles","data-label","data-payload","checked","deletable","preventDefault","stopPropagation","_Dropdown","display","handleClickOutside","eventTypes","Dropdown","onClickOutside","TrustWatchUser","handleVerify","arr","handleVerifyClear","is_in_trustedlist","includes","UserOSMLink","userName","linkClasses","UserLink","Link","to","uids","getHarmfulObject","getLinkContent","User","UserDescriptionHTML","showdown","Converter","noHeaderId","simplifiedAutoLink","makeHtml","registrationDate","renderUidFilterLink","users","whosThat","dangerouslySetInnerHTML","__html","Loading","SignIn","currentChangesetMap","cMapRender","getMapInstance","selectFeature","emit","minDebounce","debounce","container","getElementById","render","max","disableSidebar","CMap","visible","ref","setRef","setDimensions","parentNode","instance","resize","mobile","onresize","prevProp","content","timeOut","visibility","transitionName","transitionAppearTimeout","transitionAppear","transitionEnterTimeout","transitionLeaveTimeout","Feature","changesetReasons","reason","contains","role","tabIndex","onFocus","charAt","Features","reviewedFeatures","feature","user_flag","osm_id","reviewedIds","featuresIds","find","OpenAll","setOpenAll","aria-checked","ExpandItemIcon","isOpen","verticalAlign","getFeatures","processFeatures","finalReport","analyzedFeatures","newVersion","oldVersion","oldVersionKeys","newVersionKeys","addedTags","deletedTags","changedValues","analyzeFeature","FeatureListItem","ChangeTitle","oldValue","newValue","ChangeItem","opened","setIsOpen","values","OrderedSet","last_space","lastIndexOf","aria-pressed","n","ChangeItemList","changes","openAll","change","TagChanges","changeReport","setChangeReport","newChangeReport","featureIDs","sort","ActionItem","OtherFeatures","changeType","GeometryChangesItem","node","way","relation","GeometryChanges","geometry","Box","pullDown","pullUp","bg","minHeight","CommentForm","success","postCommentPromise","handleSubmit","updateValue","userCommentedBefore","discussions","changesetIsHarmful","placeholder","clicked","Discussions","changesetAuthor","renderComments","MapOptions","actions","mapStyle","layerOptions","function","toggleSatellite","toggleStreet","toggleDark","toggleBing","toggleOsm","getLayerDropdownDisplay","filteredLayer","l","onLayerChange","layer","filterLayers","renderMap","bingStyle","version","sources","tiles","attribution","layers","minzoom","maxzoom","osmStyle","tileSize","defaultChecked","Control","active","FILTER_BINDING","bindings","HELP_BINDING","NEXT_CHANGESET","PREV_CHANGESET","REFRESH_CHANGESETS","CHANGESET_DETAILS_DETAILS","CHANGESET_DETAILS_SUSPICIOUS","CHANGESET_DETAILS_TAGS","CHANGESET_DETAILS_GEOMETRY_CHANGES","CHANGESET_DETAILS_OTHER_FEATURES","CHANGESET_DETAILS_DISCUSSIONS","CHANGESET_DETAILS_USER","CHANGESET_DETAILS_MAP","VERIFY_GOOD","VERIFY_BAD","VERIFY_CLEAR","OPEN_IN_JOSM","OPEN_IN_ID","OPEN_IN_OSM","OPEN_IN_LEVEL0","OPEN_IN_ACHAVI","OPEN_IN_HDYC","FILTER_BY_USER","ControlLayout","bindingsState","toggleDetails","toggleFeatures","toggleOtherFeatures","toggleGeometryChanges","toggleTags","toggleDiscussions","toggleMapOptions","marginTop","marginLeft","keyboardToggleEnhancer","exclusive","lastKeyStroke","toggleKey","prev","exclusiveKeyToggle","newBindingState","prevBindingValue","Mousetrap","b","unbind","withFetchDataSilent","dataToFetch","onUpdate","_initFetching","fetchedData","reloadData","initFetching","getUserDetails","fromOSM","u","accountCreated","account_created","img","display_name","fromOSMCha","r1","r2","getUsers","_Changeset","showFloaters","currentChangeset","osmInfo","changesetUsername","prevProps","getUserDetailsPromise","getWhosThatPromise","names","defaultProps","Changeset","filterChangesetsByUser","showChangeset","converter","ghCompatibleHeaderId","extensions","regex","setFlavor","setOption","About","about","cancellablePromise","markdown","Stats","Radio","onChangeLocal","Text","isValid","handleFormChange","validity","min","Component","MultiSelect","allToggle","getAsyncOptions","dataURL","d","for_changeset","sendData","processed","renderSelect","promptTextCreator","loadOptions","handleToggle","showAllToggle","MappingTeamMultiSelect","trusted","nominatimSearch","LocationSelect","queryType","lastSearch","queryTypeOptions","draw","clearBeforeDraw","mode","clearMap","changeMode","deleteAll","getSource","setData","getLayer","removeLayer","drawingUpdate","drawingData","getAll","updateMap","truncate","precision","coordinates","cb","geojson","tolerance","area","simplified_bounds","simplify","highQuality","handleQueryTypeChange","addSource","addLayer","paint","geom_bbox","bbox","fitBounds","padding","getGL","mapboxgl","accessToken","MapboxDraw","displayControlsDefault","controls","polygon","addControl","on","TypeError","simpleValue","zIndex","Wrapper","handleFocus","hasValue","Meta","handleChange","activeFilters","metaOf","replaceFiltersState","findCurrentValue","option","DateField","handleDateChange","isClearable","selected","placeholderText","dateFormat","minDate","maxDate","BBoxPicker","update","bounds","getBounds","s","getSouth","toFixed","w","getWest","getNorth","wsen","getEast","clearBbox","loadingEnhancer","filtersData","ignore","FiltersList","renderFilters","propsToSend","data_url","wrapperProps","range","gteValue","lteValue","today","fi","handleToggleAll","endsWith","SaveAOI","editing","onKeyDown","keyCode","aoiList","FiltersHeader","onAoiSelect","getAois","getAoisPromise","navigator","clipboard","writeText","dropdown","save_aoi","aoiName","renderFilterInfo","renderAoiLink","renderRssLink","handleClear","handleApply","noDateGte","Filters","toJSON","is","sendToAnalytics","category","loadAoiId","getAOIName","getAOIId","removeAOI","applyCreateAOI","applyUpdateAOI","NumberOfComments","SecondaryLine","thumbsDown","thumbsUp","PrimaryLine","Title","wasOpen","Row","inputRef","other","borderClass","backgroundClass","handleScroll","scrollIntoView","block","behavior","activeChangesetId","PageRange","_onClick","Footer","start","end","base","maxPageCount","ceil","Range","handleFilterOrderBy","reloadCurrentPage","valueData","filtersConfig","NavLink","activeStyle","fontWeight","cacheTagsData","ChangesetsList","checkUpdate","Infinity","goUpDownToChangeset","direction","nextFeature","mergedFilters","keySeq","first","toggleFilters","toggleHelp","Tags","allTags","tagsData","selectData","is_visible","handleChangesetModifyTag","defaultValue","Navbar","titleClassName","buttons","buttonsClassName","Verify","onClear","checkUser","isHarmful","maxWidth","flex","whiteSpace","overflow","textOverflow","openEditor","baseUrl","center","getCenter","zoom","getZoom","lat","lng","OpenIn","unshift","NavbarChangeset","handleChangesetModifyHarmful","isChecked","fontSize","NavbarSidebar","onUserMenuSelect","renderUserMenuOptions","disable","avatar","getOAuthToken","Modal","sendNotification","addNotification","level","dismissible","activateModalCallback","dismissModalCallback","addRef","EditUserDetails","onChangeMessageGood","onChangeMessageBad","applyUpdateUserDetails","isGood","renderGoodBadImg","userValues","onUserChange","alignSelf","SecondaryPagesHeader","CustomURL","BlockMarkup","SaveButton","onCreate","onSave","AOIsBlock","activeAoiId","removeAoi","ListFortified","TargetBlock","propsToPass","SaveComp","SavedFilters","addToWatchList","removeFromWatchList","addToTrustedList","removeFromTrustedList","createAOIPromise","WatchListUser","isValidUsername","isValidUid","verified","setUsername","setUid","fetchUsername","xml","DOMParser","parseFromString","getElementsByTagName","firstElementChild","getAttribute","fetchUid","verifyInput","resp","alert","TrustedListUser","SaveUser","showInput","forWatchlist","TrustedListBlock","TrustedUsers","trustedUsers","trustedList","sortBy","a","localeCompare","WatchListBlock","Watchlist","watchList","blacklist","createMappingTeam","deleteMappingTeam","updateMappingTeam","NewTeam","teamName","setTeamName","teamUsers","setTeamUsers","setEditing","validationErrorMessage","setValidationErrorMessage","activeTeam","joined","cleanedUsers","fromEntries","onChangeInput","idx","teamUsersToUpdate","required","userIsOwner","splice","onClickRemoveUser","validation","validateData","TeamsBlock","removeTeam","editTeam","MappingTeams","addingTeam","createTeam","createTeamPromise","teamId","teams","owner","EditMappingTeam","updateTeamPromise","team","AppMobile","Route","exact","component","Home","banner","work_flow","AppDesktop","App","initialize","gaOptions","anonymizeIp","screenResolution","screen","availWidth","availHeight","appName","Raven","config","release","environment","debug","install","ReactDOM","serviceWorker","ready","registration","unregister"],"mappings":"6GAAAA,EAAOC,QAAU,IAA0B,oC,oBCA3CD,EAAOC,QAAU,IAA0B,uC,kNCC9BC,GAAQC,EACRC,GAAYD,EACZE,GAASF,EACTG,G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AAa1L,OAAOoN,SAASG,QAAQX,MACjD,CAAC,WACDjD,iBAEEpH,GAAWA,EAAQiO,KAAO,GAC5BjO,EAAUA,EACPk6B,SACAjV,MAAK,SAAC2b,EAAGrV,GAAJ,OAAUqV,EAAEC,cAActV,MAC/B5qB,KAAK,KACRkT,GAAW,aAAD,OAAc7T,KAExB6T,GAAW,QAfnB,+BAqBI,OADe+C,KAEN,kBAAC,GAAD,MAEA,kBAAC,GAAD,UAxBb,GAAyB8X,aCQzB9a,UAAQowB,WAAW,iBAAkB,CACnCC,UAAW,CACTC,aAAa,EACbC,iBAAiB,GAAD,OAAK1mC,OAAO2mC,OAAOC,WAAnB,YAAiC5mC,OAAO2mC,OAAOE,aAC/DC,QxIlBiBnnC,gBwIuBnBonC,IAAMC,OAAO,4DAA6D,CACxEC,QxIvBsBtnC,SwIwBtBunC,YAAavnC,aACbwnC,MAAOznC,IACN0nC,UAMLC,IAAS3kB,OACP,kBAAC,IAAD,CAAU3M,MAAOA,IACf,kBAAC,IAAD,CAAiBzV,QAASA,GACxB,kBAAC,GAAD,QAGJmX,SAASgL,eAAe,SCMpB,kBAAmBgW,WACrBA,UAAU6O,cAAcC,MAAM3lC,MAAK,SAAA4lC,GACjCA,EAAaC,iB,mBCpDnBjoC,EAAOC,QAAU,IAA0B,uC,mBCA3CD,EAAOC,QAAU,IAA0B,yC,06SCA3CD,EAAOC,QAAU,49D","file":"static/js/main.a3b4e0f0.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/banner.ed2bb0d2.png\";","module.exports = __webpack_public_path__ + \"static/media/work_flow.195ff4f9.png\";","// @flow\nexport const isDev = process.env.REACT_APP_STACK === 'DEV';\nexport const isStaging = process.env.REACT_APP_STACK === 'STAGING';\nexport const isProd = process.env.REACT_APP_STACK === 'PRODUCTION';\nexport const isLocal = process.env.NODE_ENV === 'development';\nexport const stack = process.env.REACT_APP_STACK;\nexport const appVersion = process.env.REACT_APP_VERSION;\n\nlet url = 'https://staging.osmcha.org/api/v1';\n\nif (isProd) {\n url = 'https://osmcha.org/api/v1';\n}\n\nwindow.debug_info = () =>\n `isDev=${isDev.toString()} isStaging=${isStaging.toString()} isProd=${isProd.toString()} isLocal=${isLocal.toString()} stack=${stack ||\n 'null'} appVersion=${appVersion || 'null'} url=${url}`;\n\nexport const API_URL = url;\n","import { createBrowserHistory } from 'history';\nimport { isDev } from '../config';\nlet historyConfig = {};\nif (isDev) {\n historyConfig.basename = '/osmcha-frontend';\n}\n\nconst history = createBrowserHistory(historyConfig);\nexport { history };\n","// @flow\n\n// Transparent wrapper over Window.localStorage\n// Adheres to the Web Storage API:\n// https://developer.mozilla.org/en-US/docs/Web/API/Storage\n\n/**\n * Wraps localStorage.getItem in a try/catch. Return null\n * if the key does not exist or localStorage fails.\n */\nfunction getItem(key: string): ?string {\n try {\n return localStorage.getItem(key) || null;\n } catch (err) {\n console.warn('Could not read from localStorage.');\n return null;\n }\n}\n\n/**\n * Wraps localStorage.setItem in a try/catch.\n */\nfunction setItem(key: string, value: string): void {\n try {\n localStorage.setItem(key, value);\n } catch (err) {\n console.warn('Could not write to localStorage.');\n }\n}\n\n/**\n * Wraps localStorage.removeItem in a try/catch.\n */\nfunction removeItem(key: string): void {\n try {\n localStorage.removeItem(key);\n } catch (err) {\n console.warn('Could not delete from localStorage.');\n }\n}\n\nexport { getItem, setItem, removeItem };\n","//@flow\nimport { API_URL } from './';\n\nexport const PAGE_SIZE = 75;\nexport const overpassBase = '//overpass.osmcha.org/api/interpreter';\nexport const osmBase = '//www.openstreetmap.org/api/0.6/';\nexport const mapboxAccessToken =\n 'pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJjam10OXpmc2YwMXI5M3BqeTRiMDBqMHVyIn0.LIcIDe3TZLSDdTWDoojzNg';\nexport const statusUrl =\n 'https://raw.githubusercontent.com/mapbox/osmcha-frontend/status/status.json';\n\nexport const osmchaSocialTokenUrl = `${API_URL}/social-auth/`;\n\nexport const osmAuthUrl = 'https://www.openstreetmap.org/oauth/authorize';\nexport const apiOSM = 'https://api.openstreetmap.org/api/0.6';\n\nexport const whosThat =\n 'https://rksbsqdel4.execute-api.us-east-1.amazonaws.com/testing?action=names&id=';\n\nexport const nominatimUrl = 'https://nominatim.openstreetmap.org/search.php';\n\n// set a default from date x days before today\nexport const DEFAULT_FROM_DATE = 2;\n// exclude changesets newer than x minutes. It's needed because of the difference\n// between the time a changeset is processed by OSMCha and the time its map\n// visualization is available\nexport const DEFAULT_TO_DATE = 5;\n","// @flow\nimport { Iterable } from 'immutable';\n\nimport { API_URL } from '../config';\nimport type { filtersType, filterType } from '../components/filters';\n\nexport function getString(input) {\n if (typeof input === 'object') {\n return JSON.stringify(input);\n } else {\n return input;\n }\n}\n\nexport function handleErrors(response: Object) {\n if (!response.ok) {\n return response.json().then(r => {\n if (response.status === 401) {\n throw new Error(\n 'Authentication error. Sign in again and repeat the operation.'\n );\n }\n if (response.status === 401) {\n throw new Error('Operation not allowed.');\n }\n if (response.status === 404) {\n throw new Error('Resource not found.');\n }\n if (r && r.detail) throw new Error(r.detail);\n if (response.statusText) throw new Error(response.statusText);\n return Promise.reject('network request failed');\n });\n }\n return response;\n}\n\nexport function createAOI(\n token: string,\n name: string,\n filters: filtersType\n): Promise<*> {\n let serverFilters = {};\n filters.forEach((v: filterType, k: string) => {\n if (!Iterable.isIterable(v)) return;\n let filter = v;\n serverFilters[k] = filter\n .filter(x => Iterable.isIterable(x) && x.get('value') !== '')\n .map(x => getString(x.get('value')))\n .join(',');\n });\n return fetch(`${API_URL}/aoi/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n name,\n filters: serverFilters\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchAOI(token: string, aoiId: number): Promise<*> {\n return fetch(`${API_URL}/aoi/${aoiId}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchAllAOIs(token?: string): Promise<*> {\n if (token == null) return Promise.resolve();\n return fetch(`${API_URL}/aoi/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function updateAOI(\n token: string,\n aoiId: number,\n name: string,\n filters: filtersType\n): Promise<*> {\n let serverFilters = {};\n filters.forEach((v: filterType, k: string) => {\n if (!Iterable.isIterable(v)) return;\n let filter = v;\n serverFilters[k] = filter\n .filter(x => Iterable.isIterable(x) && x.get('value') !== '')\n .map(x => getString(x.get('value')))\n .join(',');\n });\n return fetch(`${API_URL}/aoi/${aoiId}/`, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n name,\n filters: serverFilters\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function deleteAOI(token: string, aoiId: string): Promise<*> {\n return fetch(`${API_URL}/aoi/${aoiId}/`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(handleErrors);\n}\n","// @flow\nimport request from 'superagent';\nimport { osmchaSocialTokenUrl } from '../config/constants';\nimport { API_URL } from '../config';\nimport { handleErrors } from './aoi';\n\nexport function postFinalTokensOSMCha(\n oauth_token: string,\n oauth_token_secret: string,\n oauth_verifier: string\n) {\n return request\n .post(osmchaSocialTokenUrl)\n .type('form')\n .send({ oauth_token: oauth_token })\n .send({ oauth_verifier: oauth_verifier })\n .send({ oauth_token_secret: oauth_token_secret })\n .then(r => {\n return r.body;\n })\n .catch(e => {\n console.error(e);\n return Promise.reject(e);\n });\n}\nexport function postTokensOSMCha() {\n return request\n .post(osmchaSocialTokenUrl)\n .type('form')\n .then(r => r.body)\n .catch(e => {\n console.error(e);\n return Promise.reject(e);\n });\n}\n\nexport function fetchUserDetails(token: string) {\n return fetch(`${API_URL}/users/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function updateUserDetails(\n token: string,\n message_good: string,\n message_bad: string,\n comment_feature: boolean\n) {\n return fetch(`${API_URL}/users/`, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n message_good,\n message_bad,\n comment_feature\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","import { statusUrl } from '../config/constants';\nimport { handleErrors } from './aoi';\n\nexport function getStatus(input, type): Promise<*> {\n return fetch(`${statusUrl}`, {\n method: 'GET'\n })\n .then(handleErrors)\n .then(response => {\n return response.json();\n });\n}\n","// @flow\nimport { API_URL } from '../config';\nimport { handleErrors } from './aoi';\n\nexport function fetchChangeset(id: number, token: ?string) {\n return fetch(`${API_URL}/changesets/${id}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function setHarmful(id: number, token: string, harmful: boolean | -1) {\n // -1 is for unsetting\n let url;\n if (harmful === -1) {\n url = `${API_URL}/changesets/${id}/uncheck/`;\n } else {\n url = `${API_URL}/changesets/${id}/${\n harmful ? 'set-harmful' : 'set-good'\n }/`;\n }\n\n return fetch(url, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport const createForm = (obj: Object) => {\n var formData = new FormData();\n Object.keys(obj).forEach(k => {\n formData.append(k, obj[k]);\n });\n return formData;\n};\n\nexport function setTag(\n id: number,\n token: string,\n tag: Object,\n remove: boolean = false\n) {\n if (Number.isNaN(parseInt(tag.value, 10))) {\n throw new Error('tag is not a valid number');\n }\n return fetch(`${API_URL}/changesets/${id}/tags/${tag.value}/`, {\n method: remove ? 'DELETE' : 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: createForm({\n tag_pk: tag,\n id\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function postComment(id: number, token: string, comment: string) {\n return fetch(`${API_URL}/changesets/${id}/comment/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n comment: comment\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","// @flow\nimport { handleErrors } from './aoi';\nimport { API_URL } from '../config';\n\nexport function fetchWatchList(token: string): Promise<*> {\n return fetch(`${API_URL}/blacklisted-users/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function deleteFromWatchList(token: string, uid: string): Promise<*> {\n return fetch(`${API_URL}/blacklisted-users/${uid}/`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(handleErrors);\n}\n\nexport function postUserToWatchList(token: string, data: object): Promise<*> {\n return fetch(`${API_URL}/blacklisted-users/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n username: data.watchlist_user.username,\n uid: data.watchlist_user.uid\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","// @flow\nimport { put, call, take, takeEvery } from 'redux-saga/effects';\nimport { delay } from 'redux-saga';\n\nexport const SHOW_MODAL = 'SHOW_MODAL';\nexport const INIT_MODAL = 'INIT_MODAL';\nexport const ACTIVATE_MODAL_CALLBACK = 'ACTIVATE_MODAL_CALLBACK';\nexport const DISMISS_MODAL = 'DISMISS_MODAL';\n\n// public\n// starting point for react component to start fetch\n\nexport function modal({\n kind = 'error',\n error,\n title,\n dismiss = true,\n autoDismiss = 5,\n position = 'tr',\n description = 'Please reload the application. If it still doesnt work please refer to usage guide.',\n callback,\n callbackArgs,\n callbackLabel\n}: {\n kind?: string,\n error?: Error,\n title?: string,\n dismiss?: boolean,\n autoDismiss?: number,\n position?: string,\n description?: string,\n callback?: Function,\n callbackArgs?: Array,\n callbackLabel?: string\n}) {\n if (error && error.message) {\n description = error.message;\n }\n if (error && error.name) {\n title = error.name;\n }\n if (kind === 'error') {\n autoDismiss = 10;\n }\n return {\n type: 'INIT_MODAL',\n payload: {\n kind,\n error,\n callbackLabel,\n title,\n dismiss,\n autoDismiss,\n position,\n description\n },\n callback,\n callbackArgs\n };\n}\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const activateModalCallback = (uid: number) =>\n action(ACTIVATE_MODAL_CALLBACK, { uid });\n\nexport const dismissModalCallback = (uid: number) =>\n action(DISMISS_MODAL, { uid });\n\nexport function* watchModal(): any {\n yield takeEvery('INIT_MODAL', handleModal);\n}\n\nfunction* handleModal({ payload, callback, callbackArgs }: Object): any {\n var uidOriginal = new Date().getTime() + parseInt(1000 * Math.random(), 10);\n payload.uid = uidOriginal;\n yield put(action(SHOW_MODAL, payload));\n if (!callback) return;\n while (true) {\n const { type, uid } = yield take([ACTIVATE_MODAL_CALLBACK, DISMISS_MODAL]);\n if (type === DISMISS_MODAL && uidOriginal === uid) {\n return;\n }\n if (type === ACTIVATE_MODAL_CALLBACK && uidOriginal === uid) {\n yield call(delay, 500);\n yield put(callback(...callbackArgs));\n return;\n }\n }\n}\n","// @flow\nimport { handleErrors } from './aoi';\nimport { API_URL } from '../config';\n\nexport function fetchTrustedList(token: string): Promise<*> {\n return fetch(`${API_URL}/whitelist-user/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function deleteFromTrustedList(\n token: string,\n username: string\n): Promise<*> {\n return fetch(`${API_URL}/whitelist-user/${username}/`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(handleErrors);\n}\n\nexport function postUserToTrustedList(\n token: string,\n whitelist_user: string\n): Promise<*> {\n return fetch(`${API_URL}/whitelist-user/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n whitelist_user\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","import { all, put, call, takeEvery, select } from 'redux-saga/effects';\n\nimport {\n postUserToTrustedList,\n deleteFromTrustedList\n} from '../network/osmcha_trustedlist.js';\nimport { modal } from './modal_actions';\n\nimport type { RootStateType } from './';\n\nexport const TRUSTEDLIST = {\n define: 'TRUSTEDLIST.define',\n add: 'TRUSTEDLIST.add',\n remove: 'TRUSTEDLIST.remove',\n clear: 'TRUSTEDLIST.clear'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\n\nexport const addToTrustedlist = (trustedlist_user: string) =>\n action(TRUSTEDLIST.add, { trustedlist_user });\n\nexport const removeFromTrustedlist = (trustedlist_user: string) =>\n action(TRUSTEDLIST.remove, { trustedlist_user });\n\nexport function* watchTrustedlist(): any {\n yield all([\n takeEvery(TRUSTEDLIST.add, addToTrustedlistSaga),\n takeEvery(TRUSTEDLIST.remove, removeFromTrustedlistSaga)\n ]);\n}\n\nexport function* addToTrustedlistSaga(trustedlist_user: string): any {\n try {\n const token = yield select(tokenSelector);\n yield call(postUserToTrustedList, token, trustedlist_user.trustedlist_user);\n yield put(\n modal({\n title: 'Success',\n description: `User ${trustedlist_user.trustedlist_user} added to your Trusted Users list.`,\n kind: 'success'\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\nexport function* removeFromTrustedlistSaga(trustedlist_user: string): any {\n try {\n const token = yield select(tokenSelector);\n yield call(deleteFromTrustedList, token, trustedlist_user.trustedlist_user);\n yield put(\n modal({\n title: 'Success',\n description: `User ${trustedlist_user.trustedlist_user} removed from your Trusted Users list.`,\n kind: 'success'\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n","import { all, put, call, takeEvery, select } from 'redux-saga/effects';\n\nimport {\n postUserToWatchList,\n deleteFromWatchList\n} from '../network/osmcha_watchlist';\nimport { modal } from './modal_actions';\n\nimport type { RootStateType } from './';\n\nexport const WATCHLIST = {\n define: 'WATCHLIST.define',\n add: 'WATCHLIST.add',\n remove: 'WATCHLIST.remove',\n clear: 'WATCHLIST.clear'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\n\nexport const addToWatchlist = (watchlist_user: string, uid: string) =>\n action(WATCHLIST.add, { watchlist_user, uid });\n\nexport const removeFromWatchlist = (watchlist_user: string) =>\n action(WATCHLIST.remove, { watchlist_user });\n\nexport function* watchWatchlist(): any {\n yield all([\n takeEvery(WATCHLIST.add, addToWatchlistSaga),\n takeEvery(WATCHLIST.remove, removeFromWatchlistSaga)\n ]);\n}\n\nexport function* addToWatchlistSaga(watchlist_user: object): any {\n try {\n const token = yield select(tokenSelector);\n yield call(postUserToWatchList, token, watchlist_user);\n yield put(\n modal({\n title: 'Success',\n description: `User ${watchlist_user.watchlist_user.username} (${watchlist_user.watchlist_user.uid}) added to your watchlist.`,\n kind: 'success'\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\nexport function* removeFromWatchlistSaga(watchlist_user: string): any {\n try {\n const token = yield select(tokenSelector);\n yield call(deleteFromWatchList, token, watchlist_user.watchlist_user);\n yield put(\n modal({\n title: 'Success',\n description: `User ${watchlist_user.watchlist_user} removed from your watchlist.`,\n kind: 'success'\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n","// @flow\nimport { List, Map, fromJS } from 'immutable';\nimport { sub, format } from 'date-fns';\n\nimport { DEFAULT_FROM_DATE, DEFAULT_TO_DATE } from '../config/constants';\nimport type { filtersType } from '../components/filters';\n\nexport function validateFilters(filters: filtersType): boolean {\n var test = function() {\n if (!Map.isMap(filters)) return false;\n let valid = true;\n filters.forEach((v, k) => {\n if (!List.isList(v)) {\n // check for list\n valid = false;\n } else {\n v.forEach(vv => {\n if (!(Map.isMap(vv) && vv.has('label') && vv.has('value'))) {\n valid = false;\n }\n if (!Map.isMap(vv)) {\n valid = false;\n }\n });\n }\n });\n return valid;\n };\n if (!test()) {\n throw new Error('The filters that you applied were not correct.');\n } else {\n return true;\n }\n}\n\nexport function getDefaultFromDate(extraDays = 0): filtersType {\n const defaultDate = format(\n sub(new Date(), { days: DEFAULT_FROM_DATE + extraDays }),\n 'yyyy-MM-dd'\n );\n return fromJS({\n date__gte: [\n {\n label: defaultDate,\n value: defaultDate\n }\n ]\n });\n}\n\nexport function getDefaultToDate(): filtersType {\n const now = new Date();\n const defaultDate = format(\n sub(new Date(now.getTime() + now.getTimezoneOffset() * 60 * 1000), {\n minutes: DEFAULT_TO_DATE\n }),\n 'yyyy-MM-dd HH:mm'\n );\n return fromJS({\n date__lte: [\n {\n label: '',\n value: defaultDate\n }\n ]\n });\n}\n\nexport function appendDefaultDate(filters: filtersType) {\n // Set From date to 2 days behind if there isn't a date query.\n // In case of a users or uids query, set the From date to 30 days behind\n if (filters && !filters.has('date__gte') && !filters.has('date__lte')) {\n if (\n filters.count() === 1 &&\n (filters.has('users') || filters.has('uids'))\n ) {\n filters = filters.merge(getDefaultFromDate(28));\n } else {\n filters = filters.merge(getDefaultFromDate());\n }\n }\n if (filters && !filters.has('date__lte')) {\n filters = filters.merge(getDefaultToDate());\n }\n return filters;\n}\n","// @flow\nimport { Iterable, List, Map } from 'immutable';\nimport { API_URL } from '../config';\nimport { PAGE_SIZE } from '../config/constants';\nimport { appendDefaultDate } from '../utils/filters';\nimport { handleErrors, getString } from './aoi';\nimport type { filtersType } from '../components/filters';\n\nexport function fetchChangesetsPage(\n pageIndex: number,\n filters: filtersType = Map(),\n token: ?string,\n nocache: boolean,\n aoiId: ?string\n) {\n let flatFilters = '';\n filters = appendDefaultDate(filters);\n filters.forEach((v: List, k: string) => {\n if (!Iterable.isIterable(v)) return;\n let filter = v;\n let filterJoined = filter\n .filter(x => Iterable.isIterable(x) && x.get('value') !== '')\n .map(x => getString(x.get('value')))\n .join(',');\n\n if (filterJoined === '') return;\n flatFilters += `&${k}=${encodeURIComponent(filterJoined)}`;\n });\n let url = `${API_URL}/changesets/?${\n nocache // for cache busting of this pattern /\\/changesets\\/#nocache\\?page=/\n ? `page_size=${PAGE_SIZE}&page=${pageIndex + 1}`\n : `page=${pageIndex + 1}&page_size=${PAGE_SIZE}`\n }${flatFilters}`;\n if (aoiId) {\n url = `${API_URL}/aoi/${aoiId}/changesets/?${\n nocache\n ? `page_size=${PAGE_SIZE}&page=${pageIndex + 1}`\n : `page=${pageIndex + 1}&page_size=${PAGE_SIZE}`\n }`;\n }\n return fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(res => {\n if (res.status === 401) {\n return Promise.reject(\n Error('Authentication error. Sign in again and repeat the operation.')\n );\n }\n if (res.status === 403) {\n return Promise.reject(Error('Operation not allowed.'));\n }\n if (res.status >= 400 && res.status < 600) {\n return Promise.reject(\n Error(\n 'Bad request. Please check your filters or your network connection.'\n )\n );\n }\n return res.json();\n });\n}\n\nexport function fetchAOIChangesetPage(\n pageIndex: number,\n aoiId: string,\n token: string\n) {\n return fetch(\n `${API_URL}/aoi/${aoiId}/changesets/?page_size=${PAGE_SIZE}&page=${pageIndex +\n 1}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }\n )\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","// @flow\nimport { parse, stringify } from 'query-string';\nimport { fromJS, Map } from 'immutable';\n\nexport function getSearchObj(searchParam: string = ''): Map {\n let result = {};\n try {\n result = parse(searchParam);\n if (result.filters) {\n result.filters = JSON.parse(result.filters);\n }\n } catch (e) {\n console.error(e);\n } finally {\n return fromJS(result);\n }\n}\n\nexport function getObjAsQueryParam(key: string, obj: Object) {\n if (!obj || Object.keys(obj).length === 0) {\n return '';\n }\n return stringify({\n [key]: JSON.stringify(obj)\n });\n}\n","// @flow\nimport { API_URL } from '../config';\nimport { handleErrors } from './aoi';\n\nexport function fetchReasons(token: ?string) {\n return fetch(`${API_URL}/suspicion-reasons/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchTags(token: ?string) {\n return fetch(`${API_URL}/tags/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","// @flow\nimport { put, call, select, all, takeLatest } from 'redux-saga/effects';\nimport { fromJS, Map } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { fetchAOI, createAOI, updateAOI } from '../network/aoi';\nimport { fetchReasons, fetchTags } from '../network/reasons_tags';\nimport { validateFilters } from '../utils/filters';\nimport { CHANGESETS_PAGE, FILTERS } from './filters_actions';\nimport { tokenSelector } from './auth_actions';\nimport { modal } from './modal_actions';\nimport type { filtersType } from '../components/filters';\nimport type { RootStateType } from './';\n\nexport const AOI = {\n fetch: 'AOI.fetch',\n clear: 'AOI.clear',\n fetched: 'AOI.fetched',\n create: 'AOI.create',\n update: 'AOI.update',\n loading: 'AOI.loading',\n error: 'AOI.error'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const applyUpdateAOI = (\n aoiId: string,\n name: string,\n filters: filtersType\n) => action(AOI.update, { aoiId, name, filters });\n\nexport const applyCreateAOI = (name: string, filters: filtersType) =>\n action(AOI.create, { name, filters });\n\nexport function* watchAOI(): any {\n yield all([\n takeLatest(AOI.update, updateAOISaga),\n takeLatest(AOI.create, createAOISaga)\n ]);\n}\n\nexport function* fetchAOISaga(aoiId: string): any {\n yield put(action(AOI.loading, { loading: true }));\n const token = yield select(tokenSelector);\n const data = yield call(fetchAOI, token, aoiId);\n const reasons = yield call(fetchReasons, token);\n const tags = yield call(fetchTags, token);\n const aoi = fromJS(data);\n yield put(action(AOI.fetched, { aoi }));\n let filters = aoi.getIn(['properties', 'filters'], Map());\n filters = filters.map((v, k) => {\n if (k === 'reasons') {\n return fromJS(\n v.split(',').map(o => ({\n value: o,\n label: reasons.filter(i => i.id === Number(o))[0]['name']\n }))\n );\n }\n if (k === 'tags') {\n return fromJS(\n v.split(',').map(o => ({\n value: o,\n label: tags.filter(i => i.id === Number(o))[0]['name']\n }))\n );\n }\n try {\n if (JSON.parse(v) && JSON.parse(v).hasOwnProperty('coordinates')) {\n return fromJS([\n {\n value: JSON.parse(v),\n label: JSON.parse(v)\n }\n ]);\n } else {\n throw SyntaxError;\n }\n } catch (e) {\n const options = v.split(',');\n return fromJS(\n options.map(o => ({\n value: o,\n label: o\n }))\n );\n }\n });\n return filters;\n}\n\nexport function* createAOISaga({\n name,\n filters\n}: {\n name: string,\n filters: filtersType\n}): any {\n try {\n yield put(action(AOI.loading, { loading: true }));\n const token = yield select(tokenSelector);\n const data = yield call(createAOI, token, name, filters);\n const aoi = fromJS(data);\n yield put(action(AOI.fetched, { aoi }));\n let location = yield select(locationSelector);\n yield put(\n push({\n ...location,\n pathname: location.pathname,\n search: `aoi=${data.id}`\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n\nexport function* updateAOISaga({\n aoiId,\n name,\n filters\n}: {\n aoiId: string,\n name: string,\n filters: filtersType\n}): any {\n try {\n yield put(action(AOI.loading, { loading: true }));\n const token = yield select(tokenSelector);\n const data = yield call(updateAOI, token, aoiId, name, filters);\n const aoi = fromJS(data);\n yield put(action(AOI.fetched, { aoi }));\n yield call(validateFilters, filters);\n yield put(\n action(FILTERS.set, {\n filters\n })\n );\n yield put(\n action(CHANGESETS_PAGE.fetch, { pageIndex: 0, aoiId: aoiId, filters })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n","// @flow\nimport {\n put,\n call,\n take,\n fork,\n select,\n cancel,\n all,\n takeLatest\n} from 'redux-saga/effects';\nimport { LOCATION_CHANGE } from 'react-router-redux';\nimport { Map } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { getSearchObj, getObjAsQueryParam } from '../utils/query_params';\nimport { validateFilters } from '../utils/filters';\nimport { fetchAOISaga, AOI } from './aoi_actions';\n\nimport { modal } from './modal_actions';\n\nimport type { RootStateType } from './';\nimport type { filtersType } from '../components/filters';\n\nexport const CHANGESETS_PAGE = {\n fetch: 'CHANGESETS_PAGE_FETCH',\n fetched: 'CHANGESETS_PAGE_FETCHED',\n modify: 'CHANGESETS_PAGE_MODIFY_CHANGESET',\n loading: 'CHANGESETS_PAGE_LOADING',\n error: 'CHANGESETS_PAGE_ERROR',\n checkNew: 'CHANGESETS_PAGE_CHECK_NEW_CHANGESETS',\n updateNewCount: 'CHANGESETS_PAGE_UPDATE_NEW_COUNT',\n checkNewLoading: 'CHANGESETS_PAGE_CHECK_NEW_LOADING'\n};\n\nexport const FILTERS = {\n set: 'FILTERS_SET',\n apply: 'FILTERS_APPLY'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const applyFilters = (filters: filtersType, pathname: ?string) =>\n action(FILTERS.apply, { filters, pathname });\n\nexport function* watchFilters(): any {\n yield all([\n watchLocationChange(),\n takeLatest(FILTERS.apply, applyFilterSaga)\n ]);\n}\n\nexport function* watchLocationChange(): any {\n let lastTask;\n let lastSearchString;\n while (true) {\n const action = yield take(LOCATION_CHANGE);\n const location = action.payload;\n\n if (lastSearchString === location.search) {\n continue;\n }\n lastSearchString = location.search;\n\n if (lastTask) {\n yield cancel(lastTask);\n }\n lastTask = yield fork(filtersSaga, location);\n }\n}\n\nexport function* applyFilterSaga({\n filters,\n pathname\n}: {\n filters: filtersType,\n pathname: string\n}): any {\n const search = getObjAsQueryParam('filters', filters.toJS());\n let location = yield select(locationSelector);\n // I could find one comment on `push(location)` in the readme\n // ref: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux\n yield put(\n push({\n ...location,\n pathname: pathname || location.pathname,\n search // update the search\n })\n );\n}\n\nexport function* filtersSaga(location: Object): any {\n try {\n // the url can only contain two things `filters` or `aoiId`\n let { filters, aoi: aoiId } = getSearchObj(location.search).toObject();\n\n if (!filters) filters = Map();\n\n if (aoiId) {\n filters = yield call(fetchAOISaga, aoiId);\n } else {\n // if there is no active AOI in use\n // we might want to clear so that other\n // sagas continue using regular filters.\n yield put(action(AOI.clear));\n }\n // NOTE! `validateFilters` will throw an Error if invalid\n yield call(validateFilters, filters);\n yield put(\n action(FILTERS.set, {\n filters\n })\n );\n if (aoiId) {\n yield put(\n action(CHANGESETS_PAGE.fetch, { pageIndex: 0, filters, aoiId })\n );\n } else {\n yield put(action(CHANGESETS_PAGE.fetch, { pageIndex: 0, filters }));\n }\n } catch (e) {\n console.error(e);\n const location = yield select(locationSelector);\n location.search = '';\n yield all([\n put(\n modal({\n error: e\n })\n ),\n put(push(location))\n ]);\n }\n}\n\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n\n/** Sagas **/\n\nexport const filtersSelector = (state: RootStateType) =>\n state.filters.get('filters');\n","// @flow\nimport { put, call, takeLatest, select, all } from 'redux-saga/effects';\nimport { delay } from 'redux-saga';\n\nimport { fromJS, List, Map } from 'immutable';\nimport { fetchChangesetsPage } from '../network/changesets_page';\nimport { filtersSelector } from './filters_actions';\n\nimport { modal } from './modal_actions';\n\nimport type { RootStateType } from './';\nimport type { filtersType } from '../components/filters';\n\nexport const CHANGESETS_PAGE = {\n fetch: 'CHANGESETS_PAGE_FETCH',\n fetched: 'CHANGESETS_PAGE_FETCHED',\n modify: 'CHANGESETS_PAGE_MODIFY_CHANGESET',\n loading: 'CHANGESETS_PAGE_LOADING',\n error: 'CHANGESETS_PAGE_ERROR',\n checkNew: 'CHANGESETS_PAGE_CHECK_NEW_CHANGESETS',\n updateNewCount: 'CHANGESETS_PAGE_UPDATE_NEW_COUNT',\n checkNewLoading: 'CHANGESETS_PAGE_CHECK_NEW_LOADING'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\n// public\n// starting point for react component to start fetch\nexport const getChangesetsPage = (pageIndex: number, nocache: boolean) =>\n action(CHANGESETS_PAGE.fetch, { pageIndex, nocache });\n\n// this just checks for new changesets and updates the\n// `changesetsPage/diff` in the store.\n// @param nocache - to avoid cache busting.\nexport const checkForNewChangesets = (nocache: boolean) =>\n action(CHANGESETS_PAGE.checkNew, { nocache });\n\nexport function* watchChangesetsPage(): any {\n yield all([\n takeLatest(CHANGESETS_PAGE.fetch, fetchChangesetsPageSaga),\n takeLatest(CHANGESETS_PAGE.modify, modifyChangesetPageSaga),\n takeLatest(CHANGESETS_PAGE.checkNew, checkForNewChangesetsSaga)\n ]);\n}\n\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n\n/** Sagas **/\n\nexport const pageIndexSelector = (state: RootStateType) => [\n state.changesetsPage.getIn(['pageIndex'], 0)\n];\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\n\nexport const aoiIdSelector = (state: RootStateType) =>\n state.aoi.getIn(['aoi', 'id']);\n\nexport function* fetchChangesetsPageSaga({\n pageIndex,\n nocache,\n filters,\n aoiId\n}: {\n pageIndex?: number,\n nocache: boolean,\n filters?: filtersType,\n aoiId?: string\n}): Object {\n if (!filters) {\n filters = yield select(filtersSelector);\n }\n if (!aoiId) {\n aoiId = yield select(aoiIdSelector);\n }\n let oldPageIndex: number = yield select(pageIndexSelector);\n\n // checks both undefined and null\n if (pageIndex == null) {\n pageIndex = oldPageIndex;\n }\n yield put(\n action(CHANGESETS_PAGE.loading, {\n pageIndex\n })\n );\n try {\n let token = yield select(tokenSelector);\n let thisPage;\n if (aoiId) {\n thisPage = yield call(\n fetchChangesetsPage,\n pageIndex,\n filters,\n token,\n nocache,\n aoiId\n );\n } else {\n thisPage = yield call(\n fetchChangesetsPage,\n pageIndex,\n filters,\n token,\n nocache\n );\n }\n yield put(\n action(CHANGESETS_PAGE.fetched, {\n data: fromJS(thisPage),\n pageIndex\n })\n );\n } catch (error) {\n yield put(\n action(CHANGESETS_PAGE.error, {\n pageIndex: oldPageIndex,\n error\n })\n );\n error.name = `Failed to load page ${pageIndex}`;\n yield put(\n modal({\n error,\n callback: action,\n callbackLabel: 'Retry',\n callbackArgs: [CHANGESETS_PAGE.fetch, { pageIndex }]\n })\n );\n }\n}\n\nexport const currentPageAndIndexSelector = (state: RootStateType) => [\n state.changesetsPage.getIn(['currentPage'], Map()),\n state.changesetsPage.getIn(['pageIndex'], 0)\n];\n\nexport function* modifyChangesetPageSaga({\n changesetId,\n changeset\n}: Object): any {\n try {\n // try to modify the changeset inside the page\n // to reflect any kind of changes in the changesetList\n let [currentPage, pageIndex] = yield select(currentPageAndIndexSelector);\n\n let features: List> = currentPage.get('features');\n\n const index = features.findIndex(f => f.get('id') === changesetId);\n if (index > -1) {\n currentPage = currentPage.setIn(['features', index], changeset);\n yield put(\n action(CHANGESETS_PAGE.fetched, {\n data: currentPage,\n pageIndex\n })\n );\n // check for new changesets\n yield put(action(CHANGESETS_PAGE.checkNew));\n }\n } catch (e) {\n console.error(e);\n }\n}\n\nexport function* checkForNewChangesetsSaga({\n nocache\n}: {\n nocache: boolean\n}): any {\n try {\n yield put(action(CHANGESETS_PAGE.checkNewLoading));\n yield call(delay, 3000 + Math.random() * 2000);\n const [\n filters: filtersType,\n pageIndex: number,\n token,\n aoiId\n ] = yield select((state: RootStateType) => [\n state.filters.get('filters'),\n state.changesetsPage.get('pageIndex'),\n state.auth.get('token'),\n state.aoi.get('aoi').get('id')\n ]);\n let newData = yield call(\n fetchChangesetsPage,\n pageIndex,\n filters,\n token,\n nocache,\n aoiId\n );\n let oldData = yield select((state: RootStateType) =>\n state.changesetsPage.get('currentPage')\n );\n let diff = 0;\n if (oldData) {\n newData = fromJS(newData.features.map(f => f.id)).toSet();\n oldData = oldData\n .get('features')\n .map(f => f.get('id'))\n .toSet();\n diff = newData.subtract(oldData).size;\n }\n yield put(\n action(CHANGESETS_PAGE.updateNewCount, {\n diff\n })\n );\n } catch (e) {\n console.error(e);\n }\n}\n","export default {\n NOT_LOGGED_IN: {\n kind: 'error',\n title: 'Sign in required',\n description: 'This action requires you to sign in first.'\n },\n MODIFY_SUCCESS: {\n kind: 'success',\n title: 'Successful',\n autoDismiss: 2,\n description: changesetId =>\n `The changeset ${changesetId} was successfully modified.`\n }\n};\n","// @flow\nlet cmap;\nexport function importChangesetMap(module: string): Promise<*> {\n if (cmap) return Promise.resolve(cmap[module]);\n return import('changeset-map')\n .then(function(m) {\n cmap = m;\n return cmap[module];\n })\n .catch(function(err) {\n console.error(err);\n console.log('Failed to load module changeset-map');\n });\n}\n","// @flow\nimport { matchPath } from 'react-router';\n\nexport function getParam(param: string, location: Object, path: string) {\n const match = matchPath(location.pathname, path);\n if (!match) return null;\n return match.params[param];\n}\n\nexport function getChangesetIdFromLocation(location: Object) {\n const changesetId = parseInt(getParam('id', location, '/changesets/:id'), 10);\n if (!changesetId || Number.isNaN(changesetId)) {\n return null;\n }\n return changesetId;\n}\n\nexport function checkForLegacyURL(location: Object) {\n const changesetId = parseInt(getParam('id', location, '/:id'), 10);\n if (!changesetId || Number.isNaN(changesetId)) {\n return null;\n }\n return changesetId;\n}\n","// @flow\nimport { put, call, take, fork, select, cancel } from 'redux-saga/effects';\n\nimport { fromJS, Map, List } from 'immutable';\nimport { LOCATION_CHANGE, replace, push } from 'react-router-redux';\nimport notifications from '../config/notifications';\n\nimport { fetchChangeset, setHarmful, setTag } from '../network/changeset';\nimport { importChangesetMap } from '../utils/cmap';\n\nimport {\n getChangesetIdFromLocation,\n checkForLegacyURL\n} from '../utils/routing';\n\nimport type { RootStateType } from './';\nimport { modal } from './modal_actions';\n\nimport { CHANGESETS_PAGE } from './changesets_page_actions';\n\nexport const CHANGESET = {\n fetch: 'CHANGESET.fetch',\n fetched: 'CHANGESET.fetched',\n change: 'CHANGESET.change',\n loading: 'CHANGESET.loading',\n error: 'CHANGESET.error'\n};\nexport const CHANGESET_MODIFY = {\n modify: 'CHANGESET_MODIFY.modify',\n harmful: 'CHANGESET_MODIFY.harmful',\n revert: 'CHANGESET_MODIFY.revert',\n tag: 'CHANGESET_MODIFY.tag'\n};\nexport const CHANGESET_MAP = {\n fetched: 'CHANGESET_MAP.fetched',\n loading: 'CHANGESET_MAP.loading',\n change: 'CHANGESET_MAP.change',\n error: 'CHANGESET_MAP.error'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\n// public\n// starting point for react component to start fetch\nexport const getChangeset = (changesetId: number) =>\n action(CHANGESET.fetch, { changesetId });\n\nexport const handleChangesetModifyHarmful = (\n changesetId: number,\n changeset: Map,\n harmful: boolean | -1\n) =>\n action(CHANGESET_MODIFY.harmful, {\n oldChangeset: changeset,\n changesetId,\n harmful\n });\n\nexport const handleChangesetModifyTag = (\n changesetId: number,\n changeset: Map,\n tag: Object,\n remove: boolean\n) =>\n action(CHANGESET_MODIFY.tag, {\n oldChangeset: changeset,\n changesetId,\n tag,\n remove\n });\n\n// watches for LOCATION_CHANGE and only\n// dispatches the latest one to get changeset\n// and cMap details. It cancels the ongoign tasks\n// if route changes in between.\nexport function* watchChangeset(): any {\n let changesetTask;\n let changesetMapTask;\n while (true) {\n const { payload: location } = yield take(LOCATION_CHANGE);\n const changesetId = yield call(shouldUpdateSaga, location);\n if (changesetId) {\n /**\n * cancel any existing changeset tasks,\n * even if it doesnt change to `changesets/:id`\n * we anway would like to suspend the ongoing task\n * to save resouces\n */\n if (changesetTask) yield cancel(changesetTask);\n if (changesetMapTask) yield cancel(changesetMapTask);\n\n changesetTask = yield fork(fetchChangesetAction, changesetId);\n changesetMapTask = yield fork(fetchChangesetMapAction, changesetId);\n }\n }\n}\n\nexport function* shouldUpdateSaga(location: Object): any {\n // checks for the old osmcha style urls\n // eg osmcha.org/34354242 and redirects them\n // to osmcha.org/changesets/3432434\n const legacy = checkForLegacyURL(location);\n if (legacy) {\n yield put(\n replace({\n ...location,\n pathname: '/changesets/' + legacy\n })\n );\n return false;\n }\n let changesetId = getChangesetIdFromLocation(location);\n\n if (!changesetId) return false;\n\n let oldChangesetId = yield select(\n (state: RootStateType) =>\n !state.changeset.get('errorChangeset') &&\n !state.changeset.get('errorChangesetMap') &&\n state.changeset.get('changesetId')\n );\n\n if (oldChangesetId !== changesetId) {\n return changesetId;\n }\n}\n\nexport function* watchModifyChangeset(): any {\n while (true) {\n const modifyAction = yield take([\n CHANGESET_MODIFY.harmful,\n CHANGESET_MODIFY.tag\n ]); // scope for multiple modify actions in future\n const { token, username } = yield select((state: RootStateType) => ({\n token: state.auth.get('token'),\n username: state.auth.getIn(['userDetails', 'username'])\n }));\n if (!token) {\n yield put(\n modal({\n ...notifications.NOT_LOGGED_IN\n })\n );\n continue;\n }\n // all modify actions should have changesetId, oldChangeset\n const { changesetId, oldChangeset } = modifyAction;\n\n if (!oldChangeset) {\n continue;\n }\n let newChangeset;\n try {\n switch (modifyAction.type) {\n case CHANGESET_MODIFY.harmful: {\n const harmful = modifyAction.harmful;\n newChangeset = yield call(setHarmfulAction, {\n changesetId,\n oldChangeset,\n token,\n harmful,\n username\n });\n break;\n }\n case CHANGESET_MODIFY.tag: {\n const { tag, remove } = modifyAction;\n newChangeset = yield call(setTagActions, {\n changesetId,\n oldChangeset,\n token,\n tag,\n remove\n });\n break;\n }\n default: {\n continue;\n }\n }\n } catch (error) {\n yield put(\n action(CHANGESET_MODIFY.revert, {\n changesetId,\n changeset: oldChangeset\n })\n );\n yield put(\n modal({\n error\n })\n );\n }\n // update the change in changeset list also aka changesetP\n if (newChangeset) {\n yield put(\n action(CHANGESETS_PAGE.modify, {\n changesetId,\n changeset: newChangeset\n })\n );\n }\n }\n}\n\nexport const changesetsSelector = (state: RootStateType) => {\n return state.changeset.getIn(['changesets'], Map());\n};\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n\n/** Sagas **/\nexport function* fetchChangesetAction(changesetId: number): Object {\n let changesets = yield select(changesetsSelector);\n let changeset = changesets.get(changesetId);\n // check if the changeset already exists\n // if it does! make it active and exit\n if (changeset) {\n yield put(\n action(CHANGESET.change, {\n changesetId\n })\n );\n return;\n }\n\n yield put(\n action(CHANGESET.loading, {\n changesetId\n })\n );\n\n try {\n let token = yield select(tokenSelector);\n changeset = yield call(fetchChangeset, changesetId, token);\n yield put(\n action(CHANGESET.fetched, {\n data: fromJS(changeset),\n changesetId\n })\n );\n } catch (error) {\n yield put(\n action(CHANGESET.error, {\n changesetId,\n error\n })\n );\n const location = yield select(locationSelector);\n error.name = `Changeset:${changesetId} failed`;\n yield put(\n modal({\n error,\n callback: push,\n callbackArgs: [location],\n callbackLabel: 'Retry'\n })\n );\n }\n}\n\nexport function changesetMapModule(changesetId: number): any {\n return importChangesetMap('getChangeset').then((getCMapData: any) =>\n getCMapData(changesetId)\n );\n}\nexport const changesetMapSelector = (state: RootStateType) =>\n state.changeset.getIn(['changesetMap'], Map());\n\nexport function* fetchChangesetMapAction(changesetId: number): Object {\n const changesetMaps = yield select(changesetMapSelector);\n let changesetMap = changesetMaps.get(changesetId);\n\n if (changesetMap) {\n yield put(\n action(CHANGESET_MAP.change, {\n changesetId\n })\n );\n return;\n }\n yield put(\n action(CHANGESET_MAP.loading, {\n changesetId\n })\n );\n try {\n changesetMap = yield call(changesetMapModule, changesetId);\n yield put(\n action(CHANGESET_MAP.fetched, {\n data: changesetMap,\n changesetId\n })\n );\n } catch (error) {\n yield put(\n action(CHANGESET_MAP.error, {\n changesetId,\n error\n })\n );\n const location = yield select(locationSelector);\n error.name = `Changeset:${changesetId} Map failed`;\n yield put(\n modal({\n error,\n callback: push,\n callbackArgs: [location],\n callbackLabel: 'Retry'\n })\n );\n }\n}\n\nexport function* setHarmfulAction({\n changesetId,\n oldChangeset,\n token,\n harmful,\n username\n}: Object): any {\n const newChangeset = oldChangeset\n .setIn(['properties', 'check_user'], harmful === -1 ? null : username)\n // .setIn(\n // ['properties', 'tags'],\n // harmful === -1 ? List() : oldChangeset.getIn(['properties', 'tags'])\n // )\n .setIn(['properties', 'checked'], harmful === -1 ? false : true)\n .setIn(['properties', 'harmful'], harmful === -1 ? null : harmful);\n\n // update changeset list\n yield put(\n action(CHANGESET_MODIFY.modify, {\n changesetId,\n changeset: newChangeset\n })\n );\n yield call(setHarmful, changesetId, token, harmful);\n return newChangeset;\n}\n\nexport function* setTagActions({\n changesetId,\n oldChangeset,\n token,\n tag,\n remove\n}: Object): any {\n if (oldChangeset.getIn(['properties', 'checked'])) {\n // TOFIX also check for user\n let newChangeset = oldChangeset;\n let existingTags: List<*>;\n if (remove) {\n existingTags = oldChangeset.getIn(['properties', 'tags']);\n let key;\n existingTags.forEach((t, i) => {\n if (t.get('id') === tag.value) {\n key = i;\n }\n });\n newChangeset = oldChangeset.setIn(\n ['properties', 'tags'],\n existingTags.delete(key)\n );\n } else {\n // TOFIX consolidate the convention of backend using id and name\n // and I using label and value.\n existingTags = oldChangeset.getIn(['properties', 'tags']);\n newChangeset = oldChangeset.setIn(\n ['properties', 'tags'],\n existingTags.push(new Map().set('id', tag.value).set('name', tag.label))\n );\n }\n\n yield put(\n action(CHANGESET_MODIFY.modify, {\n changesetId,\n changeset: newChangeset\n })\n );\n yield call(setTag, changesetId, token, tag, remove);\n return newChangeset;\n } else {\n throw new Error('Only allowed on checked changesets');\n }\n}\n","// @flow\nimport { put, call, take, select, all, takeLatest } from 'redux-saga/effects';\nimport { delay as delayPromise } from 'redux-saga';\nimport { push } from 'react-router-redux';\nimport { fromJS } from 'immutable';\n\nimport {\n postTokensOSMCha,\n postFinalTokensOSMCha,\n fetchUserDetails,\n updateUserDetails\n} from '../network/auth';\nimport { getStatus } from '../network/status';\nimport { fetchChangeset } from '../network/changeset';\nimport { fetchWatchList } from '../network/osmcha_watchlist';\nimport { setItem, removeItem } from '../utils/safe_storage';\nimport { modal } from './modal_actions';\nimport { TRUSTEDLIST } from './trustedlist_actions';\nimport { WATCHLIST } from './watchlist_actions';\nimport { pageIndexSelector, CHANGESETS_PAGE } from './changesets_page_actions';\nimport { CHANGESET } from './changeset_actions';\n\nimport type { RootStateType } from './';\n\nexport const AUTH = {\n postSocialToken: 'AUTH_POST_SOCIAL_TOKEN',\n saveOAuth: 'AUTH_SAVE_OAUTH_OBJ',\n getFinalToken: 'AUTH_GET_FINAL_TOKEN',\n saveToken: 'AUTH_SAVE_TOKEN',\n logout: 'AUTH_LOGOUT',\n clearSession: 'AUTH_CLEAR_SESSION',\n loginError: 'AUTH_LOGIN_ERROR',\n userDetails: 'AUTH_USER_DETAILS',\n clearUserDetails: 'AUTH_CLEAR_USER_DETAILS',\n updateUserDetails: 'UPDATE_USER_DETAILS'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\n// public\n// starting point for react component to start fetch\nexport const getOAuthToken = () => action(AUTH.postSocialToken);\n\nexport const getFinalToken = (oauth_verifier: string) =>\n action(AUTH.getFinalToken, { oauth_verifier });\n\nexport const logUserOut = () => action(AUTH.logout);\n\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\n\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n\nexport const changesetIdSelector = (state: RootStateType) =>\n state.changeset.get('changesetId');\n\nconst delay = process.env.NODE_ENV === 'test' ? () => {} : delayPromise;\nconst DELAY = 1000;\n\nexport const applyUpdateUserDetails = (\n message_good: string,\n message_bad: string,\n comment_feature: boolean\n) =>\n action(AUTH.updateUserDetails, {\n message_good,\n message_bad,\n comment_feature\n });\n\nexport function* watchUserDetails(): any {\n yield all([takeLatest(AUTH.updateUserDetails, updateUserDetailsSaga)]);\n}\n\nexport function* watchAuth(): any {\n // get the token from localStorage.\n // if it exists we just need to wait for\n // logout action.\n let delayBy = 1000;\n let token = yield select(tokenSelector);\n\n // wrapping it in a for loop allows us to\n // pause or resume our auth workflow\n // info: https://redux-saga.js.org/docs/advanced/NonBlockingCalls.html\n while (true) {\n try {\n if (!token) {\n token = yield call(authTokenFlow);\n }\n const userDetails = fromJS(yield call(fetchUserDetails, token));\n const trustedlist = userDetails.get('whitelists');\n const watchlist = fromJS(yield call(fetchWatchList, token));\n const status = fromJS(yield call(getStatus));\n yield put(action(TRUSTEDLIST.define, { trustedlist }));\n yield put(action(WATCHLIST.define, { watchlist }));\n yield put(action(AUTH.userDetails, { userDetails }));\n let pageIndex = yield select(pageIndexSelector);\n if (pageIndex) {\n yield put(action(CHANGESETS_PAGE.fetch, { pageIndex }));\n }\n let changesetId = yield select(changesetIdSelector);\n if (changesetId) {\n let changeset = yield call(fetchChangeset, changesetId, token);\n yield put(\n action(CHANGESET.fetched, {\n data: fromJS(changeset),\n changesetId\n })\n );\n }\n // show status notification\n if (status.get('status') !== 'success') {\n yield put(\n modal({\n title: 'OSMCha Status',\n description: status.get('message'),\n kind: status.get('status'),\n autoDismiss: 20,\n position: 'bc'\n })\n );\n }\n\n yield take(AUTH.logout);\n delayBy = DELAY;\n token = undefined;\n yield call(logoutFlow);\n yield call(delay, delayBy);\n } catch (error) {\n console.log(error);\n yield put(action(AUTH.loginError, error));\n yield call(delay, delayBy / 2);\n error.name = 'Error';\n yield put(\n modal({\n error,\n kind: 'warning'\n })\n );\n yield take(AUTH.logout);\n delayBy = 4 * delayBy;\n token = undefined;\n yield call(logoutFlow);\n yield call(delay, delayBy);\n }\n }\n}\n\nexport function* logoutFlow(): any {\n yield call(removeItem, 'token');\n yield call(removeItem, 'oauth_token');\n yield call(removeItem, 'oauth_token_secret');\n yield put(action(AUTH.clearSession));\n yield put(action(TRUSTEDLIST.clear));\n // get CHANGESET_PAGE without user metadata\n let pageIndex = yield select(pageIndexSelector);\n if (pageIndex) {\n yield put(action(CHANGESETS_PAGE.fetch, { pageIndex }));\n }\n yield put(action(AUTH.clearUserDetails));\n let location = yield select(locationSelector);\n yield put(\n push({\n ...location,\n pathname: '/'\n })\n );\n}\n\nexport function* authTokenFlow(): any {\n const { oauth_token, oauth_token_secret } = yield call(postTokensOSMCha);\n yield put(\n action(AUTH.saveOAuth, {\n oauth_token,\n oauth_token_secret\n })\n );\n // yield take(ACTION) waits for the particular action\n // to emit and resume the flow. next in action would\n // be to wait for the action `GET_FINAL_TOKEN`\n // and resume the flow\n const { oauth_verifier } = yield take(AUTH.getFinalToken);\n const { token } = yield call(\n postFinalTokensOSMCha,\n oauth_token,\n oauth_token_secret,\n oauth_verifier\n );\n if (!token || token === '') {\n throw new Error('invalid token');\n }\n yield call(setItem, 'token', token);\n yield call(setItem, 'oauth_token', oauth_token);\n yield call(setItem, 'oauth_token_secret', oauth_token_secret);\n yield put(\n action(AUTH.saveToken, {\n token,\n oauth_verifier\n })\n );\n return token;\n}\n\nexport function* updateUserDetailsSaga({\n message_good,\n message_bad,\n comment_feature\n}: {\n message_good: string,\n message_bad: string,\n comment_feature: boolean\n}): any {\n try {\n let token = yield select(tokenSelector);\n if (token) {\n const userDetails = fromJS(\n yield call(\n updateUserDetails,\n token,\n message_good,\n message_bad,\n comment_feature\n )\n );\n yield put(action(AUTH.userDetails, { userDetails }));\n yield put(\n modal({\n kind: 'success',\n title: 'User updated',\n description: 'Your user preferences were updated successfully'\n })\n );\n }\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n","// @flow\nimport { Map, fromJS } from 'immutable';\nimport { AUTH } from './auth_actions';\n\nexport type AuthType = Map<\n 'oAuthToken' | 'oAuthTokenSecret' | 'error' | 'token' | 'userDetails',\n any\n>;\n\nconst initialState: AuthType = fromJS({\n oAuthToken: null,\n oAuthTokenSecret: null,\n error: null,\n token: null,\n userDetails: null\n});\n\nexport function authReducer(\n state: AuthType = initialState,\n action: Object\n): AuthType {\n switch (action.type) {\n case AUTH.saveOAuth: {\n return state\n .set('oAuthToken', action.oauth_token)\n .set('oAuthTokenSecret', action.oauth_token_secret)\n .set('error', null);\n }\n case AUTH.saveToken: {\n return state.set('token', action.token).set('error', null);\n }\n case AUTH.clearSession: {\n return fromJS({ error: state.get('error') }); // retain the error\n }\n case AUTH.loginError: {\n return state.set('error', action.error);\n }\n case AUTH.userDetails: {\n return state.set('userDetails', action.userDetails);\n }\n case AUTH.clearUserDetails: {\n return state.set('userDetails', Map());\n }\n default:\n return state;\n }\n}\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport { CHANGESETS_PAGE } from './changesets_page_actions';\n\nexport type ChangesetsPageType = Map<\n 'currentPage' | 'pageIndex' | 'loading' | 'error' | 'diff' | 'diffLoading',\n any\n>;\n\nconst changesetsInitial: ChangesetsPageType = fromJS({\n pageIndex: 0,\n currentPage: null,\n loading: false,\n error: null,\n diff: 0, // difference between the number of changesets in cache and the currentPage.\n diffLoading: false // indicator to show background update is going on.\n});\n\nexport function changesetsPageReducer(\n state: ChangesetsPageType = changesetsInitial,\n action: Object\n): ChangesetsPageType {\n switch (action.type) {\n case CHANGESETS_PAGE.updateNewCount: {\n return state.set('diff', action.diff).set('diffLoading', false);\n }\n case CHANGESETS_PAGE.checkNewLoading: {\n return state.set('diffLoading', true);\n }\n case CHANGESETS_PAGE.loading: {\n return state\n .set('pageIndex', action.pageIndex)\n .set('loading', true)\n .set('diff', 0)\n .set('diffLoading', false)\n .set('error', null);\n }\n case CHANGESETS_PAGE.fetched: {\n return state\n .set('currentPage', action.data)\n .set('pageIndex', action.pageIndex)\n .set('loading', false)\n .set('error', null);\n }\n case CHANGESETS_PAGE.error: {\n return state\n .set('pageIndex', action.pageIndex)\n .set('diff', 0)\n .set('loading', false)\n .set('error', action.error);\n }\n default: {\n return state;\n }\n }\n}\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport {\n CHANGESET,\n CHANGESET_MAP,\n CHANGESET_MODIFY\n} from './changeset_actions';\n\nexport type ChangesetType = Map<\n | 'changesets'\n | 'changesetId' // of the currentChangeset\n | 'loading'\n | 'loadingChangesetMap'\n | 'changesetMap'\n | 'errorChangesetMap'\n | 'errorChangeset',\n any\n>;\n\nconst initial: ChangesetType = fromJS({\n changesetId: null,\n changesets: new Map(),\n loading: false,\n errorChangeset: null,\n changesetMap: new Map(),\n loadingChangesetMap: false,\n errorChangesetMap: null\n});\n\nexport function changesetReducer(\n state: ChangesetType = initial,\n action: Object\n): ChangesetType {\n switch (action.type) {\n case CHANGESET.change: {\n return state\n .set('changesetId', action.changesetId)\n .set('loading', false)\n .set('errorChangeset', null)\n .set('errorChangesetMap', null);\n }\n case CHANGESET.loading: {\n return state\n .set('changesetId', action.changesetId)\n .set('loading', true)\n .set('errorChangeset', null);\n }\n case CHANGESET.fetched: {\n const changesets = state\n .get('changesets')\n .set(action.changesetId, action.data);\n return state\n .set('changesets', changesets)\n .set('changesetId', action.changesetId)\n .set('loading', false)\n .set('errorChangeset', null);\n }\n case CHANGESET.error: {\n return state\n .set('changesetId', action.changesetId)\n .set('loading', false)\n .set('errorChangeset', action.error);\n }\n case CHANGESET_MAP.change: {\n return state\n .set('changesetId', action.changesetId)\n .set('errorChangesetMap', null)\n .set('loadingChangesetMap', false);\n }\n case CHANGESET_MAP.fetched: {\n const changesetMap = state\n .get('changesetMap')\n .set(action.changesetId, action.data);\n return state\n .set('changesetMap', changesetMap)\n .set('changesetId', action.changesetId)\n .set('loadingChangesetMap', false)\n .set('errorChangesetMap', null);\n }\n case CHANGESET_MAP.loading: {\n return state\n .set('changesetId', action.changesetId)\n .set('loadingChangesetMap', true)\n .set('errorChangesetMap', null);\n }\n case CHANGESET_MAP.error: {\n return state\n .set('changesetId', action.changesetId)\n .set('loadingChangesetMap', false)\n .set('errorChangesetMap', action.error);\n }\n case CHANGESET_MODIFY.modify: {\n const changesets = state\n .get('changesets')\n .set(action.changesetId, action.changeset);\n return state.set('changesets', changesets);\n }\n case CHANGESET_MODIFY.revert: {\n const changesets = state\n .get('changesets')\n .set(action.changesetId, action.changeset);\n return state\n .set('changesets', changesets)\n .set('errorChangeset', action.error);\n }\n default: {\n return state;\n }\n }\n}\n","// @flow\nimport { Map, fromJS } from 'immutable';\nimport { SHOW_MODAL } from './modal_actions';\n\nexport type ModalType = Map<\n | 'error'\n | 'kind'\n | 'duration'\n | 'title'\n | 'description'\n | 'callback'\n | 'callbackLabel'\n | 'dismiss'\n | 'uid'\n | 'autoDismiss'\n | 'position',\n any\n>; // osmcha uses this\n\nconst initialState: ModalType = fromJS({\n error: null,\n kind: null,\n duration: null,\n title: null,\n dismiss: true,\n autoDismiss: 5, // number\n position: 'tr',\n description: null,\n uid: null // number\n});\n\nexport function modalReducer(\n state: ModalType = initialState,\n action: Object\n): ModalType {\n switch (action.type) {\n case SHOW_MODAL: {\n return state\n .set('kind', action.kind)\n .set('error', action.error)\n .set('callbackLabel', action.callbackLabel)\n .set('title', action.title)\n .set('dismiss', action.dismiss)\n .set('uid', action.uid)\n .set('autoDismiss', action.autoDismiss)\n .set('position', action.position)\n .set('description', action.description);\n }\n default:\n return state;\n }\n}\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport { FILTERS } from './filters_actions';\n\nexport type filtersReducerType = Map<\n 'loading' | 'error' | 'filters' | 'aoi',\n any\n>;\n\nconst filtersInitial: filtersReducerType = fromJS({\n filters: {},\n aoi: {},\n loading: false,\n error: null\n});\n\nexport function filtersReducer(\n state: filtersReducerType = filtersInitial,\n action: Object\n): filtersReducerType {\n switch (action.type) {\n case FILTERS.set: {\n return state.set('filters', action.filters).set('loading', false);\n }\n default:\n return state;\n }\n}\n","// @flow\n\nexport const MAPCONTROLS = {\n setStyle: 'SET_STYLE'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const updateStyle = (style: string) =>\n action(MAPCONTROLS.setStyle, { style });\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport { MAPCONTROLS } from './map_controls_actions';\n\nexport type mapControlsReducerType = Map<'style', any>;\n\nconst mapControlsInitial: mapControlsReducerType = fromJS({\n style: 'satellite'\n});\n\nexport function mapControlsReducer(\n state: filtersReducerType = mapControlsInitial,\n action: Object\n): mapControlsReducerType {\n switch (action.type) {\n case MAPCONTROLS.setStyle: {\n return state.set('style', action.style);\n }\n default:\n return state;\n }\n}\n","import { Map, fromJS } from 'immutable';\nimport { TRUSTEDLIST } from './trustedlist_actions';\n\nexport type trustedlistReducerType = Map<'trustedlist', 'loading', any>;\n\nconst initialState: trustedlistReducerType = fromJS({\n trustedlist: null,\n loading: false\n});\n\nexport function trustedlistReducer(\n state: trustedlistReducerType = initialState,\n action: Object\n): WhitelistType {\n switch (action.type) {\n case TRUSTEDLIST.define: {\n return state.set('trustedlist', action.trustedlist).set('loading', false);\n }\n case TRUSTEDLIST.add: {\n return state\n .set(\n 'trustedlist',\n state.get('trustedlist').concat([action.trustedlist_user])\n )\n .set('loading', false);\n }\n case TRUSTEDLIST.remove: {\n return state\n .set(\n 'trustedlist',\n state\n .get('trustedlist')\n .filter(item => item !== action.trustedlist_user)\n )\n .set('loading', false);\n }\n case TRUSTEDLIST.clear: {\n return state.set('trustedlist', Map()).set('loading', false);\n }\n default:\n return state;\n }\n}\n","import { Map, List, fromJS } from 'immutable';\nimport { WATCHLIST } from './watchlist_actions';\n\nexport type watchlistReducerType = Map<'watchlist', 'loading', any>;\n\nconst initialState: watchlistReducerType = fromJS({\n watchlist: List(),\n loading: false\n});\n\nexport function watchlistReducer(\n state: watchlistReducerType = initialState,\n action: Object\n): WatchlistType {\n switch (action.type) {\n case WATCHLIST.define: {\n return state.set('watchlist', action.watchlist).set('loading', false);\n }\n case WATCHLIST.add: {\n return state\n .set(\n 'watchlist',\n state.get('watchlist').concat([fromJS(action.watchlist_user)])\n )\n .set('loading', false);\n }\n case WATCHLIST.remove: {\n return state\n .set(\n 'watchlist',\n state\n .get('watchlist')\n .filter(item => item.get('uid') !== action.watchlist_user)\n )\n .set('loading', false);\n }\n case WATCHLIST.clear: {\n return state.set('watchlist', Map()).set('loading', false);\n }\n default:\n return state;\n }\n}\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport { AOI } from './aoi_actions';\n\nexport type aoiReducerType = Map<'loading' | 'error' | 'aoi', any>;\n\nconst aoiInitial: aoiReducerType = fromJS({\n aoi: {},\n loading: false,\n error: null\n});\n\nexport function aoiReducer(\n state: aoiReducerType = aoiInitial,\n action: Object\n): filtersReducerType {\n switch (action.type) {\n case AOI.loading: {\n return state.set('loading', true);\n }\n case AOI.clear: {\n return state\n .set('aoi', Map())\n .set('loading', false)\n .set('error', null);\n }\n case AOI.fetched: {\n return state\n .set('loading', false)\n .set('error', null)\n .set('aoi', action.aoi);\n }\n default:\n return state;\n }\n}\n","import { all } from 'redux-saga/effects';\nimport { watchChangesetsPage } from './changesets_page_actions';\nimport { watchChangeset, watchModifyChangeset } from './changeset_actions';\nimport { watchAuth, watchUserDetails } from './auth_actions';\nimport { watchModal } from './modal_actions';\nimport { watchFilters } from './filters_actions';\nimport { watchTrustedlist } from './trustedlist_actions';\nimport { watchWatchlist } from './watchlist_actions';\nimport { watchAOI } from './aoi_actions';\n\nexport default function* rootSaga() {\n yield all([\n watchChangesetsPage(),\n watchFilters(),\n watchAOI(),\n watchChangeset(),\n watchAuth(),\n watchUserDetails(),\n watchModifyChangeset(),\n watchModal(),\n watchTrustedlist(),\n watchWatchlist()\n ]);\n}\n","// @flow\nimport { combineReducers, createStore, applyMiddleware } from 'redux';\nimport { Map } from 'immutable';\nimport { routerReducer, routerMiddleware } from 'react-router-redux';\nimport { history } from './history';\nimport createSagaMiddleware from 'redux-saga';\n\nimport * as safeStorage from '../utils/safe_storage';\n\n// Reducers\nimport { authReducer } from './auth_reducer';\nimport { changesetsPageReducer } from './changesets_page_reducer';\nimport { changesetReducer } from './changeset_reducer';\nimport { modalReducer } from './modal_reducer';\nimport { filtersReducer } from './filters_reducer';\nimport { mapControlsReducer } from './map_controls_reducer';\nimport { trustedlistReducer } from './trustedlist_reducer';\nimport { watchlistReducer } from './blacklist_reducer';\nimport { aoiReducer } from './aoi_reducer';\n\nimport type { ModalType } from './modal_reducer';\nimport type { ChangesetsPageType } from './changesets_page_reducer';\nimport type { ChangesetType } from './changeset_reducer';\nimport type { AuthType } from './auth_reducer';\nimport type { filtersReducerType } from './filters_reducer';\nimport type { mapControlsReducerType } from './map_controls_reducer';\nimport type { trustedlistReducerType } from './trustedlist_reducer';\nimport type { watchlistReducerType } from './blacklist_reducer';\n// Sagas\nimport sagas from './sagas';\n\nexport type RootStateType = {\n auth: AuthType,\n changesetsPage: ChangesetsPageType,\n filters: filtersReducerType,\n aoi: aoiReducerType,\n changeset: ChangesetType,\n modal: ModalType,\n routing: Object,\n trustedlist: trustedlistReducerType,\n watchlist: watchlistReducerType,\n mapControls: mapControlsReducerType\n};\n\n// Root reducer\nconst reducers = combineReducers({\n changesetsPage: changesetsPageReducer,\n changeset: changesetReducer,\n filters: filtersReducer,\n mapControls: mapControlsReducer,\n aoi: aoiReducer,\n routing: routerReducer,\n auth: authReducer,\n modal: modalReducer,\n trustedlist: trustedlistReducer,\n watchlist: watchlistReducer\n});\n\nconst sagaMiddleware = createSagaMiddleware();\n// Middlewares\nconst middlewares = [sagaMiddleware, routerMiddleware(history)];\n\nlet appliedMiddlewares = applyMiddleware(...middlewares);\nif (process.env.NODE_ENV !== 'production') {\n // const { createLogger } = require('redux-logger');\n\n // const logger = createLogger({\n // stateTransformer: state => {\n // let newState = {};\n\n // for (var i of Object.keys(state)) {\n // if (Iterable.isIterable(state[i])) {\n // newState[i] = state[i].toJS();\n // } else {\n // newState[i] = state[i];\n // }\n // }\n // return newState;\n // }\n // });\n // middlewares.push(logger);\n const { composeWithDevTools } = require('redux-devtools-extension');\n appliedMiddlewares = composeWithDevTools(appliedMiddlewares);\n}\n\n// Persisted state\nconst persistedState = {\n auth: Map({\n token: safeStorage.getItem('token'),\n oAuthToken: safeStorage.getItem('oauth_token'),\n oAuthTokenSecret: safeStorage.getItem('oauth_token_secret'),\n error: null\n })\n};\n\n// Store\nconst store = createStore(reducers, persistedState, appliedMiddlewares);\nsagaMiddleware.run(sagas);\n\nexport { store };\n","import { isProd } from '../config';\nlet ReactGA;\n\nif (isProd) {\n ReactGA = require('react-ga');\n}\n\nexport function gaPageView(page: string) {\n if (ReactGA) {\n ReactGA.pageview(page);\n }\n}\n\nexport function gaSendEvent(obj: Object) {\n if (ReactGA) {\n ReactGA.event(obj);\n }\n}\n","// @flow\nexport function getDisplayName(WrappedComponent: Object): string {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n","export function createPopup(\n title: string = 'Authentication',\n location: string\n) {\n const width = 500;\n const height = 600;\n const settings = [\n ['width', width],\n ['height', height],\n ['left', window.innerWidth.width / 2 - width / 2],\n ['top', window.innerHeight.height / 2 - height / 2]\n ]\n .map(x => x.join('='))\n .join(',');\n\n const popup = window.open('about:blank', title, settings);\n if (!popup) return;\n popup.location = location;\n}\n","export function dispatchEvent(\n messageId: string,\n payLoad: Object,\n target: ?Object\n) {\n const event = new CustomEvent(messageId, {\n detail: payLoad\n });\n (target || document.body).dispatchEvent(event);\n}\n","// @flow\nexport function elementInViewport(element: HTMLElement) {\n var rect = element.getBoundingClientRect();\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= window.innerHeight &&\n rect.right <= window.innerWidth\n );\n}\n","const parseQueryString = queryString => {\n const query = {};\n queryString.split('&').forEach(pair => {\n const [key, value] = pair.split('=');\n query[decodeURIComponent(key)] = decodeURIComponent(value) || null;\n });\n\n return query;\n};\n\nexport function handlePopupCallback() {\n // TO-FIX what if it never resolves\n return new Promise((res, rej) => {\n window.authComplete = location => {\n const queryString = location.split('?')[1];\n const creds = parseQueryString(queryString);\n delete window.authComplete;\n return res(creds);\n };\n });\n}\n","// @flow\n// export type cancelablePromiseType = { promise: Promise<*>, cancel: () => any };\nexport function cancelablePromise(promise: Promise<*>) {\n let hasCanceled_ = false;\n\n const wrappedPromise = new Promise((resolve, reject) => {\n promise\n .then(val => (hasCanceled_ ? reject({ isCanceled: true }) : resolve(val)))\n .catch(\n error => (hasCanceled_ ? reject({ isCanceled: true }) : reject(error))\n );\n });\n\n return {\n promise: wrappedPromise,\n cancel() {\n hasCanceled_ = true;\n }\n };\n}\nfunction handleErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n}\n\nexport function cancelableFetchJSON(url: string, token?: string) {\n if (token) {\n return cancelablePromise(\n fetch(url, {\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n })\n );\n } else {\n return cancelablePromise(\n fetch(url)\n .then(handleErrors)\n .then(res => {\n return res.json();\n })\n );\n }\n}\n\nexport function delayPromise(\n interval: number\n): { promise: Promise<*>, cancel: () => any } {\n return cancelablePromise(new Promise(res => setTimeout(res, interval)));\n}\n","// Very, very basic mobile detection.\nexport const isMobile = () => {\n return window.innerWidth <= 800;\n};\n","import React from 'react';\n\nexport class Floater extends React.PureComponent {\n render() {\n return (\n \n \n {this.props.children}\n \n \n );\n }\n}\n","// @flow\nimport React from 'react';\n\nexport function CreateDeleteModify(props: Object) {\n const showZero = props.showZero;\n return (\n \n {(props.create > -1 || showZero) &&\n
      \n {props.create}\n
      }\n {(props.modify > -1 || showZero) &&\n
      \n {props.modify}\n
      }\n {(props.delete > -1 || showZero) &&\n
      \n {props.delete}\n
      }\n \n );\n}\n\n// export function CreateDeleteModify(props: Object) {\n// const showZero = props.showZero;\n// return (\n// \n// \n// \n// \n// \n// {props.create}\n// \n// \n// {props.modify}\n// \n// \n// \n// \n// \n// {props.delete}\n// \n// \n// );\n// }\n","//@flow\nimport React from 'react';\n\nexport default function AssemblyAnchor({ url }: { url?: string }) {\n return (\n \n {url}\n \n );\n}\n","//@flow\nimport React from 'react';\n\nexport default function TranslateButton({ text }: { text: string }) {\n return (\n \n Translate\n \n \n \n \n );\n}\n","// @flow\nimport React from 'react';\nimport { List } from 'immutable';\n\nexport function Reasons({\n reasons,\n userFlag,\n underline,\n color\n}: {\n reasons: List<*>,\n userFlag: string,\n underline: boolean,\n color: string\n}) {\n const extraClass = underline ? 'txt-underline-dotted' : '';\n return (\n \n {reasons.map((r: Map, k) => (\n \n ))}\n {userFlag && (\n \n )}\n \n );\n}\n\nconst Reason = ({\n text,\n color,\n extraClass\n}: {\n text: string,\n color: string,\n extraClass: string\n}) => (\n \n \n {text}\n \n \n);\n","import React from 'react';\n\nconst Property = ({ property, value, imageryMatch, sourceMatch }) => {\n return (\n
      \n \n {property}\n \n {value}\n {property === 'imagery' && (\n \n
      \n {imageryMatch.map((e, k) => (\n \n {Array.isArray(\n e.match(\n /^(?:https?:\\/\\/)?(?:[^@\\/\\n]+@)?(?:www\\.)?([^:\\/\\n]+)/gim\n )\n ) ? (\n e.match(\n /^(?:https?:\\/\\/)?(?:[^@\\/\\n]+@)?(?:www\\.)?([^:\\/\\n]+)/gim\n )[0]\n ) : (\n \n \n \n )}\n \n ))}\n
      \n )}\n {property === 'source' && (\n \n
      \n {sourceMatch.map((e, k) => (\n \n {Array.isArray(\n e.match(\n /^(?:https?:\\/\\/)?(?:[^@\\/\\n]+@)?(?:www\\.)?([^:\\/\\n]+)/gim\n )\n ) ? (\n e.match(\n /^(?:https?:\\/\\/)?(?:[^@\\/\\n]+@)?(?:www\\.)?([^:\\/\\n]+)/gim\n )[0]\n ) : (\n \n \n \n )}\n \n ))}\n
      \n )}\n
      \n );\n};\n\nexport default Property;\n","import React from 'react';\nimport Property from './property';\n\nconst PropertyList = ({ limit, properties, imageryMatch, sourceMatch }) => {\n return Object.entries(properties)\n .map(([property, value]) => (\n \n ))\n .slice(limit, limit + 2);\n};\n\nexport default PropertyList;\n","// @flow\nimport React, { useState } from 'react';\nimport { Map } from 'immutable';\nimport AnchorifyText from 'react-anchorify-text';\nimport AssemblyAnchor from '../assembly_anchor';\nimport TranslateButton from './translate_button';\nimport { Reasons } from '../reasons';\nimport PropertyList from './property_list';\n\nexport function Details({\n properties,\n changesetId\n}: {\n properties: Map,\n changesetId: number,\n expanded?: boolean\n}) {\n let source = properties.get('source');\n let imagery = properties.get('imagery_used');\n const editor = properties.get('editor');\n const metadata = properties.get('metadata');\n const reasons = properties.get('reasons');\n const comment = properties.get('comment');\n\n const urlRegex = new RegExp(\n /(?:(?:https?|ftp|file):\\/\\/|www\\.|ftp\\.)(?:\\([-A-Z0-9+&@#\\/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#\\/%=~_|$?!:,.])*(?:\\([-A-Z0-9+&@#\\/%=~_|$?!:,.]*\\)|[A-Z0-9+&@#\\/%=~_|$])/gim\n );\n\n let sourceMatch = [];\n if (source && source.indexOf('{switch:a,b,c}.') > -1) {\n source = source.replace('{switch:a,b,c}.', '');\n }\n if (source && source.match(urlRegex)) {\n sourceMatch = source.match(urlRegex);\n source = source.replace(urlRegex, '');\n }\n\n let imageryMatch = [];\n if (imagery && imagery.match(urlRegex)) {\n imageryMatch = imagery.match(urlRegex);\n imagery = imagery.replace(urlRegex, '');\n }\n\n let propertiesObj = {};\n // As JOSM doesn't use the imagery field, change the order\n // to make the source field visible in the first page\n if (imagery === 'Not reported') {\n propertiesObj = {\n editor: editor,\n source: source,\n imagery: imagery\n };\n } else {\n propertiesObj = {\n editor: editor,\n imagery: imagery,\n source: source\n };\n }\n\n Array.from(metadata, ([p, v]) => {\n if (\n !p.startsWith('ideditor') &&\n !p.startsWith('resolved') &&\n !p.startsWith('warnings')\n ) {\n propertiesObj[p] = v;\n }\n });\n\n const size = Object.keys(propertiesObj).length;\n const [leftLimit, setLeftLimit] = useState(0);\n\n return (\n
      \n
      \n
      \n \n \n \n \n

      \n
      \n
      \n \n
      \n
      \n
      \n \n
      \n
      \n {leftLimit > 0 && (\n setLeftLimit(leftLimit - 2)}\n title=\"Previous changeset properties\"\n >\n \n \n \n \n )}\n \n {leftLimit + 2 < size && (\n setLeftLimit(leftLimit + 2)}\n title=\"Next changeset properties\"\n >\n \n \n \n \n )}\n
      \n
      \n );\n}\n","import { useEffect, useState } from 'react';\n\nexport const useIsUserListed = (username, uid, trustedlist, watchlist) => {\n const [isInTrustedlist, setIsInTrustedlist] = useState(false);\n const [isInWatchlist, setIsInWatchlist] = useState(false);\n\n useEffect(() => {\n try {\n setIsInTrustedlist(trustedlist.indexOf(username) !== -1);\n } catch (e) {\n setIsInTrustedlist(false);\n }\n try {\n setIsInWatchlist(\n watchlist.map(user => user.get('uid')).indexOf(uid) !== -1\n );\n } catch (e) {\n setIsInWatchlist(false);\n }\n }, [username, uid, watchlist, trustedlist]);\n\n return [isInTrustedlist, isInWatchlist];\n};\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { formatDistanceToNow, parse } from 'date-fns';\n\nimport { CreateDeleteModify } from '../create_delete_modify';\nimport { Details } from './details';\nimport { useIsUserListed } from '../../hooks/UseIsUserListed';\n\ntype propsType = {|\n properties: Map,\n changesetId: number,\n userEditCount: number,\n toggleUser: () => mixed,\n trustedlist: Map,\n watchlisted: Map\n|};\n\nfunction HeaderComponent({\n properties,\n changesetId,\n userEditCount,\n toggleUser,\n trustedlist,\n watchlisted\n}: propsType) {\n const user = properties.get('user');\n const date = parse(\n properties.get('date'),\n // eslint-disable-next-line\n \"yyyy-MM-dd'T'HH:mm:ssX\",\n new Date()\n );\n const create = properties.get('create');\n const modify = properties.get('modify');\n const destroy = properties.get('delete');\n const [isInTrustedlist, isInWatchlist] = useIsUserListed(\n user,\n properties.get('uid'),\n trustedlist,\n watchlisted\n );\n\n return (\n
      \n
      \n
      \n

      Details

      \n
      \n \n
      \n
      \n
      \n \n \n \n {user}\n \n \n {isInTrustedlist && (\n \n \n \n )}\n {isInWatchlist && (\n \n \n \n )}\n {userEditCount > 0 && (\n \n  ({userEditCount} edits)\n \n )}\n  created {formatDistanceToNow(date, { addSuffix: true })}\n \n
      \n
      \n
      \n
      \n );\n}\n\nconst Header = connect((state: RootStateType, props) => ({\n trustedlist: state.trustedlist.get('trustedlist'),\n watchlisted: state.watchlist.get('watchlist')\n}))(HeaderComponent);\nexport { Header };\n","import React from 'react';\nimport Placeholder from './user.jpg';\n\nexport class Avatar extends React.PureComponent {\n props: {\n url: string\n };\n state = {\n loaded: false\n };\n handleImageLoaded() {\n this.setState({ loaded: true });\n }\n handleImageErrored() {\n this.setState({ loaded: false });\n }\n componentWillReceiveProps(nextProps) {\n if (nextProps.url !== this.props.url) {\n this.setState({\n loaded: false\n });\n }\n }\n render() {\n let url: string = Placeholder;\n if (this.props.url) {\n url = this.props.url;\n if (url.indexOf('http://') > -1) {\n url = 'https://' + url.slice(5);\n }\n }\n return (\n
      \n \n \n
      \n );\n }\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\n\nimport { createPopup } from '../../utils/create_popup';\nimport { handlePopupCallback } from '../../utils/handle_popup_callback';\nimport { osmAuthUrl } from '../../config/constants';\nimport { isDev, isLocal } from '../../config';\nimport type { RootStateType } from '../../store';\nimport { getFinalToken } from '../../store/auth_actions';\nimport { getChangesetsPage } from '../../store/changesets_page_actions';\nimport { getChangeset } from '../../store/changeset_actions';\n\nclass SignInButton extends React.PureComponent {\n props: {\n text: string,\n oAuthToken: ?string,\n pageIndex: number,\n getFinalToken: string => mixed,\n getChangeset: string => mixed,\n getChangesetsPage: string => mixed\n };\n\n handleLoginClick = () => {\n var oAuthToken = this.props.oAuthToken;\n if (!oAuthToken) return;\n\n let url;\n if (isDev || isLocal) {\n url = `/local-landing.html#${oAuthToken}`;\n } else {\n url = `${osmAuthUrl}?oauth_token=${oAuthToken}`;\n }\n\n createPopup('oauth_popup', url);\n handlePopupCallback().then(oAuthObj => {\n this.props.getFinalToken(oAuthObj.oauth_verifier);\n });\n };\n render() {\n const extraClasses = this.props.className\n ? this.props.className\n : 'border--darken5 border--darken25-on-hover bg-darken10 bg-darken5-on-hover color-gray';\n return (\n \n \n \n \n {this.props.text}\n \n );\n }\n}\n\nSignInButton = connect(\n (state: RootStateType, props) => ({\n oAuthToken: state.auth.get('oAuthToken'),\n pageIndex: state.changesetsPage.get('pageIndex') || 0\n }),\n {\n getFinalToken,\n getChangeset,\n getChangesetsPage\n }\n)(SignInButton);\n\nexport { SignInButton };\n","import React from 'react';\n\nexport function Button({\n onClick,\n children,\n iconName,\n className,\n disabled\n}: Object) {\n return (\n \n {children}\n {iconName && (\n \n \n \n )}\n \n );\n}\n","// @flow\nimport React from 'react';\nimport './dropdown.css';\nimport onClickOutside from 'react-click-outside';\nimport { Button } from './button';\n\nclass DropdownContent extends React.PureComponent {\n isActive = (obj: Object) => {\n for (let v of this.props.value) {\n if (v.label === obj.label) {\n return true;\n }\n }\n return false;\n };\n\n handleClick = (data: Object) => {\n if (data) {\n var label = data.label;\n if (!label || !this.props.value || !this.props.onChange) return;\n const value = this.props.value;\n let ourObj = data;\n if (!ourObj) return;\n\n let isRemove = false;\n for (let x = 0; x < value.length; x++) {\n if (value[x].label === label) {\n isRemove = true;\n this.props.onRemove(ourObj);\n this.props.onChange(value.slice(0, x).concat(value.slice(x + 1)));\n }\n }\n\n if (!isRemove) {\n let newArray = value.slice(0, value.length);\n if (!this.props.multi) {\n newArray = [];\n }\n newArray.push(ourObj);\n this.props.onAdd(ourObj);\n this.props.onChange(newArray);\n }\n }\n if (!this.props.multi) {\n this.props.toggleDropdown();\n }\n };\n\n render() {\n return (\n \n {this.props.options.map((i, k) => (\n \n {this.props.multi && (\n \n )}\n {i.href ? (\n \n {i.label}\n \n ) : (\n \n {i.label}\n \n )}\n {this.props.deletable && (\n {\n e.preventDefault();\n e.stopPropagation();\n this.props.toggleDropdown();\n this.props.deletable(i.value);\n }}\n >\n x\n \n )}\n \n ))}\n \n );\n }\n}\n\nexport class _Dropdown extends React.PureComponent {\n props: {\n className: string,\n disabled: boolean,\n value: Array,\n onChange: (Array) => any,\n onAdd: (?Object) => any,\n onRemove: (?Object) => any,\n options: Array,\n display: string,\n deletable?: (value: string) => any,\n multi: boolean,\n position: string\n };\n\n state = {\n display: false\n };\n\n handleClickOutside = () => {\n this.setState({\n display: false\n });\n };\n\n toggleDropdown = () => {\n this.setState({\n display: !this.state.display\n });\n };\n\n isActive = (obj: Object) => {\n for (let v of this.props.value) {\n if (v.label === obj.label) {\n return true;\n }\n }\n return false;\n };\n\n render() {\n return (\n
      \n \n {this.props.display}\n \n {this.state.display && (\n \n )}\n
      \n );\n }\n}\n\nexport const Dropdown = onClickOutside(_Dropdown);\n","import React from 'react';\nimport { connect } from 'react-redux';\n\nimport { Dropdown } from '../dropdown';\nimport {\n addToWatchlist,\n removeFromWatchlist\n} from '../../store/watchlist_actions';\nimport {\n addToTrustedlist,\n removeFromTrustedlist\n} from '../../store/trustedlist_actions';\n\ntype propsType = {\n user: Map,\n trustedlist: Map,\n watchlist: Map,\n addToWatchlist: string => void,\n removeFromWatchlist: string => void,\n addToTrustedlist: string => void,\n removeFromTrustedlist: string => void\n};\n\nclass TrustWatchUser extends React.PureComponent {\n handleVerify = (arr: Array) => {\n const username = this.props.user.get('name');\n const uid = this.props.user.get('uid');\n if (arr.length === 1) {\n if (arr[0].value === false) {\n this.props.addToWatchlist({ username, uid });\n }\n if (arr[0].value === true) {\n this.props.addToTrustedlist(username);\n }\n } else if (arr.length > 1) {\n throw new Error('verify array is big');\n }\n };\n\n handleVerifyClear = () => {\n const is_in_trustedlist =\n this.props.trustedlist.indexOf(this.props.user.get('name')) !== -1;\n const is_watchlisted =\n this.props.watchlist\n .map(user => user.get('uid'))\n .indexOf(this.props.user.get('uid')) !== -1;\n\n if (is_watchlisted) {\n this.props.removeFromWatchlist(this.props.user.get('uid'));\n } else if (is_in_trustedlist) {\n this.props.removeFromTrustedlist(this.props.user.get('name'));\n }\n };\n\n render() {\n const watchlist = this.props.watchlist.map(user => user.get('uid'));\n\n if (watchlist.includes(this.props.user.get('uid'))) {\n return (\n
      \n \n \n \n \n \n Watchlisted user\n \n \n this.props.removeFromWatchlist(this.props.user.get('uid'))\n }\n className=\"icon inline-block align-middle pl6 w24 h24 pointer color-gray\"\n >\n \n \n \n
      \n );\n } else if (\n this.props.trustedlist &&\n this.props.trustedlist.includes(this.props.user.get('name'))\n ) {\n return (\n
      \n \n \n \n \n \n Trusted user\n \n \n this.props.removeFromTrustedlist(this.props.user.get('name'))\n }\n className=\"icon inline-block align-middle pl6 w24 h24 pointer color-gray\"\n >\n \n \n \n
      \n );\n }\n\n return (\n
      \n {}}\n onRemove={() => {}}\n options={[\n {\n value: false,\n label: 'Add to your watchlist'\n },\n {\n value: true,\n label: 'Add to your trusted users list'\n }\n ]}\n onChange={this.handleVerify}\n display=\"Trust / Watch user\"\n position=\"left\"\n />\n
      \n );\n }\n}\n\nTrustWatchUser = connect(\n (state: RootStateType, props) => ({\n trustedlist: state.trustedlist.get('trustedlist'),\n watchlist: state.watchlist.get('watchlist')\n }),\n {\n addToWatchlist,\n removeFromWatchlist,\n addToTrustedlist,\n removeFromTrustedlist\n }\n)(TrustWatchUser);\n\nexport { TrustWatchUser };\n","import React from 'react';\n\nexport const UserOSMLink = ({ userName, linkClasses, children }) => {\n if (!userName) return null;\n\n const url = `https://www.openstreetmap.org/user/${userName}`;\n\n return (\n \n {children}\n \n );\n};\n","import React from 'react';\nimport { Link } from 'react-router-dom';\nimport showdown from 'showdown';\nimport { formatDistanceToNow, parse } from 'date-fns';\n\nimport { Avatar } from '../avatar';\nimport { getObjAsQueryParam } from '../../utils/query_params';\nimport { SignInButton } from './sign_in_button';\nimport { TrustWatchUser } from './trust_watch_user';\nimport { UserOSMLink } from './user_osm_link';\n\nclass UserLink extends React.PureComponent {\n getHarmfulObject() {\n if (this.props.harmful) {\n return {\n label: 'Show Bad only',\n value: true\n };\n } else {\n return {\n label: 'Show Good only',\n value: false\n };\n }\n }\n getLinkContent() {\n if (this.props.harmful) {\n return `${this.props.userDetails.get('harmful_changesets')} Bad`;\n } else {\n const count =\n this.props.userDetails.get('checked_changesets') -\n this.props.userDetails.get('harmful_changesets');\n return `${count} Good`;\n }\n }\n render() {\n return (\n \n {this.getLinkContent()}\n \n );\n }\n}\n\n// getObjAsQueryParam('filters', filters.toJS());\nexport class User extends React.PureComponent {\n renderUidFilterLink() {\n return (\n \n {`${this.props.userDetails.get('count')} edits`}\n \n );\n }\n render() {\n const converter = new showdown.Converter({\n noHeaderId: true,\n simplifiedAutoLink: true\n });\n const UserDescriptionHTML = converter.makeHtml(\n this.props.userDetails.get('description') || ''\n );\n const registrationDate = this.props.userDetails.get('accountCreated')\n ? formatDistanceToNow(\n parse(\n this.props.userDetails.get('accountCreated'),\n // eslint-disable-next-line\n \"yyyy-MM-dd'T'HH:mm:ssX\",\n new Date()\n ),\n { addSuffix: true }\n )\n : '';\n\n return (\n
      \n

      \n User{' '}\n {this.props.userDetails.get('uid') &&\n `/ ${this.props.userDetails.get('uid')}`}\n

      \n {this.props.userDetails.get('name') ? (\n
      \n
      \n \n
      \n {this.props.userDetails.get('name')}\n
      \n
      \n
      \n

      \n {`Joined ${registrationDate} | `}\n {this.props.userDetails.get('count')\n ? this.renderUidFilterLink()\n : `${this.props.userDetails.get(\n 'changesets_in_osmcha'\n )} edits registered on OSMCha`}\n

      \n
      \n
      \n

      \n \n  and \n \n  changesets\n

      \n
      \n\n
      \n \n
      \n\n
      \n \n OSMCha\n \n \n OSM\n \n \n HDYC\n \n \n Missing Maps\n \n
      \n\n {this.props.whosThat.size > 1 && (\n
      \n Past usernames:  \n {this.props.whosThat.slice(0, -1).map((e, k) => (\n \n {e} \n \n ))}\n
      \n )}\n
      \n \n
      \n
      \n ) : (\n
      \n
      \n \n
      \n {this.props.userDetails.get('name')}\n
      \n
      \n
      \n \n
      \n
      \n )}\n
      \n );\n }\n}\n","import React from 'react';\n\nexport const Loading = ({ height, className }) => (\n \n
      \n
      \n);\n","// @flow\nimport React from 'react';\n\nimport { SignInButton } from './changeset/sign_in_button';\n\nexport function SignIn() {\n return (\n
      \n
       
      \n
      \n \n \n \n
      \n
      \n Sign in with your OpenStreetMap account to use OSMCha.\n
      \n
      \n \n
      \n
       
      \n
      \n );\n}\n","import React from 'react';\nimport debounce from 'lodash.debounce';\nimport { connect } from 'react-redux';\nimport CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';\nimport { Loading } from '../components/loading';\nimport { SignIn } from '../components/sign_in';\nimport { dispatchEvent } from '../utils/dispatch_event';\nimport { updateStyle } from '../store/map_controls_actions';\nimport { importChangesetMap } from '../utils/cmap';\n\nimport 'changeset-map/public/css/style.css';\nimport type { RootStateType } from '../store';\nimport { isMobile } from '../utils';\n\nlet changesetId;\nlet currentChangesetMap;\nlet width = 700;\nlet height = 500;\nlet event;\nlet cMapRender;\n\nlet getMapInstance;\nexport function selectFeature(id: number) {\n if (!id || !event) return;\n event.emit('selectFeature', 'node|way', id);\n}\n\nfunction loadingChangesetMapAsync() {\n if (cMapRender) return Promise.resolve(cMapRender);\n return Promise.all([\n importChangesetMap('render'),\n importChangesetMap('getMapInstance')\n ]).then(res => {\n cMapRender = res[0];\n getMapInstance = res[1];\n return cMapRender;\n });\n}\n\nfunction loadMap() {\n var container = document.getElementById('container');\n if (!container || !currentChangesetMap) return;\n loadingChangesetMapAsync().then(render => {\n if (!render) return;\n // if (event) event.emit('clearFeature');\n event = render(container, changesetId, {\n width: width + 'px',\n height: Math.max(400, height) + 'px',\n data: currentChangesetMap,\n disableSidebar: true\n });\n });\n}\n\nvar minDebounce = debounce(loadMap, 250);\n\nclass CMap extends React.PureComponent {\n props: {\n changesetId: number,\n currentChangesetMap: Object,\n errorChangesetMap: ?Object,\n loadingChangesetMap: boolean,\n className: string,\n style: string\n };\n\n state = {\n visible: false,\n height: 0,\n width: 0\n };\n\n ref = null;\n\n componentDidMount() {\n changesetId = this.props.changesetId;\n currentChangesetMap = this.props.currentChangesetMap;\n const mobile = isMobile();\n\n if (this.ref) {\n var rect = this.ref.parentNode.getBoundingClientRect();\n // On mobile, above the map are two bars, one 36px, on 40px\n height = mobile\n ? parseInt(window.innerHeight - 36 - 40, 10)\n : parseInt(window.innerHeight - 1 * 55, 10);\n width = parseInt(rect.width, 10);\n }\n window.onresize = debounce(this.setDimensions, 100);\n minDebounce();\n }\n\n componentWillUnmount() {\n window.onresize = null;\n if (this.props.style !== 'satellite') this.props.updateStyle('satellite');\n event && event.emit('remove');\n }\n\n componentDidUpdate(prevProp: Object) {\n if (\n this.props.currentChangesetMap !== prevProp.currentChangesetMap ||\n this.props.token !== prevProp.token\n ) {\n minDebounce();\n }\n }\n\n setRef = (r: any) => {\n this.ref = r;\n this.setDimensions();\n };\n\n setDimensions = () => {\n if (!this.ref) return;\n var rect = this.ref.parentNode.getBoundingClientRect();\n height = parseInt(window.innerHeight - 1 * 55, 10);\n width = parseInt(rect.width, 10);\n this.setState({\n height,\n width\n });\n if (getMapInstance) {\n var instance = getMapInstance();\n if (instance && instance.map) {\n instance.map.resize();\n }\n }\n };\n\n render() {\n if (this.props.errorChangesetMap) {\n dispatchEvent('showToast', {\n title: 'changeset-map failed to load',\n content: 'Try reloading osmcha',\n timeOut: 5000,\n type: 'error'\n });\n console.error(this.props.errorChangesetMap);\n // return null;\n }\n changesetId = this.props.changesetId;\n currentChangesetMap = this.props.currentChangesetMap;\n\n if (this.props.token) {\n return (\n
      \n \n \n {(this.props.loadingChangesetMap ||\n this.props.errorChangesetMap) && (\n \n \n
      \n )}\n \n \n );\n } else {\n return ;\n }\n }\n}\n\nCMap = connect(\n (state: RootStateType, props) => ({\n changesetId: state.changeset.get('changesetId'),\n currentChangesetMap: state.changeset.getIn([\n 'changesetMap',\n state.changeset.get('changesetId')\n ]),\n errorChangesetMap: state.changeset.get('errorChangesetMap'),\n loadingChangesetMap: state.changeset.get('loadingChangesetMap'),\n style: state.mapControls.get('style'),\n token: state.auth.get('token')\n }),\n { updateStyle }\n)(CMap);\n\nexport { CMap };\n","// @flow\nimport React from 'react';\nimport { Map, List } from 'immutable';\nimport { Reasons } from '../reasons';\nimport { selectFeature } from '../../views/map';\n\nconst Feature = ({\n data,\n changesetReasons\n}: {\n data: Map,\n changesetReasons: Map\n}) => {\n let reasons;\n // operation necessary to the change\n if (\n data.get('reasons').size &&\n typeof data.get('reasons').get(0) === 'number'\n ) {\n reasons = changesetReasons.filter(reason =>\n data.get('reasons').contains(reason.get('id'))\n );\n } else {\n reasons = data.get('reasons');\n }\n return (\n \n {data.get('osm_id')}\n {data.get('name')}\n \n {data.get('note') ? (\n \n \n \n ) : (\n \n )}\n \n \n selectFeature(parseInt(data.get('osm_id'), 10))}\n >\n Map\n \n \n \n JOSM\n \n \n \n \n );\n};\n\nexport function Features({\n properties,\n changesetId\n}: {\n properties: Map,\n changesetId: number\n}) {\n let features: List> = properties.get('features');\n const reviewedFeatures: List> = properties\n .get('reviewed_features')\n .map(feature =>\n Map({\n url: feature.get('id'),\n user_flag: `Flagged by ${feature.get('user')}`,\n osm_id: feature.get('id').split('-')[1],\n reasons: []\n })\n );\n const reviewedIds = reviewedFeatures.map(feature => feature.get('url'));\n const featuresIds = features.map(feature => feature.get('url'));\n const intersection = features\n .filter(feature => reviewedIds.includes(feature.get('url')))\n .map((feature, k) => [k, feature.get('url')]);\n intersection.forEach(item => {\n features = features.setIn(\n [item[0], 'user_flag'],\n reviewedFeatures.find(f => f.get('url') === item[1]).get('user_flag')\n );\n });\n features = features.concat(\n reviewedFeatures.filter(\n feature => !featuresIds.includes(feature.get('url'))\n )\n );\n\n return (\n
      \n
      \n

      \n Flagged Features\n {features.size > 0 && (\n \n {features.size}\n \n )}\n

      \n {features.size === 0 ? (\n
      \n \n \n \n

      {`No features were flagged for ${changesetId}.`}

      \n
      \n ) : (\n \n \n \n \n \n \n \n \n \n \n {features.map((f, k) => (\n \n ))}\n \n
      OSM IdNameReasonsActions
      \n )}\n
      \n
      \n );\n}\n","// @flow\nimport React from 'react';\n\ntype propsType = {|\n isActive: boolean,\n setOpenAll: Function\n|};\n\nexport const OpenAll = ({ isActive, setOpenAll }: propsType) => (\n
      \n setOpenAll(!isActive)}\n role=\"switch\"\n aria-checked={isActive}\n tabIndex=\"0\"\n >\n {isActive ? 'Close all' : 'Open all'}\n \n
      \n);\n","// @flow\nimport React from 'react';\n\ntype propsType = {|\n isOpen: boolean\n|};\n\nexport const ExpandItemIcon = ({ isOpen }: propsType) => {\n return (\n <>\n {isOpen ? (\n \n \n \n ) : (\n \n \n \n )}\n \n );\n};\n","// @flow\nimport React, { useState, useEffect } from 'react';\nimport { connect } from 'react-redux';\nimport { OrderedSet } from 'immutable';\n\nimport type { RootStateType } from '../store';\nimport { selectFeature } from '../../views/map';\nimport { Loading } from '../loading';\nimport { OpenAll } from '../open_all';\nimport { ExpandItemIcon } from '../expand_item_icon';\n\nexport function getFeatures(features) {\n var keys = Object.keys(features);\n return keys.map(item => features[item]);\n}\n\nexport function processFeatures(features) {\n const finalReport = new Map();\n const analyzedFeatures = features.map(feature =>\n analyzeFeature(feature[0], feature[1])\n );\n const keys = ['addedTags', 'changedValues', 'deletedTags'];\n analyzedFeatures.map(item =>\n keys.map(key =>\n item.get(key).forEach(tag => {\n if (finalReport.get(tag[0])) {\n finalReport.set(\n tag[0],\n finalReport\n .get(tag[0])\n .concat([\n { id: item.get('id'), type: item.get('type'), value: tag[1] }\n ])\n );\n } else {\n finalReport.set(tag[0], [\n { id: item.get('id'), type: item.get('type'), value: tag[1] }\n ]);\n }\n })\n )\n );\n return finalReport;\n}\n\nexport function analyzeFeature(newVersion, oldVersion) {\n const oldVersionKeys = Object.keys(oldVersion.properties.tags);\n const newVersionKeys = Object.keys(newVersion.properties.tags);\n const addedTags = newVersionKeys.filter(tag => !oldVersionKeys.includes(tag));\n const deletedTags = oldVersionKeys.filter(\n tag => !newVersionKeys.includes(tag)\n );\n const changedValues = newVersionKeys\n .filter(tag => !addedTags.includes(tag) && !deletedTags.includes(tag))\n .filter(\n tag => newVersion.properties.tags[tag] !== oldVersion.properties.tags[tag]\n );\n const result = new Map();\n result\n .set('id', newVersion.properties.id)\n .set('type', newVersion.properties.type)\n .set(\n 'addedTags',\n addedTags.map(tag => [\n `Added tag ${tag}`,\n newVersion.properties.tags[tag]\n ])\n )\n .set(\n 'deletedTags',\n deletedTags.map(tag => [\n `Deleted tag ${tag}`,\n oldVersion.properties.tags[tag]\n ])\n )\n .set(\n 'changedValues',\n changedValues.map(tag => [\n `Changed value of tag ${tag}`,\n [oldVersion.properties.tags[tag], newVersion.properties.tags[tag]]\n ])\n );\n return result;\n}\n\nexport function FeatureListItem({ id, type }) {\n return (\n
    • \n selectFeature(id)}\n >\n {type} {id}\n \n
    • \n );\n}\n\nfunction ChangeTitle({ value, type }) {\n if (type.startsWith('Added')) {\n return {value};\n }\n if (type.startsWith('Deleted')) {\n return {value};\n }\n if (type.startsWith('Changed')) {\n const [oldValue, newValue] = value;\n return (\n \n {oldValue}\n âžœ \n {newValue}\n \n );\n }\n return
      ;\n}\n\nexport const ChangeItem = ({ opened, tag, features }) => {\n const [isOpen, setIsOpen] = useState(opened);\n const values = new OrderedSet(features.map(feature => feature.value));\n const last_space = tag.lastIndexOf(' ') + 1;\n\n useEffect(() => setIsOpen(opened), [opened]);\n\n return (\n
      \n setIsOpen(!isOpen)}\n >\n \n {tag.slice(0, last_space)}\n {tag.slice(last_space)}\n \n {features.length}\n \n \n {values.map((value, n) => (\n \n \n
        \n {features\n .filter(feature => feature.value === value)\n .map((feature, k) => (\n \n ))}\n
      \n
      \n ))}\n \n );\n};\n\nconst ChangeItemList = ({ changes, openAll }) => {\n return (\n <>\n {changes.length ? (\n changes.map((change, k) => (\n \n ))\n ) : (\n No tags were changed in this changeset.\n )}\n \n );\n};\n\ntype propsType = {|\n changesetId: string,\n changes: Object\n|};\n\nconst TagChangesComponent = ({ changesetId, changes }: propsType) => {\n const [changeReport, setChangeReport] = useState([]);\n const [openAll, setOpenAll] = useState(false);\n\n useEffect(() => {\n const newChangeReport = [];\n if (changes && changes.get(changesetId)) {\n const changesetData = changes.get(changesetId)['featureMap'];\n const processed = processFeatures(\n getFeatures(changesetData).filter(\n item => item.length === 2 && item[0].properties.action === 'modify'\n )\n );\n processed.forEach((featureIDs, tag) =>\n newChangeReport.push([tag, featureIDs])\n );\n setChangeReport(newChangeReport.sort());\n }\n }, [changes, changesetId]);\n\n return (\n
      \n
      \n

      \n Tag changes\n

      \n {changeReport.length ? (\n \n ) : null}\n
      \n {changes.get(changesetId) ? (\n \n ) : (\n \n )}\n
      \n );\n};\n\nconst TagChanges = connect((state: RootStateType, props) => ({\n changes: state.changeset.get('changesetMap')\n}))(TagChangesComponent);\n\nexport { TagChanges };\n","// @flow\nimport React, { useEffect, useState } from 'react';\nimport { connect } from 'react-redux';\n\nimport type { RootStateType } from '../store';\nimport { getFeatures, FeatureListItem } from './tag_changes';\nimport { Loading } from '../loading';\nimport { OpenAll } from '../open_all';\nimport { ExpandItemIcon } from '../expand_item_icon';\n\nfunction processFeatures(features) {\n const finalReport = new Map();\n features = features.map(item => item[0]);\n const keys = ['create', 'delete'];\n keys.map(key =>\n finalReport.set(\n key,\n features\n .filter(item => item.properties.action === key)\n .map(item => ({ id: item.properties.id, type: item.properties.type }))\n )\n );\n finalReport.set(\n 'modify',\n features\n .filter(item => item.properties.action === 'modify')\n .filter(item => item.properties.type === 'relation')\n .map(item => ({ id: item.properties.id, type: item.properties.type }))\n );\n return finalReport;\n}\n\nconst ActionItem = ({ opened, tag, features }) => {\n const [isOpen, setIsOpen] = useState(opened);\n const titles = {\n create: 'Created',\n modify: 'Modified Relations',\n delete: 'Deleted'\n };\n\n useEffect(() => setIsOpen(opened), [opened]);\n\n return (\n
      \n setIsOpen(!isOpen)}\n >\n \n {titles[tag]}\n \n {features.length}\n \n \n
        \n {features.map((item, k) => (\n \n ))}\n
      \n
      \n );\n};\n\ntype propsType = {|\n changesetId: string,\n changes: Object\n|};\n\nconst OtherFeaturesComponent = ({ changesetId, changes }: propsType) => {\n const [changeReport, setChangeReport] = useState([]);\n const [openAll, setOpenAll] = useState(false);\n\n useEffect(() => {\n const newChangeReport = [];\n if (changes && changes.get(changesetId)) {\n const changesetData = changes.get(changesetId)['featureMap'];\n const processed = processFeatures(getFeatures(changesetData));\n processed.forEach((featureIDs, tag) =>\n newChangeReport.push([tag, featureIDs])\n );\n setChangeReport(\n newChangeReport.filter(changeType => changeType[1].length)\n );\n }\n }, [changes, changesetId]);\n\n return (\n
      \n
      \n

      \n Other features\n

      \n {changeReport.length ? (\n \n ) : null}\n
      \n {changes.get(changesetId) ? (\n changeReport.length ? (\n changeReport.map((change, k) => (\n \n ))\n ) : (\n No created and deleted features in this changeset.\n )\n ) : (\n \n )}\n
      \n );\n};\n\nexport const OtherFeatures = connect((state: RootStateType, props) => ({\n changes: state.changeset.get('changesetMap')\n}))(OtherFeaturesComponent);\n","// @flow\nimport React, { useState, useEffect } from 'react';\nimport { connect } from 'react-redux';\n\nimport type { RootStateType } from '../store';\nimport { getFeatures, FeatureListItem } from './tag_changes';\nimport { Loading } from '../loading';\nimport { OpenAll } from '../open_all';\nimport { ExpandItemIcon } from '../expand_item_icon';\n\nfunction processFeatures(features) {\n const finalReport = new Map();\n const keys = ['node', 'way', 'relation'];\n keys.map(key =>\n finalReport.set(\n key,\n features\n .filter(item => item[0].properties.action === 'modify')\n .filter(item => item[0].properties.type === key)\n .filter(\n item =>\n JSON.stringify(item[0].geometry) !==\n JSON.stringify(item[1].geometry)\n )\n .map(item => ({ id: item[0].properties.id }))\n )\n );\n return finalReport;\n}\n\nconst GeometryChangesItem = ({ tag, features, opened }) => {\n const titles = { node: 'Nodes', way: 'Ways', relation: 'Relations' };\n const [isOpen, setIsOpen] = useState(opened);\n\n useEffect(() => setIsOpen(opened), [opened]);\n\n return (\n
      \n setIsOpen(!isOpen)}\n >\n \n {titles[tag]}\n \n {features.length}\n \n \n
        \n {features.map((item, k) => (\n \n ))}\n
      \n
      \n );\n};\n\ntype propsType = {|\n changesetId: string,\n changes: Object\n|};\n\nconst GeometryChangesComponent = ({ changesetId, changes }: propsType) => {\n const [changeReport, setChangeReport] = useState([]);\n const [openAll, setOpenAll] = useState(false);\n\n useEffect(() => {\n const newChangeReport = [];\n if (changes && changes.get(changesetId)) {\n const changesetData = changes.get(changesetId)['featureMap'];\n const processed = processFeatures(getFeatures(changesetData));\n processed.forEach((featureIDs, tag) =>\n newChangeReport.push([tag, featureIDs])\n );\n setChangeReport(\n newChangeReport.filter(changeType => changeType[1].length)\n );\n }\n }, [changes, changesetId]);\n\n return (\n
      \n
      \n

      \n Geometry Changes\n

      \n {changeReport.length ? (\n \n ) : null}\n
      \n {changes.get(changesetId) ? (\n changeReport.length ? (\n changeReport.map((change, k) => (\n \n ))\n ) : (\n No geometry changes in this changeset.\n )\n ) : (\n \n )}\n
      \n );\n};\n\nexport const GeometryChanges = connect((state: RootStateType, props) => ({\n changes: state.changeset.get('changesetMap')\n}))(GeometryChangesComponent);\n","import React from 'react';\n\nexport const Box = ({ children, pullDown, pullUp, className, style, bg }) => (\n
      \n \n {children}\n
      \n \n);\n","// @flow\nimport React from 'react';\nimport { Map, List } from 'immutable';\n\nimport { cancelablePromise } from '../../utils/promise';\nimport { postComment } from '../../network/changeset';\nimport { Button } from '../button';\n\ntype propsType = {\n token: string,\n changesetId: number,\n userDetails: Map,\n changesetIsHarmful: boolean,\n discussions: List<*>\n};\n\nexport class CommentForm extends React.PureComponent {\n postCommentPromise;\n\n state = {\n success: false,\n error: false,\n value: ''\n };\n\n componentWillUnmount() {\n this.postCommentPromise && this.postCommentPromise.cancel();\n }\n componentDidMount() {\n this.updateValue(this.props);\n }\n componentWillReceiveProps(nextProps) {\n this.updateValue(nextProps);\n }\n updateValue(props) {\n const userCommentedBefore =\n props.discussions.filter(\n item => item.get('userName') === props.userDetails.get('username')\n ).size > 0;\n if (\n this.state.value === '' &&\n props.changesetIsHarmful !== null &&\n !userCommentedBefore\n ) {\n if (props.changesetIsHarmful) {\n this.setState({ value: props.userDetails.get('message_bad') });\n } else {\n this.setState({ value: props.userDetails.get('message_good') });\n }\n }\n }\n onChange = (event: any) => {\n this.setState({ value: event.target.value });\n if (this.state.error) {\n this.setState({ error: false });\n }\n if (this.state.success) {\n this.setState({ success: false });\n }\n };\n postComment = (comment: string) => {\n if (!comment) return;\n this.postCommentPromise = cancelablePromise(\n postComment(this.props.changesetId, this.props.token, comment)\n );\n this.postCommentPromise.promise\n .then(r => {\n this.setState({ success: true });\n this.setState({ error: false });\n this.setState({ value: '' });\n })\n .catch(e => {\n console.log(e);\n this.setState({ error: true });\n this.setState({ success: false });\n });\n };\n handleSubmit = event => {\n this.postComment(this.state.value);\n };\n render() {\n return (\n
      \n {this.props.token && (\n
      \n {this.state.success && (\n
      \n Comment successfully posted.\n
      \n It will appear on OSMCha after some minutes.\n
      \n )}\n {this.state.error && (\n
      \n It was not possible to post your comment.\n
      \n )}\n
      \n
      \n {\n if (this.clicked) {\n r && r.select();\n this.clicked = false;\n }\n }}\n value={this.state.value}\n onChange={this.onChange}\n />\n
      \n \n
      \n
      \n
      \n
      \n )}\n
      \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { formatDistanceToNow, parse } from 'date-fns';\nimport AnchorifyText from 'react-anchorify-text';\n\nimport AssemblyAnchor from '../assembly_anchor';\nimport { CommentForm } from './comment';\nimport TranslateButton from './translate_button';\nimport { SignInButton } from './sign_in_button';\nimport { UserOSMLink } from './user_osm_link';\n\nclass Discussions extends React.PureComponent {\n props: {\n discussions: List<*>,\n changesetId: number,\n changesetAuthor: string,\n changesetIsHarmful: boolean\n };\n\n renderComments() {\n const { discussions, changesetAuthor } = this.props;\n\n if (discussions.size === 0) {\n return (\n
      \n \n \n \n

      {'No discussions, yet.'}

      \n
      \n );\n } else {\n return (\n
      \n {discussions.map((comment, i) => (\n \n
      \n \n By{' '}\n \n \n {comment.get('user')}\n {' '}\n \n {changesetAuthor === comment.get('user') && (\n (changeset author)\n )}\n \n \n {formatDistanceToNow(\n // eslint-disable-next-line\n parse(\n comment.get('date'),\n \"yyyy-MM-dd'T'HH:mm:ssX\",\n new Date()\n ),\n { addSuffix: true }\n )}\n \n
      \n
      \n

      \n \n \n \n

      \n
      \n
      \n \n
      \n
      \n ))}\n \n );\n }\n }\n render() {\n const {\n discussions,\n changesetId,\n changesetIsHarmful,\n changesetAuthor\n } = this.props;\n\n return (\n
      \n

      \n Discussions \n for changeset by {changesetAuthor}\n

      \n {this.props.token ? (\n this.renderComments()\n ) : (\n
      \n
      \n \n \n \n
      \n
      \n \n
      \n
      \n )}\n {this.props.token && (\n
      \n \n
      \n )}\n
      \n );\n }\n}\n\nDiscussions = connect((state: RootStateType) => ({\n token: state.auth.get('token'),\n userDetails: state.auth.get('userDetails')\n}))(Discussions);\n\nexport { Discussions };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\n\nimport { importChangesetMap } from '../../utils/cmap';\nimport { updateStyle } from '../../store/map_controls_actions';\nimport { Dropdown } from '../dropdown';\n\nclass MapOptions extends React.PureComponent {\n state = {\n actions: true,\n type: true,\n mapStyle: true,\n user: true\n };\n layerOptions = [\n {\n label: 'Mapbox Satellite',\n value: 'satellite',\n function: () => this.toggleSatellite()\n },\n {\n label: 'Mapbox Streets',\n value: 'streets',\n function: () => this.toggleStreet()\n },\n { label: 'Mapbox Dark', value: 'dark', function: () => this.toggleDark() },\n { label: 'Bing', value: 'bing', function: () => this.toggleBing() },\n {\n label: 'OpenStreetMap Carto',\n value: 'carto',\n function: () => this.toggleOsm()\n }\n ];\n getLayerDropdownDisplay = id => {\n const filteredLayer = this.layerOptions.filter(l => l.value === id);\n if (filteredLayer.length) return filteredLayer[0].label;\n return 'Select a style';\n };\n onLayerChange = layer => {\n if (layer && layer.length) {\n layer[0].function();\n this.props.updateStyle(layer[0].value);\n }\n };\n onChange = () => {\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().filterLayers()\n );\n };\n toggleSatellite = () => {\n importChangesetMap('getMapInstance').then(\n r =>\n r &&\n r() &&\n r().renderMap('mapbox://styles/openstreetmap/cjnd8lj0e10i42spfo4nsvoay')\n );\n };\n toggleDark = () => {\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().renderMap('mapbox://styles/mapbox/dark-v9')\n );\n };\n toggleStreet = () => {\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().renderMap('mapbox://styles/mapbox/streets-v9')\n );\n };\n toggleBing = () => {\n const bingStyle = {\n version: 8,\n sources: {\n 'bing-tiles': {\n type: 'raster',\n tiles: [\n 'https://ecn.t0.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=587&mkt=en-gb&n=z',\n 'https://ecn.t1.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=587&mkt=en-gb&n=z',\n 'https://ecn.t2.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=587&mkt=en-gb&n=z',\n 'https://ecn.t3.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=587&mkt=en-gb&n=z'\n ],\n attribution:\n '© Microsoft Corporation'\n }\n },\n layers: [\n {\n id: 'bing',\n type: 'raster',\n source: 'bing-tiles',\n minzoom: 0,\n maxzoom: 22\n }\n ]\n };\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().renderMap(bingStyle)\n );\n };\n toggleOsm = () => {\n const osmStyle = {\n version: 8,\n sources: {\n 'osm-tiles': {\n type: 'raster',\n tiles: [\n 'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png',\n 'https://b.tile.openstreetmap.org/{z}/{x}/{y}.png',\n 'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png'\n ],\n tileSize: 256,\n attribution:\n '© OpenStreetMap contributors'\n }\n },\n layers: [\n {\n id: 'osm',\n type: 'raster',\n source: 'osm-tiles',\n minzoom: 0,\n maxzoom: 22\n }\n ]\n };\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().renderMap(osmStyle)\n );\n };\n render() {\n return (\n
      \n

      Map Controls

      \n
      \n
      Filter by actions
      \n\n
        \n
      • \n \n
      • \n
      • \n \n
      • \n
      • \n \n
      • \n
      \n
      \n
      \n
      Filter by type
      \n
        \n
      • \n \n
      • \n
      • \n \n
      • \n
      • \n \n
      • \n
      \n
      \n
      \n
      Map style
      \n {}}\n onRemove={() => {}}\n options={this.layerOptions}\n onChange={this.onLayerChange}\n display={this.getLayerDropdownDisplay(this.props.style)}\n position=\"left\"\n />\n
      \n
      \n );\n }\n}\n\nMapOptions = connect(\n (state: RootStateType, props) => ({ style: state.mapControls.get('style') }),\n { updateStyle }\n)(MapOptions);\n\nexport { MapOptions };\n","import React from 'react';\n\nexport function Control({ active, onClick, children, className }: Object) {\n return (\n \n {children}\n \n );\n}\n","// @flow\n\nexport const FILTER_BINDING = {\n label: 'FILTER_BINDING',\n bindings: ['\\\\']\n};\nexport const HELP_BINDING = {\n label: 'HELP_BINDING',\n bindings: ['/', '?']\n};\nexport const NEXT_CHANGESET = {\n label: 'NEXT_CHANGESET',\n bindings: ['down', 'right']\n};\nexport const PREV_CHANGESET = {\n label: 'PREV_CHANGESET',\n bindings: ['up', 'left']\n};\nexport const REFRESH_CHANGESETS = {\n label: 'REFRESH_CHANGESETS',\n bindings: ['R', 'r']\n};\nexport const CHANGESET_DETAILS_SHOW_ALL = {\n label: 'CHANGESET_DETAILS_SHOW_ALL',\n bindings: ['0']\n};\nexport const CHANGESET_DETAILS_DETAILS = {\n label: 'CHANGESET_DETAILS_DETAILS',\n bindings: ['1']\n};\nexport const CHANGESET_DETAILS_SUSPICIOUS = {\n label: 'CHANGESET_DETAILS_SUSPICIOUS',\n bindings: ['2']\n};\nexport const CHANGESET_DETAILS_TAGS = {\n label: 'CHANGESET_DETAILS_TAGS',\n bindings: ['3']\n};\nexport const CHANGESET_DETAILS_GEOMETRY_CHANGES = {\n label: 'CHANGESET_DETAILS_GEOMETRY_CHANGES',\n bindings: ['4']\n};\nexport const CHANGESET_DETAILS_OTHER_FEATURES = {\n label: 'CHANGESET_DETAILS_OTHER_FEATURES',\n bindings: ['5']\n};\nexport const CHANGESET_DETAILS_DISCUSSIONS = {\n label: 'CHANGESET_DETAILS_DISCUSSIONS',\n bindings: ['6']\n};\nexport const CHANGESET_DETAILS_USER = {\n label: 'CHANGESET_DETAILS_USER',\n bindings: ['7']\n};\nexport const CHANGESET_DETAILS_MAP = {\n label: 'CHANGESET_DETAILS_MAP',\n bindings: ['8']\n};\nexport const VERIFY_GOOD = {\n label: 'VERIFY_GOOD',\n bindings: ['G', 'g']\n};\nexport const VERIFY_BAD = {\n label: 'VERIFY_BAD',\n bindings: ['B', 'b']\n};\nexport const VERIFY_CLEAR = {\n label: 'VERIFY_CLEAR',\n bindings: ['C', 'c', 'u', 'U']\n};\nexport const OPEN_IN_JOSM = {\n label: 'OPEN_IN_JOSM',\n bindings: ['J', 'j']\n};\nexport const OPEN_IN_ID = {\n label: 'OPEN_IN_ID',\n bindings: ['I', 'i']\n};\nexport const OPEN_IN_OSM = {\n label: 'OPEN_IN_OSM',\n bindings: ['O', 'o']\n};\nexport const OPEN_IN_LEVEL0 = {\n label: 'OPEN_IN_LEVEL0',\n bindings: ['L', 'l']\n};\nexport const OPEN_IN_ACHAVI = {\n label: 'OPEN_IN_ACHAVI',\n bindings: ['V', 'v']\n};\nexport const OPEN_IN_HDYC = {\n label: 'OPEN_IN_HDYC',\n bindings: ['H', 'h']\n};\nexport const FILTER_BY_USER = {\n label: 'FILTER_BY_USER',\n bindings: ['A', 'a']\n};\n","import React from 'react';\n\nimport { Control } from './control';\nimport { Floater } from './floater';\n\nimport {\n CHANGESET_DETAILS_DETAILS,\n CHANGESET_DETAILS_SUSPICIOUS,\n CHANGESET_DETAILS_TAGS,\n CHANGESET_DETAILS_GEOMETRY_CHANGES,\n CHANGESET_DETAILS_OTHER_FEATURES,\n CHANGESET_DETAILS_USER,\n CHANGESET_DETAILS_DISCUSSIONS,\n CHANGESET_DETAILS_MAP\n} from '../../config/bindings';\n\nexport function ControlLayout({\n bindingsState,\n features,\n discussions,\n toggleDetails,\n toggleFeatures,\n toggleOtherFeatures,\n toggleGeometryChanges,\n toggleTags,\n toggleDiscussions,\n toggleUser,\n toggleMapOptions\n}) {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n","// @flow\nimport React from 'react';\nimport Mousetrap from 'mousetrap';\nimport { Map } from 'immutable';\n\nimport { getDisplayName } from '../utils/component';\n\ntype stateType = {\n bindings: Map,\n lastKeyStroke: Map\n};\n\n/**\n * @param exclusive - flag to toggle one key and switch off all other keys\n * @prop `bindingsState` - immutable Map containing toggleState(true/false) for each of the bindings. \n * @prop `lastKeyStroke` - immutable Map containg the state of last key pressed only.\n */\nexport function keyboardToggleEnhancer(\n exclusive: boolean,\n bindings: Array<{ label: string, bindings: Array }>,\n WrappedComponent: Class>\n): Class> {\n return class wrapper extends React.PureComponent {\n static displayName = `HOCKeyboard${getDisplayName(WrappedComponent)}`;\n\n state = {\n bindings: Map(),\n lastKeyStroke: Map()\n };\n componentDidMount() {\n bindings.forEach(item =>\n Mousetrap.bind(item.bindings, (e: Event) => {\n e.preventDefault();\n if (exclusive) {\n return this.exclusiveKeyToggle(item.label);\n }\n this.toggleKey(item.label);\n })\n );\n }\n\n componentWillUnmount() {\n // unbind all bindings\n bindings.forEach(item =>\n item.bindings.forEach(b => {\n Mousetrap.unbind(b);\n })\n );\n }\n\n // allow toggling the state of a particular key\n toggleKey = (label: string) => {\n let prev = this.state.bindings;\n let lastKeyStroke = Map().set(label, !prev.get(label));\n prev = prev.set(label, !prev.get(label));\n this.setState({\n bindings: prev,\n lastKeyStroke\n });\n };\n\n // exclusively toggle this label and switch off others\n exclusiveKeyToggle = (label: string) => {\n let newBindingState = Map();\n const prevBindingValue = this.state.bindings.get(label);\n newBindingState = newBindingState.set(label, !prevBindingValue);\n this.setState({\n bindings: newBindingState,\n lastKeyStroke: newBindingState // will be same as state.bindings as size=1\n });\n };\n\n render() {\n return (\n \n );\n }\n };\n}\n","// @flow\nimport React from 'react';\nimport { Map, fromJS } from 'immutable';\nimport debounce from 'lodash.debounce';\nimport { getDisplayName } from '../utils/component';\n\ntype stateType = {\n data: Map\n};\n\n/**\n * @desc If any network request fails it silents it \n * It also sets state on first come first serve basis.\n * @param onUpdate - decides whether to do the network calls on not\n */\nexport function withFetchDataSilent(\n dataToFetch: (props: P) => Object,\n onUpdate: (P, P) => boolean,\n WrappedComponent: Class>\n): Class> {\n return class FetchDataEnhancer extends React.PureComponent<\n void,\n P,\n stateType\n > {\n static displayName = `HOCFetchData${getDisplayName(WrappedComponent)}`;\n state = {\n data: Map()\n };\n fetchedData: Object;\n initFetching: (props: P) => void;\n constructor(props) {\n super(props);\n this.initFetching = debounce(this._initFetching, 500);\n }\n componentDidMount() {\n this.initFetching(this.props);\n }\n componentWillReceiveProps(nextProps: P) {\n if (onUpdate(nextProps, this.props)) {\n this.initFetching(nextProps);\n }\n }\n _initFetching = (props: P) => {\n this.fetchedData = dataToFetch(props);\n // iterate through all of cancelable promises, one for each api request\n Object.keys(this.fetchedData).forEach(k => {\n var prom = this.fetchedData[k];\n prom.promise\n .then(x => {\n let data = this.state.data;\n data = data.set(k, fromJS(x));\n this.setState({ data });\n })\n .catch(e => console.error(e));\n });\n };\n reloadData = () => {\n this.initFetching(this.props);\n };\n componentWillUnmount() {\n this.fetchedData &&\n Object.keys(this.fetchedData).forEach(k => {\n this.fetchedData[k] && this.fetchedData[k].cancel();\n });\n }\n render() {\n return (\n \n );\n }\n };\n}\n","import { fromJS, Map } from 'immutable';\nimport { apiOSM } from '../config/constants';\nimport { API_URL } from '../config';\n\nexport function getUserDetails(uid: number, token: string): Map<'string', *> {\n const user = { uid: uid };\n const fromOSM = fetch(`${apiOSM}/user/${uid}.json`, {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' }\n })\n .then(r => r.json())\n .then(r => {\n const u = r.user;\n user.count = u.changesets.count;\n user.accountCreated = u.account_created;\n user.description = u.description;\n user.img = u.img && u.img.href;\n user.name = u.display_name;\n return fromJS(user);\n })\n .catch(e => user);\n\n const fromOSMCha = fetch(`${API_URL}/user-stats/${uid}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(r => r.json())\n .then(r => fromJS(r))\n .catch(e => new Map());\n\n return Promise.all([fromOSMCha, fromOSM]).then(([r1, r2]) => r1.merge(r2));\n}\n","import { whosThat } from '../config/constants';\nimport { handleErrors } from './aoi';\n\nexport function getUsers(input): Promise<*> {\n return fetch(`${whosThat}${input}`, {\n method: 'GET'\n })\n .then(handleErrors)\n .then(response => {\n return response.json();\n });\n}\n","// @flow\nimport { Map, List, fromJS } from 'immutable';\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport CSSGroup from 'react-transition-group/CSSTransitionGroup';\n\nimport { cancelablePromise } from '../../utils/promise';\nimport { Floater } from './floater';\nimport { Header } from './header';\nimport { User } from './user';\nimport { Features } from './features';\nimport { TagChanges } from './tag_changes';\nimport { OtherFeatures } from './other_features';\nimport { GeometryChanges } from './geometry_changes';\nimport { Box } from './box';\nimport { Discussions } from './discussions';\nimport { MapOptions } from './map_options';\nimport { ControlLayout } from './control_layout';\nimport { keyboardToggleEnhancer } from '../keyboard_enhancer';\nimport { withFetchDataSilent } from '../fetch_data_enhancer';\nimport { getUserDetails } from '../../network/openstreetmap';\nimport { getUsers } from '../../network/whosthat';\nimport {\n CHANGESET_DETAILS_DETAILS,\n CHANGESET_DETAILS_SUSPICIOUS,\n CHANGESET_DETAILS_TAGS,\n CHANGESET_DETAILS_GEOMETRY_CHANGES,\n CHANGESET_DETAILS_OTHER_FEATURES,\n CHANGESET_DETAILS_USER,\n CHANGESET_DETAILS_DISCUSSIONS,\n CHANGESET_DETAILS_MAP\n} from '../../config/bindings';\n\n// | denote strict props\ntype propsType = {|\n changesetId: number,\n currentChangeset: Map,\n // The props below come from HOCs, they are not optional!\n // to circumvent the $Diff bug ref: https://github.com/facebook/flow/issues/1601\n // have to make them optional for flow to not throw error.\n data?: Map,\n bindingsState?: Map,\n exclusiveKeyToggle?: (label: string) => any\n|};\n\n// presentational component for view/changeset.js\nexport class _Changeset extends React.PureComponent<*, propsType, *> {\n getUserDetailsPromise;\n getWhosThatPromise;\n\n state = {\n userDetails: null,\n whosThat: null\n };\n\n static defaultProps = {\n data: Map()\n };\n componentDidMount() {\n this.toggleDetails();\n }\n componentDidUpdate(prevProps) {\n if (\n !prevProps.currentChangeset.getIn(['properties', 'uid']) &&\n this.props.currentChangeset.getIn(['properties', 'uid'])\n ) {\n this.getUserDetailsPromise = cancelablePromise(\n getUserDetails(\n this.props.currentChangeset.getIn(['properties', 'uid'], null),\n this.props.token\n )\n );\n this.getUserDetailsPromise.promise\n .then(r => {\n this.setState({ userDetails: r });\n })\n .catch(e => console.log(e));\n\n this.getWhosThatPromise = cancelablePromise(\n getUsers(this.props.currentChangeset.getIn(['properties', 'uid'], ''))\n );\n this.getWhosThatPromise.promise\n .then(r => {\n this.setState({ whosThat: List(r[0].names) });\n })\n .catch(e => console.log(e));\n }\n }\n showFloaters = () => {\n const { changesetId, currentChangeset, bindingsState, data } = this.props;\n if (!bindingsState || !data) return;\n const properties = currentChangeset.get('properties');\n return (\n \n {bindingsState.get(CHANGESET_DETAILS_DETAILS.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_SUSPICIOUS.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_TAGS.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_GEOMETRY_CHANGES.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_OTHER_FEATURES.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_DISCUSSIONS.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_USER.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_MAP.label) && (\n \n \n \n )}\n \n );\n };\n\n toggleFeatures = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_SUSPICIOUS.label);\n };\n toggleOtherFeatures = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_OTHER_FEATURES.label);\n };\n toggleTags = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_TAGS.label);\n };\n toggleGeometryChanges = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_GEOMETRY_CHANGES.label);\n };\n toggleDiscussions = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_DISCUSSIONS.label);\n };\n toggleDetails = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_DETAILS.label);\n };\n toggleUser = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_USER.label);\n };\n toggleMapOptions = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_MAP.label);\n };\n\n render() {\n const { bindingsState, currentChangeset } = this.props;\n const features = currentChangeset.getIn(['properties', 'features']);\n return (\n
      \n \n \n {this.showFloaters()}\n \n
      \n );\n }\n}\n\nlet Changeset = keyboardToggleEnhancer(\n true,\n [\n CHANGESET_DETAILS_DETAILS,\n CHANGESET_DETAILS_SUSPICIOUS,\n CHANGESET_DETAILS_TAGS,\n CHANGESET_DETAILS_GEOMETRY_CHANGES,\n CHANGESET_DETAILS_OTHER_FEATURES,\n CHANGESET_DETAILS_USER,\n CHANGESET_DETAILS_DISCUSSIONS,\n CHANGESET_DETAILS_MAP\n ],\n _Changeset\n);\n\n/**\n * Never use props not required by the Basecomponent in HOCs\n */\nChangeset = withFetchDataSilent(\n (props: propsType) => ({\n userDetails: cancelablePromise(\n getUserDetails(\n props.currentChangeset.getIn(['properties', 'uid'], null),\n props.token\n )\n ),\n whosThat: cancelablePromise(\n getUsers(props.currentChangeset.getIn(['properties', 'uid'], ''))\n )\n }),\n (nextProps: propsType, props: propsType) =>\n props.changesetId !== nextProps.changesetId,\n Changeset\n);\n\nChangeset = connect((state: RootStateType, props) => ({\n token: state.auth.get('token'),\n osmInfo: fromJS(state.changeset.getIn(['changesetMap', props.changesetId]))\n}))(Changeset);\n\nexport { Changeset };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map, fromJS } from 'immutable';\nimport Mousetrap from 'mousetrap';\n\nimport { Changeset as ChangesetDumb } from '../components/changeset';\n\nimport { dispatchEvent } from '../utils/dispatch_event';\n\nimport { applyFilters } from '../store/filters_actions';\nimport { FILTER_BY_USER } from '../config/bindings';\nimport type { RootStateType } from '../store';\n\nclass Changeset extends React.PureComponent {\n props: {\n errorChangeset: ?Object, // error of the latest that changeset failed\n location: Object,\n loading: boolean, // loading of the selected changesetId\n currentChangeset?: Map,\n changesetId: number,\n token: string,\n applyFilters: (Map) => mixed // base 0\n };\n componentDidMount() {\n Mousetrap.bind(FILTER_BY_USER.bindings, this.filterChangesetsByUser);\n }\n componentWillUnmount() {\n FILTER_BY_USER.bindings.forEach(k => Mousetrap.unbind(k));\n }\n filterChangesetsByUser = () => {\n if (this.props.currentChangeset) {\n const userName = this.props.currentChangeset.getIn([\n 'properties',\n 'user'\n ]);\n this.props.applyFilters(\n new Map().set(\n 'users',\n fromJS([\n {\n label: userName,\n value: userName\n }\n ])\n )\n );\n }\n };\n showChangeset = () => {\n const {\n loading,\n errorChangeset,\n currentChangeset,\n changesetId,\n token\n } = this.props;\n\n if (loading || !currentChangeset) {\n return null;\n }\n\n if (errorChangeset) {\n dispatchEvent('showToast', {\n title: `changeset:${changesetId} failed to load`,\n content: 'Try reloading osmcha',\n timeOut: 5000,\n type: 'error'\n });\n console.error(errorChangeset);\n return null;\n }\n return (\n \n );\n };\n render() {\n return (\n
      \n
      \n {this.showChangeset()}\n
      \n
      \n );\n }\n}\n\nChangeset = connect(\n (state: RootStateType, props) => ({\n changeset: state.changeset,\n location: props.location,\n changesetId: parseInt(props.match.params.id, 10),\n currentChangeset: state.changeset.getIn([\n 'changesets',\n parseInt(props.match.params.id, 10)\n ]),\n errorChangeset: state.changeset.get('errorChangeset'),\n loading: state.changeset.get('loading'),\n token: state.auth.get('token')\n }),\n { applyFilters }\n)(Changeset);\n\nexport { Changeset };\n","// @flow\nimport React from 'react';\nimport showdown from 'showdown';\nimport { cancelablePromise } from '../utils/promise';\nimport { appVersion, isDev, isStaging, isLocal } from '../config';\n\nconst converter = new showdown.Converter({\n ghCompatibleHeaderId: true,\n extensions: formatMarkdown()\n});\n\nconverter.setFlavor('github');\nconverter.setOption('simpleLineBreaks', false);\n\nfunction formatMarkdown() {\n return [\n {\n type: 'output',\n regex: /a href=/g,\n replace: 'a class=\"link\" href='\n },\n {\n type: 'output',\n regex: /\\

      /g,\n replace: '
        '\n },\n {\n type: 'output',\n regex: /\\/g,\n replace: '
      • '\n },\n {\n type: 'output',\n regex: /img src=/g,\n replace: `img\n class=\"py12 my12 border border--gray-light border--2\"\n style=\"margin-left: auto;\n margin-right: auto;\n display: block;\n \" src=`\n }\n ];\n}\n\nexport class About extends React.PureComponent {\n state = {\n about: null\n };\n cancellablePromise = null;\n componentDidMount() {\n this.cancellablePromise = cancelablePromise(\n fetch(\n 'https://raw.githubusercontent.com/mapbox/osmcha-frontend/master/ABOUT.md'\n ).then(r => r.text())\n );\n this.cancellablePromise.promise\n .then(markdown => this.setState({ about: converter.makeHtml(markdown) }))\n .catch(e => {});\n }\n componentWillUnmount() {\n this.cancellablePromise && this.cancellablePromise.cancel();\n }\n render() {\n return (\n
        \n
        \n OSMCha Version {appVersion}\n {isDev && ' Dev'}\n {isLocal && ' Local'}\n {isStaging && ' Staging'}\n
        \n \n
        \n );\n }\n}\n","import React from 'react';\n\nexport const Stats = () =>
        stats here
        ;\n","// @flow\nimport React from 'react';\nimport Select from 'react-select';\nimport { fromJS } from 'immutable';\nimport type { filterType } from './';\n\nexport class Radio extends React.PureComponent {\n props: {\n name: string,\n display: string,\n type: string,\n placeholder: string,\n options: Array,\n value: filterType,\n onChange: (string, value?: filterType) => any\n };\n onChangeLocal = (data: Object) => {\n if (!data || data.value === '') {\n return this.props.onChange(this.props.name); // always sends 1 size array to keep things consistent with multiselect InputTypes\n }\n this.props.onChange(this.props.name, fromJS([data])); // always sends 1 size array to keep things consistent with multiselect InputTypes\n };\n render() {\n const { name, options, placeholder, value } = this.props;\n return (\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { fromJS } from 'immutable';\nimport type { filterType } from './';\n\nexport class Text extends React.Component {\n props: {\n name: string,\n display: string,\n type: string,\n placeholder: string,\n value: filterType,\n className: string,\n onChange: (string, value?: filterType) => any,\n min: ?string,\n max: ?string\n };\n static defaultProps = {\n className: ''\n };\n state = {\n isValid: true\n };\n handleFormChange = (event: any) => {\n const target = event.target;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n const name = target.name;\n this.setState({ isValid: target.validity.valid });\n if (!value || value === '') {\n return this.props.onChange(name);\n }\n this.props.onChange(\n name,\n fromJS([\n // allways sends 1 size array to keep things consistent\n {\n label: value,\n value\n }\n ])\n );\n };\n render() {\n const {\n name,\n type,\n placeholder,\n display,\n value,\n className,\n min,\n max\n } = this.props;\n const { isValid } = this.state;\n const errorClass = 'border border--1 border--red';\n return (\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { fromJS } from 'immutable';\nimport { Creatable, Async } from 'react-select';\nimport { API_URL } from '../../config';\nimport type { filterType } from './';\n\nexport class MultiSelect extends React.PureComponent {\n props: {\n name: string,\n display: string,\n value: filterType,\n type: string,\n placeholder: string,\n options: Array,\n dataURL: ?string,\n onChange: (string, value?: filterType) => any,\n showAllToggle: boolean,\n token: string\n };\n state = {\n allToggle: this.props.name.slice(0, 4) === 'all_'\n };\n getAsyncOptions = () => {\n if (!this.props.dataURL) return;\n return fetch(`${API_URL}/${this.props.dataURL}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: this.props.token ? `Token ${this.props.token}` : ''\n }\n })\n .then(response => {\n return response.json();\n })\n .then(json => {\n const data = json\n .filter(d => d.for_changeset)\n .map(d => ({ ...d, label: d.name, value: d.id }));\n return { options: data };\n });\n };\n onChangeLocal = (data: ?Array) => {\n if (!Array.isArray(data)) return;\n this.sendData(this.state.allToggle, data);\n };\n sendData = (allToggle: boolean, data: Array) => {\n let name =\n this.props.name.slice(0, 4) === 'all_'\n ? this.props.name.slice(4)\n : this.props.name;\n\n name = `${allToggle ? 'all_' : ''}${name}`;\n if (data.length === 0) return this.props.onChange(name);\n var processed = data.map(o => ({ label: o.label, value: o.value })); // remove any bogus keys\n this.props.onChange(name, fromJS(processed));\n };\n renderSelect = () => {\n const { name, options, placeholder, value, display, dataURL } = this.props;\n if (dataURL)\n return (\n `Add ${label} to ${display}`}\n name={name}\n className=\"\"\n value={value && value.toJS()}\n loadOptions={this.getAsyncOptions}\n onChange={this.onChangeLocal} // have to add an identifier for filter name\n placeholder={placeholder}\n />\n );\n return (\n `Add ${label} to ${display}`}\n name={name}\n value={value && value.toJS()}\n options={options}\n onChange={this.onChangeLocal}\n placeholder={placeholder}\n />\n );\n };\n handleToggle = (e: Event) => {\n let { value } = this.props;\n value = value && value.toJS();\n if (value) {\n this.sendData(!this.state.allToggle, value);\n }\n this.setState({\n allToggle: !this.state.allToggle\n });\n };\n render() {\n return (\n
        \n {this.props.showAllToggle && (\n \n \n
        \n \n \n
        \n
        \n
        \n )}\n {this.renderSelect()}\n
        \n );\n }\n}\n\nexport class MappingTeamMultiSelect extends MultiSelect {\n getAsyncOptions = () => {\n if (!this.props.dataURL) return;\n return fetch(`${API_URL}/${this.props.dataURL}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: this.props.token ? `Token ${this.props.token}` : ''\n }\n })\n .then(response => {\n return response.json();\n })\n .then(json => {\n const data = json.map(d => {\n if (d.trusted) {\n return { ...d, label: `${d.name} (verified)`, value: d.name };\n } else {\n return {\n ...d,\n label: d.name.replace('(verified)', ''),\n value: d.name\n };\n }\n });\n return { options: data };\n });\n };\n sendData = (allToggle: boolean, data: Array) => {\n let name =\n this.props.name.slice(0, 4) === 'all_'\n ? this.props.name.slice(4)\n : this.props.name;\n\n name = `${allToggle ? 'all_' : ''}${name}`;\n if (data.length === 0) return this.props.onChange(name);\n var processed = data.map(o => ({ label: o.label, value: o.value })); // remove any bogus keys\n this.props.onChange(name, fromJS(processed));\n };\n}\n","import { nominatimUrl } from '../config/constants';\nimport { handleErrors } from './aoi';\n\nexport function nominatimSearch(input, type): Promise<*> {\n return fetch(\n `${nominatimUrl}?polygon_geojson=1&format=json&${type}=${input}`,\n {\n method: 'GET'\n }\n )\n .then(handleErrors)\n .then(response => {\n return response.json();\n });\n}\n","// @flow\nimport React from 'react';\nimport { fromJS } from 'immutable';\nimport debounce from 'lodash.debounce';\nimport { Async } from 'react-select';\nimport Select from 'react-select';\n\nimport area from '@turf/area';\nimport bbox from '@turf/bbox';\nimport simplify from '@turf/simplify';\nimport truncate from '@turf/truncate';\nimport MapboxDraw from '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw';\n\nimport { nominatimSearch } from '../../network/nominatim';\nimport { mapboxAccessToken } from '../../config/constants';\nimport { importChangesetMap } from '../../utils/cmap';\n\nexport class LocationSelect extends React.PureComponent {\n props: {\n name: string,\n display: string,\n value: Object,\n type: string,\n placeholder: string,\n options: Array,\n onChange: (string, value: Object) => any\n };\n state = {\n geometry: Object,\n location: '',\n queryType: 'q',\n lastSearch: new Date()\n };\n queryTypeOptions = [\n { value: 'q', label: 'Any' },\n { value: 'city', label: 'City' },\n { value: 'county', label: 'County' },\n { value: 'state', label: 'State' },\n { value: 'country', label: 'Country' }\n ];\n map = null;\n draw = null;\n\n updateMap(data) {\n if (this.map.getSource('feature')) {\n this.map.getSource('feature').setData(data);\n } else {\n this.map.addSource('feature', {\n type: 'geojson',\n data: {\n type: 'Feature',\n geometry: data\n }\n });\n }\n if (this.map.getLayer('geometry') === undefined) {\n this.map.addLayer({\n id: 'geometry',\n type: 'fill',\n source: 'feature',\n paint: {\n 'fill-color': '#088',\n 'fill-opacity': 0.6\n }\n });\n }\n this.setState({ geometry: data });\n this.props.onChange(\n this.props.name,\n fromJS([{ label: data, value: data }])\n );\n const geom_bbox = bbox(data);\n this.map.fitBounds([geom_bbox.slice(0, 2), geom_bbox.slice(2)], {\n padding: 20\n });\n }\n\n componentDidMount() {\n importChangesetMap('getGL').then((getGL: any) => {\n if (getGL) {\n var mapboxgl = getGL();\n mapboxgl.accessToken = mapboxAccessToken;\n const map = new mapboxgl.Map({\n container: 'geometry-map',\n style: 'mapbox://styles/mapbox/light-v9'\n });\n this.map = map;\n this.draw = new MapboxDraw({\n displayControlsDefault: false,\n controls: {\n polygon: true\n }\n });\n map.addControl(this.draw);\n\n map.on('draw.create', this.drawingUpdate);\n map.on('draw.modechange', this.clearBeforeDraw);\n map.on('draw.delete', this.drawingUpdate);\n map.on('draw.update', this.drawingUpdate);\n map.on('style.load', () => {\n try {\n this.updateMap(\n this.props.value\n .get('0')\n .get('value')\n .toJS()\n );\n } catch (e) {\n if (e instanceof TypeError) {\n }\n }\n });\n }\n });\n }\n\n clearBeforeDraw = e => {\n if (e.mode === 'draw_polygon') {\n this.clearMap();\n this.draw.changeMode('draw_polygon');\n }\n };\n clearMap = () => {\n this.draw.deleteAll();\n this.props.onChange(this.props.name, null);\n if (this.map.getSource('feature')) {\n this.map.getSource('feature').setData({});\n }\n if (this.map.getLayer('geometry')) {\n this.map.removeLayer('geometry');\n }\n };\n drawingUpdate = e => {\n const drawingData = this.draw.getAll();\n if (\n drawingData &&\n drawingData.features.length &&\n drawingData.features[0].geometry\n ) {\n this.updateMap(\n truncate(drawingData.features[0].geometry, {\n precision: 6,\n coordinates: 2\n })\n );\n } else {\n this.clearMap();\n }\n };\n\n getAsyncOptions = (input: string, cb: (e: ?Error, any) => void) => {\n if (input.length >= 3) {\n return nominatimSearch(input, this.state.queryType)\n .then(json => {\n if (!Array.isArray(json)) return cb(null, { options: [] });\n\n const data = json.map(d => ({\n label: d.display_name,\n value: d.geojson\n }));\n return cb(null, { options: data });\n })\n .catch(e => cb(e, null));\n } else {\n return cb(null, { options: [] });\n }\n };\n onChangeLocal = (data: ?Array) => {\n if (data) {\n this.draw.deleteAll();\n const tolerance = area(data.value) / 10 ** 6 < 1000 ? 0.01 : 0.1;\n const simplified_bounds = simplify(data.value, {\n tolerance: tolerance,\n highQuality: true\n });\n this.updateMap(\n truncate(simplified_bounds, { precision: 6, coordinates: 2 })\n );\n }\n };\n handleQueryTypeChange = value => {\n this.setState({ queryType: value });\n };\n renderSelect = () => {\n const { name, placeholder, value } = this.props;\n return (\n this.getAsyncOptions(input, cb),\n 500\n )}\n onChange={this.onChangeLocal}\n placeholder={placeholder}\n />\n );\n };\n render() {\n return (\n
        \n
        \n
        \n \n
        \n
        {this.renderSelect()}
        \n
        \n
        \n
        \n
        \n \n Clear All\n \n
        \n
        \n
        \n
        \n );\n }\n}\n","import React from 'react';\nimport CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';\nimport { isMobile } from '../../utils';\n\nexport function Wrapper({\n display,\n children,\n description,\n handleFocus = () => {},\n name,\n hasValue\n}) {\n const mobile = isMobile();\n\n return (\n handleFocus(name)}\n onFocus={() => handleFocus(name)}\n >\n
        \n \n {hasValue && (\n \n \n \n )}\n \n {display} \n
        \n
        \n \n {children}\n \n {!mobile && (\n \n \n \n {description && (\n \n {description}\n \n )}\n \n \n \n )}\n
        \n \n );\n}\n","// @flow\nimport React from 'react';\nimport { Map, fromJS } from 'immutable';\nimport Select from 'react-select';\nimport type { filtersType } from './';\n\nexport class Meta extends React.PureComponent {\n options: Array<*>;\n props: {\n placeholder: string,\n name: string,\n activeFilters: filtersType,\n metaOf: Array,\n options: Array,\n replaceFiltersState: filtersType => void\n };\n handleChange = (data: Object) => {\n let { activeFilters } = this.props;\n if (!activeFilters) activeFilters = new Map();\n this.props.metaOf.forEach(f => {\n activeFilters = activeFilters.delete(f);\n });\n if (data && data.value) {\n activeFilters = activeFilters.merge(fromJS(data.value));\n }\n this.props.replaceFiltersState(activeFilters);\n };\n findCurrentValue = () => {\n const { activeFilters } = this.props;\n let value;\n if (activeFilters) {\n activeFilters.forEach((v, k) => {\n this.props.options.forEach(option => {\n if (\n Object.keys(option.value)[0] === k &&\n v.getIn([0, 'value']) === option.value[k][0].value\n ) {\n value = option;\n }\n });\n });\n }\n return value;\n };\n render() {\n const { name, placeholder } = this.props;\n let value = this.findCurrentValue();\n return (\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { fromJS } from 'immutable';\nimport DatePicker from 'react-datepicker';\nimport { format, parse } from 'date-fns';\nimport type { filterType } from './';\n\nimport 'react-datepicker/dist/react-datepicker.css';\n\nexport class DateField extends React.Component {\n props: {\n name: string,\n display: string,\n type: string,\n placeholder: string,\n value: filterType,\n className: string,\n onChange: (string, value?: filterType) => any,\n min: ?string,\n max: ?string\n };\n static defaultProps = {\n className: ''\n };\n handleDateChange = date => {\n const name = this.props.name;\n if (date) {\n const value = format(date, 'yyyy-MM-dd');\n this.props.onChange(\n name,\n fromJS([\n // allways sends 1 size array to keep things consistent\n {\n label: value,\n value\n }\n ])\n );\n } else {\n this.props.onChange(name);\n }\n };\n render() {\n const { placeholder, display, value, className, min, max } = this.props;\n const hasValue = value && value.getIn([0, 'value']);\n return (\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport debounce from 'lodash.debounce';\nimport { fromJS } from 'immutable';\n\nimport { mapboxAccessToken } from '../config/constants';\nimport { importChangesetMap } from '../utils/cmap';\n\nexport class BBoxPicker extends React.Component {\n update = debounce(() => {\n if (!this.map) return;\n let bounds: {\n getSouth: () => number,\n getWest: () => number,\n getNorth: () => number,\n getEast: () => number\n } =\n this.map && this.map.getBounds(); // ne, sw / lat, lng\n\n let s = bounds.getSouth().toFixed(4);\n let w = bounds.getWest().toFixed(4);\n let n = bounds.getNorth().toFixed(4);\n let e = bounds.getEast().toFixed(4);\n let wsen = [w, s, e, n].join(',');\n this.props.onChange(\n this.props.name,\n fromJS([\n {\n label: wsen,\n value: wsen\n }\n ])\n );\n }, 600);\n\n map = null;\n componentDidMount() {\n importChangesetMap('getGL').then((getGL: any) => {\n if (getGL) {\n var mapboxgl = getGL();\n mapboxgl.accessToken = mapboxAccessToken;\n if (this.props.value) {\n // let bbox = this.props.value.getIn(['0', 'value'], '').split(',');\n }\n const map = new mapboxgl.Map({\n container: 'map',\n style: 'mapbox://styles/mapbox/light-v9'\n });\n map.on('dragend', this.update);\n map.on('zoomend', this.update);\n map.on('touchend', this.update);\n this.map = map;\n }\n });\n }\n componentWillUnmount() {\n this.map && this.map.remove();\n }\n clearBbox = () => {\n this.props.onChange(this.props.name, null);\n };\n\n render() {\n return (\n
        \n \n Clear\n
        \n
        \n
        \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { Loading } from './loading';\n\ntype propTypes = {\n loading: boolean\n};\n\nexport function loadingEnhancer(\n WrappedComponent: Class>\n): Class> {\n return class PureRendered extends React.PureComponent<\n void,\n P & propTypes,\n *\n > {\n render() {\n return this.props.loading\n ? \n : ;\n }\n };\n}\n","// @flow\nimport React from 'react';\n\nimport {\n Text,\n Radio,\n MappingTeamMultiSelect,\n MultiSelect,\n Wrapper,\n Meta,\n DateField,\n LocationSelect\n} from './';\n\nimport { BBoxPicker } from '../bbox_picker';\nimport { loadingEnhancer } from '../loading_enhancer';\nimport filters from '../../config/filters.json';\nimport { getDefaultFromDate } from '../../utils/filters';\nimport type { filterType, filtersType } from './';\n\nconst defaultDate = getDefaultFromDate().getIn(['date__gte']);\n\nvar filtersData = filters.filter(f => {\n return !f.ignore;\n});\ntype propsType = {|\n filters: filtersType,\n loading: boolean,\n active: string,\n token: string,\n handleChange: (name: string, values?: filterType) => void,\n handleFocus: (name: string) => void,\n replaceFiltersState: (filters: filtersType) => void,\n handleToggleAll: (name: string, values?: filterType) => void\n|};\nclass FiltersList extends React.PureComponent {\n renderFilters = (f: Object, k: number) => {\n const propsToSend = {\n name: f.name,\n type: f.type,\n display: f.display,\n value: this.props.filters.get(f.name),\n placeholder: f.placeholder,\n options: f.options || [],\n onChange: this.props.handleChange,\n dataURL: f.data_url,\n min: f.min,\n max: f.max\n };\n const wrapperProps = {\n name: f.name,\n handleFocus: this.props.handleFocus,\n hasValue: this.props.filters.has(f.name),\n display: f.display,\n key: k,\n description: this.props.active === f.name && f.description\n };\n if (f.range && f.type === 'number') {\n const gteValue = this.props.filters.get(f.name + '__gte');\n const lteValue = this.props.filters.get(f.name + '__lte');\n return (\n \n \n \n \n \n \n );\n }\n if (!f.range && f.type === 'number') {\n return (\n \n \n \n );\n }\n if (f.range && f.type === 'date') {\n let gteValue = this.props.filters.get(f.name + '__gte');\n if (f.name === 'date') {\n gteValue = this.props.filters.get(f.name + '__gte') || defaultDate;\n }\n const lteValue = this.props.filters.get(f.name + '__lte');\n const today = new Date();\n return (\n \n \n \n \n \n \n );\n }\n if (f.type === 'location') {\n return (\n \n \n \n );\n }\n if (f.type === 'text') {\n return (\n \n \n \n );\n }\n if (f.type === 'radio') {\n return (\n \n \n \n );\n }\n if (f.type === 'meta') {\n return (\n this.props.filters.has(fi))}\n >\n \n \n );\n }\n if (f.type === 'text_comma') {\n let { name, value, onChange } = propsToSend;\n if (f.all) {\n onChange = this.props.handleToggleAll;\n }\n if (f.all && this.props.filters.has(`all_${f.name}`)) {\n name = `all_${f.name}`;\n value = this.props.filters.get(name);\n }\n\n return (\n \n {name.endsWith('_teams') ? (\n \n ) : (\n \n )}\n \n );\n }\n if (f.type === 'map') {\n return (\n \n )\n }\n >\n \n \n );\n }\n };\n render() {\n return (\n
        \n

        \n Basic\n

        \n {filtersData\n .slice(0, 5)\n .map((f: Object, k) => this.renderFilters(f, k))}\n

        \n OSM Features\n

        \n {filtersData\n .slice(5, 6)\n .map((f: Object, k) => this.renderFilters(f, k))}\n \n

        \n Flags\n

        \n {filtersData\n .slice(6, 8)\n .map((f: Object, k) => this.renderFilters(f, k))}\n \n\n

        \n Review\n

        \n {filtersData\n .slice(8, 12)\n .map((f: Object, k) => this.renderFilters(f, k))}\n \n\n

        \n Users & Teams\n

        \n {filtersData\n .slice(12, 19)\n .map((f: Object, k) => this.renderFilters(f, k))}\n \n\n

        \n Changeset Details\n

        \n {filtersData.slice(19).map((f: Object, k) => this.renderFilters(f, k))}\n \n
        \n );\n }\n}\nFiltersList = loadingEnhancer(FiltersList);\nexport { FiltersList };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport { push } from 'react-router-redux';\n\nimport { cancelablePromise } from '../../utils/promise';\nimport { fetchAllAOIs } from '../../network/aoi';\nimport { Button } from '../button';\nimport { Dropdown } from '../dropdown';\nimport { API_URL } from '../../config';\n\nclass SaveAOI extends React.PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n editing: false,\n value: props.name\n };\n }\n ref;\n clicked = false;\n onClick = event => {\n this.clicked = true;\n this.setState({ editing: true, value: this.props.name });\n };\n onChange = (event: any) => {\n this.setState({ value: event.target.value });\n };\n onKeyDown = event => {\n if (event.keyCode === 13) {\n this.handleSubmit(event);\n } else if (event.keyCode === 27) {\n this.setState({\n editing: false,\n value: this.props.name\n });\n this.clicked = false;\n }\n };\n handleSubmit = event => {\n this.setState({\n editing: false\n });\n const aoiList = this.props.aoiList.filter(\n aoi => aoi.value === this.props.aoiId\n );\n if (this.props.aoiId && aoiList.length) {\n this.props.updateAOI(this.props.aoiId, this.state.value);\n } else {\n this.props.createAOI(this.state.value);\n }\n };\n // handleFocus = event => {\n // event.target.select();\n // };\n render() {\n return (\n \n {this.state.editing ? (\n \n {\n if (this.clicked) {\n r.select();\n this.clicked = false;\n }\n }}\n value={this.state.value}\n onChange={this.onChange}\n onKeyDown={this.onKeyDown}\n />\n \n \n ) : (\n \n )}\n \n );\n }\n}\n\ntype filterProps = {\n createAOI: string => void,\n updateAOI: string => void,\n removeAOI: string => void,\n loading: boolean,\n search: string,\n token?: string,\n aoiName?: string,\n aoiId?: string,\n handleApply: () => void,\n handleClear: () => void,\n loadAoiId: string => void,\n location: Object,\n push: any => any\n};\n\nclass FiltersHeader extends React.Component {\n getAoisPromise;\n state = {\n aoiList: []\n };\n\n componentDidMount() {\n this.getAois();\n }\n\n componentWillUnmount() {\n this.getAoisPromise && this.getAoisPromise.cancel();\n }\n\n getAois() {\n if (this.props.token) {\n this.getAoisPromise = cancelablePromise(fetchAllAOIs(this.props.token));\n this.getAoisPromise.promise\n .then(r => {\n let aoiList = r.features.map(aoi => {\n return { label: aoi.properties.name, value: aoi.id };\n });\n this.setState({ aoiList: aoiList });\n })\n .catch(e => console.log(e));\n }\n }\n\n renderRssLink() {\n if (this.props.aoiId) {\n return (\n \n \n \n \n \n );\n }\n }\n\n renderAoiLink() {\n if (this.props.aoiId) {\n return (\n \n navigator.clipboard.writeText(\n `${API_URL.replace('/api/v1', '')}/?aoi=${this.props.aoiId}`\n )\n }\n title=\"Copy filter URL\"\n >\n \n \n \n \n );\n }\n }\n\n onAoiSelect = (arr: Array) => {\n if (arr.length === 1) {\n this.props.push({\n ...this.props.location,\n search: `aoi=${arr[0].value}`,\n path: '/filters'\n });\n } else if (arr.length > 1) {\n throw new Error('filter select array is big');\n }\n };\n\n renderFilterInfo() {\n const dropdown = (\n {}}\n onRemove={() => {}}\n position=\"left\"\n />\n );\n if (this.props.token && this.state.aoiList.length) {\n return {dropdown};\n }\n }\n\n render() {\n var save_aoi = '';\n if (this.props.token) {\n save_aoi = (\n \n );\n }\n\n return (\n
        \n \n {this.renderFilterInfo()}\n \n \n \n Filters\n {this.props.aoiId && / {this.props.aoiName}}\n {this.renderAoiLink()}\n {this.renderRssLink()}\n \n \n \n {save_aoi}\n \n Reset\n \n \n \n \n \n \n \n \n
        \n );\n }\n}\n\nFiltersHeader = connect(\n (state: RootStateType, props) => ({\n location: props.location\n }),\n {\n push\n }\n)(FiltersHeader);\n\nexport { FiltersHeader };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { push } from 'react-router-redux';\n\nimport { Map, List, fromJS, is } from 'immutable';\n\nimport { checkForNewChangesets } from '../store/changesets_page_actions';\nimport { applyFilters } from '../store/filters_actions';\nimport { applyUpdateAOI, applyCreateAOI } from '../store/aoi_actions';\nimport { modal } from '../store/modal_actions';\n\nimport { FiltersList } from '../components/filters/filters_list';\nimport { FiltersHeader } from '../components/filters/filters_header';\n\nimport { deleteAOI } from '../network/aoi';\nimport type { RootStateType } from '../store';\nimport { delayPromise, gaSendEvent, isMobile } from '../utils';\n\nimport type { filterType, filtersType } from '../components/filters';\nconst NEW_AOI = 'unnamed *';\n\ntype propsType = {|\n filters: filtersType,\n loading: boolean,\n aoi: Object,\n token: string,\n location: Object,\n features: ?List>,\n checkForNewChangesets: boolean => any,\n push: (location: Object) => void,\n applyFilters: (filtersType, path?: string) => mixed, // base 0\n applyCreateAOI: (name?: string, filtersType) => mixed,\n applyUpdateAOI: (aoiId?: string, name?: string, filtersType) => mixed,\n modal: any => any\n|};\n\ntype stateType = {\n filters: filtersType,\n active: string\n};\nconst noDateGte: filterType = fromJS({\n date__gte: [{ label: '', value: '' }]\n});\n\nclass Filters extends React.PureComponent {\n state = {\n filters: this.props.filters,\n active: ''\n // aoiName: this.props.aoi.getIn(['properties', 'name'], NEW_AOI)\n };\n componentWillReceiveProps(nextProps: propsType) {\n if (!is(this.props.filters, nextProps.filters)) {\n this.setState({\n filters: nextProps.filters\n });\n }\n }\n handleFocus = (name: string) => {\n this.setState({\n active: name\n });\n };\n handleApply = () => {\n // in case the user clicks on apply when filter\n // loaded AOI.\n if (JSON.stringify(this.state.filters.toJSON()).length > 7000) {\n this.props.modal({\n kind: 'error',\n title: 'Use Save Filter',\n description:\n 'Your filter is too big to be applied. You need to Save your Filter to be able to see the results.'\n });\n } else {\n if (is(this.state.filters, this.props.filters)) {\n this.props.push({\n ...this.props.location,\n pathname: '/'\n });\n return;\n }\n this.props.applyFilters(this.state.filters, '/');\n this.sendToAnalytics();\n // show user if there were any new changesets\n // incase service had cached the request\n delayPromise(3000).promise.then(() =>\n this.props.checkForNewChangesets(true)\n );\n }\n };\n sendToAnalytics = () => {\n const filters = this.state.filters;\n filters.forEach((v, k) => {\n v.forEach(vv => {\n gaSendEvent({\n category: 'Filters',\n action: k,\n label: vv.get('label')\n });\n });\n });\n };\n handleChange = (name: string, values?: filterType) => {\n let filters = this.state.filters;\n // if someone cleared date__gte filter\n // we use the convention defined at `noDateGte`\n // to signify no default gte.\n if (name === 'date__gte' && values == null) {\n filters = filters.merge(noDateGte);\n } else if (values == null) {\n // clear this filter\n filters = filters.delete(name);\n } else {\n filters = filters.set(name, values);\n }\n return this.setState({\n filters\n });\n };\n handleToggleAll = (name: string, values?: filterType) => {\n let filters = this.state.filters;\n const isAll = name.slice(0, 4) === 'all_';\n // delete the opposite value\n if (isAll) {\n filters = filters.delete(name.slice(4));\n } else {\n filters = filters.delete('all_' + name);\n }\n // regularly handle change\n if (!values) {\n filters = filters.delete(name);\n } else {\n filters = filters.set(name, values);\n }\n return this.setState({ filters });\n };\n replaceFiltersState = filters => {\n this.setState({ filters });\n };\n handleClear = () => {\n this.props.applyFilters(new Map(), '/');\n };\n loadAoiId = (aoiId: string) => {\n this.props.push({\n ...this.props.location,\n search: `aoi=${aoiId}`\n });\n };\n getAOIName = () => {\n if (this.props.loading) return '';\n return this.props.aoi.getIn(['properties', 'name'], NEW_AOI);\n };\n getAOIId = (aoiId: string) => {\n if (this.props.loading) return '';\n return this.props.aoi.get('id');\n };\n removeAOI = (aoiId: string) => {\n if (aoiId === this.props.aoi.get('id')) {\n this.handleClear();\n }\n deleteAOI(this.props.token, aoiId).catch(e => console.error(e));\n };\n createAOI = (name: string) => {\n this.props.applyCreateAOI(name, this.state.filters);\n };\n updateAOI = (aoiId: string, name: string) => {\n this.props.applyUpdateAOI(aoiId, name, this.state.filters);\n };\n render() {\n const mobile = isMobile();\n\n return (\n \n \n \n \n );\n }\n}\n\nFilters = connect(\n (state: RootStateType, props) => ({\n filters: state.filters.get('filters'),\n aoi: state.aoi.get('aoi'),\n loading: state.filters.get('loading'),\n features: state.changesetsPage.getIn(['currentPage', 'features']),\n location: props.location,\n token: state.auth.get('token')\n }),\n {\n checkForNewChangesets,\n applyFilters,\n applyCreateAOI,\n applyUpdateAOI,\n push,\n modal\n }\n)(Filters);\n\nexport { Filters };\n","// @flow\nimport React from 'react';\n\nexport function NumberOfComments({ count }: { count: ?number }) {\n return (\n 1 ? 's' : ''}`}>\n {count}\n \n \n \n \n );\n}\n","// @flow\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nimport { CreateDeleteModify } from '../create_delete_modify';\nimport { NumberOfComments } from './comments';\nimport { getObjAsQueryParam } from '../../utils/query_params';\n\nimport thumbsUp from '../../assets/thumbs-up.svg';\nimport thumbsDown from '../../assets/thumbs-down.svg';\n\nexport function SecondaryLine({ changesetId, date, properties }: Object) {\n return (\n \n \n \n {changesetId}\n \n {properties.get('checked') ? (\n \n {properties.get('harmful') ? (\n \n ) : (\n \n )}\n {properties.get('check_user') && (\n {`by ${properties.get(\n 'check_user'\n )}`}\n )}\n \n ) : null}\n \n \n {properties.get('comments_count') > 0 && (\n \n )}\n \n \n \n );\n}\n// // // \n","// @flow\nimport React from 'react';\nimport { Reasons } from '../reasons';\n\nexport function PrimaryLine({ reasons, comment, tags }: Object) {\n return (\n \n

        \n {comment}\n

        \n \n \n
        \n );\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { formatDistanceToNow, parse } from 'date-fns';\n\nimport { useIsUserListed } from '../../hooks/UseIsUserListed';\n\nfunction TitleComponent({\n properties,\n wasOpen,\n date,\n trustedlist,\n watchlisted\n}: Object) {\n const [isInTrustedlist, isInWatchlist] = useIsUserListed(\n properties.get('user'),\n properties.get('uid'),\n trustedlist,\n watchlisted\n );\n\n return (\n
        \n \n \n {properties.get('user') || OSM User}\n {isInTrustedlist && (\n \n \n \n )}\n {isInWatchlist && (\n \n \n \n )}\n \n \n  \n {formatDistanceToNow(\n // eslint-disable-next-line\n parse(date, \"yyyy-MM-dd'T'HH:mm:ssX\", new Date()),\n { addSuffix: true }\n )}\n \n \n
        \n );\n}\n\nconst Title = connect((state: RootStateType, props) => ({\n trustedlist: state.trustedlist.get('trustedlist'),\n watchlisted: state.watchlist.get('watchlist')\n}))(TitleComponent);\n\nexport { Title };\n","// @flow\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport { Map } from 'immutable';\n\nimport { SecondaryLine } from './secondary_line';\nimport { PrimaryLine } from './primary_line';\nimport { Title } from './title';\nimport { history } from '../../store/history';\n\nexport class Row extends React.Component {\n props: {\n properties: Map,\n active: ?boolean,\n changesetId: number,\n inputRef: ?(any) => any\n };\n\n shouldComponentUpdate(nextProps: Object) {\n return (\n nextProps.properties !== this.props.properties ||\n this.props.active ||\n nextProps.active\n );\n }\n\n wasOpen = false;\n\n render() {\n const { properties, changesetId, active, inputRef, ...other } = this.props;\n if (!this.wasOpen) {\n // way to show read/unread state without\n // performance compromise. The moment component\n // gets active we set wasOpen to true and never\n // toggle it back to any other state.\n this.wasOpen = this.props.active;\n }\n\n let borderClass = 'border-l border-l--4 border-color-neutral';\n if (properties.get('harmful') === true)\n borderClass = 'border-l border-l--4 border-color-bad';\n if (properties.get('harmful') === false)\n borderClass = 'border-l border-l--4 border-color-good';\n\n let backgroundClass = '';\n\n backgroundClass += active ? 'light-blue' : this.wasOpen ? 'bg-darken5' : '';\n return (\n \n history.push({\n search: window.location.search,\n pathname: `/changesets/${changesetId}`\n })\n }\n >\n
        \n \n \n \n \n \n \n
        \n \n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { Row } from './row';\nimport { SignInButton } from '../changeset/sign_in_button.js';\nimport { elementInViewport } from '../../utils/element_in_view';\nimport { loadingEnhancer } from '../loading_enhancer';\n\ntype propTypes = {\n currentPage: ?Map,\n activeChangesetId: ?number,\n pageIndex: number\n};\n\nclass List extends React.Component {\n shouldComponentUpdate(nextProps: propTypes) {\n return (\n nextProps.activeChangesetId !== this.props.activeChangesetId ||\n nextProps.currentPage !== this.props.currentPage\n );\n }\n\n handleScroll = (r: HTMLElement) => {\n if (!r) return;\n if (!elementInViewport(r)) {\n r.scrollIntoView({ block: 'end', behavior: 'smooth' });\n }\n };\n\n render() {\n if (\n !this.props.token &&\n ['/about', '/filters', '/user', '/'].includes(this.props.location)\n ) {\n return (\n
        \n
        \n \n \n \n
        \n
        \n \n
        \n
        \n );\n }\n\n return (\n
          \n
          \n {this.props.currentPage &&\n this.props.currentPage.get('features').map((f, k) => (\n \n ))}\n
          \n
        \n );\n }\n}\n\nList = loadingEnhancer(List);\nList = connect((state: RootStateType, props) => ({\n token: state.auth.get('token')\n}))(List);\n\nexport { List };\n","// @flow\nimport React from 'react';\n\nexport class PageRange extends React.PureComponent {\n render() {\n return (\n \n {typeof this.props.page === 'number'\n ? this.props.page + 1\n : \n \n }\n \n );\n }\n _onClick = () => {\n this.props.getChangesetsPage(this.props.pageIndex);\n };\n}\n","// @flow\nimport React from 'react';\nimport { Range } from 'immutable';\n\nimport { PageRange } from './page_range';\nimport { PAGE_SIZE } from '../../config/constants';\n\nconst RANGE = 6;\n\nfunction range(start, end) {\n return Range(start, end).map((k, i) => i + start);\n}\n\nexport function Footer({\n pageIndex,\n getChangesetsPage,\n count\n}: {\n pageIndex: number,\n getChangesetsPage: (number, ?boolean) => mixed,\n count: ?number\n}) {\n const base = parseInt(pageIndex / RANGE, 10) * RANGE;\n let maxPageCount = 0;\n if (count && !Number.isNaN(count)) {\n maxPageCount = Math.ceil(count / PAGE_SIZE);\n }\n return (\n
        \n \n {range(base, Math.min(base + RANGE, maxPageCount)).map(n =>\n \n )}\n = maxPageCount}\n pageIndex={pageIndex + 1}\n active={false}\n getChangesetsPage={getChangesetsPage}\n />\n
        \n );\n}\n","// @flow\nimport React from 'react';\nimport { NavLink } from 'react-router-dom';\nimport { Dropdown } from '../dropdown';\nimport { Button } from '../button';\nimport numberWithCommas from '../../utils/number_with_commas.js';\nimport filtersConfig from '../../config/filters.json';\n\nexport function Header({\n filters,\n handleFilterOrderBy,\n location,\n diffLoading,\n diff,\n currentPage,\n reloadCurrentPage\n}: Object) {\n const valueData = [];\n const options = filtersConfig.filter(f => f.name === 'order_by')[0].options;\n if (filters.get('order_by')) {\n options.forEach(o => {\n if (filters.getIn(['order_by', 0, 'value']) === o.value) {\n valueData.push(o);\n }\n });\n }\n return (\n
        \n
        \n {}}\n onRemove={() => {}}\n onChange={handleFilterOrderBy}\n value={valueData}\n options={filtersConfig.filter(f => f.name === 'order_by')[0].options}\n display={(valueData[0] && valueData[0].label) || 'Order by'}\n position=\"left\"\n />\n -1 ? '/' : '/filters'\n }}\n >\n \n \n
        \n 0 ? 'bg-darken10' : 'bg-gray-faint'\n } flex-child align-items--center`}\n >\n \n \n {(currentPage &&\n numberWithCommas(currentPage.getIn(['count'], 0))) ||\n 0}{' '}\n changesets.\n \n \n {diffLoading ? (\n \n ) : (\n \n {diff > 0 ? `${diff} new` : ''}\n \n )}\n \n \n \n
        \n );\n}\n","//@flow\n\nexport default function numberWithCommas(num: number): string {\n return num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n}\n","// @flow\nimport React from 'react';\nimport { API_URL } from '../../config';\nimport { Map } from 'immutable';\nimport { Dropdown } from '../dropdown';\nimport { cancelablePromise } from '../../utils/promise';\n\n// TOFIX Needs cleanup.\n\nlet cacheTagsData;\nexport class Tags extends React.PureComponent {\n props: {\n changesetId: number,\n disabled: boolean,\n currentChangeset: Map,\n handleChangesetModifyTag: (number, Map, Object, boolean) => mixed\n };\n\n state: {\n options: Array,\n allTags: Array\n };\n\n state = {\n allTags: {},\n options: []\n };\n\n tagsData = cacheTagsData;\n\n componentDidMount() {\n this.getAsyncOptions();\n }\n\n getAsyncOptions = () => {\n if (!this.tagsData) {\n this.tagsData = cancelablePromise(\n fetch(`${API_URL}/tags/`).then(response => {\n return response.json();\n })\n );\n }\n\n return this.tagsData.promise\n .then(json => {\n let data = {};\n let selectData = json.filter(d => d.is_visible && d.for_changeset);\n\n selectData.forEach(d => {\n data[d.name] = { ...d, value: d.id, label: d.name };\n });\n this.setState({\n allTags: data,\n options: selectData.map(d => ({ label: d.name, value: d.id }))\n });\n })\n .catch(e => {});\n };\n\n componentWillUnmount() {\n if (this.tagsData) {\n cacheTagsData = this.tagsData;\n this.tagsData.cancel();\n }\n }\n\n onAdd = (obj: Object) => {\n if (!obj) return;\n const {\n changesetId,\n currentChangeset,\n handleChangesetModifyTag\n } = this.props;\n handleChangesetModifyTag(changesetId, currentChangeset, obj, false);\n };\n\n onRemove = (obj: Object) => {\n if (!obj) return;\n const {\n changesetId,\n currentChangeset,\n handleChangesetModifyTag\n } = this.props;\n handleChangesetModifyTag(changesetId, currentChangeset, obj, true);\n };\n\n defaultValue = new Map();\n\n render() {\n if (!this.props.currentChangeset) return null;\n\n const value = this.props.currentChangeset\n .getIn(['properties', 'tags'], this.defaultValue)\n .toJS()\n .map(t => ({\n value: t.id,\n label: t.name\n }));\n\n if (this.state.options) {\n return (\n {}}\n display={`Tags${value.length > 0 ? ` (${value.length})` : ''}`}\n position=\"right\"\n />\n );\n } else {\n return null;\n }\n }\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { is, List as ImmutableList, Map, fromJS } from 'immutable';\nimport { push } from 'react-router-redux';\nimport type { RootStateType } from '../store';\n\nimport {\n getChangesetsPage,\n checkForNewChangesets\n} from '../store/changesets_page_actions';\n\nimport { applyFilters } from '../store/filters_actions';\n\nimport { List } from '../components/list';\nimport { Footer } from '../components/list/footer';\nimport { Header } from '../components/list/header';\nimport { keyboardToggleEnhancer } from '../components/keyboard_enhancer';\nimport {\n NEXT_CHANGESET,\n PREV_CHANGESET,\n FILTER_BINDING,\n HELP_BINDING,\n REFRESH_CHANGESETS\n} from '../config/bindings';\n\ntype propsType = {\n location: Object,\n loading: boolean,\n error: Object,\n currentPage: ?Map,\n diff: number,\n diffLoading: boolean,\n pageIndex: number,\n activeChangesetId: ?number,\n filters: Map>,\n aoiId: ?string,\n lastKeyStroke: Map,\n getChangesetsPage: (number, ?boolean) => mixed, // base 0\n checkForNewChangesets: boolean => any,\n push: Object => mixed,\n applyFilters: (Map>) => mixed // base 0\n};\n\nclass ChangesetsList extends React.PureComponent {\n checkUpdate = null;\n maxPageCount = Infinity;\n\n // constructor(props: propsType) {\n // super(props);\n // this.props.getChangesetsPage(props.pageIndex);\n // this.checkUpdate = delayPromise(2000);\n // this.checkUpdate.promise.then(() => this.props.checkForNewChangesets(true));\n // }\n componentWillUnmount() {\n this.checkUpdate && this.checkUpdate.cancel();\n }\n\n goUpDownToChangeset = (direction: number) => {\n if (!this.props.currentPage) return;\n let features = this.props.currentPage.get('features');\n if (features) {\n let index = features.findIndex(\n f => f.get('id') === this.props.activeChangesetId\n );\n index += direction;\n const nextFeature = features.get(index);\n if (nextFeature) {\n const location = {\n ...this.props.location, // clone it\n pathname: `/changesets/${nextFeature.get('id')}`\n };\n this.props.push(location);\n }\n }\n };\n\n toggleFilters() {\n if (this.props.location && this.props.location.pathname === '/filters') {\n const location = {\n ...this.props.location, // clone it\n pathname: '/'\n };\n this.props.push(location);\n } else {\n const location = {\n ...this.props.location, // clone it\n pathname: '/filters'\n };\n this.props.push(location);\n }\n }\n\n toggleHelp() {\n if (\n this.props.location &&\n this.props.location.pathname.startsWith('/about')\n ) {\n const location = {\n ...this.props.location, // clone it\n pathname: '/'\n };\n this.props.push(location);\n } else {\n console.log(...this.props.location);\n const location = {\n ...this.props.location, // clone it\n pathname: '/about'\n };\n this.props.push(location);\n }\n }\n\n componentWillReceiveProps(nextProps: propsType) {\n const lastKeyStroke: Map = nextProps.lastKeyStroke;\n if (is(this.props.lastKeyStroke, lastKeyStroke)) return;\n switch (lastKeyStroke.keySeq().first()) {\n case FILTER_BINDING.label: {\n this.toggleFilters();\n break;\n }\n case HELP_BINDING.label: {\n this.toggleHelp();\n break;\n }\n case NEXT_CHANGESET.label: {\n this.goUpDownToChangeset(1);\n break;\n }\n case PREV_CHANGESET.label: {\n this.goUpDownToChangeset(-1);\n break;\n }\n case REFRESH_CHANGESETS.label: {\n this.reloadCurrentPage();\n break;\n }\n default: {\n return;\n }\n }\n }\n\n handleFilterOrderBy = (selected: Array<*>) => {\n let mergedFilters;\n mergedFilters = this.props.filters.set('order_by', fromJS(selected));\n this.props.applyFilters(mergedFilters);\n };\n\n reloadCurrentPage = () => {\n this.props.getChangesetsPage(this.props.pageIndex, true);\n };\n\n render() {\n const {\n filters,\n currentPage,\n loading,\n location,\n diff,\n diffLoading,\n activeChangesetId,\n pageIndex,\n getChangesetsPage\n } = this.props;\n\n return (\n
        \n \n \n \n
        \n );\n }\n}\n\nChangesetsList = keyboardToggleEnhancer(\n false,\n [\n NEXT_CHANGESET,\n PREV_CHANGESET,\n FILTER_BINDING,\n HELP_BINDING,\n REFRESH_CHANGESETS\n ],\n ChangesetsList\n);\n\nChangesetsList = connect(\n (state: RootStateType, props) => ({\n location: state.routing.location,\n loading: state.changesetsPage.get('loading'),\n error: state.changesetsPage.get('error'),\n currentPage: state.changesetsPage.get('currentPage'),\n diff: state.changesetsPage.get('diff'),\n diffLoading: state.changesetsPage.get('diffLoading'),\n pageIndex: state.changesetsPage.get('pageIndex') || 0,\n activeChangesetId: state.changeset.get('changesetId'),\n filters: state.filters.get('filters'),\n aoiId: state.aoi.get('aoi').get('id')\n }),\n {\n // actions\n getChangesetsPage,\n checkForNewChangesets,\n applyFilters,\n push\n }\n)(ChangesetsList);\nexport { ChangesetsList };\n","import React from 'react';\nimport { isMobile } from '../utils';\n\nexport function Navbar({\n className,\n title,\n titleClassName = '',\n buttons,\n buttonsClassName = ''\n}) {\n const mobile = isMobile();\n\n return (\n \n
        \n {title || ''}\n
        \n
        {buttons}
        \n \n );\n}\n","import React from 'react';\nimport { Dropdown } from '../dropdown';\nimport thumbsUp from '../../assets/thumbs-up.svg';\nimport thumbsDown from '../../assets/thumbs-down.svg';\n\nexport function Verify({\n changeset,\n options,\n className,\n onChange,\n value,\n onClear,\n username,\n checkUser\n}) {\n if (changeset.getIn(['properties', 'checked'])) {\n const isHarmful = changeset.getIn(['properties', 'harmful']);\n return (\n \n \n \n {checkUser ? <>{checkUser} : Verified}\n \n \n \n \n \n );\n }\n\n return (\n
        \n {}}\n onRemove={() => {}}\n options={options}\n onChange={onChange}\n display=\"Verify\"\n position=\"right\"\n />\n
        \n );\n}\n","import React from 'react';\n\nimport { importChangesetMap } from '../../utils/cmap';\nimport { Dropdown } from '../dropdown';\nimport { isMobile } from '../../utils';\n\nfunction openEditor(selected) {\n importChangesetMap('getMapInstance')\n .then(r => r && r() && r().map)\n .then(map => {\n let baseUrl;\n if (selected && selected[0].value === 'iD') {\n baseUrl = 'https://www.openstreetmap.org/edit?editor=id&';\n }\n if (selected && selected[0].value === 'RapiD') {\n baseUrl = 'https://mapwith.ai/rapid?';\n }\n if (baseUrl) {\n const center = map.getCenter();\n const zoom = map.getZoom();\n let windowObjectReference = window.open('editor - OSMCha');\n windowObjectReference.location.href = `${baseUrl}#map=${zoom}/${center.lat}/${center.lng}`;\n }\n });\n}\n\nexport function OpenIn({ display, changesetId, coordinates, className }) {\n const mobile = isMobile();\n const options = [\n {\n label: 'Achavi',\n value: 'Achavi',\n href: `https://overpass-api.de/achavi/?changeset=${changesetId}&relations=true`\n },\n {\n label: 'iD',\n value: 'iD'\n },\n {\n label: 'JOSM',\n value: 'JOSM',\n href: `http://127.0.0.1:8111/import?url=https://www.openstreetmap.org/api/0.6/changeset/${changesetId}/download`\n },\n {\n label: 'Level0',\n value: 'Level0',\n href: `http://level0.osmz.ru/?url=changeset/${changesetId}`\n },\n {\n label: 'RapiD',\n value: 'RapiD'\n }\n ];\n if (mobile) {\n options.unshift({\n label: 'OSM.org',\n value: 'OSM.org',\n href: `https://www.openstreetmap.org/changeset/${changesetId}`\n });\n }\n\n return (\n
        \n {}}\n onRemove={() => {}}\n value={[]}\n onChange={openEditor}\n options={options}\n display={display}\n position=\"left\"\n />\n
        \n );\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport { is, Map } from 'immutable';\n\nimport { keyboardToggleEnhancer } from '../components/keyboard_enhancer';\nimport { Tags } from '../components/changeset/tags';\nimport { Navbar } from '../components/navbar';\nimport { Verify } from '../components/changeset/verify';\nimport { OpenIn } from '../components/changeset/open_in';\nimport { isMobile } from '../utils';\n\nimport {\n VERIFY_BAD,\n VERIFY_GOOD,\n VERIFY_CLEAR,\n OPEN_IN_JOSM,\n OPEN_IN_ID,\n OPEN_IN_OSM,\n OPEN_IN_LEVEL0,\n OPEN_IN_ACHAVI,\n OPEN_IN_HDYC\n} from '../config/bindings';\nimport { API_URL } from '../config/index';\n\nimport {\n handleChangesetModifyTag,\n handleChangesetModifyHarmful\n} from '../store/changeset_actions';\nimport type { RootStateType } from '../store';\n\ntype propsType = {\n changesetId: number,\n location: Object,\n currentChangeset: Map,\n username: ?string,\n lastKeyStroke: Map,\n handleChangesetModifyTag: (number, Map, Object, boolean) => mixed,\n handleChangesetModifyHarmful: (number, Map, boolean | -1) => mixed\n};\n\nclass NavbarChangeset extends React.PureComponent {\n componentWillReceiveProps(nextProps: propsType) {\n if (!this.props.currentChangeset) return;\n const lastKeyStroke: Map = nextProps.lastKeyStroke;\n if (is(this.props.lastKeyStroke, lastKeyStroke)) return;\n switch (lastKeyStroke.keySeq().first()) {\n case VERIFY_BAD.label: {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n true\n );\n break;\n }\n case VERIFY_CLEAR.label: {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n -1\n );\n break;\n }\n case VERIFY_GOOD.label: {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n false\n );\n break;\n }\n case OPEN_IN_JOSM.label: {\n if (!this.props.changesetId) return;\n const url = `http://127.0.0.1:8111/import?url=https://www.openstreetmap.org/api/0.6/changeset/${this.props.changesetId}/download`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_ID.label: {\n if (!this.props.changesetId || !this.props.currentChangeset) return;\n const coordinates = this.props.currentChangeset.getIn([\n 'geometry',\n 'coordinates',\n 0,\n 0\n ]);\n const url = `https://www.openstreetmap.org/edit?changeset=${\n this.props.changesetId\n }#map=15/${coordinates && coordinates.get('1')}/${coordinates &&\n coordinates.get('0')}`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_OSM.label: {\n if (!this.props.changesetId) return;\n const url = `https://www.openstreetmap.org/changeset/${this.props.changesetId}`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_LEVEL0.label: {\n if (!this.props.changesetId) return;\n const url = `http://level0.osmz.ru/?url=changeset/${this.props.changesetId}`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_ACHAVI.label: {\n if (!this.props.changesetId) return;\n const url = `https://overpass-api.de/achavi/?changeset=${this.props.changesetId}`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_HDYC.label: {\n const user: string = this.props.currentChangeset.getIn(\n ['properties', 'user'],\n ''\n );\n const url = `https://hdyc.neis-one.org/?${user}`;\n window.open(url, '_blank');\n break;\n }\n default: {\n return;\n }\n }\n }\n\n handleVerify = (arr: Array) => {\n if (arr.length === 1) {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n arr[0].value // whether harmful is true or false\n );\n } else if (arr.length > 1) {\n throw new Error('verify array is big');\n }\n };\n\n handleVerifyClear = () => {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n -1\n );\n };\n\n isChecked = () =>\n this.props.currentChangeset &&\n this.props.currentChangeset.getIn(['properties', 'checked']);\n\n render() {\n const mobile = isMobile();\n\n return (\n \n {mobile && (\n \n \n ☰\n {' '}\n \n )}\n {!mobile && (\n <>\n
        \n Changeset: {this.props.changesetId}\n \n \n navigator.clipboard.writeText(\n `${API_URL.replace('/api/v1', '')}/changesets/${\n this.props.changesetId\n }`\n )\n }\n title=\"Copy OSMCha Changeset URL\"\n >\n \n \n \n \n \n \n \n \n \n \n
        \n \n )}\n \n \n }\n buttonsClassName=\"flex-parent\"\n buttons={\n this.props.currentChangeset && (\n <>\n {this.props.currentChangeset.getIn([\n 'properties',\n 'check_user'\n ]) && (\n \n )}\n \n \n )\n }\n />\n );\n }\n}\n\nNavbarChangeset = keyboardToggleEnhancer(\n false,\n [\n VERIFY_BAD,\n VERIFY_GOOD,\n VERIFY_CLEAR,\n OPEN_IN_JOSM,\n OPEN_IN_ID,\n OPEN_IN_OSM,\n OPEN_IN_LEVEL0,\n OPEN_IN_ACHAVI,\n OPEN_IN_HDYC\n ],\n NavbarChangeset\n);\n\nNavbarChangeset = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n changesetId: parseInt(state.changeset.get('changesetId'), 10),\n currentChangeset: state.changeset.getIn([\n 'changesets',\n parseInt(state.changeset.get('changesetId'), 10)\n ]),\n username: state.auth.getIn(['userDetails', 'username'])\n }),\n { handleChangesetModifyTag, handleChangesetModifyHarmful }\n)(NavbarChangeset);\n\nexport { NavbarChangeset };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { Link } from 'react-router-dom';\nimport { push } from 'react-router-redux';\n\nimport { Button } from '../components/button';\nimport { Navbar } from '../components/navbar';\nimport { Dropdown } from '../components/dropdown';\n\nimport { createPopup } from '../utils/create_popup';\nimport { handlePopupCallback, isMobile } from '../utils';\nimport { osmAuthUrl } from '../config/constants';\nimport { isDev, isLocal } from '../config';\n\nimport {\n getOAuthToken,\n getFinalToken,\n logUserOut\n} from '../store/auth_actions';\n\nimport type { RootStateType } from '../store';\n\nclass NavbarSidebar extends React.PureComponent {\n props: {\n changesetId: ?number,\n location: Object,\n avatar: ?string,\n currentChangeset: Map,\n username: ?string,\n token: ?string,\n oAuthToken: ?string,\n getOAuthToken: () => mixed,\n getFinalToken: string => mixed,\n logUserOut: () => mixed,\n push: any => any\n };\n\n handleLoginClick = () => {\n var oAuthToken = this.props.oAuthToken;\n if (!oAuthToken) return;\n\n let url;\n if (isDev || isLocal) {\n url = `/local-landing.html#${oAuthToken}`;\n } else {\n url = `${osmAuthUrl}?oauth_token=${oAuthToken}`;\n }\n\n createPopup('oauth_popup', url);\n handlePopupCallback().then(oAuthObj => {\n this.props.getFinalToken(oAuthObj.oauth_verifier);\n });\n };\n\n onUserMenuSelect = (arr: Array) => {\n const username = this.props.username;\n\n if (arr.length === 1) {\n if (arr[0].url === '/logout') {\n this.props.logUserOut();\n return;\n }\n if (arr[0].url === '/my-changesets') {\n this.props.push({\n ...this.props.location,\n search: `filters={\"users\":[{\"label\":\"${username}\",\"value\":\"${username}\"}],\"date__gte\":[{\"label\":\"\",\"value\":\"\"}]}`,\n pathname: '/'\n });\n return;\n }\n if (arr[0].url === '/my-reviews') {\n this.props.push({\n ...this.props.location,\n search: `filters={\"checked_by\":[{\"label\":\"${username}\",\"value\":\"${username}\"}],\"date__gte\":[{\"label\":\"\",\"value\":\"\"}]}`,\n pathname: '/'\n });\n return;\n }\n this.props.push({\n ...this.props.location,\n search: this.props.location.search,\n pathname: arr[0].url\n });\n } else if (arr.length > 1) {\n throw new Error('filter select array is big');\n }\n };\n\n renderUserMenuOptions() {\n const username = this.props.username;\n\n return (\n \n {username}\n \n ) : (\n 'User'\n )\n }\n options={[\n { label: 'Account settings', url: '/user' },\n {\n label: 'My changesets',\n url: '/my-changesets'\n },\n {\n label: 'My reviews',\n url: '/my-reviews'\n },\n { label: 'My saved filters', url: '/saved-filters' },\n { label: 'My teams', url: '/teams' },\n { label: 'My trusted users list', url: '/trusted-users' },\n { label: 'My watchlist', url: '/watchlist' },\n { label: 'Logout', url: '/logout' }\n ]}\n onChange={this.onUserMenuSelect}\n value={[]}\n onAdd={() => {}}\n onRemove={() => {}}\n position=\"right\"\n />\n );\n }\n\n render() {\n const mobile = isMobile();\n\n return (\n <>\n \n OSM\n Cha\n \n }\n buttons={\n
        \n \n \n \n \n \n {this.props.token ? (\n
        {this.renderUserMenuOptions()}
        \n ) : (\n \n Sign in\n \n )}\n
        \n }\n />\n \n );\n }\n}\n\nNavbarSidebar = connect(\n (state: RootStateType, props) => ({\n location: state.routing.location,\n changesetId: parseInt(state.changeset.get('changesetId'), 10),\n currentChangeset: state.changeset.getIn([\n 'changesets',\n parseInt(state.changeset.get('changesetId'), 10)\n ]),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n username: state.auth.getIn(['userDetails', 'username']),\n avatar: state.auth.getIn(['userDetails', 'avatar'])\n }),\n {\n getOAuthToken,\n getFinalToken,\n logUserOut,\n push\n }\n)(NavbarSidebar);\n\nexport { NavbarSidebar };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport Notify from 'react-notification-system';\n\nimport type { RootStateType } from '../store';\n\nimport {\n dismissModalCallback,\n activateModalCallback\n} from '../store/modal_actions';\n\nclass Modal extends React.PureComponent {\n props: {\n title: ?string,\n description: ?string,\n kind: 'error' | 'success',\n dismiss: ?boolean,\n autoDismiss: ?boolean,\n dismissModalCallback: number => any,\n activateModalCallback: number => any,\n position: ?string,\n callbackLabel: ?string,\n error: Object,\n uid: number\n };\n static defaultProps = {\n title: 'Error',\n description: 'Oops there was a problem. Please reload the app.',\n autoDismiss: 5,\n dismiss: true,\n position: 'tr',\n kind: 'error'\n };\n ref = null;\n componentDidMount() {\n if (this.props.error) {\n this.sendNotification(this.props);\n }\n }\n componentWillUpdate(nextProps: Object) {\n this.sendNotification(nextProps);\n }\n sendNotification = nextProps => {\n const uid = nextProps.uid;\n if (!this.ref) return;\n this.ref.addNotification({\n uid,\n title: nextProps.title,\n message:\n (nextProps.error && nextProps.error.message) || nextProps.description,\n level: nextProps.kind,\n autoDismiss: nextProps.autoDismiss,\n position: nextProps.position,\n dismissible: nextProps.dismiss,\n action: nextProps.callbackLabel && {\n label: nextProps.callbackLabel,\n callback: () => nextProps.activateModalCallback(uid)\n },\n onRemove: () => {\n nextProps.dismissModalCallback(uid);\n }\n });\n };\n addRef = r => {\n this.ref = r;\n };\n render() {\n return ;\n }\n}\nModal = connect(\n (state: RootStateType) => ({\n error: state.modal.get('error'),\n callback: state.modal.get('callback'),\n callbackLabel: state.modal.get('callbackLabel'),\n title: state.modal.get('title'),\n description: state.modal.get('description'),\n dismiss: state.modal.get('dismiss'),\n position: state.modal.get('position'),\n autoDismiss: state.modal.get('autoDismiss'),\n kind: state.modal.get('kind'),\n uid: state.modal.get('uid')\n }),\n { dismissModalCallback, activateModalCallback }\n)(Modal);\n\nexport { Modal };\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\n\nimport { Button } from '../button';\nimport { applyUpdateUserDetails } from '../../store/auth_actions';\nimport type { RootStateType } from '../../store';\nimport thumbsUp from '../../assets/thumbs-up.svg';\nimport thumbsDown from '../../assets/thumbs-down.svg';\n\nclass EditUserDetails extends React.PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n message_good: props.userDetails.get('message_good'),\n message_bad: props.userDetails.get('message_bad'),\n comment_feature: props.userDetails.get('comment_feature')\n };\n }\n componentWillReceiveProps(nextProps) {\n this.setState({ message_good: nextProps.userDetails.get('message_good') });\n this.setState({ message_bad: nextProps.userDetails.get('message_bad') });\n this.setState({\n comment_feature: nextProps.userDetails.get('comment_feature')\n });\n }\n onChangeMessageGood = (event: any) => {\n this.setState({ message_good: event.target.value });\n };\n onChangeMessageBad = (event: any) => {\n this.setState({ message_bad: event.target.value });\n };\n handleSubmit = event => {\n this.props.applyUpdateUserDetails(\n this.state.message_good,\n this.state.message_bad,\n this.state.comment_feature\n );\n };\n renderGoodBadImg(isGood) {\n return (\n \n );\n }\n\n render() {\n return (\n
        \n \n

        \n Default comment for changesets reviewed as GOOD{' '}\n {this.renderGoodBadImg(true)}:\n

        \n
        \n \n \n

        \n Default comment for changesets reviewed as BAD{' '}\n {this.renderGoodBadImg()}:\n

        \n
        \n \n \n
        \n );\n }\n}\nEditUserDetails = connect(\n (state: RootStateType, props) => ({\n userDetails: state.auth.getIn(['userDetails'], Map())\n }),\n {\n applyUpdateUserDetails\n }\n)(EditUserDetails);\n\nexport { EditUserDetails };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport type { filtersType } from '../components/filters';\nimport { Avatar } from '../components/avatar';\nimport { Button } from '../components/button';\nimport { EditUserDetails } from '../components/user/details';\nimport { isMobile } from '../utils';\nimport type { RootStateType } from '../store';\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n filters: filtersType,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any\n};\nclass User extends React.PureComponent {\n state = {\n userValues: null\n };\n onUserChange = (value: ?Array) => {\n if (Array.isArray(value) && value.length === 0)\n return this.setState({ userValues: null });\n this.setState({\n userValues: value\n });\n };\n render() {\n const userDetails = this.props.userDetails;\n const mobile = isMobile();\n return (\n \n
        \n \n Account Settings\n \n\n \n \n Logout\n \n \n
        \n
        \n \n \n \n

        \n Welcome,{' '}\n {userDetails.get('username')\n ? userDetails.get('username')\n : 'stranger'}\n !\n

        \n
         
        \n
        \n \n
        \n

        \n Info\n

        \n \n

        OSMCha ID:

        \n

        {userDetails.get('id')}

        \n
        \n \n

        OSM ID:

        \n

        {userDetails.get('uid')}

        \n
        \n \n

        Username:

        \n

        {userDetails.get('username')}

        \n
        \n {userDetails.get('is_staff') && (\n \n

        Staff:

        \n

        Yes

        \n
        \n )}\n \n

        API key:

        \n

        \n Token {this.props.token}\n \n navigator.clipboard.writeText(`Token ${this.props.token}`)\n }\n title=\"Copy Authorization Token\"\n >\n \n \n \n

        \n

        \n \n\n {this.props.token && (\n
        \n
        \n

        \n Review Comments Template\n

        \n \n
        \n
        \n )}\n
        \n \n \n );\n }\n}\n\nUser = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n changesetId: parseInt(state.changeset.get('changesetId'), 10),\n currentChangeset: state.changeset.getIn([\n 'changesets',\n parseInt(state.changeset.get('changesetId'), 10)\n ]),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map()),\n avatar: state.auth.getIn(['userDetails', 'avatar'])\n }),\n {\n logUserOut,\n modal,\n push\n }\n)(User);\n\nexport { User };\n","import React from 'react';\n\nimport { isMobile } from '../utils';\nimport { Avatar } from './avatar';\n\nexport function SecondaryPagesHeader({ title, avatar }) {\n const mobile = isMobile();\n\n return (\n \n \n \n \n \n {title}\n \n \n );\n}\n","import React from 'react';\n\nexport function CustomURL({ href, children, iconName, className }: Object) {\n return (\n \n {iconName && (\n \n \n \n )}\n \n );\n}\n","import React from 'react';\n\nexport const BlockMarkup = ({ children }) => (\n
        \n
        \n {children}\n
        \n
        \n);\n","// @flow\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport { push } from 'react-router-redux';\nimport { connect } from 'react-redux';\nimport { Map, List } from 'immutable';\n\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { applyFilters } from '../store/filters_actions';\nimport { cancelablePromise, isMobile } from '../utils';\nimport { fetchAllAOIs } from '../network/aoi';\nimport { createAOI, deleteAOI } from '../network/aoi';\nimport { withFetchDataSilent } from '../components/fetch_data_enhancer';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport { Button } from '../components/button';\nimport { CustomURL } from '../components/customURL';\nimport { BlockMarkup } from '../components/user/block_markup';\nimport type { filtersType } from '../components/filters';\nimport type { RootStateType } from '../store';\nimport { API_URL } from '../config';\n\nclass SaveButton extends React.PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n editing: false\n };\n }\n ref;\n clicked = false;\n onClick = event => {\n this.clicked = true;\n this.setState({ editing: true });\n };\n onChange = (event: any) => {\n this.setState({ value: event.target.value });\n };\n onKeyDown = event => {\n if (event.keyCode === 13) {\n this.setState({\n editing: false\n });\n this.props.onCreate(this.state.value);\n } else if (event.keyCode === 27) {\n this.setState({\n editing: false\n });\n this.clicked = false;\n }\n };\n onSave = event => {\n this.setState({\n editing: false\n });\n this.props.onCreate(this.state.value);\n };\n render() {\n return (\n \n {this.state.editing ? (\n \n {\n if (this.clicked) {\n r && r.select();\n this.clicked = false;\n }\n }}\n value={this.state.value}\n onChange={this.onChange}\n onKeyDown={this.onKeyDown}\n />\n \n \n ) : (\n \n )}\n \n );\n }\n}\n\nconst AOIsBlock = ({ data, activeAoiId, removeAoi }) => (\n \n \n \n {data.getIn(['properties', 'name'])}\n {activeAoiId === data.getIn(['id']) ? '*' : ''}\n \n ({data.getIn(['id'])})\n \n \n \n {activeAoiId === data.getIn(['id']) ? 'Active' : 'Load'}\n \n \n \n \n \n);\n\nconst ListFortified = ({\n onAdd,\n onRemove,\n data,\n TargetBlock,\n propsToPass,\n SaveComp\n}) => (\n
        \n {data.map((e, i) => (\n \n ))}\n {SaveComp}\n
        \n);\n\ntype propsType = {\n avatar: ?string,\n aoiId: ?string,\n token: string,\n data: Map,\n location: Object,\n filters: filtersType,\n userDetails: Map,\n applyFilters: (filtersType, path?: string) => mixed, // base\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any\n};\nclass SavedFilters extends React.PureComponent {\n createAOIPromise;\n state = {\n userValues: null\n };\n componentWillUnmount() {\n this.createAOIPromise && this.createAOIPromise.cancel();\n }\n\n addToWatchList = ({ username, uid }: { username: string, uid: string }) => {\n if (!username || !uid) return;\n this.props.addToWatchlist({ username, uid });\n };\n removeFromWatchList = (uid: number) => {\n if (!uid) return;\n this.props.removeFromWatchlist(uid);\n };\n addToTrustedList = ({ username }: { username: string }) => {\n if (!username) return;\n this.props.addToTrustedlist(username);\n };\n removeFromTrustedList = (username: string) => {\n if (!username) return;\n this.props.removeFromTrustedlist(username);\n };\n // aoi\n loadAoiId = (aoiId: ?string) => {\n if (!aoiId) return;\n this.props.push({\n ...this.props.location,\n search: `aoi=${aoiId}`,\n path: '/filters'\n });\n };\n createAOI = (name: string) => {\n if (name === '' || !name) return;\n this.createAOIPromise = cancelablePromise(\n createAOI(this.props.token, name, this.props.filters)\n );\n\n this.createAOIPromise.promise\n .then(r => r && this.loadAoiId(r.id))\n .catch(e => console.error(e));\n };\n removeAOI = (aoiId: string) => {\n if (!aoiId) return;\n deleteAOI(this.props.token, aoiId)\n .then(r => {\n if (aoiId === this.props.aoiId) {\n this.props.applyFilters(new Map(), '/user');\n } else {\n // const location = {\n // ...this.props.location, // clone it\n // pathname: '/user'\n // };\n this.props.reloadData();\n }\n this.props.modal({\n kind: 'success',\n title: 'Filter Deleted ',\n description: `The ${aoiId} was deleted`\n });\n })\n .catch(e => {\n this.props.reloadData();\n this.props.modal({\n kind: 'error',\n title: 'Deletion failed ',\n error: e\n });\n });\n };\n onUserChange = (value: ?Array) => {\n if (Array.isArray(value) && value.length === 0)\n return this.setState({ userValues: null });\n this.setState({\n userValues: value\n });\n };\n render() {\n const mobile = isMobile();\n\n return (\n \n \n
        \n
        \n {this.props.token && (\n
        \n
        \n

        \n My saved filters\n

        \n }\n />\n
        \n
        \n )}\n
        \n
        \n \n );\n }\n}\n/**\n * Never use props not required by the Basecomponent in HOCs\n */\nSavedFilters = withFetchDataSilent(\n (props: propsType) => ({\n aoi: cancelablePromise(fetchAllAOIs(props.token))\n }),\n (nextProps: propsType, props: propsType) => true,\n SavedFilters\n);\n\nSavedFilters = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n filters: state.filters.get('filters'),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map()),\n avatar: state.auth.getIn(['userDetails', 'avatar']),\n aoiId: state.filters.getIn(['aoi', 'id'], null)\n }),\n {\n applyFilters,\n logUserOut,\n modal,\n push\n }\n)(SavedFilters);\n\nexport { SavedFilters };\n","// @flow\nimport React from 'react';\nimport { Button } from '../button';\nimport { handleErrors } from '../../network/aoi';\n\nexport class WatchListUser extends React.Component {\n state = {\n username: '',\n uid: '',\n isValidUsername: true,\n isValidUid: true,\n verified: false\n };\n setUsername = (event: any) => {\n const target = event.target;\n const value = target.value;\n this.setState({ username: value, isValidUsername: true, verified: false });\n };\n setUid = (event: any) => {\n const target = event.target;\n const value = target.value;\n this.setState({ uid: value, isValidUid: true, verified: false });\n };\n fetchUsername = (username: string) =>\n fetch(\n `https://www.openstreetmap.org/api/0.6/changesets?display_name=${this.state.username}`\n )\n .then(handleErrors)\n .then(r => r.text())\n .then(r => {\n try {\n const parser = new DOMParser();\n const xml = parser.parseFromString(r, 'text/xml');\n return (\n xml.getElementsByTagName('osm')[0] &&\n xml\n .getElementsByTagName('osm')[0]\n .firstElementChild.getAttribute('uid')\n );\n } catch (e) {\n handleErrors();\n }\n });\n\n fetchUid = (uid: string) =>\n fetch(`https://www.openstreetmap.org/api/0.6/user/${uid}.json`)\n .then(handleErrors)\n .then(r => r.json());\n\n verifyInput = () => {\n if (this.state.uid.length > 0 && this.state.username.length === 0) {\n this.fetchUid(this.state.uid)\n .then(r => ({\n uid: r.user.id.toString(),\n username: r.user.display_name\n }))\n .then(r =>\n this.setState({\n username: r.username,\n uid: r.uid,\n verified: true,\n isValidUsername: true,\n isValidUid: true\n })\n )\n .catch(r => this.setState({ isValidUid: false, verified: false }));\n } else if (this.state.username.length > 0 && this.state.uid.length === 0) {\n this.fetchUsername(this.state.username)\n .then(r => ({\n uid: r.toString(),\n username: this.state.username\n }))\n .then(x => {\n return x;\n })\n .then(r =>\n this.setState({\n username: r.username,\n uid: r.uid,\n verified: true,\n isValidUsername: true,\n isValidUid: true\n })\n )\n .catch(r => this.setState({ isValidUsername: false, verified: false }));\n } else if (this.state.uid.length > 0 && this.state.username.length > 0) {\n Promise.all([\n this.fetchUid(this.state.uid).then(r => ({\n uid: r.id,\n username: r.name\n })),\n this.fetchUsername(this.state.username).then(r => ({\n uid: r.id,\n username: r.name\n }))\n ])\n .then(resp => {\n if (\n resp[0].uid === resp[1].uid &&\n resp[0].username === resp[1].username\n ) {\n window.alert('The user is valid');\n this.setState({ verified: true });\n } else {\n this.setState({ isValidUsername: false, isValidUid: false });\n }\n })\n .catch(e =>\n this.setState({ isValidUsername: false, isValidUid: false })\n );\n }\n };\n onAdd = () => {\n const username = this.state.username;\n const uid = this.state.uid;\n if (username && username.length > 0 && uid && uid.length > 0) {\n this.props.onSave(username, uid);\n } else {\n this.setState({ isValidUsername: false, isValidUid: false });\n }\n };\n\n render() {\n const errorClass = 'border border--1 border--red';\n return (\n \n \n \n \n \n Add\n \n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { Button } from '../button';\n\nexport class TrustedListUser extends React.Component {\n state = {\n username: ''\n };\n\n onAdd = () => {\n const username = this.state.username;\n if (username && username.length > 0) {\n this.props.onSave(username);\n this.setState({ username: '' });\n }\n };\n\n render() {\n return (\n \n this.setState({ username: e.target.value })}\n placeholder=\"Username\"\n type=\"text\"\n />\n \n \n );\n }\n}\n","import React from 'react';\n\nimport { Button } from '../button';\nimport { WatchListUser } from './watchlist_user';\nimport { TrustedListUser } from './trustedlist_user';\n\nexport class SaveUser extends React.PureComponent {\n state = {\n showInput: false\n };\n onSave = (username, uid) => {\n if (this.props.forWatchlist) {\n if (!username || !uid) return;\n this.props.onCreate({ username, uid });\n this.setState({ showInput: false });\n } else {\n if (!username) return;\n this.props.onCreate({ username });\n this.setState({ showInput: false });\n }\n };\n render() {\n return (\n \n {this.state.showInput ? (\n \n {this.props.forWatchlist ? (\n \n ) : (\n \n )}\n \n ) : (\n this.setState({ showInput: true })}\n >\n Add+\n \n )}\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map, List } from 'immutable';\nimport { push } from 'react-router-redux';\nimport { Link } from 'react-router-dom';\n\nimport { getObjAsQueryParam, isMobile } from '../utils';\nimport { BlockMarkup } from '../components/user/block_markup';\nimport { SaveUser } from '../components/user/save_user';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport {\n addToTrustedlist,\n removeFromTrustedlist\n} from '../store/trustedlist_actions';\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { Button } from '../components/button';\nimport type { RootStateType } from '../store';\n\nconst TrustedListBlock = ({ data, removeFromTrustedList }) => (\n \n \n {data}\n \n \n \n OSMCha\n \n \n \n \n);\n\nconst ListFortified = ({\n onAdd,\n onRemove,\n data,\n TargetBlock,\n propsToPass,\n SaveComp\n}) => (\n
        \n {data.map((e, i) => (\n \n ))}\n {SaveComp}\n
        \n);\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any,\n trustedList: Map,\n addToTrustedlist: string => void,\n removeFromTrustedlist: string => void\n};\nclass TrustedUsers extends React.PureComponent {\n state = {\n userValues: null\n };\n addToTrustedList = ({ username }: { username: string }) => {\n if (!username) return;\n this.props.addToTrustedlist(username);\n };\n removeFromTrustedList = (username: string) => {\n if (!username) return;\n this.props.removeFromTrustedlist(username);\n };\n onUserChange = (value: ?Array) => {\n if (Array.isArray(value) && value.length === 0)\n return this.setState({ userValues: null });\n this.setState({\n userValues: value\n });\n };\n render() {\n let trustedUsers = this.props.trustedList ? this.props.trustedList : List();\n trustedUsers = trustedUsers.sortBy(\n a => a,\n (a: string, b: string) => a.localeCompare(b)\n );\n const mobile = isMobile();\n\n return (\n \n \n
        \n
        \n {this.props.token && (\n
        \n
        \n

        \n My trusted users list\n

        \n }\n />\n
        \n
        \n )}\n
        \n
        \n \n );\n }\n}\n\nTrustedUsers = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n trustedList: state.trustedlist.get('trustedlist'),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map()),\n avatar: state.auth.getIn(['userDetails', 'avatar'])\n }),\n {\n logUserOut,\n modal,\n push,\n addToTrustedlist,\n removeFromTrustedlist\n }\n)(TrustedUsers);\n\nexport { TrustedUsers };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map, List } from 'immutable';\nimport { push } from 'react-router-redux';\nimport { Link } from 'react-router-dom';\n\nimport { getObjAsQueryParam, isMobile } from '../utils';\nimport { BlockMarkup } from '../components/user/block_markup';\nimport { SaveUser } from '../components/user/save_user';\nimport {\n addToWatchlist,\n removeFromWatchlist\n} from '../store/watchlist_actions';\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { Button } from '../components/button';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport type { RootStateType } from '../store';\n\nconst WatchListBlock = ({ data, removeFromWatchList }) => (\n \n \n {data.getIn(['username'])}\n ({data.getIn(['uid'])})\n \n \n \n OSMCha\n \n removeFromWatchList(data.getIn(['uid']))}\n >\n Remove\n \n \n \n);\n\nconst ListFortified = ({\n onAdd,\n onRemove,\n data,\n TargetBlock,\n propsToPass,\n SaveComp\n}) => (\n
        \n {data.map((e, i) => (\n \n ))}\n {SaveComp}\n
        \n);\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any,\n watchlisted: Map,\n addToWatchlist: string => void,\n removeFromWatchlist: string => void\n};\nclass Watchlist extends React.PureComponent {\n state = {\n userValues: null\n };\n // blacklist\n addToWatchList = ({ username, uid }: { username: string, uid: string }) => {\n if (!username || !uid) return;\n this.props.addToWatchlist({ username, uid });\n };\n removeFromWatchList = (uid: number) => {\n if (!uid) return;\n this.props.removeFromWatchlist(uid);\n };\n onUserChange = (value: ?Array) => {\n if (Array.isArray(value) && value.length === 0)\n return this.setState({ userValues: null });\n this.setState({\n userValues: value\n });\n };\n render() {\n let watchList = this.props.watchlisted ? this.props.watchlisted : List();\n watchList = watchList.sortBy(\n a => a.get('username'),\n (a: string, b: string) => a.localeCompare(b)\n );\n const mobile = isMobile();\n\n return (\n \n \n \n
        \n {this.props.token && (\n
        \n
        \n

        \n My watched users list\n

        \n \n }\n />\n
        \n
        \n )}\n {this.props.token && (\n \n \n Filter changesets\n \n \n )}\n
        \n \n \n );\n }\n}\n\nWatchlist = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n watchlisted: state.watchlist.get('watchlist'),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map()),\n avatar: state.auth.getIn(['userDetails', 'avatar'])\n }),\n {\n logUserOut,\n modal,\n push,\n addToWatchlist,\n removeFromWatchlist\n }\n)(Watchlist);\n\nexport { Watchlist };\n","import { API_URL } from '../config';\nimport { handleErrors } from './aoi';\n\nexport function createMappingTeam(token: string, name: string, users: string) {\n return fetch(`${API_URL}/mapping-team/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n name,\n users\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchMappingTeam(token: string, id: number) {\n return fetch(`${API_URL}/mapping-team/${id}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\nexport function deleteMappingTeam(token: string, id: number) {\n return fetch(`${API_URL}/mapping-team/${id}/`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(handleErrors);\n}\n\nexport function fetchUserMappingTeams(token: string, owner: string) {\n return fetch(`${API_URL}/mapping-team/?owner=${owner}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchTrustedMappingTeams(token: string) {\n return fetch(`${API_URL}/mapping-team/?trusted=true`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function updateMappingTeam(\n token: string,\n id: number,\n name: ?string,\n users: ?object\n) {\n return fetch(`${API_URL}/mapping-team/${id}`, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n name,\n users\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","import React, { useEffect, useState } from 'react';\nimport { Link } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport { format } from 'date-fns';\nimport DatePicker from 'react-datepicker';\nimport 'react-datepicker/dist/react-datepicker.css';\n\nimport { Button } from '../button';\n\nconst NewTeam = props => {\n const [teamName, setTeamName] = useState('');\n const [teamUsers, setTeamUsers] = useState([{}]);\n const [editing, setEditing] = useState(props.editing || false);\n const [validationErrorMessage, setValidationErrorMessage] = useState('');\n\n useEffect(() => {\n if (props.activeTeam) {\n setTeamName(props.activeTeam.get('name'));\n let users = [];\n props.activeTeam.get('users').map(user =>\n users.push({\n username: user.get('username'),\n uid: user.get('uid'),\n joined: user.get('joined'),\n left: user.get('left')\n })\n );\n let cleanedUsers = [];\n users.forEach((user, k) => {\n let u = Object.fromEntries(\n Object.entries(user).filter(([_, v]) => v !== undefined)\n );\n cleanedUsers.push(u);\n });\n setTeamUsers([...cleanedUsers]);\n }\n }, [props.activeTeam]);\n\n const onClickRemoveUser = idx => {\n let teamUsersToUpdate = [...teamUsers];\n teamUsersToUpdate.splice(idx, 1);\n setTeamUsers(teamUsersToUpdate);\n };\n\n const onClickAddAnotherUser = () => setTeamUsers([...teamUsers, {}]);\n\n const onChangeInput = (property, value, idx) => {\n let teamUsersToUpdate = [...teamUsers];\n teamUsersToUpdate[idx] = { ...teamUsersToUpdate[idx], [property]: value };\n setTeamUsers(teamUsersToUpdate);\n };\n\n const validateData = () => {\n if (!teamName) {\n return { valid: false, error: 'Team name cannot be empty.' };\n }\n if (teamUsers) {\n try {\n if (\n teamUsers.filter(i => i.hasOwnProperty('username')).length ===\n teamUsers.length\n ) {\n return { valid: true };\n } else {\n return {\n valid: false,\n error: 'The username field should not be empty.'\n };\n }\n } catch (err) {\n return {\n valid: false,\n error: 'Verify if there is some wrong user information.'\n };\n }\n } else {\n return { valid: false, error: 'Users cannot be empty' };\n }\n };\n\n const onSave = e => {\n const validation = validateData();\n\n if (validation.valid) {\n if (props.activeTeam) {\n props.onChange(props.activeTeam.get('id'), teamName, teamUsers);\n setValidationErrorMessage('');\n } else {\n props.onCreate(teamName, teamUsers);\n setEditing(false);\n setValidationErrorMessage('');\n }\n } else {\n setValidationErrorMessage(validation.error);\n }\n };\n\n return (\n
        \n {editing ? (\n <>\n {props.activeTeam ? (\n <>\n ) : (\n

        Add a new mapping team

        \n )}\n <>\n \n Users\n {teamUsers.map((user, k) => (\n
        \n \n \n \n \n \n
        \n ))}\n \n\n

        \n The mapping team members are public and can be\n visualized by any logged in OSMCha user.\n

        \n\n {validationErrorMessage && (\n \n {validationErrorMessage}\n \n )}\n\n \n {props.userIsOwner && (\n \n )}\n {props.activeTeam ? (\n \n Back to teams\n \n ) : (\n setEditing(false)}\n >\n Cancel\n \n )}\n \n \n \n ) : (\n <>\n \n \n )}\n
        \n );\n};\n\nNewTeam.propTypes = {\n teamUsers: PropTypes.arrayOf(PropTypes.object),\n teamName: PropTypes.string,\n editing: PropTypes.bool,\n validationErrorMessage: PropTypes.string,\n onClickRemoveUser: PropTypes.func,\n onClickAddAnotherUser: PropTypes.func,\n onChangeInput: PropTypes.func,\n onSave: PropTypes.func,\n validateData: PropTypes.func\n};\n\nexport default NewTeam;\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map, List } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { cancelablePromise, isMobile } from '../utils';\nimport {\n createMappingTeam,\n fetchUserMappingTeams,\n deleteMappingTeam\n} from '../network/mapping_team';\nimport { Link } from 'react-router-dom';\nimport { withFetchDataSilent } from '../components/fetch_data_enhancer';\nimport { Button } from '../components/button';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport { BlockMarkup } from '../components/user/block_markup';\nimport type { RootStateType } from '../store';\n\nimport NewTeam from '../components/teams/new_team';\n\nexport type teamsOptionsType = Map<'label' | 'value', ?string>;\nexport type teamType = List;\nexport type teamsType = Map;\n\nconst TeamsBlock = ({ data, removeTeam, editTeam }) => (\n \n \n {data.get('name')}\n \n \n \n Filter team changesets\n \n \n Edit\n \n \n \n \n);\n\nconst ListFortified = ({\n onAdd,\n onRemove,\n data,\n TargetBlock,\n propsToPass,\n SaveComp\n}) => (\n
        \n {data.map((e, i) => (\n \n ))}\n {SaveComp}\n
        \n);\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any\n};\n\nclass MappingTeams extends React.PureComponent {\n createTeamPromise;\n state = {\n userValues: null,\n addingTeam: false\n };\n\n componentWillUnmount() {\n this.createTeamPromise && this.createTeamPromise.cancel();\n }\n\n createTeam = (name: string, users: object) => {\n if (name === '' || !name || !users) return;\n this.setState({ addingTeam: true });\n this.createTeamPromise = cancelablePromise(\n createMappingTeam(this.props.token, name, users)\n );\n this.createTeamPromise.promise\n .then(r => {\n this.props.modal({\n kind: 'success',\n title: 'Team Created ',\n description: `The team ${name} was created successfully!`\n });\n this.props.reloadData();\n this.setState({ addingTeam: false });\n })\n .catch(e => console.error(e));\n };\n\n removeTeam = (teamId: string) => {\n if (!teamId) return;\n deleteMappingTeam(this.props.token, teamId)\n .then(r => {\n this.props.modal({\n kind: 'success',\n title: 'Team Deleted ',\n description: `The team with id ${teamId} was deleted`\n });\n this.props.reloadData();\n })\n .catch(e => {\n this.props.reloadData();\n this.props.modal({\n kind: 'error',\n title: 'Deletion failed ',\n error: e\n });\n });\n };\n\n render() {\n const mobile = isMobile();\n\n return (\n \n \n
        \n
        \n {this.props.token && (\n
        \n
        \n

        \n My mapping teams\n

        \n \n }\n />\n
        \n
        \n )}\n
        \n
        \n \n );\n }\n}\n/**\n * Never use props not required by the Basecomponent in HOCs\n */\nMappingTeams = withFetchDataSilent(\n (props: propsType) => ({\n teams: cancelablePromise(\n fetchUserMappingTeams(props.token, props.userDetails.get('username'))\n )\n }),\n (nextProps: propsType, props: propsType) => true,\n MappingTeams\n);\n\nMappingTeams = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map())\n }),\n {\n modal,\n logUserOut,\n push\n }\n)(MappingTeams);\n\nexport { MappingTeams };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { cancelablePromise } from '../utils/promise';\nimport {\n fetchMappingTeam,\n updateMappingTeam,\n deleteMappingTeam\n} from '../network/mapping_team';\nimport { withFetchDataSilent } from '../components/fetch_data_enhancer';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport { SignIn } from '../components/sign_in';\nimport type { RootStateType } from '../store';\nimport NewTeam from '../components/teams/new_team';\nimport { isMobile } from '../utils';\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any\n};\nclass EditMappingTeam extends React.PureComponent {\n updateTeamPromise;\n state = {\n userValues: null\n };\n\n componentWillUnmount() {\n this.createTeamPromise && this.createTeamPromise.cancel();\n }\n\n editTeam = (id: string, name: string, users: object) => {\n if (name === '' || !name || !users) return;\n this.updateTeamPromise = cancelablePromise(\n updateMappingTeam(this.props.token, id, name, users)\n );\n this.updateTeamPromise.promise\n .then(r => {\n this.props.modal({\n kind: 'success',\n title: 'Team Updated ',\n description: `The team ${name} was updated successfully!`\n });\n this.props.reloadData();\n })\n .catch(e => {\n this.props.modal({\n kind: 'error',\n title: 'Update failed ',\n error: e\n });\n console.error(e);\n });\n };\n\n removeTeam = (teamId: string) => {\n if (!teamId) return;\n deleteMappingTeam(this.props.token, teamId)\n .then(r => {\n this.props.modal({\n kind: 'success',\n title: 'Team Deleted ',\n description: `The team with id ${teamId} was deleted`\n });\n this.props.reloadData();\n })\n .catch(e => {\n this.props.reloadData();\n this.props.modal({\n kind: 'error',\n title: 'Deletion failed ',\n error: e\n });\n });\n };\n\n render() {\n const mobile = isMobile();\n\n return (\n \n \n {this.props.token ? (\n
        \n
        \n
        \n
        \n

        \n Editing mapping team: \n {this.props.data.getIn(['team', 'name'])}\n

        \n \n
        \n
        \n
        \n
        \n ) : (\n \n )}\n \n );\n }\n}\n/**\n * Never use props not required by the Basecomponent in HOCs\n */\nEditMappingTeam = withFetchDataSilent(\n (props: propsType) => ({\n team: cancelablePromise(fetchMappingTeam(props.token, props.teamId))\n }),\n (nextProps: propsType, props: propsType) => true,\n EditMappingTeam\n);\n\nEditMappingTeam = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n teamId: parseInt(props.match.params.id, 10),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map())\n }),\n {\n modal,\n logUserOut,\n push\n }\n)(EditMappingTeam);\n\nexport { EditMappingTeam };\n","import React from 'react';\nimport { Route } from 'react-router-dom';\n\nimport { Changeset } from './views/changeset';\nimport { About } from './views/about';\nimport { Stats } from './views/stats';\nimport { Filters } from './views/filters';\nimport { ChangesetsList } from './views/changesets_list';\nimport { CMap } from './views/map';\nimport { NavbarChangeset } from './views/navbar_changeset';\nimport { NavbarSidebar } from './views/navbar_sidebar';\n// import { Home } from './views/home';\nimport { Modal } from './views/modal';\nimport { User } from './views/user';\nimport { SavedFilters } from './views/saved_filters';\nimport { TrustedUsers } from './views/trusted_users';\nimport { Watchlist } from './views/watchlist';\nimport { MappingTeams } from './views/teams';\nimport { EditMappingTeam } from './views/edit_team';\n\nexport const AppMobile = () => {\n return (\n <>\n
        \n \n \n \n }\n />\n \n \n \n \n \n \n \n \n \n \n
        \n \n \n );\n};\n","// @flow\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nimport { appVersion, isDev, isStaging, isLocal } from '../config';\nimport banner from '../assets/banner.png';\nimport work_flow from '../assets/work_flow.png';\n\nexport function Home() {\n return (\n
        \n
         
        \n
        \n \"OSMCHA\"\n \n
        \n
         
        \n
        \n
        \n v{appVersion}\n {isDev && ' Dev'}\n {isStaging && ' Staging'}\n {isLocal && ' Local'}\n
        \n
        \n \n \n \n {' '}\n Guide\n {' '}\n |{' '}\n \n \n \n {' '}\n GitHub\n {' '}\n |{' '}\n \n \n \n {' '}\n File an issue\n \n
        \n
        \n
         
        \n
        \n );\n}\n","import React from 'react';\nimport { Route } from 'react-router-dom';\nimport CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';\n\nimport { Changeset } from './views/changeset';\nimport { About } from './views/about';\nimport { Stats } from './views/stats';\nimport { Filters } from './views/filters';\nimport { ChangesetsList } from './views/changesets_list';\nimport { CMap } from './views/map';\nimport { NavbarChangeset } from './views/navbar_changeset';\nimport { NavbarSidebar } from './views/navbar_sidebar';\nimport { Home } from './views/home';\nimport { Modal } from './views/modal';\nimport { User } from './views/user';\nimport { SavedFilters } from './views/saved_filters';\nimport { TrustedUsers } from './views/trusted_users';\nimport { Watchlist } from './views/watchlist';\nimport { MappingTeams } from './views/teams';\nimport { EditMappingTeam } from './views/edit_team';\n\nexport const AppDesktop = () => {\n return (\n <>\n
        \n
        \n \n \n
        \n
        \n (\n \n \n \n \n }\n />\n \n \n \n \n \n \n \n \n \n \n )}\n />\n
        \n
        \n \n \n );\n};\n","// @flow\nimport React, { Component } from 'react';\nimport { Map } from 'immutable';\n\nimport { isMobile } from './utils';\nimport { AppMobile } from './AppMobile';\nimport { AppDesktop } from './AppDesktop';\n\nimport { gaPageView } from './utils/analytics';\nimport { getSearchObj } from './utils/query_params';\n\nexport class App extends Component {\n resize = null;\n componentDidMount() {\n if (document && document.body) {\n var filters = getSearchObj(window.location.search).getIn(\n ['filters'],\n Map()\n );\n if (filters && filters.size > 0) {\n filters = filters\n .keySeq()\n .sort((a, b) => a.localeCompare(b))\n .join(',');\n gaPageView(`/?filters=${filters}`);\n } else {\n gaPageView('/');\n }\n }\n }\n render() {\n const mobile = isMobile();\n if (mobile) {\n return ;\n } else {\n return ;\n }\n }\n}\n","// @flow\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ConnectedRouter } from 'react-router-redux';\nimport { Provider } from 'react-redux';\nimport ReactGA from 'react-ga';\nimport Raven from 'raven-js';\nimport { history } from './store/history';\nimport { store } from './store';\nimport { isDev, stack, appVersion } from './config';\nimport { unregisterServiceWorker } from './serviceworker';\n\nimport './assets/index.css';\nimport 'animate.css/animate.css';\nimport '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';\nimport 'react-select/dist/react-select.css';\n\nimport { App } from './app';\n\nReactGA.initialize('UA-100686765-1', {\n gaOptions: {\n anonymizeIp: true,\n screenResolution: `${window.screen.availWidth}X${window.screen.availHeight}`,\n appName: stack\n }\n});\n\nif (process.env.NODE_ENV === 'production') {\n Raven.config('https://5637ef87f5794e2fb9e1e5fe9119688d@sentry.io/175926', {\n release: appVersion,\n environment: process.env.NODE_ENV,\n debug: isDev\n }).install();\n}\n// if (process.env.NODE_ENV !== 'production') {\n// const { whyDidYouUpdate } = require('why-did-you-update');\n// whyDidYouUpdate(React);\n// }\nReactDOM.render(\n \n \n \n \n ,\n document.getElementById('root')\n);\nunregisterServiceWorker();\n","// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nexport function registerServiceWorker() {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh\" message in your web app.\n const r = window.confirm(\n 'New version of OSMCha is available. Would you like to reload?'\n );\n if (r) {\n window.location.reload();\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n });\n }\n}\n\nexport function unregisterServiceWorker() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","module.exports = __webpack_public_path__ + \"static/media/thumbs-up.13d765c5.svg\";","module.exports = __webpack_public_path__ + \"static/media/thumbs-down.7e04a82a.svg\";","module.exports = \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWi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aHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/AP2YooooAKKz7u8ito9z9T0UdSa4eXWb1z8pCD0Az+poA9IorzeLWb1D8xDj0Ix+oruLS8iuY9ydR1U9QaANCiiigAooooA8v1Scy3snPCHaPwrHq3d/8fU//XRv51UoAK2NLnMV7Hzw52n8ax6t2n/H1B/10X+dAHrtFFFABRRTHdEUszBQO5OBQBwOs2jJOZgPlfr7N/8AXrmK9En1ixAK4MgPUAcH8689JBY4GBk4FADa6fRrRnnExHyp092/+tXNAgMMjIyMivQoNYsSAuDGB0BHA/KgDpKKYjo6hlYMD3ByKfQBmX17Haxbjyx4VfU/4V5rcXM1w+6Rs+g7D6CtLWJGe+cHogCj+dYVABRRRQAUUUUAW7e5mt33Rtj1HY/UV6VY3sd1FuHDDhl9D/hXlVbujyMl8gHRwVP86AP/2Q==\""],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["assets/banner.png","assets/work_flow.png","config/index.js","store/history.js","utils/safe_storage.js","config/constants.js","network/aoi.js","network/auth.js","network/status.js","network/changeset.js","network/osmcha_watchlist.js","store/modal_actions.js","network/osmcha_trustedlist.js","store/trustedlist_actions.js","store/watchlist_actions.js","utils/filters.js","network/changesets_page.js","utils/query_params.js","network/reasons_tags.js","store/aoi_actions.js","store/filters_actions.js","store/changesets_page_actions.js","config/notifications.js","utils/cmap.js","utils/routing.js","store/changeset_actions.js","store/auth_actions.js","store/auth_reducer.js","store/changesets_page_reducer.js","store/changeset_reducer.js","store/modal_reducer.js","store/filters_reducer.js","store/map_controls_actions.js","store/map_controls_reducer.js","store/trustedlist_reducer.js","store/blacklist_reducer.js","store/aoi_reducer.js","store/sagas.js","store/index.js","utils/analytics.js","utils/component.js","utils/create_popup.js","utils/dispatch_event.js","utils/element_in_view.js","utils/handle_popup_callback.js","utils/promise.js","utils/isMobile.js","components/changeset/floater.js","components/create_delete_modify.js","components/assembly_anchor.js","components/changeset/translate_button.js","components/reasons.js","components/changeset/property.js","components/changeset/property_list.js","components/changeset/details.js","hooks/UseIsUserListed.js","components/changeset/header.js","components/avatar.js","components/changeset/sign_in_button.js","components/button.js","components/dropdown.js","components/changeset/trust_watch_user.js","components/changeset/user_osm_link.js","components/changeset/user.js","components/loading.js","components/sign_in.js","views/map.js","components/changeset/features.js","components/open_all.js","components/expand_item_icon.js","components/changeset/tag_changes.js","components/changeset/other_features.js","components/changeset/geometry_changes.js","components/changeset/box.js","components/changeset/comment.js","components/changeset/discussions.js","components/changeset/map_options.js","components/changeset/control.js","config/bindings.js","components/changeset/control_layout.js","components/keyboard_enhancer.js","components/fetch_data_enhancer.js","network/openstreetmap.js","network/whosthat.js","components/changeset/index.js","views/changeset.js","views/about.js","views/stats.js","components/filters/radio.js","components/filters/text.js","components/filters/multi_select.js","network/nominatim.js","components/filters/location.js","components/filters/wrapper.js","components/filters/meta.js","components/filters/date.js","components/bbox_picker.js","components/loading_enhancer.js","components/filters/filters_list.js","components/filters/filters_header.js","views/filters.js","components/list/comments.js","components/list/secondary_line.js","components/list/primary_line.js","components/list/title.js","components/list/row.js","components/list/index.js","components/list/page_range.js","components/list/footer.js","components/list/header.js","utils/number_with_commas.js","components/changeset/tags.js","views/changesets_list.js","components/navbar.js","components/changeset/verify.js","components/changeset/open_in.js","views/navbar_changeset.js","views/navbar_sidebar.js","views/modal.js","components/user/details.js","views/user.js","components/secondary_pages_header.js","components/customURL.js","components/user/block_markup.js","views/saved_filters.js","components/user/watchlist_user.js","components/user/trustedlist_user.js","components/user/save_user.js","views/trusted_users.js","views/watchlist.js","network/mapping_team.js","components/teams/new_team.js","views/teams.js","views/edit_team.js","AppMobile.js","views/home.js","AppDesktop.js","app.js","index.js","serviceworker.js","assets/thumbs-up.svg","assets/thumbs-down.svg","components/user.jpg"],"names":["module","exports","isDev","process","isStaging","isProd","isLocal","url","window","debug_info","toString","API_URL","historyConfig","basename","history","createBrowserHistory","getItem","key","localStorage","err","console","warn","setItem","value","removeItem","mapboxAccessToken","osmchaSocialTokenUrl","osmAuthUrl","getString","input","JSON","stringify","handleErrors","response","ok","json","then","r","status","Error","detail","statusText","Promise","reject","createAOI","token","name","filters","serverFilters","forEach","v","k","Iterable","isIterable","filter","x","get","map","join","fetch","method","headers","Authorization","body","res","fetchAOI","aoiId","fetchAllAOIs","resolve","updateAOI","deleteAOI","postFinalTokensOSMCha","oauth_token","oauth_token_secret","oauth_verifier","request","post","type","send","catch","e","error","postTokensOSMCha","fetchUserDetails","updateUserDetails","message_good","message_bad","comment_feature","getStatus","fetchChangeset","id","setHarmful","harmful","createForm","obj","formData","FormData","Object","keys","append","setTag","tag","remove","Number","isNaN","parseInt","tag_pk","postComment","comment","fetchWatchList","deleteFromWatchList","uid","postUserToWatchList","data","username","watchlist_user","watchModal","handleModal","modal","kind","title","dismiss","autoDismiss","position","description","callback","callbackArgs","callbackLabel","message","payload","action","takeEvery","uidOriginal","Date","getTime","Math","random","put","take","call","delay","deleteFromTrustedList","postUserToTrustedList","whitelist_user","watchTrustedlist","addToTrustedlistSaga","removeFromTrustedlistSaga","TRUSTEDLIST","tokenSelector","state","auth","addToTrustedlist","trustedlist_user","removeFromTrustedlist","all","select","watchWatchlist","addToWatchlistSaga","removeFromWatchlistSaga","WATCHLIST","addToWatchlist","removeFromWatchlist","validateFilters","Map","isMap","valid","List","isList","vv","has","test","getDefaultFromDate","extraDays","defaultDate","format","sub","days","fromJS","date__gte","label","appendDefaultDate","count","merge","now","getTimezoneOffset","minutes","date__lte","getDefaultToDate","fetchChangesetsPage","pageIndex","nocache","flatFilters","filterJoined","encodeURIComponent","getSearchObj","searchParam","result","parse","getObjAsQueryParam","length","fetchReasons","fetchTags","watchAOI","fetchAOISaga","createAOISaga","updateAOISaga","AOI","takeLatest","loading","reasons","tags","aoi","getIn","split","o","i","hasOwnProperty","SyntaxError","options","locationSelector","location","push","pathname","search","FILTERS","set","CHANGESETS_PAGE","routing","watchFilters","watchLocationChange","applyFilterSaga","filtersSaga","fetched","modify","checkNew","updateNewCount","checkNewLoading","apply","applyFilters","LOCATION_CHANGE","lastSearchString","lastTask","cancel","fork","toJS","toObject","filtersSelector","watchChangesetsPage","fetchChangesetsPageSaga","modifyChangesetPageSaga","checkForNewChangesetsSaga","getChangesetsPage","checkForNewChangesets","pageIndexSelector","changesetsPage","aoiIdSelector","oldPageIndex","thisPage","currentPageAndIndexSelector","changesetId","changeset","currentPage","features","index","findIndex","f","setIn","newData","oldData","diff","toSet","subtract","size","cmap","importChangesetMap","m","log","getParam","param","path","match","matchPath","params","getChangesetIdFromLocation","checkForLegacyURL","watchChangeset","shouldUpdateSaga","watchModifyChangeset","fetchChangesetAction","fetchChangesetMapAction","setHarmfulAction","setTagActions","CHANGESET","CHANGESET_MODIFY","CHANGESET_MAP","changesetTask","changesetMapTask","legacy","replace","modifyAction","notifications","oldChangeset","newChangeset","changesetsSelector","changesets","changesetMapModule","getCMapData","changesetMapSelector","changesetMaps","changesetMap","existingTags","t","delete","watchUserDetails","watchAuth","logoutFlow","authTokenFlow","updateUserDetailsSaga","AUTH","getFinalToken","logUserOut","changesetIdSelector","delayPromise","delayBy","userDetails","trustedlist","watchlist","undefined","initialState","oAuthToken","oAuthTokenSecret","changesetsInitial","diffLoading","initial","errorChangeset","loadingChangesetMap","errorChangesetMap","duration","filtersInitial","MAPCONTROLS","updateStyle","style","mapControlsInitial","aoiInitial","rootSaga","reducers","combineReducers","mapControls","routerReducer","concat","item","sagaMiddleware","createSagaMiddleware","middlewares","routerMiddleware","appliedMiddlewares","applyMiddleware","persistedState","safeStorage","store","createStore","run","sagas","ReactGA","gaPageView","page","pageview","gaSendEvent","event","getDisplayName","WrappedComponent","displayName","createPopup","width","height","settings","innerWidth","innerHeight","popup","open","dispatchEvent","messageId","payLoad","target","CustomEvent","document","elementInViewport","element","rect","getBoundingClientRect","top","left","bottom","right","require","handlePopupCallback","rej","authComplete","creds","queryString","query","pair","decodeURIComponent","parseQueryString","cancelablePromise","promise","hasCanceled_","val","isCanceled","interval","setTimeout","isMobile","Floater","className","this","props","children","React","PureComponent","CreateDeleteModify","showZero","create","AssemblyAnchor","href","rel","TranslateButton","text","xlinkHref","Reasons","userFlag","underline","color","extraClass","Reason","Property","property","imageryMatch","sourceMatch","Array","isArray","PropertyList","limit","properties","entries","slice","Details","source","imagery","editor","metadata","urlRegex","RegExp","indexOf","propertiesObj","from","p","startsWith","useState","leftLimit","setLeftLimit","onClick","useIsUserListed","isInTrustedlist","setIsInTrustedlist","isInWatchlist","setIsInWatchlist","useEffect","user","Header","connect","watchlisted","userEditCount","toggleUser","date","destroy","dir","formatDistanceToNow","addSuffix","Avatar","loaded","setState","nextProps","Placeholder","background","alt","src","onLoad","handleImageLoaded","bind","onError","handleImageErrored","SignInButton","handleLoginClick","oAuthObj","extraClasses","getChangeset","Button","iconName","disabled","DropdownContent","isActive","handleClick","onChange","ourObj","isRemove","onRemove","newArray","multi","onAdd","toggleDropdown","styles","data-label","data-payload","checked","deletable","preventDefault","stopPropagation","_Dropdown","display","handleClickOutside","eventTypes","Dropdown","onClickOutside","TrustWatchUser","handleVerify","arr","handleVerifyClear","is_in_trustedlist","includes","UserOSMLink","userName","linkClasses","UserLink","Link","to","uids","getHarmfulObject","getLinkContent","User","UserDescriptionHTML","showdown","Converter","noHeaderId","simplifiedAutoLink","makeHtml","registrationDate","renderUidFilterLink","users","whosThat","dangerouslySetInnerHTML","__html","Loading","SignIn","currentChangesetMap","cMapRender","getMapInstance","selectFeature","emit","minDebounce","debounce","container","getElementById","render","max","disableSidebar","CMap","visible","ref","setRef","setDimensions","parentNode","instance","resize","mobile","onresize","prevProp","content","timeOut","visibility","transitionName","transitionAppearTimeout","transitionAppear","transitionEnterTimeout","transitionLeaveTimeout","Feature","changesetReasons","reason","contains","role","tabIndex","onFocus","charAt","Features","reviewedFeatures","feature","user_flag","osm_id","reviewedIds","featuresIds","find","OpenAll","setOpenAll","aria-checked","ExpandItemIcon","isOpen","verticalAlign","getFeatures","processFeatures","finalReport","analyzedFeatures","newVersion","oldVersion","oldVersionKeys","newVersionKeys","addedTags","deletedTags","changedValues","analyzeFeature","FeatureListItem","ChangeTitle","oldValue","newValue","ChangeItem","opened","setIsOpen","values","OrderedSet","last_space","lastIndexOf","aria-pressed","n","ChangeItemList","changes","openAll","change","TagChanges","changeReport","setChangeReport","newChangeReport","featureIDs","sort","ActionItem","OtherFeatures","changeType","GeometryChangesItem","node","way","relation","GeometryChanges","geometry","Box","pullDown","pullUp","bg","minHeight","CommentForm","success","postCommentPromise","handleSubmit","updateValue","userCommentedBefore","discussions","changesetIsHarmful","placeholder","clicked","Discussions","changesetAuthor","renderComments","MapOptions","actions","mapStyle","layerOptions","function","toggleSatellite","toggleStreet","toggleDark","toggleBing","toggleOsm","getLayerDropdownDisplay","filteredLayer","l","onLayerChange","layer","filterLayers","renderMap","bingStyle","version","sources","tiles","attribution","layers","minzoom","maxzoom","osmStyle","tileSize","defaultChecked","Control","active","FILTER_BINDING","bindings","HELP_BINDING","NEXT_CHANGESET","PREV_CHANGESET","REFRESH_CHANGESETS","CHANGESET_DETAILS_DETAILS","CHANGESET_DETAILS_SUSPICIOUS","CHANGESET_DETAILS_TAGS","CHANGESET_DETAILS_GEOMETRY_CHANGES","CHANGESET_DETAILS_OTHER_FEATURES","CHANGESET_DETAILS_DISCUSSIONS","CHANGESET_DETAILS_USER","CHANGESET_DETAILS_MAP","VERIFY_GOOD","VERIFY_BAD","VERIFY_CLEAR","OPEN_IN_JOSM","OPEN_IN_ID","OPEN_IN_OSM","OPEN_IN_LEVEL0","OPEN_IN_ACHAVI","OPEN_IN_HDYC","FILTER_BY_USER","ControlLayout","bindingsState","toggleDetails","toggleFeatures","toggleOtherFeatures","toggleGeometryChanges","toggleTags","toggleDiscussions","toggleMapOptions","marginTop","marginLeft","keyboardToggleEnhancer","exclusive","lastKeyStroke","toggleKey","prev","exclusiveKeyToggle","newBindingState","prevBindingValue","Mousetrap","b","unbind","withFetchDataSilent","dataToFetch","onUpdate","_initFetching","fetchedData","reloadData","initFetching","getUserDetails","fromOSM","u","accountCreated","account_created","img","display_name","fromOSMCha","r1","r2","getUsers","_Changeset","showFloaters","currentChangeset","osmInfo","changesetUsername","prevProps","getUserDetailsPromise","getWhosThatPromise","names","defaultProps","Changeset","filterChangesetsByUser","showChangeset","converter","ghCompatibleHeaderId","extensions","regex","setFlavor","setOption","About","about","cancellablePromise","markdown","Stats","Radio","onChangeLocal","Text","isValid","handleFormChange","validity","min","Component","MultiSelect","allToggle","getAsyncOptions","dataURL","d","for_changeset","sendData","processed","renderSelect","promptTextCreator","loadOptions","handleToggle","showAllToggle","MappingTeamMultiSelect","trusted","nominatimSearch","LocationSelect","queryType","lastSearch","queryTypeOptions","draw","clearBeforeDraw","mode","clearMap","changeMode","deleteAll","getSource","setData","getLayer","removeLayer","drawingUpdate","drawingData","getAll","updateMap","truncate","precision","coordinates","cb","geojson","tolerance","area","simplified_bounds","simplify","highQuality","handleQueryTypeChange","addSource","addLayer","paint","geom_bbox","bbox","fitBounds","padding","getGL","mapboxgl","accessToken","MapboxDraw","displayControlsDefault","controls","polygon","addControl","on","TypeError","simpleValue","zIndex","Wrapper","handleFocus","hasValue","Meta","handleChange","activeFilters","metaOf","replaceFiltersState","findCurrentValue","option","DateField","handleDateChange","isClearable","selected","placeholderText","dateFormat","minDate","maxDate","BBoxPicker","update","bounds","getBounds","s","getSouth","toFixed","w","getWest","getNorth","wsen","getEast","clearBbox","loadingEnhancer","filtersData","ignore","FiltersList","renderFilters","propsToSend","data_url","wrapperProps","range","gteValue","lteValue","today","fi","handleToggleAll","endsWith","SaveAOI","editing","onKeyDown","keyCode","aoiList","FiltersHeader","onAoiSelect","getAois","getAoisPromise","navigator","clipboard","writeText","dropdown","save_aoi","aoiName","renderFilterInfo","renderAoiLink","renderRssLink","handleClear","handleApply","noDateGte","Filters","toJSON","is","sendToAnalytics","category","loadAoiId","getAOIName","getAOIId","removeAOI","applyCreateAOI","applyUpdateAOI","NumberOfComments","SecondaryLine","thumbsDown","thumbsUp","PrimaryLine","Title","wasOpen","Row","inputRef","other","borderClass","backgroundClass","handleScroll","scrollIntoView","block","behavior","activeChangesetId","PageRange","_onClick","Footer","start","end","base","maxPageCount","ceil","Range","handleFilterOrderBy","reloadCurrentPage","valueData","filtersConfig","NavLink","activeStyle","fontWeight","cacheTagsData","ChangesetsList","checkUpdate","Infinity","goUpDownToChangeset","direction","nextFeature","mergedFilters","keySeq","first","toggleFilters","toggleHelp","Tags","allTags","tagsData","selectData","is_visible","handleChangesetModifyTag","defaultValue","Navbar","titleClassName","buttons","buttonsClassName","Verify","onClear","checkUser","isHarmful","maxWidth","flex","whiteSpace","overflow","textOverflow","openEditor","baseUrl","center","getCenter","zoom","getZoom","lat","lng","OpenIn","unshift","NavbarChangeset","handleChangesetModifyHarmful","isChecked","fontSize","NavbarSidebar","onUserMenuSelect","renderUserMenuOptions","disable","avatar","getOAuthToken","Modal","sendNotification","addNotification","level","dismissible","activateModalCallback","dismissModalCallback","addRef","EditUserDetails","onChangeMessageGood","onChangeMessageBad","applyUpdateUserDetails","isGood","renderGoodBadImg","userValues","onUserChange","alignSelf","SecondaryPagesHeader","CustomURL","BlockMarkup","SaveButton","onCreate","onSave","AOIsBlock","activeAoiId","removeAoi","ListFortified","TargetBlock","propsToPass","SaveComp","SavedFilters","addToWatchList","removeFromWatchList","addToTrustedList","removeFromTrustedList","createAOIPromise","WatchListUser","isValidUsername","isValidUid","verified","setUsername","setUid","fetchUsername","xml","DOMParser","parseFromString","getElementsByTagName","firstElementChild","getAttribute","fetchUid","verifyInput","resp","alert","TrustedListUser","SaveUser","showInput","forWatchlist","TrustedListBlock","TrustedUsers","trustedUsers","trustedList","sortBy","a","localeCompare","WatchListBlock","Watchlist","watchList","blacklist","createMappingTeam","deleteMappingTeam","updateMappingTeam","NewTeam","teamName","setTeamName","teamUsers","setTeamUsers","setEditing","validationErrorMessage","setValidationErrorMessage","activeTeam","joined","cleanedUsers","fromEntries","onChangeInput","idx","teamUsersToUpdate","required","userIsOwner","splice","onClickRemoveUser","validation","validateData","TeamsBlock","removeTeam","editTeam","MappingTeams","addingTeam","createTeam","createTeamPromise","teamId","teams","owner","EditMappingTeam","updateTeamPromise","team","AppMobile","Route","exact","component","Home","banner","work_flow","AppDesktop","App","initialize","gaOptions","anonymizeIp","screenResolution","screen","availWidth","availHeight","appName","Raven","config","release","environment","debug","install","ReactDOM","serviceWorker","ready","registration","unregister"],"mappings":"6GAAAA,EAAOC,QAAU,IAA0B,oC,oBCA3CD,EAAOC,QAAU,IAA0B,uC,kNCC9BC,GAAQC,EACRC,GAAYD,EACZE,GAASF,EACTG,GAAUH,EAInBI,EAAM,oCAENF,IACFE,EAAM,6BAGRC,OAAOC,WAAa,iCACTP,EAAMQ,WADG,sBACqBN,EAAUM,WAD/B,mBACoDL,EAAOK,WAD3D,oBACiFJ,EAAQI,WADzF,kBATCP,aASD,uBARMA,SAQN,gBAEiCI,IAE9C,IAAMI,EAAUJ,EChBnBK,EAAgB,GAChBV,IACFU,EAAcC,SAAW,oBAG3B,IAAMC,EAAUC,YAAqBH,G,uBCGrC,SAASI,EAAQC,GACf,IACE,OAAOC,aAAaF,QAAQC,IAAQ,KACpC,MAAOE,GAEP,OADAC,QAAQC,KAAK,qCACN,MAOX,SAASC,EAAQL,EAAaM,GAC5B,IACEL,aAAaI,QAAQL,EAAKM,GAC1B,MAAOJ,GACPC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nBonC,IAAMC,OAAO,4DAA6D,CACxEC,QxIvBsBtnC,SwIwBtBunC,YAAavnC,aACbwnC,MAAOznC,IACN0nC,UAMLC,IAAS3kB,OACP,kBAAC,IAAD,CAAU3M,MAAOA,IACf,kBAAC,IAAD,CAAiBzV,QAASA,GACxB,kBAAC,GAAD,QAGJmX,SAASgL,eAAe,SCMpB,kBAAmBgW,WACrBA,UAAU6O,cAAcC,MAAM3lC,MAAK,SAAA4lC,GACjCA,EAAaC,iB,mBCpDnBjoC,EAAOC,QAAU,IAA0B,uC,mBCA3CD,EAAOC,QAAU,IAA0B,yC,06SCA3CD,EAAOC,QAAU,49D","file":"static/js/main.0631e5da.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/banner.ed2bb0d2.png\";","module.exports = __webpack_public_path__ + \"static/media/work_flow.195ff4f9.png\";","// @flow\nexport const isDev = process.env.REACT_APP_STACK === 'DEV';\nexport const isStaging = process.env.REACT_APP_STACK === 'STAGING';\nexport const isProd = process.env.REACT_APP_STACK === 'PRODUCTION';\nexport const isLocal = process.env.NODE_ENV === 'development';\nexport const stack = process.env.REACT_APP_STACK;\nexport const appVersion = process.env.REACT_APP_VERSION;\n\nlet url = 'https://staging.osmcha.org/api/v1';\n\nif (isProd) {\n url = 'https://osmcha.org/api/v1';\n}\n\nwindow.debug_info = () =>\n `isDev=${isDev.toString()} isStaging=${isStaging.toString()} isProd=${isProd.toString()} isLocal=${isLocal.toString()} stack=${stack ||\n 'null'} appVersion=${appVersion || 'null'} url=${url}`;\n\nexport const API_URL = url;\n","import { createBrowserHistory } from 'history';\nimport { isDev } from '../config';\nlet historyConfig = {};\nif (isDev) {\n historyConfig.basename = '/osmcha-frontend';\n}\n\nconst history = createBrowserHistory(historyConfig);\nexport { history };\n","// @flow\n\n// Transparent wrapper over Window.localStorage\n// Adheres to the Web Storage API:\n// https://developer.mozilla.org/en-US/docs/Web/API/Storage\n\n/**\n * Wraps localStorage.getItem in a try/catch. Return null\n * if the key does not exist or localStorage fails.\n */\nfunction getItem(key: string): ?string {\n try {\n return localStorage.getItem(key) || null;\n } catch (err) {\n console.warn('Could not read from localStorage.');\n return null;\n }\n}\n\n/**\n * Wraps localStorage.setItem in a try/catch.\n */\nfunction setItem(key: string, value: string): void {\n try {\n localStorage.setItem(key, value);\n } catch (err) {\n console.warn('Could not write to localStorage.');\n }\n}\n\n/**\n * Wraps localStorage.removeItem in a try/catch.\n */\nfunction removeItem(key: string): void {\n try {\n localStorage.removeItem(key);\n } catch (err) {\n console.warn('Could not delete from localStorage.');\n }\n}\n\nexport { getItem, setItem, removeItem };\n","//@flow\nimport { API_URL } from './';\n\nexport const PAGE_SIZE = 25;\nexport const overpassBase = '//overpass.osmcha.org/api/interpreter';\nexport const osmBase = '//www.openstreetmap.org/api/0.6/';\nexport const mapboxAccessToken =\n 'pk.eyJ1Ijoib3BlbnN0cmVldG1hcCIsImEiOiJjam10OXpmc2YwMXI5M3BqeTRiMDBqMHVyIn0.LIcIDe3TZLSDdTWDoojzNg';\nexport const statusUrl =\n 'https://raw.githubusercontent.com/mapbox/osmcha-frontend/status/status.json';\n\nexport const osmchaSocialTokenUrl = `${API_URL}/social-auth/`;\n\nexport const osmAuthUrl = 'https://www.openstreetmap.org/oauth/authorize';\nexport const apiOSM = 'https://api.openstreetmap.org/api/0.6';\n\nexport const whosThat =\n 'https://rksbsqdel4.execute-api.us-east-1.amazonaws.com/testing?action=names&id=';\n\nexport const nominatimUrl = 'https://nominatim.openstreetmap.org/search.php';\n\n// set a default from date x days before today\nexport const DEFAULT_FROM_DATE = 2;\n// exclude changesets newer than x minutes. It's needed because of the difference\n// between the time a changeset is processed by OSMCha and the time its map\n// visualization is available\nexport const DEFAULT_TO_DATE = 5;\n","// @flow\nimport { Iterable } from 'immutable';\n\nimport { API_URL } from '../config';\nimport type { filtersType, filterType } from '../components/filters';\n\nexport function getString(input) {\n if (typeof input === 'object') {\n return JSON.stringify(input);\n } else {\n return input;\n }\n}\n\nexport function handleErrors(response: Object) {\n if (!response.ok) {\n return response.json().then(r => {\n if (response.status === 401) {\n throw new Error(\n 'Authentication error. Sign in again and repeat the operation.'\n );\n }\n if (response.status === 401) {\n throw new Error('Operation not allowed.');\n }\n if (response.status === 404) {\n throw new Error('Resource not found.');\n }\n if (r && r.detail) throw new Error(r.detail);\n if (response.statusText) throw new Error(response.statusText);\n return Promise.reject('network request failed');\n });\n }\n return response;\n}\n\nexport function createAOI(\n token: string,\n name: string,\n filters: filtersType\n): Promise<*> {\n let serverFilters = {};\n filters.forEach((v: filterType, k: string) => {\n if (!Iterable.isIterable(v)) return;\n let filter = v;\n serverFilters[k] = filter\n .filter(x => Iterable.isIterable(x) && x.get('value') !== '')\n .map(x => getString(x.get('value')))\n .join(',');\n });\n return fetch(`${API_URL}/aoi/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n name,\n filters: serverFilters\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchAOI(token: string, aoiId: number): Promise<*> {\n return fetch(`${API_URL}/aoi/${aoiId}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchAllAOIs(token?: string): Promise<*> {\n if (token == null) return Promise.resolve();\n return fetch(`${API_URL}/aoi/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function updateAOI(\n token: string,\n aoiId: number,\n name: string,\n filters: filtersType\n): Promise<*> {\n let serverFilters = {};\n filters.forEach((v: filterType, k: string) => {\n if (!Iterable.isIterable(v)) return;\n let filter = v;\n serverFilters[k] = filter\n .filter(x => Iterable.isIterable(x) && x.get('value') !== '')\n .map(x => getString(x.get('value')))\n .join(',');\n });\n return fetch(`${API_URL}/aoi/${aoiId}/`, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n name,\n filters: serverFilters\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function deleteAOI(token: string, aoiId: string): Promise<*> {\n return fetch(`${API_URL}/aoi/${aoiId}/`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(handleErrors);\n}\n","// @flow\nimport request from 'superagent';\nimport { osmchaSocialTokenUrl } from '../config/constants';\nimport { API_URL } from '../config';\nimport { handleErrors } from './aoi';\n\nexport function postFinalTokensOSMCha(\n oauth_token: string,\n oauth_token_secret: string,\n oauth_verifier: string\n) {\n return request\n .post(osmchaSocialTokenUrl)\n .type('form')\n .send({ oauth_token: oauth_token })\n .send({ oauth_verifier: oauth_verifier })\n .send({ oauth_token_secret: oauth_token_secret })\n .then(r => {\n return r.body;\n })\n .catch(e => {\n console.error(e);\n return Promise.reject(e);\n });\n}\nexport function postTokensOSMCha() {\n return request\n .post(osmchaSocialTokenUrl)\n .type('form')\n .then(r => r.body)\n .catch(e => {\n console.error(e);\n return Promise.reject(e);\n });\n}\n\nexport function fetchUserDetails(token: string) {\n return fetch(`${API_URL}/users/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function updateUserDetails(\n token: string,\n message_good: string,\n message_bad: string,\n comment_feature: boolean\n) {\n return fetch(`${API_URL}/users/`, {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n message_good,\n message_bad,\n comment_feature\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","import { statusUrl } from '../config/constants';\nimport { handleErrors } from './aoi';\n\nexport function getStatus(input, type): Promise<*> {\n return fetch(`${statusUrl}`, {\n method: 'GET'\n })\n .then(handleErrors)\n .then(response => {\n return response.json();\n });\n}\n","// @flow\nimport { API_URL } from '../config';\nimport { handleErrors } from './aoi';\n\nexport function fetchChangeset(id: number, token: ?string) {\n return fetch(`${API_URL}/changesets/${id}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function setHarmful(id: number, token: string, harmful: boolean | -1) {\n // -1 is for unsetting\n let url;\n if (harmful === -1) {\n url = `${API_URL}/changesets/${id}/uncheck/`;\n } else {\n url = `${API_URL}/changesets/${id}/${\n harmful ? 'set-harmful' : 'set-good'\n }/`;\n }\n\n return fetch(url, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport const createForm = (obj: Object) => {\n var formData = new FormData();\n Object.keys(obj).forEach(k => {\n formData.append(k, obj[k]);\n });\n return formData;\n};\n\nexport function setTag(\n id: number,\n token: string,\n tag: Object,\n remove: boolean = false\n) {\n if (Number.isNaN(parseInt(tag.value, 10))) {\n throw new Error('tag is not a valid number');\n }\n return fetch(`${API_URL}/changesets/${id}/tags/${tag.value}/`, {\n method: remove ? 'DELETE' : 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: createForm({\n tag_pk: tag,\n id\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function postComment(id: number, token: string, comment: string) {\n return fetch(`${API_URL}/changesets/${id}/comment/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n comment: comment\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","// @flow\nimport { handleErrors } from './aoi';\nimport { API_URL } from '../config';\n\nexport function fetchWatchList(token: string): Promise<*> {\n return fetch(`${API_URL}/blacklisted-users/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function deleteFromWatchList(token: string, uid: string): Promise<*> {\n return fetch(`${API_URL}/blacklisted-users/${uid}/`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(handleErrors);\n}\n\nexport function postUserToWatchList(token: string, data: object): Promise<*> {\n return fetch(`${API_URL}/blacklisted-users/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n username: data.watchlist_user.username,\n uid: data.watchlist_user.uid\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","// @flow\nimport { put, call, take, takeEvery } from 'redux-saga/effects';\nimport { delay } from 'redux-saga';\n\nexport const SHOW_MODAL = 'SHOW_MODAL';\nexport const INIT_MODAL = 'INIT_MODAL';\nexport const ACTIVATE_MODAL_CALLBACK = 'ACTIVATE_MODAL_CALLBACK';\nexport const DISMISS_MODAL = 'DISMISS_MODAL';\n\n// public\n// starting point for react component to start fetch\n\nexport function modal({\n kind = 'error',\n error,\n title,\n dismiss = true,\n autoDismiss = 5,\n position = 'tr',\n description = 'Please reload the application. If it still doesnt work please refer to usage guide.',\n callback,\n callbackArgs,\n callbackLabel\n}: {\n kind?: string,\n error?: Error,\n title?: string,\n dismiss?: boolean,\n autoDismiss?: number,\n position?: string,\n description?: string,\n callback?: Function,\n callbackArgs?: Array,\n callbackLabel?: string\n}) {\n if (error && error.message) {\n description = error.message;\n }\n if (error && error.name) {\n title = error.name;\n }\n if (kind === 'error') {\n autoDismiss = 10;\n }\n return {\n type: 'INIT_MODAL',\n payload: {\n kind,\n error,\n callbackLabel,\n title,\n dismiss,\n autoDismiss,\n position,\n description\n },\n callback,\n callbackArgs\n };\n}\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const activateModalCallback = (uid: number) =>\n action(ACTIVATE_MODAL_CALLBACK, { uid });\n\nexport const dismissModalCallback = (uid: number) =>\n action(DISMISS_MODAL, { uid });\n\nexport function* watchModal(): any {\n yield takeEvery('INIT_MODAL', handleModal);\n}\n\nfunction* handleModal({ payload, callback, callbackArgs }: Object): any {\n var uidOriginal = new Date().getTime() + parseInt(1000 * Math.random(), 10);\n payload.uid = uidOriginal;\n yield put(action(SHOW_MODAL, payload));\n if (!callback) return;\n while (true) {\n const { type, uid } = yield take([ACTIVATE_MODAL_CALLBACK, DISMISS_MODAL]);\n if (type === DISMISS_MODAL && uidOriginal === uid) {\n return;\n }\n if (type === ACTIVATE_MODAL_CALLBACK && uidOriginal === uid) {\n yield call(delay, 500);\n yield put(callback(...callbackArgs));\n return;\n }\n }\n}\n","// @flow\nimport { handleErrors } from './aoi';\nimport { API_URL } from '../config';\n\nexport function fetchTrustedList(token: string): Promise<*> {\n return fetch(`${API_URL}/whitelist-user/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function deleteFromTrustedList(\n token: string,\n username: string\n): Promise<*> {\n return fetch(`${API_URL}/whitelist-user/${username}/`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(handleErrors);\n}\n\nexport function postUserToTrustedList(\n token: string,\n whitelist_user: string\n): Promise<*> {\n return fetch(`${API_URL}/whitelist-user/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n whitelist_user\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","import { all, put, call, takeEvery, select } from 'redux-saga/effects';\n\nimport {\n postUserToTrustedList,\n deleteFromTrustedList\n} from '../network/osmcha_trustedlist.js';\nimport { modal } from './modal_actions';\n\nimport type { RootStateType } from './';\n\nexport const TRUSTEDLIST = {\n define: 'TRUSTEDLIST.define',\n add: 'TRUSTEDLIST.add',\n remove: 'TRUSTEDLIST.remove',\n clear: 'TRUSTEDLIST.clear'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\n\nexport const addToTrustedlist = (trustedlist_user: string) =>\n action(TRUSTEDLIST.add, { trustedlist_user });\n\nexport const removeFromTrustedlist = (trustedlist_user: string) =>\n action(TRUSTEDLIST.remove, { trustedlist_user });\n\nexport function* watchTrustedlist(): any {\n yield all([\n takeEvery(TRUSTEDLIST.add, addToTrustedlistSaga),\n takeEvery(TRUSTEDLIST.remove, removeFromTrustedlistSaga)\n ]);\n}\n\nexport function* addToTrustedlistSaga(trustedlist_user: string): any {\n try {\n const token = yield select(tokenSelector);\n yield call(postUserToTrustedList, token, trustedlist_user.trustedlist_user);\n yield put(\n modal({\n title: 'Success',\n description: `User ${trustedlist_user.trustedlist_user} added to your Trusted Users list.`,\n kind: 'success'\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\nexport function* removeFromTrustedlistSaga(trustedlist_user: string): any {\n try {\n const token = yield select(tokenSelector);\n yield call(deleteFromTrustedList, token, trustedlist_user.trustedlist_user);\n yield put(\n modal({\n title: 'Success',\n description: `User ${trustedlist_user.trustedlist_user} removed from your Trusted Users list.`,\n kind: 'success'\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n","import { all, put, call, takeEvery, select } from 'redux-saga/effects';\n\nimport {\n postUserToWatchList,\n deleteFromWatchList\n} from '../network/osmcha_watchlist';\nimport { modal } from './modal_actions';\n\nimport type { RootStateType } from './';\n\nexport const WATCHLIST = {\n define: 'WATCHLIST.define',\n add: 'WATCHLIST.add',\n remove: 'WATCHLIST.remove',\n clear: 'WATCHLIST.clear'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\n\nexport const addToWatchlist = (watchlist_user: string, uid: string) =>\n action(WATCHLIST.add, { watchlist_user, uid });\n\nexport const removeFromWatchlist = (watchlist_user: string) =>\n action(WATCHLIST.remove, { watchlist_user });\n\nexport function* watchWatchlist(): any {\n yield all([\n takeEvery(WATCHLIST.add, addToWatchlistSaga),\n takeEvery(WATCHLIST.remove, removeFromWatchlistSaga)\n ]);\n}\n\nexport function* addToWatchlistSaga(watchlist_user: object): any {\n try {\n const token = yield select(tokenSelector);\n yield call(postUserToWatchList, token, watchlist_user);\n yield put(\n modal({\n title: 'Success',\n description: `User ${watchlist_user.watchlist_user.username} (${watchlist_user.watchlist_user.uid}) added to your watchlist.`,\n kind: 'success'\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\nexport function* removeFromWatchlistSaga(watchlist_user: string): any {\n try {\n const token = yield select(tokenSelector);\n yield call(deleteFromWatchList, token, watchlist_user.watchlist_user);\n yield put(\n modal({\n title: 'Success',\n description: `User ${watchlist_user.watchlist_user} removed from your watchlist.`,\n kind: 'success'\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n","// @flow\nimport { List, Map, fromJS } from 'immutable';\nimport { sub, format } from 'date-fns';\n\nimport { DEFAULT_FROM_DATE, DEFAULT_TO_DATE } from '../config/constants';\nimport type { filtersType } from '../components/filters';\n\nexport function validateFilters(filters: filtersType): boolean {\n var test = function() {\n if (!Map.isMap(filters)) return false;\n let valid = true;\n filters.forEach((v, k) => {\n if (!List.isList(v)) {\n // check for list\n valid = false;\n } else {\n v.forEach(vv => {\n if (!(Map.isMap(vv) && vv.has('label') && vv.has('value'))) {\n valid = false;\n }\n if (!Map.isMap(vv)) {\n valid = false;\n }\n });\n }\n });\n return valid;\n };\n if (!test()) {\n throw new Error('The filters that you applied were not correct.');\n } else {\n return true;\n }\n}\n\nexport function getDefaultFromDate(extraDays = 0): filtersType {\n const defaultDate = format(\n sub(new Date(), { days: DEFAULT_FROM_DATE + extraDays }),\n 'yyyy-MM-dd'\n );\n return fromJS({\n date__gte: [\n {\n label: defaultDate,\n value: defaultDate\n }\n ]\n });\n}\n\nexport function getDefaultToDate(): filtersType {\n const now = new Date();\n const defaultDate = format(\n sub(new Date(now.getTime() + now.getTimezoneOffset() * 60 * 1000), {\n minutes: DEFAULT_TO_DATE\n }),\n 'yyyy-MM-dd HH:mm'\n );\n return fromJS({\n date__lte: [\n {\n label: '',\n value: defaultDate\n }\n ]\n });\n}\n\nexport function appendDefaultDate(filters: filtersType) {\n // Set From date to 2 days behind if there isn't a date query.\n // In case of a users or uids query, set the From date to 30 days behind\n if (filters && !filters.has('date__gte') && !filters.has('date__lte')) {\n if (\n filters.count() === 1 &&\n (filters.has('users') || filters.has('uids'))\n ) {\n filters = filters.merge(getDefaultFromDate(28));\n } else {\n filters = filters.merge(getDefaultFromDate());\n }\n }\n if (filters && !filters.has('date__lte')) {\n filters = filters.merge(getDefaultToDate());\n }\n return filters;\n}\n","// @flow\nimport { Iterable, List, Map } from 'immutable';\nimport { API_URL } from '../config';\nimport { PAGE_SIZE } from '../config/constants';\nimport { appendDefaultDate } from '../utils/filters';\nimport { handleErrors, getString } from './aoi';\nimport type { filtersType } from '../components/filters';\n\nexport function fetchChangesetsPage(\n pageIndex: number,\n filters: filtersType = Map(),\n token: ?string,\n nocache: boolean,\n aoiId: ?string\n) {\n let flatFilters = '';\n filters = appendDefaultDate(filters);\n filters.forEach((v: List, k: string) => {\n if (!Iterable.isIterable(v)) return;\n let filter = v;\n let filterJoined = filter\n .filter(x => Iterable.isIterable(x) && x.get('value') !== '')\n .map(x => getString(x.get('value')))\n .join(',');\n\n if (filterJoined === '') return;\n flatFilters += `&${k}=${encodeURIComponent(filterJoined)}`;\n });\n let url = `${API_URL}/changesets/?${\n nocache // for cache busting of this pattern /\\/changesets\\/#nocache\\?page=/\n ? `page_size=${PAGE_SIZE}&page=${pageIndex + 1}`\n : `page=${pageIndex + 1}&page_size=${PAGE_SIZE}`\n }${flatFilters}`;\n if (aoiId) {\n url = `${API_URL}/aoi/${aoiId}/changesets/?${\n nocache\n ? `page_size=${PAGE_SIZE}&page=${pageIndex + 1}`\n : `page=${pageIndex + 1}&page_size=${PAGE_SIZE}`\n }`;\n }\n return fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(res => {\n if (res.status === 401) {\n return Promise.reject(\n Error('Authentication error. Sign in again and repeat the operation.')\n );\n }\n if (res.status === 403) {\n return Promise.reject(Error('Operation not allowed.'));\n }\n if (res.status >= 400 && res.status < 600) {\n return Promise.reject(\n Error(\n 'Bad request. Please check your filters or your network connection.'\n )\n );\n }\n return res.json();\n });\n}\n\nexport function fetchAOIChangesetPage(\n pageIndex: number,\n aoiId: string,\n token: string\n) {\n return fetch(\n `${API_URL}/aoi/${aoiId}/changesets/?page_size=${PAGE_SIZE}&page=${pageIndex +\n 1}`,\n {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }\n )\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","// @flow\nimport { parse, stringify } from 'query-string';\nimport { fromJS, Map } from 'immutable';\n\nexport function getSearchObj(searchParam: string = ''): Map {\n let result = {};\n try {\n result = parse(searchParam);\n if (result.filters) {\n result.filters = JSON.parse(result.filters);\n }\n } catch (e) {\n console.error(e);\n } finally {\n return fromJS(result);\n }\n}\n\nexport function getObjAsQueryParam(key: string, obj: Object) {\n if (!obj || Object.keys(obj).length === 0) {\n return '';\n }\n return stringify({\n [key]: JSON.stringify(obj)\n });\n}\n","// @flow\nimport { API_URL } from '../config';\nimport { handleErrors } from './aoi';\n\nexport function fetchReasons(token: ?string) {\n return fetch(`${API_URL}/suspicion-reasons/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchTags(token: ?string) {\n return fetch(`${API_URL}/tags/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","// @flow\nimport { put, call, select, all, takeLatest } from 'redux-saga/effects';\nimport { fromJS, Map } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { fetchAOI, createAOI, updateAOI } from '../network/aoi';\nimport { fetchReasons, fetchTags } from '../network/reasons_tags';\nimport { validateFilters } from '../utils/filters';\nimport { CHANGESETS_PAGE, FILTERS } from './filters_actions';\nimport { tokenSelector } from './auth_actions';\nimport { modal } from './modal_actions';\nimport type { filtersType } from '../components/filters';\nimport type { RootStateType } from './';\n\nexport const AOI = {\n fetch: 'AOI.fetch',\n clear: 'AOI.clear',\n fetched: 'AOI.fetched',\n create: 'AOI.create',\n update: 'AOI.update',\n loading: 'AOI.loading',\n error: 'AOI.error'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const applyUpdateAOI = (\n aoiId: string,\n name: string,\n filters: filtersType\n) => action(AOI.update, { aoiId, name, filters });\n\nexport const applyCreateAOI = (name: string, filters: filtersType) =>\n action(AOI.create, { name, filters });\n\nexport function* watchAOI(): any {\n yield all([\n takeLatest(AOI.update, updateAOISaga),\n takeLatest(AOI.create, createAOISaga)\n ]);\n}\n\nexport function* fetchAOISaga(aoiId: string): any {\n yield put(action(AOI.loading, { loading: true }));\n const token = yield select(tokenSelector);\n const data = yield call(fetchAOI, token, aoiId);\n const reasons = yield call(fetchReasons, token);\n const tags = yield call(fetchTags, token);\n const aoi = fromJS(data);\n yield put(action(AOI.fetched, { aoi }));\n let filters = aoi.getIn(['properties', 'filters'], Map());\n filters = filters.map((v, k) => {\n if (k === 'reasons') {\n return fromJS(\n v.split(',').map(o => ({\n value: o,\n label: reasons.filter(i => i.id === Number(o))[0]['name']\n }))\n );\n }\n if (k === 'tags') {\n return fromJS(\n v.split(',').map(o => ({\n value: o,\n label: tags.filter(i => i.id === Number(o))[0]['name']\n }))\n );\n }\n try {\n if (JSON.parse(v) && JSON.parse(v).hasOwnProperty('coordinates')) {\n return fromJS([\n {\n value: JSON.parse(v),\n label: JSON.parse(v)\n }\n ]);\n } else {\n throw SyntaxError;\n }\n } catch (e) {\n const options = v.split(',');\n return fromJS(\n options.map(o => ({\n value: o,\n label: o\n }))\n );\n }\n });\n return filters;\n}\n\nexport function* createAOISaga({\n name,\n filters\n}: {\n name: string,\n filters: filtersType\n}): any {\n try {\n yield put(action(AOI.loading, { loading: true }));\n const token = yield select(tokenSelector);\n const data = yield call(createAOI, token, name, filters);\n const aoi = fromJS(data);\n yield put(action(AOI.fetched, { aoi }));\n let location = yield select(locationSelector);\n yield put(\n push({\n ...location,\n pathname: location.pathname,\n search: `aoi=${data.id}`\n })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n\nexport function* updateAOISaga({\n aoiId,\n name,\n filters\n}: {\n aoiId: string,\n name: string,\n filters: filtersType\n}): any {\n try {\n yield put(action(AOI.loading, { loading: true }));\n const token = yield select(tokenSelector);\n const data = yield call(updateAOI, token, aoiId, name, filters);\n const aoi = fromJS(data);\n yield put(action(AOI.fetched, { aoi }));\n yield call(validateFilters, filters);\n yield put(\n action(FILTERS.set, {\n filters\n })\n );\n yield put(\n action(CHANGESETS_PAGE.fetch, { pageIndex: 0, aoiId: aoiId, filters })\n );\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n","// @flow\nimport {\n put,\n call,\n take,\n fork,\n select,\n cancel,\n all,\n takeLatest\n} from 'redux-saga/effects';\nimport { LOCATION_CHANGE } from 'react-router-redux';\nimport { Map } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { getSearchObj, getObjAsQueryParam } from '../utils/query_params';\nimport { validateFilters } from '../utils/filters';\nimport { fetchAOISaga, AOI } from './aoi_actions';\n\nimport { modal } from './modal_actions';\n\nimport type { RootStateType } from './';\nimport type { filtersType } from '../components/filters';\n\nexport const CHANGESETS_PAGE = {\n fetch: 'CHANGESETS_PAGE_FETCH',\n fetched: 'CHANGESETS_PAGE_FETCHED',\n modify: 'CHANGESETS_PAGE_MODIFY_CHANGESET',\n loading: 'CHANGESETS_PAGE_LOADING',\n error: 'CHANGESETS_PAGE_ERROR',\n checkNew: 'CHANGESETS_PAGE_CHECK_NEW_CHANGESETS',\n updateNewCount: 'CHANGESETS_PAGE_UPDATE_NEW_COUNT',\n checkNewLoading: 'CHANGESETS_PAGE_CHECK_NEW_LOADING'\n};\n\nexport const FILTERS = {\n set: 'FILTERS_SET',\n apply: 'FILTERS_APPLY'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const applyFilters = (filters: filtersType, pathname: ?string) =>\n action(FILTERS.apply, { filters, pathname });\n\nexport function* watchFilters(): any {\n yield all([\n watchLocationChange(),\n takeLatest(FILTERS.apply, applyFilterSaga)\n ]);\n}\n\nexport function* watchLocationChange(): any {\n let lastTask;\n let lastSearchString;\n while (true) {\n const action = yield take(LOCATION_CHANGE);\n const location = action.payload;\n\n if (lastSearchString === location.search) {\n continue;\n }\n lastSearchString = location.search;\n\n if (lastTask) {\n yield cancel(lastTask);\n }\n lastTask = yield fork(filtersSaga, location);\n }\n}\n\nexport function* applyFilterSaga({\n filters,\n pathname\n}: {\n filters: filtersType,\n pathname: string\n}): any {\n const search = getObjAsQueryParam('filters', filters.toJS());\n let location = yield select(locationSelector);\n // I could find one comment on `push(location)` in the readme\n // ref: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux\n yield put(\n push({\n ...location,\n pathname: pathname || location.pathname,\n search // update the search\n })\n );\n}\n\nexport function* filtersSaga(location: Object): any {\n try {\n // the url can only contain two things `filters` or `aoiId`\n let { filters, aoi: aoiId } = getSearchObj(location.search).toObject();\n\n if (!filters) filters = Map();\n\n if (aoiId) {\n filters = yield call(fetchAOISaga, aoiId);\n } else {\n // if there is no active AOI in use\n // we might want to clear so that other\n // sagas continue using regular filters.\n yield put(action(AOI.clear));\n }\n // NOTE! `validateFilters` will throw an Error if invalid\n yield call(validateFilters, filters);\n yield put(\n action(FILTERS.set, {\n filters\n })\n );\n if (aoiId) {\n yield put(\n action(CHANGESETS_PAGE.fetch, { pageIndex: 0, filters, aoiId })\n );\n } else {\n yield put(action(CHANGESETS_PAGE.fetch, { pageIndex: 0, filters }));\n }\n } catch (e) {\n console.error(e);\n const location = yield select(locationSelector);\n location.search = '';\n yield all([\n put(\n modal({\n error: e\n })\n ),\n put(push(location))\n ]);\n }\n}\n\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n\n/** Sagas **/\n\nexport const filtersSelector = (state: RootStateType) =>\n state.filters.get('filters');\n","// @flow\nimport { put, call, takeLatest, select, all } from 'redux-saga/effects';\nimport { delay } from 'redux-saga';\n\nimport { fromJS, List, Map } from 'immutable';\nimport { fetchChangesetsPage } from '../network/changesets_page';\nimport { filtersSelector } from './filters_actions';\n\nimport { modal } from './modal_actions';\n\nimport type { RootStateType } from './';\nimport type { filtersType } from '../components/filters';\n\nexport const CHANGESETS_PAGE = {\n fetch: 'CHANGESETS_PAGE_FETCH',\n fetched: 'CHANGESETS_PAGE_FETCHED',\n modify: 'CHANGESETS_PAGE_MODIFY_CHANGESET',\n loading: 'CHANGESETS_PAGE_LOADING',\n error: 'CHANGESETS_PAGE_ERROR',\n checkNew: 'CHANGESETS_PAGE_CHECK_NEW_CHANGESETS',\n updateNewCount: 'CHANGESETS_PAGE_UPDATE_NEW_COUNT',\n checkNewLoading: 'CHANGESETS_PAGE_CHECK_NEW_LOADING'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\n// public\n// starting point for react component to start fetch\nexport const getChangesetsPage = (pageIndex: number, nocache: boolean) =>\n action(CHANGESETS_PAGE.fetch, { pageIndex, nocache });\n\n// this just checks for new changesets and updates the\n// `changesetsPage/diff` in the store.\n// @param nocache - to avoid cache busting.\nexport const checkForNewChangesets = (nocache: boolean) =>\n action(CHANGESETS_PAGE.checkNew, { nocache });\n\nexport function* watchChangesetsPage(): any {\n yield all([\n takeLatest(CHANGESETS_PAGE.fetch, fetchChangesetsPageSaga),\n takeLatest(CHANGESETS_PAGE.modify, modifyChangesetPageSaga),\n takeLatest(CHANGESETS_PAGE.checkNew, checkForNewChangesetsSaga)\n ]);\n}\n\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n\n/** Sagas **/\n\nexport const pageIndexSelector = (state: RootStateType) => [\n state.changesetsPage.getIn(['pageIndex'], 0)\n];\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\n\nexport const aoiIdSelector = (state: RootStateType) =>\n state.aoi.getIn(['aoi', 'id']);\n\nexport function* fetchChangesetsPageSaga({\n pageIndex,\n nocache,\n filters,\n aoiId\n}: {\n pageIndex?: number,\n nocache: boolean,\n filters?: filtersType,\n aoiId?: string\n}): Object {\n if (!filters) {\n filters = yield select(filtersSelector);\n }\n if (!aoiId) {\n aoiId = yield select(aoiIdSelector);\n }\n let oldPageIndex: number = yield select(pageIndexSelector);\n\n // checks both undefined and null\n if (pageIndex == null) {\n pageIndex = oldPageIndex;\n }\n yield put(\n action(CHANGESETS_PAGE.loading, {\n pageIndex\n })\n );\n try {\n let token = yield select(tokenSelector);\n let thisPage;\n if (aoiId) {\n thisPage = yield call(\n fetchChangesetsPage,\n pageIndex,\n filters,\n token,\n nocache,\n aoiId\n );\n } else {\n thisPage = yield call(\n fetchChangesetsPage,\n pageIndex,\n filters,\n token,\n nocache\n );\n }\n yield put(\n action(CHANGESETS_PAGE.fetched, {\n data: fromJS(thisPage),\n pageIndex\n })\n );\n } catch (error) {\n yield put(\n action(CHANGESETS_PAGE.error, {\n pageIndex: oldPageIndex,\n error\n })\n );\n error.name = `Failed to load page ${pageIndex}`;\n yield put(\n modal({\n error,\n callback: action,\n callbackLabel: 'Retry',\n callbackArgs: [CHANGESETS_PAGE.fetch, { pageIndex }]\n })\n );\n }\n}\n\nexport const currentPageAndIndexSelector = (state: RootStateType) => [\n state.changesetsPage.getIn(['currentPage'], Map()),\n state.changesetsPage.getIn(['pageIndex'], 0)\n];\n\nexport function* modifyChangesetPageSaga({\n changesetId,\n changeset\n}: Object): any {\n try {\n // try to modify the changeset inside the page\n // to reflect any kind of changes in the changesetList\n let [currentPage, pageIndex] = yield select(currentPageAndIndexSelector);\n\n let features: List> = currentPage.get('features');\n\n const index = features.findIndex(f => f.get('id') === changesetId);\n if (index > -1) {\n currentPage = currentPage.setIn(['features', index], changeset);\n yield put(\n action(CHANGESETS_PAGE.fetched, {\n data: currentPage,\n pageIndex\n })\n );\n // check for new changesets\n yield put(action(CHANGESETS_PAGE.checkNew));\n }\n } catch (e) {\n console.error(e);\n }\n}\n\nexport function* checkForNewChangesetsSaga({\n nocache\n}: {\n nocache: boolean\n}): any {\n try {\n yield put(action(CHANGESETS_PAGE.checkNewLoading));\n yield call(delay, 3000 + Math.random() * 2000);\n const [\n filters: filtersType,\n pageIndex: number,\n token,\n aoiId\n ] = yield select((state: RootStateType) => [\n state.filters.get('filters'),\n state.changesetsPage.get('pageIndex'),\n state.auth.get('token'),\n state.aoi.get('aoi').get('id')\n ]);\n let newData = yield call(\n fetchChangesetsPage,\n pageIndex,\n filters,\n token,\n nocache,\n aoiId\n );\n let oldData = yield select((state: RootStateType) =>\n state.changesetsPage.get('currentPage')\n );\n let diff = 0;\n if (oldData) {\n newData = fromJS(newData.features.map(f => f.id)).toSet();\n oldData = oldData\n .get('features')\n .map(f => f.get('id'))\n .toSet();\n diff = newData.subtract(oldData).size;\n }\n yield put(\n action(CHANGESETS_PAGE.updateNewCount, {\n diff\n })\n );\n } catch (e) {\n console.error(e);\n }\n}\n","export default {\n NOT_LOGGED_IN: {\n kind: 'error',\n title: 'Sign in required',\n description: 'This action requires you to sign in first.'\n },\n MODIFY_SUCCESS: {\n kind: 'success',\n title: 'Successful',\n autoDismiss: 2,\n description: changesetId =>\n `The changeset ${changesetId} was successfully modified.`\n }\n};\n","// @flow\nlet cmap;\nexport function importChangesetMap(module: string): Promise<*> {\n if (cmap) return Promise.resolve(cmap[module]);\n return import('changeset-map')\n .then(function(m) {\n cmap = m;\n return cmap[module];\n })\n .catch(function(err) {\n console.error(err);\n console.log('Failed to load module changeset-map');\n });\n}\n","// @flow\nimport { matchPath } from 'react-router';\n\nexport function getParam(param: string, location: Object, path: string) {\n const match = matchPath(location.pathname, path);\n if (!match) return null;\n return match.params[param];\n}\n\nexport function getChangesetIdFromLocation(location: Object) {\n const changesetId = parseInt(getParam('id', location, '/changesets/:id'), 10);\n if (!changesetId || Number.isNaN(changesetId)) {\n return null;\n }\n return changesetId;\n}\n\nexport function checkForLegacyURL(location: Object) {\n const changesetId = parseInt(getParam('id', location, '/:id'), 10);\n if (!changesetId || Number.isNaN(changesetId)) {\n return null;\n }\n return changesetId;\n}\n","// @flow\nimport { put, call, take, fork, select, cancel } from 'redux-saga/effects';\n\nimport { fromJS, Map, List } from 'immutable';\nimport { LOCATION_CHANGE, replace, push } from 'react-router-redux';\nimport notifications from '../config/notifications';\n\nimport { fetchChangeset, setHarmful, setTag } from '../network/changeset';\nimport { importChangesetMap } from '../utils/cmap';\n\nimport {\n getChangesetIdFromLocation,\n checkForLegacyURL\n} from '../utils/routing';\n\nimport type { RootStateType } from './';\nimport { modal } from './modal_actions';\n\nimport { CHANGESETS_PAGE } from './changesets_page_actions';\n\nexport const CHANGESET = {\n fetch: 'CHANGESET.fetch',\n fetched: 'CHANGESET.fetched',\n change: 'CHANGESET.change',\n loading: 'CHANGESET.loading',\n error: 'CHANGESET.error'\n};\nexport const CHANGESET_MODIFY = {\n modify: 'CHANGESET_MODIFY.modify',\n harmful: 'CHANGESET_MODIFY.harmful',\n revert: 'CHANGESET_MODIFY.revert',\n tag: 'CHANGESET_MODIFY.tag'\n};\nexport const CHANGESET_MAP = {\n fetched: 'CHANGESET_MAP.fetched',\n loading: 'CHANGESET_MAP.loading',\n change: 'CHANGESET_MAP.change',\n error: 'CHANGESET_MAP.error'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\n// public\n// starting point for react component to start fetch\nexport const getChangeset = (changesetId: number) =>\n action(CHANGESET.fetch, { changesetId });\n\nexport const handleChangesetModifyHarmful = (\n changesetId: number,\n changeset: Map,\n harmful: boolean | -1\n) =>\n action(CHANGESET_MODIFY.harmful, {\n oldChangeset: changeset,\n changesetId,\n harmful\n });\n\nexport const handleChangesetModifyTag = (\n changesetId: number,\n changeset: Map,\n tag: Object,\n remove: boolean\n) =>\n action(CHANGESET_MODIFY.tag, {\n oldChangeset: changeset,\n changesetId,\n tag,\n remove\n });\n\n// watches for LOCATION_CHANGE and only\n// dispatches the latest one to get changeset\n// and cMap details. It cancels the ongoign tasks\n// if route changes in between.\nexport function* watchChangeset(): any {\n let changesetTask;\n let changesetMapTask;\n while (true) {\n const { payload: location } = yield take(LOCATION_CHANGE);\n const changesetId = yield call(shouldUpdateSaga, location);\n if (changesetId) {\n /**\n * cancel any existing changeset tasks,\n * even if it doesnt change to `changesets/:id`\n * we anway would like to suspend the ongoing task\n * to save resouces\n */\n if (changesetTask) yield cancel(changesetTask);\n if (changesetMapTask) yield cancel(changesetMapTask);\n\n changesetTask = yield fork(fetchChangesetAction, changesetId);\n changesetMapTask = yield fork(fetchChangesetMapAction, changesetId);\n }\n }\n}\n\nexport function* shouldUpdateSaga(location: Object): any {\n // checks for the old osmcha style urls\n // eg osmcha.org/34354242 and redirects them\n // to osmcha.org/changesets/3432434\n const legacy = checkForLegacyURL(location);\n if (legacy) {\n yield put(\n replace({\n ...location,\n pathname: '/changesets/' + legacy\n })\n );\n return false;\n }\n let changesetId = getChangesetIdFromLocation(location);\n\n if (!changesetId) return false;\n\n let oldChangesetId = yield select(\n (state: RootStateType) =>\n !state.changeset.get('errorChangeset') &&\n !state.changeset.get('errorChangesetMap') &&\n state.changeset.get('changesetId')\n );\n\n if (oldChangesetId !== changesetId) {\n return changesetId;\n }\n}\n\nexport function* watchModifyChangeset(): any {\n while (true) {\n const modifyAction = yield take([\n CHANGESET_MODIFY.harmful,\n CHANGESET_MODIFY.tag\n ]); // scope for multiple modify actions in future\n const { token, username } = yield select((state: RootStateType) => ({\n token: state.auth.get('token'),\n username: state.auth.getIn(['userDetails', 'username'])\n }));\n if (!token) {\n yield put(\n modal({\n ...notifications.NOT_LOGGED_IN\n })\n );\n continue;\n }\n // all modify actions should have changesetId, oldChangeset\n const { changesetId, oldChangeset } = modifyAction;\n\n if (!oldChangeset) {\n continue;\n }\n let newChangeset;\n try {\n switch (modifyAction.type) {\n case CHANGESET_MODIFY.harmful: {\n const harmful = modifyAction.harmful;\n newChangeset = yield call(setHarmfulAction, {\n changesetId,\n oldChangeset,\n token,\n harmful,\n username\n });\n break;\n }\n case CHANGESET_MODIFY.tag: {\n const { tag, remove } = modifyAction;\n newChangeset = yield call(setTagActions, {\n changesetId,\n oldChangeset,\n token,\n tag,\n remove\n });\n break;\n }\n default: {\n continue;\n }\n }\n } catch (error) {\n yield put(\n action(CHANGESET_MODIFY.revert, {\n changesetId,\n changeset: oldChangeset\n })\n );\n yield put(\n modal({\n error\n })\n );\n }\n // update the change in changeset list also aka changesetP\n if (newChangeset) {\n yield put(\n action(CHANGESETS_PAGE.modify, {\n changesetId,\n changeset: newChangeset\n })\n );\n }\n }\n}\n\nexport const changesetsSelector = (state: RootStateType) => {\n return state.changeset.getIn(['changesets'], Map());\n};\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n\n/** Sagas **/\nexport function* fetchChangesetAction(changesetId: number): Object {\n let changesets = yield select(changesetsSelector);\n let changeset = changesets.get(changesetId);\n // check if the changeset already exists\n // if it does! make it active and exit\n if (changeset) {\n yield put(\n action(CHANGESET.change, {\n changesetId\n })\n );\n return;\n }\n\n yield put(\n action(CHANGESET.loading, {\n changesetId\n })\n );\n\n try {\n let token = yield select(tokenSelector);\n changeset = yield call(fetchChangeset, changesetId, token);\n yield put(\n action(CHANGESET.fetched, {\n data: fromJS(changeset),\n changesetId\n })\n );\n } catch (error) {\n yield put(\n action(CHANGESET.error, {\n changesetId,\n error\n })\n );\n const location = yield select(locationSelector);\n error.name = `Changeset:${changesetId} failed`;\n yield put(\n modal({\n error,\n callback: push,\n callbackArgs: [location],\n callbackLabel: 'Retry'\n })\n );\n }\n}\n\nexport function changesetMapModule(changesetId: number): any {\n return importChangesetMap('getChangeset').then((getCMapData: any) =>\n getCMapData(changesetId)\n );\n}\nexport const changesetMapSelector = (state: RootStateType) =>\n state.changeset.getIn(['changesetMap'], Map());\n\nexport function* fetchChangesetMapAction(changesetId: number): Object {\n const changesetMaps = yield select(changesetMapSelector);\n let changesetMap = changesetMaps.get(changesetId);\n\n if (changesetMap) {\n yield put(\n action(CHANGESET_MAP.change, {\n changesetId\n })\n );\n return;\n }\n yield put(\n action(CHANGESET_MAP.loading, {\n changesetId\n })\n );\n try {\n changesetMap = yield call(changesetMapModule, changesetId);\n yield put(\n action(CHANGESET_MAP.fetched, {\n data: changesetMap,\n changesetId\n })\n );\n } catch (error) {\n yield put(\n action(CHANGESET_MAP.error, {\n changesetId,\n error\n })\n );\n const location = yield select(locationSelector);\n error.name = `Changeset:${changesetId} Map failed`;\n yield put(\n modal({\n error,\n callback: push,\n callbackArgs: [location],\n callbackLabel: 'Retry'\n })\n );\n }\n}\n\nexport function* setHarmfulAction({\n changesetId,\n oldChangeset,\n token,\n harmful,\n username\n}: Object): any {\n const newChangeset = oldChangeset\n .setIn(['properties', 'check_user'], harmful === -1 ? null : username)\n // .setIn(\n // ['properties', 'tags'],\n // harmful === -1 ? List() : oldChangeset.getIn(['properties', 'tags'])\n // )\n .setIn(['properties', 'checked'], harmful === -1 ? false : true)\n .setIn(['properties', 'harmful'], harmful === -1 ? null : harmful);\n\n // update changeset list\n yield put(\n action(CHANGESET_MODIFY.modify, {\n changesetId,\n changeset: newChangeset\n })\n );\n yield call(setHarmful, changesetId, token, harmful);\n return newChangeset;\n}\n\nexport function* setTagActions({\n changesetId,\n oldChangeset,\n token,\n tag,\n remove\n}: Object): any {\n if (oldChangeset.getIn(['properties', 'checked'])) {\n // TOFIX also check for user\n let newChangeset = oldChangeset;\n let existingTags: List<*>;\n if (remove) {\n existingTags = oldChangeset.getIn(['properties', 'tags']);\n let key;\n existingTags.forEach((t, i) => {\n if (t.get('id') === tag.value) {\n key = i;\n }\n });\n newChangeset = oldChangeset.setIn(\n ['properties', 'tags'],\n existingTags.delete(key)\n );\n } else {\n // TOFIX consolidate the convention of backend using id and name\n // and I using label and value.\n existingTags = oldChangeset.getIn(['properties', 'tags']);\n newChangeset = oldChangeset.setIn(\n ['properties', 'tags'],\n existingTags.push(new Map().set('id', tag.value).set('name', tag.label))\n );\n }\n\n yield put(\n action(CHANGESET_MODIFY.modify, {\n changesetId,\n changeset: newChangeset\n })\n );\n yield call(setTag, changesetId, token, tag, remove);\n return newChangeset;\n } else {\n throw new Error('Only allowed on checked changesets');\n }\n}\n","// @flow\nimport { put, call, take, select, all, takeLatest } from 'redux-saga/effects';\nimport { delay as delayPromise } from 'redux-saga';\nimport { push } from 'react-router-redux';\nimport { fromJS } from 'immutable';\n\nimport {\n postTokensOSMCha,\n postFinalTokensOSMCha,\n fetchUserDetails,\n updateUserDetails\n} from '../network/auth';\nimport { getStatus } from '../network/status';\nimport { fetchChangeset } from '../network/changeset';\nimport { fetchWatchList } from '../network/osmcha_watchlist';\nimport { setItem, removeItem } from '../utils/safe_storage';\nimport { modal } from './modal_actions';\nimport { TRUSTEDLIST } from './trustedlist_actions';\nimport { WATCHLIST } from './watchlist_actions';\nimport { pageIndexSelector, CHANGESETS_PAGE } from './changesets_page_actions';\nimport { CHANGESET } from './changeset_actions';\n\nimport type { RootStateType } from './';\n\nexport const AUTH = {\n postSocialToken: 'AUTH_POST_SOCIAL_TOKEN',\n saveOAuth: 'AUTH_SAVE_OAUTH_OBJ',\n getFinalToken: 'AUTH_GET_FINAL_TOKEN',\n saveToken: 'AUTH_SAVE_TOKEN',\n logout: 'AUTH_LOGOUT',\n clearSession: 'AUTH_CLEAR_SESSION',\n loginError: 'AUTH_LOGIN_ERROR',\n userDetails: 'AUTH_USER_DETAILS',\n clearUserDetails: 'AUTH_CLEAR_USER_DETAILS',\n updateUserDetails: 'UPDATE_USER_DETAILS'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\n// public\n// starting point for react component to start fetch\nexport const getOAuthToken = () => action(AUTH.postSocialToken);\n\nexport const getFinalToken = (oauth_verifier: string) =>\n action(AUTH.getFinalToken, { oauth_verifier });\n\nexport const logUserOut = () => action(AUTH.logout);\n\nexport const tokenSelector = (state: RootStateType) => state.auth.get('token');\n\nexport const locationSelector = (state: RootStateType) =>\n state.routing.location;\n\nexport const changesetIdSelector = (state: RootStateType) =>\n state.changeset.get('changesetId');\n\nconst delay = process.env.NODE_ENV === 'test' ? () => {} : delayPromise;\nconst DELAY = 1000;\n\nexport const applyUpdateUserDetails = (\n message_good: string,\n message_bad: string,\n comment_feature: boolean\n) =>\n action(AUTH.updateUserDetails, {\n message_good,\n message_bad,\n comment_feature\n });\n\nexport function* watchUserDetails(): any {\n yield all([takeLatest(AUTH.updateUserDetails, updateUserDetailsSaga)]);\n}\n\nexport function* watchAuth(): any {\n // get the token from localStorage.\n // if it exists we just need to wait for\n // logout action.\n let delayBy = 1000;\n let token = yield select(tokenSelector);\n\n // wrapping it in a for loop allows us to\n // pause or resume our auth workflow\n // info: https://redux-saga.js.org/docs/advanced/NonBlockingCalls.html\n while (true) {\n try {\n if (!token) {\n token = yield call(authTokenFlow);\n }\n const userDetails = fromJS(yield call(fetchUserDetails, token));\n const trustedlist = userDetails.get('whitelists');\n const watchlist = fromJS(yield call(fetchWatchList, token));\n const status = fromJS(yield call(getStatus));\n yield put(action(TRUSTEDLIST.define, { trustedlist }));\n yield put(action(WATCHLIST.define, { watchlist }));\n yield put(action(AUTH.userDetails, { userDetails }));\n let pageIndex = yield select(pageIndexSelector);\n if (pageIndex) {\n yield put(action(CHANGESETS_PAGE.fetch, { pageIndex }));\n }\n let changesetId = yield select(changesetIdSelector);\n if (changesetId) {\n let changeset = yield call(fetchChangeset, changesetId, token);\n yield put(\n action(CHANGESET.fetched, {\n data: fromJS(changeset),\n changesetId\n })\n );\n }\n // show status notification\n if (status.get('status') !== 'success') {\n yield put(\n modal({\n title: 'OSMCha Status',\n description: status.get('message'),\n kind: status.get('status'),\n autoDismiss: 20,\n position: 'bc'\n })\n );\n }\n\n yield take(AUTH.logout);\n delayBy = DELAY;\n token = undefined;\n yield call(logoutFlow);\n yield call(delay, delayBy);\n } catch (error) {\n console.log(error);\n yield put(action(AUTH.loginError, error));\n yield call(delay, delayBy / 2);\n error.name = 'Error';\n yield put(\n modal({\n error,\n kind: 'warning'\n })\n );\n yield take(AUTH.logout);\n delayBy = 4 * delayBy;\n token = undefined;\n yield call(logoutFlow);\n yield call(delay, delayBy);\n }\n }\n}\n\nexport function* logoutFlow(): any {\n yield call(removeItem, 'token');\n yield call(removeItem, 'oauth_token');\n yield call(removeItem, 'oauth_token_secret');\n yield put(action(AUTH.clearSession));\n yield put(action(TRUSTEDLIST.clear));\n // get CHANGESET_PAGE without user metadata\n let pageIndex = yield select(pageIndexSelector);\n if (pageIndex) {\n yield put(action(CHANGESETS_PAGE.fetch, { pageIndex }));\n }\n yield put(action(AUTH.clearUserDetails));\n let location = yield select(locationSelector);\n yield put(\n push({\n ...location,\n pathname: '/'\n })\n );\n}\n\nexport function* authTokenFlow(): any {\n const { oauth_token, oauth_token_secret } = yield call(postTokensOSMCha);\n yield put(\n action(AUTH.saveOAuth, {\n oauth_token,\n oauth_token_secret\n })\n );\n // yield take(ACTION) waits for the particular action\n // to emit and resume the flow. next in action would\n // be to wait for the action `GET_FINAL_TOKEN`\n // and resume the flow\n const { oauth_verifier } = yield take(AUTH.getFinalToken);\n const { token } = yield call(\n postFinalTokensOSMCha,\n oauth_token,\n oauth_token_secret,\n oauth_verifier\n );\n if (!token || token === '') {\n throw new Error('invalid token');\n }\n yield call(setItem, 'token', token);\n yield call(setItem, 'oauth_token', oauth_token);\n yield call(setItem, 'oauth_token_secret', oauth_token_secret);\n yield put(\n action(AUTH.saveToken, {\n token,\n oauth_verifier\n })\n );\n return token;\n}\n\nexport function* updateUserDetailsSaga({\n message_good,\n message_bad,\n comment_feature\n}: {\n message_good: string,\n message_bad: string,\n comment_feature: boolean\n}): any {\n try {\n let token = yield select(tokenSelector);\n if (token) {\n const userDetails = fromJS(\n yield call(\n updateUserDetails,\n token,\n message_good,\n message_bad,\n comment_feature\n )\n );\n yield put(action(AUTH.userDetails, { userDetails }));\n yield put(\n modal({\n kind: 'success',\n title: 'User updated',\n description: 'Your user preferences were updated successfully'\n })\n );\n }\n } catch (e) {\n console.error(e);\n yield put(\n modal({\n error: e\n })\n );\n }\n}\n","// @flow\nimport { Map, fromJS } from 'immutable';\nimport { AUTH } from './auth_actions';\n\nexport type AuthType = Map<\n 'oAuthToken' | 'oAuthTokenSecret' | 'error' | 'token' | 'userDetails',\n any\n>;\n\nconst initialState: AuthType = fromJS({\n oAuthToken: null,\n oAuthTokenSecret: null,\n error: null,\n token: null,\n userDetails: null\n});\n\nexport function authReducer(\n state: AuthType = initialState,\n action: Object\n): AuthType {\n switch (action.type) {\n case AUTH.saveOAuth: {\n return state\n .set('oAuthToken', action.oauth_token)\n .set('oAuthTokenSecret', action.oauth_token_secret)\n .set('error', null);\n }\n case AUTH.saveToken: {\n return state.set('token', action.token).set('error', null);\n }\n case AUTH.clearSession: {\n return fromJS({ error: state.get('error') }); // retain the error\n }\n case AUTH.loginError: {\n return state.set('error', action.error);\n }\n case AUTH.userDetails: {\n return state.set('userDetails', action.userDetails);\n }\n case AUTH.clearUserDetails: {\n return state.set('userDetails', Map());\n }\n default:\n return state;\n }\n}\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport { CHANGESETS_PAGE } from './changesets_page_actions';\n\nexport type ChangesetsPageType = Map<\n 'currentPage' | 'pageIndex' | 'loading' | 'error' | 'diff' | 'diffLoading',\n any\n>;\n\nconst changesetsInitial: ChangesetsPageType = fromJS({\n pageIndex: 0,\n currentPage: null,\n loading: false,\n error: null,\n diff: 0, // difference between the number of changesets in cache and the currentPage.\n diffLoading: false // indicator to show background update is going on.\n});\n\nexport function changesetsPageReducer(\n state: ChangesetsPageType = changesetsInitial,\n action: Object\n): ChangesetsPageType {\n switch (action.type) {\n case CHANGESETS_PAGE.updateNewCount: {\n return state.set('diff', action.diff).set('diffLoading', false);\n }\n case CHANGESETS_PAGE.checkNewLoading: {\n return state.set('diffLoading', true);\n }\n case CHANGESETS_PAGE.loading: {\n return state\n .set('pageIndex', action.pageIndex)\n .set('loading', true)\n .set('diff', 0)\n .set('diffLoading', false)\n .set('error', null);\n }\n case CHANGESETS_PAGE.fetched: {\n return state\n .set('currentPage', action.data)\n .set('pageIndex', action.pageIndex)\n .set('loading', false)\n .set('error', null);\n }\n case CHANGESETS_PAGE.error: {\n return state\n .set('pageIndex', action.pageIndex)\n .set('diff', 0)\n .set('loading', false)\n .set('error', action.error);\n }\n default: {\n return state;\n }\n }\n}\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport {\n CHANGESET,\n CHANGESET_MAP,\n CHANGESET_MODIFY\n} from './changeset_actions';\n\nexport type ChangesetType = Map<\n | 'changesets'\n | 'changesetId' // of the currentChangeset\n | 'loading'\n | 'loadingChangesetMap'\n | 'changesetMap'\n | 'errorChangesetMap'\n | 'errorChangeset',\n any\n>;\n\nconst initial: ChangesetType = fromJS({\n changesetId: null,\n changesets: new Map(),\n loading: false,\n errorChangeset: null,\n changesetMap: new Map(),\n loadingChangesetMap: false,\n errorChangesetMap: null\n});\n\nexport function changesetReducer(\n state: ChangesetType = initial,\n action: Object\n): ChangesetType {\n switch (action.type) {\n case CHANGESET.change: {\n return state\n .set('changesetId', action.changesetId)\n .set('loading', false)\n .set('errorChangeset', null)\n .set('errorChangesetMap', null);\n }\n case CHANGESET.loading: {\n return state\n .set('changesetId', action.changesetId)\n .set('loading', true)\n .set('errorChangeset', null);\n }\n case CHANGESET.fetched: {\n const changesets = state\n .get('changesets')\n .set(action.changesetId, action.data);\n return state\n .set('changesets', changesets)\n .set('changesetId', action.changesetId)\n .set('loading', false)\n .set('errorChangeset', null);\n }\n case CHANGESET.error: {\n return state\n .set('changesetId', action.changesetId)\n .set('loading', false)\n .set('errorChangeset', action.error);\n }\n case CHANGESET_MAP.change: {\n return state\n .set('changesetId', action.changesetId)\n .set('errorChangesetMap', null)\n .set('loadingChangesetMap', false);\n }\n case CHANGESET_MAP.fetched: {\n const changesetMap = state\n .get('changesetMap')\n .set(action.changesetId, action.data);\n return state\n .set('changesetMap', changesetMap)\n .set('changesetId', action.changesetId)\n .set('loadingChangesetMap', false)\n .set('errorChangesetMap', null);\n }\n case CHANGESET_MAP.loading: {\n return state\n .set('changesetId', action.changesetId)\n .set('loadingChangesetMap', true)\n .set('errorChangesetMap', null);\n }\n case CHANGESET_MAP.error: {\n return state\n .set('changesetId', action.changesetId)\n .set('loadingChangesetMap', false)\n .set('errorChangesetMap', action.error);\n }\n case CHANGESET_MODIFY.modify: {\n const changesets = state\n .get('changesets')\n .set(action.changesetId, action.changeset);\n return state.set('changesets', changesets);\n }\n case CHANGESET_MODIFY.revert: {\n const changesets = state\n .get('changesets')\n .set(action.changesetId, action.changeset);\n return state\n .set('changesets', changesets)\n .set('errorChangeset', action.error);\n }\n default: {\n return state;\n }\n }\n}\n","// @flow\nimport { Map, fromJS } from 'immutable';\nimport { SHOW_MODAL } from './modal_actions';\n\nexport type ModalType = Map<\n | 'error'\n | 'kind'\n | 'duration'\n | 'title'\n | 'description'\n | 'callback'\n | 'callbackLabel'\n | 'dismiss'\n | 'uid'\n | 'autoDismiss'\n | 'position',\n any\n>; // osmcha uses this\n\nconst initialState: ModalType = fromJS({\n error: null,\n kind: null,\n duration: null,\n title: null,\n dismiss: true,\n autoDismiss: 5, // number\n position: 'tr',\n description: null,\n uid: null // number\n});\n\nexport function modalReducer(\n state: ModalType = initialState,\n action: Object\n): ModalType {\n switch (action.type) {\n case SHOW_MODAL: {\n return state\n .set('kind', action.kind)\n .set('error', action.error)\n .set('callbackLabel', action.callbackLabel)\n .set('title', action.title)\n .set('dismiss', action.dismiss)\n .set('uid', action.uid)\n .set('autoDismiss', action.autoDismiss)\n .set('position', action.position)\n .set('description', action.description);\n }\n default:\n return state;\n }\n}\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport { FILTERS } from './filters_actions';\n\nexport type filtersReducerType = Map<\n 'loading' | 'error' | 'filters' | 'aoi',\n any\n>;\n\nconst filtersInitial: filtersReducerType = fromJS({\n filters: {},\n aoi: {},\n loading: false,\n error: null\n});\n\nexport function filtersReducer(\n state: filtersReducerType = filtersInitial,\n action: Object\n): filtersReducerType {\n switch (action.type) {\n case FILTERS.set: {\n return state.set('filters', action.filters).set('loading', false);\n }\n default:\n return state;\n }\n}\n","// @flow\n\nexport const MAPCONTROLS = {\n setStyle: 'SET_STYLE'\n};\n\nexport function action(type: string, payload: ?Object) {\n return { type, ...payload };\n}\n\nexport const updateStyle = (style: string) =>\n action(MAPCONTROLS.setStyle, { style });\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport { MAPCONTROLS } from './map_controls_actions';\n\nexport type mapControlsReducerType = Map<'style', any>;\n\nconst mapControlsInitial: mapControlsReducerType = fromJS({\n style: 'satellite'\n});\n\nexport function mapControlsReducer(\n state: filtersReducerType = mapControlsInitial,\n action: Object\n): mapControlsReducerType {\n switch (action.type) {\n case MAPCONTROLS.setStyle: {\n return state.set('style', action.style);\n }\n default:\n return state;\n }\n}\n","import { Map, fromJS } from 'immutable';\nimport { TRUSTEDLIST } from './trustedlist_actions';\n\nexport type trustedlistReducerType = Map<'trustedlist', 'loading', any>;\n\nconst initialState: trustedlistReducerType = fromJS({\n trustedlist: null,\n loading: false\n});\n\nexport function trustedlistReducer(\n state: trustedlistReducerType = initialState,\n action: Object\n): WhitelistType {\n switch (action.type) {\n case TRUSTEDLIST.define: {\n return state.set('trustedlist', action.trustedlist).set('loading', false);\n }\n case TRUSTEDLIST.add: {\n return state\n .set(\n 'trustedlist',\n state.get('trustedlist').concat([action.trustedlist_user])\n )\n .set('loading', false);\n }\n case TRUSTEDLIST.remove: {\n return state\n .set(\n 'trustedlist',\n state\n .get('trustedlist')\n .filter(item => item !== action.trustedlist_user)\n )\n .set('loading', false);\n }\n case TRUSTEDLIST.clear: {\n return state.set('trustedlist', Map()).set('loading', false);\n }\n default:\n return state;\n }\n}\n","import { Map, List, fromJS } from 'immutable';\nimport { WATCHLIST } from './watchlist_actions';\n\nexport type watchlistReducerType = Map<'watchlist', 'loading', any>;\n\nconst initialState: watchlistReducerType = fromJS({\n watchlist: List(),\n loading: false\n});\n\nexport function watchlistReducer(\n state: watchlistReducerType = initialState,\n action: Object\n): WatchlistType {\n switch (action.type) {\n case WATCHLIST.define: {\n return state.set('watchlist', action.watchlist).set('loading', false);\n }\n case WATCHLIST.add: {\n return state\n .set(\n 'watchlist',\n state.get('watchlist').concat([fromJS(action.watchlist_user)])\n )\n .set('loading', false);\n }\n case WATCHLIST.remove: {\n return state\n .set(\n 'watchlist',\n state\n .get('watchlist')\n .filter(item => item.get('uid') !== action.watchlist_user)\n )\n .set('loading', false);\n }\n case WATCHLIST.clear: {\n return state.set('watchlist', Map()).set('loading', false);\n }\n default:\n return state;\n }\n}\n","/* @flow */\nimport { Map, fromJS } from 'immutable';\n\nimport { AOI } from './aoi_actions';\n\nexport type aoiReducerType = Map<'loading' | 'error' | 'aoi', any>;\n\nconst aoiInitial: aoiReducerType = fromJS({\n aoi: {},\n loading: false,\n error: null\n});\n\nexport function aoiReducer(\n state: aoiReducerType = aoiInitial,\n action: Object\n): filtersReducerType {\n switch (action.type) {\n case AOI.loading: {\n return state.set('loading', true);\n }\n case AOI.clear: {\n return state\n .set('aoi', Map())\n .set('loading', false)\n .set('error', null);\n }\n case AOI.fetched: {\n return state\n .set('loading', false)\n .set('error', null)\n .set('aoi', action.aoi);\n }\n default:\n return state;\n }\n}\n","import { all } from 'redux-saga/effects';\nimport { watchChangesetsPage } from './changesets_page_actions';\nimport { watchChangeset, watchModifyChangeset } from './changeset_actions';\nimport { watchAuth, watchUserDetails } from './auth_actions';\nimport { watchModal } from './modal_actions';\nimport { watchFilters } from './filters_actions';\nimport { watchTrustedlist } from './trustedlist_actions';\nimport { watchWatchlist } from './watchlist_actions';\nimport { watchAOI } from './aoi_actions';\n\nexport default function* rootSaga() {\n yield all([\n watchChangesetsPage(),\n watchFilters(),\n watchAOI(),\n watchChangeset(),\n watchAuth(),\n watchUserDetails(),\n watchModifyChangeset(),\n watchModal(),\n watchTrustedlist(),\n watchWatchlist()\n ]);\n}\n","// @flow\nimport { combineReducers, createStore, applyMiddleware } from 'redux';\nimport { Map } from 'immutable';\nimport { routerReducer, routerMiddleware } from 'react-router-redux';\nimport { history } from './history';\nimport createSagaMiddleware from 'redux-saga';\n\nimport * as safeStorage from '../utils/safe_storage';\n\n// Reducers\nimport { authReducer } from './auth_reducer';\nimport { changesetsPageReducer } from './changesets_page_reducer';\nimport { changesetReducer } from './changeset_reducer';\nimport { modalReducer } from './modal_reducer';\nimport { filtersReducer } from './filters_reducer';\nimport { mapControlsReducer } from './map_controls_reducer';\nimport { trustedlistReducer } from './trustedlist_reducer';\nimport { watchlistReducer } from './blacklist_reducer';\nimport { aoiReducer } from './aoi_reducer';\n\nimport type { ModalType } from './modal_reducer';\nimport type { ChangesetsPageType } from './changesets_page_reducer';\nimport type { ChangesetType } from './changeset_reducer';\nimport type { AuthType } from './auth_reducer';\nimport type { filtersReducerType } from './filters_reducer';\nimport type { mapControlsReducerType } from './map_controls_reducer';\nimport type { trustedlistReducerType } from './trustedlist_reducer';\nimport type { watchlistReducerType } from './blacklist_reducer';\n// Sagas\nimport sagas from './sagas';\n\nexport type RootStateType = {\n auth: AuthType,\n changesetsPage: ChangesetsPageType,\n filters: filtersReducerType,\n aoi: aoiReducerType,\n changeset: ChangesetType,\n modal: ModalType,\n routing: Object,\n trustedlist: trustedlistReducerType,\n watchlist: watchlistReducerType,\n mapControls: mapControlsReducerType\n};\n\n// Root reducer\nconst reducers = combineReducers({\n changesetsPage: changesetsPageReducer,\n changeset: changesetReducer,\n filters: filtersReducer,\n mapControls: mapControlsReducer,\n aoi: aoiReducer,\n routing: routerReducer,\n auth: authReducer,\n modal: modalReducer,\n trustedlist: trustedlistReducer,\n watchlist: watchlistReducer\n});\n\nconst sagaMiddleware = createSagaMiddleware();\n// Middlewares\nconst middlewares = [sagaMiddleware, routerMiddleware(history)];\n\nlet appliedMiddlewares = applyMiddleware(...middlewares);\nif (process.env.NODE_ENV !== 'production') {\n // const { createLogger } = require('redux-logger');\n\n // const logger = createLogger({\n // stateTransformer: state => {\n // let newState = {};\n\n // for (var i of Object.keys(state)) {\n // if (Iterable.isIterable(state[i])) {\n // newState[i] = state[i].toJS();\n // } else {\n // newState[i] = state[i];\n // }\n // }\n // return newState;\n // }\n // });\n // middlewares.push(logger);\n const { composeWithDevTools } = require('redux-devtools-extension');\n appliedMiddlewares = composeWithDevTools(appliedMiddlewares);\n}\n\n// Persisted state\nconst persistedState = {\n auth: Map({\n token: safeStorage.getItem('token'),\n oAuthToken: safeStorage.getItem('oauth_token'),\n oAuthTokenSecret: safeStorage.getItem('oauth_token_secret'),\n error: null\n })\n};\n\n// Store\nconst store = createStore(reducers, persistedState, appliedMiddlewares);\nsagaMiddleware.run(sagas);\n\nexport { store };\n","import { isProd } from '../config';\nlet ReactGA;\n\nif (isProd) {\n ReactGA = require('react-ga');\n}\n\nexport function gaPageView(page: string) {\n if (ReactGA) {\n ReactGA.pageview(page);\n }\n}\n\nexport function gaSendEvent(obj: Object) {\n if (ReactGA) {\n ReactGA.event(obj);\n }\n}\n","// @flow\nexport function getDisplayName(WrappedComponent: Object): string {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n","export function createPopup(\n title: string = 'Authentication',\n location: string\n) {\n const width = 500;\n const height = 600;\n const settings = [\n ['width', width],\n ['height', height],\n ['left', window.innerWidth.width / 2 - width / 2],\n ['top', window.innerHeight.height / 2 - height / 2]\n ]\n .map(x => x.join('='))\n .join(',');\n\n const popup = window.open('about:blank', title, settings);\n if (!popup) return;\n popup.location = location;\n}\n","export function dispatchEvent(\n messageId: string,\n payLoad: Object,\n target: ?Object\n) {\n const event = new CustomEvent(messageId, {\n detail: payLoad\n });\n (target || document.body).dispatchEvent(event);\n}\n","// @flow\nexport function elementInViewport(element: HTMLElement) {\n var rect = element.getBoundingClientRect();\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= window.innerHeight &&\n rect.right <= window.innerWidth\n );\n}\n","const parseQueryString = queryString => {\n const query = {};\n queryString.split('&').forEach(pair => {\n const [key, value] = pair.split('=');\n query[decodeURIComponent(key)] = decodeURIComponent(value) || null;\n });\n\n return query;\n};\n\nexport function handlePopupCallback() {\n // TO-FIX what if it never resolves\n return new Promise((res, rej) => {\n window.authComplete = location => {\n const queryString = location.split('?')[1];\n const creds = parseQueryString(queryString);\n delete window.authComplete;\n return res(creds);\n };\n });\n}\n","// @flow\n// export type cancelablePromiseType = { promise: Promise<*>, cancel: () => any };\nexport function cancelablePromise(promise: Promise<*>) {\n let hasCanceled_ = false;\n\n const wrappedPromise = new Promise((resolve, reject) => {\n promise\n .then(val => (hasCanceled_ ? reject({ isCanceled: true }) : resolve(val)))\n .catch(\n error => (hasCanceled_ ? reject({ isCanceled: true }) : reject(error))\n );\n });\n\n return {\n promise: wrappedPromise,\n cancel() {\n hasCanceled_ = true;\n }\n };\n}\nfunction handleErrors(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n}\n\nexport function cancelableFetchJSON(url: string, token?: string) {\n if (token) {\n return cancelablePromise(\n fetch(url, {\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n })\n );\n } else {\n return cancelablePromise(\n fetch(url)\n .then(handleErrors)\n .then(res => {\n return res.json();\n })\n );\n }\n}\n\nexport function delayPromise(\n interval: number\n): { promise: Promise<*>, cancel: () => any } {\n return cancelablePromise(new Promise(res => setTimeout(res, interval)));\n}\n","// Very, very basic mobile detection.\nexport const isMobile = () => {\n return window.innerWidth <= 800;\n};\n","import React from 'react';\n\nexport class Floater extends React.PureComponent {\n render() {\n return (\n \n \n {this.props.children}\n \n \n );\n }\n}\n","// @flow\nimport React from 'react';\n\nexport function CreateDeleteModify(props: Object) {\n const showZero = props.showZero;\n return (\n \n {(props.create > -1 || showZero) &&\n
        \n {props.create}\n
        }\n {(props.modify > -1 || showZero) &&\n
        \n {props.modify}\n
        }\n {(props.delete > -1 || showZero) &&\n
        \n {props.delete}\n
        }\n \n );\n}\n\n// export function CreateDeleteModify(props: Object) {\n// const showZero = props.showZero;\n// return (\n// \n// \n// \n// \n// \n// {props.create}\n// \n// \n// {props.modify}\n// \n// \n// \n// \n// \n// {props.delete}\n// \n// \n// );\n// }\n","//@flow\nimport React from 'react';\n\nexport default function AssemblyAnchor({ url }: { url?: string }) {\n return (\n \n {url}\n \n );\n}\n","//@flow\nimport React from 'react';\n\nexport default function TranslateButton({ text }: { text: string }) {\n return (\n \n Translate\n \n \n \n \n );\n}\n","// @flow\nimport React from 'react';\nimport { List } from 'immutable';\n\nexport function Reasons({\n reasons,\n userFlag,\n underline,\n color\n}: {\n reasons: List<*>,\n userFlag: string,\n underline: boolean,\n color: string\n}) {\n const extraClass = underline ? 'txt-underline-dotted' : '';\n return (\n \n {reasons.map((r: Map, k) => (\n \n ))}\n {userFlag && (\n \n )}\n \n );\n}\n\nconst Reason = ({\n text,\n color,\n extraClass\n}: {\n text: string,\n color: string,\n extraClass: string\n}) => (\n \n \n {text}\n \n \n);\n","import React from 'react';\n\nconst Property = ({ property, value, imageryMatch, sourceMatch }) => {\n return (\n
        \n \n {property}\n \n {value}\n {property === 'imagery' && (\n \n
        \n {imageryMatch.map((e, k) => (\n \n {Array.isArray(\n e.match(\n /^(?:https?:\\/\\/)?(?:[^@\\/\\n]+@)?(?:www\\.)?([^:\\/\\n]+)/gim\n )\n ) ? (\n e.match(\n /^(?:https?:\\/\\/)?(?:[^@\\/\\n]+@)?(?:www\\.)?([^:\\/\\n]+)/gim\n )[0]\n ) : (\n \n \n \n )}\n \n ))}\n
        \n )}\n {property === 'source' && (\n \n
        \n {sourceMatch.map((e, k) => (\n \n {Array.isArray(\n e.match(\n /^(?:https?:\\/\\/)?(?:[^@\\/\\n]+@)?(?:www\\.)?([^:\\/\\n]+)/gim\n )\n ) ? (\n e.match(\n /^(?:https?:\\/\\/)?(?:[^@\\/\\n]+@)?(?:www\\.)?([^:\\/\\n]+)/gim\n )[0]\n ) : (\n \n \n \n )}\n \n ))}\n
        \n )}\n
        \n );\n};\n\nexport default Property;\n","import React from 'react';\nimport Property from './property';\n\nconst PropertyList = ({ limit, properties, imageryMatch, sourceMatch }) => {\n return Object.entries(properties)\n .map(([property, value]) => (\n \n ))\n .slice(limit, limit + 2);\n};\n\nexport default PropertyList;\n","// @flow\nimport React, { useState } from 'react';\nimport { Map } from 'immutable';\nimport AnchorifyText from 'react-anchorify-text';\nimport AssemblyAnchor from '../assembly_anchor';\nimport TranslateButton from './translate_button';\nimport { Reasons } from '../reasons';\nimport PropertyList from './property_list';\n\nexport function Details({\n properties,\n changesetId\n}: {\n properties: Map,\n changesetId: number,\n expanded?: boolean\n}) {\n let source = properties.get('source');\n let imagery = properties.get('imagery_used');\n const editor = properties.get('editor');\n const metadata = properties.get('metadata');\n const reasons = properties.get('reasons');\n const comment = properties.get('comment');\n\n const urlRegex = new RegExp(\n /(?:(?:https?|ftp|file):\\/\\/|www\\.|ftp\\.)(?:\\([-A-Z0-9+&@#\\/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#\\/%=~_|$?!:,.])*(?:\\([-A-Z0-9+&@#\\/%=~_|$?!:,.]*\\)|[A-Z0-9+&@#\\/%=~_|$])/gim\n );\n\n let sourceMatch = [];\n if (source && source.indexOf('{switch:a,b,c}.') > -1) {\n source = source.replace('{switch:a,b,c}.', '');\n }\n if (source && source.match(urlRegex)) {\n sourceMatch = source.match(urlRegex);\n source = source.replace(urlRegex, '');\n }\n\n let imageryMatch = [];\n if (imagery && imagery.match(urlRegex)) {\n imageryMatch = imagery.match(urlRegex);\n imagery = imagery.replace(urlRegex, '');\n }\n\n let propertiesObj = {};\n // As JOSM doesn't use the imagery field, change the order\n // to make the source field visible in the first page\n if (imagery === 'Not reported') {\n propertiesObj = {\n editor: editor,\n source: source,\n imagery: imagery\n };\n } else {\n propertiesObj = {\n editor: editor,\n imagery: imagery,\n source: source\n };\n }\n\n Array.from(metadata, ([p, v]) => {\n if (\n !p.startsWith('ideditor') &&\n !p.startsWith('resolved') &&\n !p.startsWith('warnings')\n ) {\n propertiesObj[p] = v;\n }\n });\n\n const size = Object.keys(propertiesObj).length;\n const [leftLimit, setLeftLimit] = useState(0);\n\n return (\n
        \n
        \n
        \n \n \n \n \n

        \n
        \n
        \n \n
        \n
        \n
        \n \n
        \n
        \n {leftLimit > 0 && (\n setLeftLimit(leftLimit - 2)}\n title=\"Previous changeset properties\"\n >\n \n \n \n \n )}\n \n {leftLimit + 2 < size && (\n setLeftLimit(leftLimit + 2)}\n title=\"Next changeset properties\"\n >\n \n \n \n \n )}\n
        \n
        \n );\n}\n","import { useEffect, useState } from 'react';\n\nexport const useIsUserListed = (username, uid, trustedlist, watchlist) => {\n const [isInTrustedlist, setIsInTrustedlist] = useState(false);\n const [isInWatchlist, setIsInWatchlist] = useState(false);\n\n useEffect(() => {\n try {\n setIsInTrustedlist(trustedlist.indexOf(username) !== -1);\n } catch (e) {\n setIsInTrustedlist(false);\n }\n try {\n setIsInWatchlist(\n watchlist.map(user => user.get('uid')).indexOf(uid) !== -1\n );\n } catch (e) {\n setIsInWatchlist(false);\n }\n }, [username, uid, watchlist, trustedlist]);\n\n return [isInTrustedlist, isInWatchlist];\n};\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { formatDistanceToNow, parse } from 'date-fns';\n\nimport { CreateDeleteModify } from '../create_delete_modify';\nimport { Details } from './details';\nimport { useIsUserListed } from '../../hooks/UseIsUserListed';\n\ntype propsType = {|\n properties: Map,\n changesetId: number,\n userEditCount: number,\n toggleUser: () => mixed,\n trustedlist: Map,\n watchlisted: Map\n|};\n\nfunction HeaderComponent({\n properties,\n changesetId,\n userEditCount,\n toggleUser,\n trustedlist,\n watchlisted\n}: propsType) {\n const user = properties.get('user');\n const date = parse(\n properties.get('date'),\n // eslint-disable-next-line\n \"yyyy-MM-dd'T'HH:mm:ssX\",\n new Date()\n );\n const create = properties.get('create');\n const modify = properties.get('modify');\n const destroy = properties.get('delete');\n const [isInTrustedlist, isInWatchlist] = useIsUserListed(\n user,\n properties.get('uid'),\n trustedlist,\n watchlisted\n );\n\n return (\n
        \n
        \n
        \n

        Details

        \n
        \n \n
        \n
        \n
        \n \n \n \n {user}\n \n \n {isInTrustedlist && (\n \n \n \n )}\n {isInWatchlist && (\n \n \n \n )}\n {userEditCount > 0 && (\n \n  ({userEditCount} edits)\n \n )}\n  created {formatDistanceToNow(date, { addSuffix: true })}\n \n
        \n
        \n
        \n
        \n );\n}\n\nconst Header = connect((state: RootStateType, props) => ({\n trustedlist: state.trustedlist.get('trustedlist'),\n watchlisted: state.watchlist.get('watchlist')\n}))(HeaderComponent);\nexport { Header };\n","import React from 'react';\nimport Placeholder from './user.jpg';\n\nexport class Avatar extends React.PureComponent {\n props: {\n url: string\n };\n state = {\n loaded: false\n };\n handleImageLoaded() {\n this.setState({ loaded: true });\n }\n handleImageErrored() {\n this.setState({ loaded: false });\n }\n componentWillReceiveProps(nextProps) {\n if (nextProps.url !== this.props.url) {\n this.setState({\n loaded: false\n });\n }\n }\n render() {\n let url: string = Placeholder;\n if (this.props.url) {\n url = this.props.url;\n if (url.indexOf('http://') > -1) {\n url = 'https://' + url.slice(5);\n }\n }\n return (\n
        \n \n \n
        \n );\n }\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\n\nimport { createPopup } from '../../utils/create_popup';\nimport { handlePopupCallback } from '../../utils/handle_popup_callback';\nimport { osmAuthUrl } from '../../config/constants';\nimport { isDev, isLocal } from '../../config';\nimport type { RootStateType } from '../../store';\nimport { getFinalToken } from '../../store/auth_actions';\nimport { getChangesetsPage } from '../../store/changesets_page_actions';\nimport { getChangeset } from '../../store/changeset_actions';\n\nclass SignInButton extends React.PureComponent {\n props: {\n text: string,\n oAuthToken: ?string,\n pageIndex: number,\n getFinalToken: string => mixed,\n getChangeset: string => mixed,\n getChangesetsPage: string => mixed\n };\n\n handleLoginClick = () => {\n var oAuthToken = this.props.oAuthToken;\n if (!oAuthToken) return;\n\n let url;\n if (isDev || isLocal) {\n url = `/local-landing.html#${oAuthToken}`;\n } else {\n url = `${osmAuthUrl}?oauth_token=${oAuthToken}`;\n }\n\n createPopup('oauth_popup', url);\n handlePopupCallback().then(oAuthObj => {\n this.props.getFinalToken(oAuthObj.oauth_verifier);\n });\n };\n render() {\n const extraClasses = this.props.className\n ? this.props.className\n : 'border--darken5 border--darken25-on-hover bg-darken10 bg-darken5-on-hover color-gray';\n return (\n \n \n \n \n {this.props.text}\n \n );\n }\n}\n\nSignInButton = connect(\n (state: RootStateType, props) => ({\n oAuthToken: state.auth.get('oAuthToken'),\n pageIndex: state.changesetsPage.get('pageIndex') || 0\n }),\n {\n getFinalToken,\n getChangeset,\n getChangesetsPage\n }\n)(SignInButton);\n\nexport { SignInButton };\n","import React from 'react';\n\nexport function Button({\n onClick,\n children,\n iconName,\n className,\n disabled\n}: Object) {\n return (\n \n {children}\n {iconName && (\n \n \n \n )}\n \n );\n}\n","// @flow\nimport React from 'react';\nimport './dropdown.css';\nimport onClickOutside from 'react-click-outside';\nimport { Button } from './button';\n\nclass DropdownContent extends React.PureComponent {\n isActive = (obj: Object) => {\n for (let v of this.props.value) {\n if (v.label === obj.label) {\n return true;\n }\n }\n return false;\n };\n\n handleClick = (data: Object) => {\n if (data) {\n var label = data.label;\n if (!label || !this.props.value || !this.props.onChange) return;\n const value = this.props.value;\n let ourObj = data;\n if (!ourObj) return;\n\n let isRemove = false;\n for (let x = 0; x < value.length; x++) {\n if (value[x].label === label) {\n isRemove = true;\n this.props.onRemove(ourObj);\n this.props.onChange(value.slice(0, x).concat(value.slice(x + 1)));\n }\n }\n\n if (!isRemove) {\n let newArray = value.slice(0, value.length);\n if (!this.props.multi) {\n newArray = [];\n }\n newArray.push(ourObj);\n this.props.onAdd(ourObj);\n this.props.onChange(newArray);\n }\n }\n if (!this.props.multi) {\n this.props.toggleDropdown();\n }\n };\n\n render() {\n return (\n \n {this.props.options.map((i, k) => (\n \n {this.props.multi && (\n \n )}\n {i.href ? (\n \n {i.label}\n \n ) : (\n \n {i.label}\n \n )}\n {this.props.deletable && (\n {\n e.preventDefault();\n e.stopPropagation();\n this.props.toggleDropdown();\n this.props.deletable(i.value);\n }}\n >\n x\n \n )}\n \n ))}\n \n );\n }\n}\n\nexport class _Dropdown extends React.PureComponent {\n props: {\n className: string,\n disabled: boolean,\n value: Array,\n onChange: (Array) => any,\n onAdd: (?Object) => any,\n onRemove: (?Object) => any,\n options: Array,\n display: string,\n deletable?: (value: string) => any,\n multi: boolean,\n position: string\n };\n\n state = {\n display: false\n };\n\n handleClickOutside = () => {\n this.setState({\n display: false\n });\n };\n\n toggleDropdown = () => {\n this.setState({\n display: !this.state.display\n });\n };\n\n isActive = (obj: Object) => {\n for (let v of this.props.value) {\n if (v.label === obj.label) {\n return true;\n }\n }\n return false;\n };\n\n render() {\n return (\n
        \n \n {this.props.display}\n \n {this.state.display && (\n \n )}\n
        \n );\n }\n}\n\nexport const Dropdown = onClickOutside(_Dropdown);\n","import React from 'react';\nimport { connect } from 'react-redux';\n\nimport { Dropdown } from '../dropdown';\nimport {\n addToWatchlist,\n removeFromWatchlist\n} from '../../store/watchlist_actions';\nimport {\n addToTrustedlist,\n removeFromTrustedlist\n} from '../../store/trustedlist_actions';\n\ntype propsType = {\n user: Map,\n trustedlist: Map,\n watchlist: Map,\n addToWatchlist: string => void,\n removeFromWatchlist: string => void,\n addToTrustedlist: string => void,\n removeFromTrustedlist: string => void\n};\n\nclass TrustWatchUser extends React.PureComponent {\n handleVerify = (arr: Array) => {\n const username = this.props.user.get('name');\n const uid = this.props.user.get('uid');\n if (arr.length === 1) {\n if (arr[0].value === false) {\n this.props.addToWatchlist({ username, uid });\n }\n if (arr[0].value === true) {\n this.props.addToTrustedlist(username);\n }\n } else if (arr.length > 1) {\n throw new Error('verify array is big');\n }\n };\n\n handleVerifyClear = () => {\n const is_in_trustedlist =\n this.props.trustedlist.indexOf(this.props.user.get('name')) !== -1;\n const is_watchlisted =\n this.props.watchlist\n .map(user => user.get('uid'))\n .indexOf(this.props.user.get('uid')) !== -1;\n\n if (is_watchlisted) {\n this.props.removeFromWatchlist(this.props.user.get('uid'));\n } else if (is_in_trustedlist) {\n this.props.removeFromTrustedlist(this.props.user.get('name'));\n }\n };\n\n render() {\n const watchlist = this.props.watchlist.map(user => user.get('uid'));\n\n if (watchlist.includes(this.props.user.get('uid'))) {\n return (\n
        \n \n \n \n \n \n Watchlisted user\n \n \n this.props.removeFromWatchlist(this.props.user.get('uid'))\n }\n className=\"icon inline-block align-middle pl6 w24 h24 pointer color-gray\"\n >\n \n \n \n
        \n );\n } else if (\n this.props.trustedlist &&\n this.props.trustedlist.includes(this.props.user.get('name'))\n ) {\n return (\n
        \n \n \n \n \n \n Trusted user\n \n \n this.props.removeFromTrustedlist(this.props.user.get('name'))\n }\n className=\"icon inline-block align-middle pl6 w24 h24 pointer color-gray\"\n >\n \n \n \n
        \n );\n }\n\n return (\n
        \n {}}\n onRemove={() => {}}\n options={[\n {\n value: false,\n label: 'Add to your watchlist'\n },\n {\n value: true,\n label: 'Add to your trusted users list'\n }\n ]}\n onChange={this.handleVerify}\n display=\"Trust / Watch user\"\n position=\"left\"\n />\n
        \n );\n }\n}\n\nTrustWatchUser = connect(\n (state: RootStateType, props) => ({\n trustedlist: state.trustedlist.get('trustedlist'),\n watchlist: state.watchlist.get('watchlist')\n }),\n {\n addToWatchlist,\n removeFromWatchlist,\n addToTrustedlist,\n removeFromTrustedlist\n }\n)(TrustWatchUser);\n\nexport { TrustWatchUser };\n","import React from 'react';\n\nexport const UserOSMLink = ({ userName, linkClasses, children }) => {\n if (!userName) return null;\n\n const url = `https://www.openstreetmap.org/user/${userName}`;\n\n return (\n \n {children}\n \n );\n};\n","import React from 'react';\nimport { Link } from 'react-router-dom';\nimport showdown from 'showdown';\nimport { formatDistanceToNow, parse } from 'date-fns';\n\nimport { Avatar } from '../avatar';\nimport { getObjAsQueryParam } from '../../utils/query_params';\nimport { SignInButton } from './sign_in_button';\nimport { TrustWatchUser } from './trust_watch_user';\nimport { UserOSMLink } from './user_osm_link';\n\nclass UserLink extends React.PureComponent {\n getHarmfulObject() {\n if (this.props.harmful) {\n return {\n label: 'Show Bad only',\n value: true\n };\n } else {\n return {\n label: 'Show Good only',\n value: false\n };\n }\n }\n getLinkContent() {\n if (this.props.harmful) {\n return `${this.props.userDetails.get('harmful_changesets')} Bad`;\n } else {\n const count =\n this.props.userDetails.get('checked_changesets') -\n this.props.userDetails.get('harmful_changesets');\n return `${count} Good`;\n }\n }\n render() {\n return (\n \n {this.getLinkContent()}\n \n );\n }\n}\n\n// getObjAsQueryParam('filters', filters.toJS());\nexport class User extends React.PureComponent {\n renderUidFilterLink() {\n return (\n \n {`${this.props.userDetails.get('count')} edits`}\n \n );\n }\n render() {\n const converter = new showdown.Converter({\n noHeaderId: true,\n simplifiedAutoLink: true\n });\n const UserDescriptionHTML = converter.makeHtml(\n this.props.userDetails.get('description') || ''\n );\n const registrationDate = this.props.userDetails.get('accountCreated')\n ? formatDistanceToNow(\n parse(\n this.props.userDetails.get('accountCreated'),\n // eslint-disable-next-line\n \"yyyy-MM-dd'T'HH:mm:ssX\",\n new Date()\n ),\n { addSuffix: true }\n )\n : '';\n\n return (\n
        \n

        \n User{' '}\n {this.props.userDetails.get('uid') &&\n `/ ${this.props.userDetails.get('uid')}`}\n

        \n {this.props.userDetails.get('name') ? (\n
        \n
        \n \n
        \n {this.props.userDetails.get('name')}\n
        \n
        \n
        \n

        \n {`Joined ${registrationDate} | `}\n {this.props.userDetails.get('count')\n ? this.renderUidFilterLink()\n : `${this.props.userDetails.get(\n 'changesets_in_osmcha'\n )} edits registered on OSMCha`}\n

        \n
        \n
        \n

        \n \n  and \n \n  changesets\n

        \n
        \n\n
        \n \n
        \n\n
        \n \n OSMCha\n \n \n OSM\n \n \n HDYC\n \n \n Missing Maps\n \n
        \n\n {this.props.whosThat.size > 1 && (\n
        \n Past usernames:  \n {this.props.whosThat.slice(0, -1).map((e, k) => (\n \n {e} \n \n ))}\n
        \n )}\n
        \n \n
        \n
        \n ) : (\n
        \n
        \n \n
        \n {this.props.userDetails.get('name')}\n
        \n
        \n
        \n \n
        \n
        \n )}\n
        \n );\n }\n}\n","import React from 'react';\n\nexport const Loading = ({ height, className }) => (\n \n
        \n
        \n);\n","// @flow\nimport React from 'react';\n\nimport { SignInButton } from './changeset/sign_in_button';\n\nexport function SignIn() {\n return (\n
        \n
         
        \n
        \n \n \n \n
        \n
        \n Sign in with your OpenStreetMap account to use OSMCha.\n
        \n
        \n \n
        \n
         
        \n
        \n );\n}\n","import React from 'react';\nimport debounce from 'lodash.debounce';\nimport { connect } from 'react-redux';\nimport CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';\nimport { Loading } from '../components/loading';\nimport { SignIn } from '../components/sign_in';\nimport { dispatchEvent } from '../utils/dispatch_event';\nimport { updateStyle } from '../store/map_controls_actions';\nimport { importChangesetMap } from '../utils/cmap';\n\nimport 'changeset-map/public/css/style.css';\nimport type { RootStateType } from '../store';\nimport { isMobile } from '../utils';\n\nlet changesetId;\nlet currentChangesetMap;\nlet width = 700;\nlet height = 500;\nlet event;\nlet cMapRender;\n\nlet getMapInstance;\nexport function selectFeature(id: number) {\n if (!id || !event) return;\n event.emit('selectFeature', 'node|way', id);\n}\n\nfunction loadingChangesetMapAsync() {\n if (cMapRender) return Promise.resolve(cMapRender);\n return Promise.all([\n importChangesetMap('render'),\n importChangesetMap('getMapInstance')\n ]).then(res => {\n cMapRender = res[0];\n getMapInstance = res[1];\n return cMapRender;\n });\n}\n\nfunction loadMap() {\n var container = document.getElementById('container');\n if (!container || !currentChangesetMap) return;\n loadingChangesetMapAsync().then(render => {\n if (!render) return;\n // if (event) event.emit('clearFeature');\n event = render(container, changesetId, {\n width: width + 'px',\n height: Math.max(400, height) + 'px',\n data: currentChangesetMap,\n disableSidebar: true\n });\n });\n}\n\nvar minDebounce = debounce(loadMap, 250);\n\nclass CMap extends React.PureComponent {\n props: {\n changesetId: number,\n currentChangesetMap: Object,\n errorChangesetMap: ?Object,\n loadingChangesetMap: boolean,\n className: string,\n style: string\n };\n\n state = {\n visible: false,\n height: 0,\n width: 0\n };\n\n ref = null;\n\n componentDidMount() {\n changesetId = this.props.changesetId;\n currentChangesetMap = this.props.currentChangesetMap;\n const mobile = isMobile();\n\n if (this.ref) {\n var rect = this.ref.parentNode.getBoundingClientRect();\n // On mobile, above the map are two bars, one 36px, on 40px\n height = mobile\n ? parseInt(window.innerHeight - 36 - 40, 10)\n : parseInt(window.innerHeight - 1 * 55, 10);\n width = parseInt(rect.width, 10);\n }\n window.onresize = debounce(this.setDimensions, 100);\n minDebounce();\n }\n\n componentWillUnmount() {\n window.onresize = null;\n if (this.props.style !== 'satellite') this.props.updateStyle('satellite');\n event && event.emit('remove');\n }\n\n componentDidUpdate(prevProp: Object) {\n if (\n this.props.currentChangesetMap !== prevProp.currentChangesetMap ||\n this.props.token !== prevProp.token\n ) {\n minDebounce();\n }\n }\n\n setRef = (r: any) => {\n this.ref = r;\n this.setDimensions();\n };\n\n setDimensions = () => {\n if (!this.ref) return;\n var rect = this.ref.parentNode.getBoundingClientRect();\n height = parseInt(window.innerHeight - 1 * 55, 10);\n width = parseInt(rect.width, 10);\n this.setState({\n height,\n width\n });\n if (getMapInstance) {\n var instance = getMapInstance();\n if (instance && instance.map) {\n instance.map.resize();\n }\n }\n };\n\n render() {\n if (this.props.errorChangesetMap) {\n dispatchEvent('showToast', {\n title: 'changeset-map failed to load',\n content: 'Try reloading osmcha',\n timeOut: 5000,\n type: 'error'\n });\n console.error(this.props.errorChangesetMap);\n // return null;\n }\n changesetId = this.props.changesetId;\n currentChangesetMap = this.props.currentChangesetMap;\n\n if (this.props.token) {\n return (\n
        \n \n \n {(this.props.loadingChangesetMap ||\n this.props.errorChangesetMap) && (\n \n \n
        \n )}\n \n \n );\n } else {\n return ;\n }\n }\n}\n\nCMap = connect(\n (state: RootStateType, props) => ({\n changesetId: state.changeset.get('changesetId'),\n currentChangesetMap: state.changeset.getIn([\n 'changesetMap',\n state.changeset.get('changesetId')\n ]),\n errorChangesetMap: state.changeset.get('errorChangesetMap'),\n loadingChangesetMap: state.changeset.get('loadingChangesetMap'),\n style: state.mapControls.get('style'),\n token: state.auth.get('token')\n }),\n { updateStyle }\n)(CMap);\n\nexport { CMap };\n","// @flow\nimport React from 'react';\nimport { Map, List } from 'immutable';\nimport { Reasons } from '../reasons';\nimport { selectFeature } from '../../views/map';\n\nconst Feature = ({\n data,\n changesetReasons\n}: {\n data: Map,\n changesetReasons: Map\n}) => {\n let reasons;\n // operation necessary to the change\n if (\n data.get('reasons').size &&\n typeof data.get('reasons').get(0) === 'number'\n ) {\n reasons = changesetReasons.filter(reason =>\n data.get('reasons').contains(reason.get('id'))\n );\n } else {\n reasons = data.get('reasons');\n }\n return (\n \n {data.get('osm_id')}\n {data.get('name')}\n \n {data.get('note') ? (\n \n \n \n ) : (\n \n )}\n \n \n selectFeature(parseInt(data.get('osm_id'), 10))}\n >\n Map\n \n \n \n JOSM\n \n \n \n \n );\n};\n\nexport function Features({\n properties,\n changesetId\n}: {\n properties: Map,\n changesetId: number\n}) {\n let features: List> = properties.get('features');\n const reviewedFeatures: List> = properties\n .get('reviewed_features')\n .map(feature =>\n Map({\n url: feature.get('id'),\n user_flag: `Flagged by ${feature.get('user')}`,\n osm_id: feature.get('id').split('-')[1],\n reasons: []\n })\n );\n const reviewedIds = reviewedFeatures.map(feature => feature.get('url'));\n const featuresIds = features.map(feature => feature.get('url'));\n const intersection = features\n .filter(feature => reviewedIds.includes(feature.get('url')))\n .map((feature, k) => [k, feature.get('url')]);\n intersection.forEach(item => {\n features = features.setIn(\n [item[0], 'user_flag'],\n reviewedFeatures.find(f => f.get('url') === item[1]).get('user_flag')\n );\n });\n features = features.concat(\n reviewedFeatures.filter(\n feature => !featuresIds.includes(feature.get('url'))\n )\n );\n\n return (\n
        \n
        \n

        \n Flagged Features\n {features.size > 0 && (\n \n {features.size}\n \n )}\n

        \n {features.size === 0 ? (\n
        \n \n \n \n

        {`No features were flagged for ${changesetId}.`}

        \n
        \n ) : (\n \n \n \n \n \n \n \n \n \n \n {features.map((f, k) => (\n \n ))}\n \n
        OSM IdNameReasonsActions
        \n )}\n
        \n
        \n );\n}\n","// @flow\nimport React from 'react';\n\ntype propsType = {|\n isActive: boolean,\n setOpenAll: Function\n|};\n\nexport const OpenAll = ({ isActive, setOpenAll }: propsType) => (\n
        \n setOpenAll(!isActive)}\n role=\"switch\"\n aria-checked={isActive}\n tabIndex=\"0\"\n >\n {isActive ? 'Close all' : 'Open all'}\n \n
        \n);\n","// @flow\nimport React from 'react';\n\ntype propsType = {|\n isOpen: boolean\n|};\n\nexport const ExpandItemIcon = ({ isOpen }: propsType) => {\n return (\n <>\n {isOpen ? (\n \n \n \n ) : (\n \n \n \n )}\n \n );\n};\n","// @flow\nimport React, { useState, useEffect } from 'react';\nimport { connect } from 'react-redux';\nimport { OrderedSet } from 'immutable';\n\nimport type { RootStateType } from '../store';\nimport { selectFeature } from '../../views/map';\nimport { Loading } from '../loading';\nimport { OpenAll } from '../open_all';\nimport { ExpandItemIcon } from '../expand_item_icon';\n\nexport function getFeatures(features) {\n var keys = Object.keys(features);\n return keys.map(item => features[item]);\n}\n\nexport function processFeatures(features) {\n const finalReport = new Map();\n const analyzedFeatures = features.map(feature =>\n analyzeFeature(feature[0], feature[1])\n );\n const keys = ['addedTags', 'changedValues', 'deletedTags'];\n analyzedFeatures.map(item =>\n keys.map(key =>\n item.get(key).forEach(tag => {\n if (finalReport.get(tag[0])) {\n finalReport.set(\n tag[0],\n finalReport\n .get(tag[0])\n .concat([\n { id: item.get('id'), type: item.get('type'), value: tag[1] }\n ])\n );\n } else {\n finalReport.set(tag[0], [\n { id: item.get('id'), type: item.get('type'), value: tag[1] }\n ]);\n }\n })\n )\n );\n return finalReport;\n}\n\nexport function analyzeFeature(newVersion, oldVersion) {\n const oldVersionKeys = Object.keys(oldVersion.properties.tags);\n const newVersionKeys = Object.keys(newVersion.properties.tags);\n const addedTags = newVersionKeys.filter(tag => !oldVersionKeys.includes(tag));\n const deletedTags = oldVersionKeys.filter(\n tag => !newVersionKeys.includes(tag)\n );\n const changedValues = newVersionKeys\n .filter(tag => !addedTags.includes(tag) && !deletedTags.includes(tag))\n .filter(\n tag => newVersion.properties.tags[tag] !== oldVersion.properties.tags[tag]\n );\n const result = new Map();\n result\n .set('id', newVersion.properties.id)\n .set('type', newVersion.properties.type)\n .set(\n 'addedTags',\n addedTags.map(tag => [\n `Added tag ${tag}`,\n newVersion.properties.tags[tag]\n ])\n )\n .set(\n 'deletedTags',\n deletedTags.map(tag => [\n `Deleted tag ${tag}`,\n oldVersion.properties.tags[tag]\n ])\n )\n .set(\n 'changedValues',\n changedValues.map(tag => [\n `Changed value of tag ${tag}`,\n [oldVersion.properties.tags[tag], newVersion.properties.tags[tag]]\n ])\n );\n return result;\n}\n\nexport function FeatureListItem({ id, type }) {\n return (\n
      • \n selectFeature(id)}\n >\n {type} {id}\n \n
      • \n );\n}\n\nfunction ChangeTitle({ value, type }) {\n if (type.startsWith('Added')) {\n return {value};\n }\n if (type.startsWith('Deleted')) {\n return {value};\n }\n if (type.startsWith('Changed')) {\n const [oldValue, newValue] = value;\n return (\n \n {oldValue}\n âžœ \n {newValue}\n \n );\n }\n return
        ;\n}\n\nexport const ChangeItem = ({ opened, tag, features }) => {\n const [isOpen, setIsOpen] = useState(opened);\n const values = new OrderedSet(features.map(feature => feature.value));\n const last_space = tag.lastIndexOf(' ') + 1;\n\n useEffect(() => setIsOpen(opened), [opened]);\n\n return (\n
        \n setIsOpen(!isOpen)}\n >\n \n {tag.slice(0, last_space)}\n {tag.slice(last_space)}\n \n {features.length}\n \n \n {values.map((value, n) => (\n \n \n
          \n {features\n .filter(feature => feature.value === value)\n .map((feature, k) => (\n \n ))}\n
        \n
        \n ))}\n \n );\n};\n\nconst ChangeItemList = ({ changes, openAll }) => {\n return (\n <>\n {changes.length ? (\n changes.map((change, k) => (\n \n ))\n ) : (\n No tags were changed in this changeset.\n )}\n \n );\n};\n\ntype propsType = {|\n changesetId: string,\n changes: Object\n|};\n\nconst TagChangesComponent = ({ changesetId, changes }: propsType) => {\n const [changeReport, setChangeReport] = useState([]);\n const [openAll, setOpenAll] = useState(false);\n\n useEffect(() => {\n const newChangeReport = [];\n if (changes && changes.get(changesetId)) {\n const changesetData = changes.get(changesetId)['featureMap'];\n const processed = processFeatures(\n getFeatures(changesetData).filter(\n item => item.length === 2 && item[0].properties.action === 'modify'\n )\n );\n processed.forEach((featureIDs, tag) =>\n newChangeReport.push([tag, featureIDs])\n );\n setChangeReport(newChangeReport.sort());\n }\n }, [changes, changesetId]);\n\n return (\n
        \n
        \n

        \n Tag changes\n

        \n {changeReport.length ? (\n \n ) : null}\n
        \n {changes.get(changesetId) ? (\n \n ) : (\n \n )}\n
        \n );\n};\n\nconst TagChanges = connect((state: RootStateType, props) => ({\n changes: state.changeset.get('changesetMap')\n}))(TagChangesComponent);\n\nexport { TagChanges };\n","// @flow\nimport React, { useEffect, useState } from 'react';\nimport { connect } from 'react-redux';\n\nimport type { RootStateType } from '../store';\nimport { getFeatures, FeatureListItem } from './tag_changes';\nimport { Loading } from '../loading';\nimport { OpenAll } from '../open_all';\nimport { ExpandItemIcon } from '../expand_item_icon';\n\nfunction processFeatures(features) {\n const finalReport = new Map();\n features = features.map(item => item[0]);\n const keys = ['create', 'delete'];\n keys.map(key =>\n finalReport.set(\n key,\n features\n .filter(item => item.properties.action === key)\n .map(item => ({ id: item.properties.id, type: item.properties.type }))\n )\n );\n finalReport.set(\n 'modify',\n features\n .filter(item => item.properties.action === 'modify')\n .filter(item => item.properties.type === 'relation')\n .map(item => ({ id: item.properties.id, type: item.properties.type }))\n );\n return finalReport;\n}\n\nconst ActionItem = ({ opened, tag, features }) => {\n const [isOpen, setIsOpen] = useState(opened);\n const titles = {\n create: 'Created',\n modify: 'Modified Relations',\n delete: 'Deleted'\n };\n\n useEffect(() => setIsOpen(opened), [opened]);\n\n return (\n
        \n setIsOpen(!isOpen)}\n >\n \n {titles[tag]}\n \n {features.length}\n \n \n
          \n {features.map((item, k) => (\n \n ))}\n
        \n
        \n );\n};\n\ntype propsType = {|\n changesetId: string,\n changes: Object\n|};\n\nconst OtherFeaturesComponent = ({ changesetId, changes }: propsType) => {\n const [changeReport, setChangeReport] = useState([]);\n const [openAll, setOpenAll] = useState(false);\n\n useEffect(() => {\n const newChangeReport = [];\n if (changes && changes.get(changesetId)) {\n const changesetData = changes.get(changesetId)['featureMap'];\n const processed = processFeatures(getFeatures(changesetData));\n processed.forEach((featureIDs, tag) =>\n newChangeReport.push([tag, featureIDs])\n );\n setChangeReport(\n newChangeReport.filter(changeType => changeType[1].length)\n );\n }\n }, [changes, changesetId]);\n\n return (\n
        \n
        \n

        \n Other features\n

        \n {changeReport.length ? (\n \n ) : null}\n
        \n {changes.get(changesetId) ? (\n changeReport.length ? (\n changeReport.map((change, k) => (\n \n ))\n ) : (\n No created and deleted features in this changeset.\n )\n ) : (\n \n )}\n
        \n );\n};\n\nexport const OtherFeatures = connect((state: RootStateType, props) => ({\n changes: state.changeset.get('changesetMap')\n}))(OtherFeaturesComponent);\n","// @flow\nimport React, { useState, useEffect } from 'react';\nimport { connect } from 'react-redux';\n\nimport type { RootStateType } from '../store';\nimport { getFeatures, FeatureListItem } from './tag_changes';\nimport { Loading } from '../loading';\nimport { OpenAll } from '../open_all';\nimport { ExpandItemIcon } from '../expand_item_icon';\n\nfunction processFeatures(features) {\n const finalReport = new Map();\n const keys = ['node', 'way', 'relation'];\n keys.map(key =>\n finalReport.set(\n key,\n features\n .filter(item => item[0].properties.action === 'modify')\n .filter(item => item[0].properties.type === key)\n .filter(\n item =>\n JSON.stringify(item[0].geometry) !==\n JSON.stringify(item[1].geometry)\n )\n .map(item => ({ id: item[0].properties.id }))\n )\n );\n return finalReport;\n}\n\nconst GeometryChangesItem = ({ tag, features, opened }) => {\n const titles = { node: 'Nodes', way: 'Ways', relation: 'Relations' };\n const [isOpen, setIsOpen] = useState(opened);\n\n useEffect(() => setIsOpen(opened), [opened]);\n\n return (\n
        \n setIsOpen(!isOpen)}\n >\n \n {titles[tag]}\n \n {features.length}\n \n \n
          \n {features.map((item, k) => (\n \n ))}\n
        \n
        \n );\n};\n\ntype propsType = {|\n changesetId: string,\n changes: Object\n|};\n\nconst GeometryChangesComponent = ({ changesetId, changes }: propsType) => {\n const [changeReport, setChangeReport] = useState([]);\n const [openAll, setOpenAll] = useState(false);\n\n useEffect(() => {\n const newChangeReport = [];\n if (changes && changes.get(changesetId)) {\n const changesetData = changes.get(changesetId)['featureMap'];\n const processed = processFeatures(getFeatures(changesetData));\n processed.forEach((featureIDs, tag) =>\n newChangeReport.push([tag, featureIDs])\n );\n setChangeReport(\n newChangeReport.filter(changeType => changeType[1].length)\n );\n }\n }, [changes, changesetId]);\n\n return (\n
        \n
        \n

        \n Geometry Changes\n

        \n {changeReport.length ? (\n \n ) : null}\n
        \n {changes.get(changesetId) ? (\n changeReport.length ? (\n changeReport.map((change, k) => (\n \n ))\n ) : (\n No geometry changes in this changeset.\n )\n ) : (\n \n )}\n
        \n );\n};\n\nexport const GeometryChanges = connect((state: RootStateType, props) => ({\n changes: state.changeset.get('changesetMap')\n}))(GeometryChangesComponent);\n","import React from 'react';\n\nexport const Box = ({ children, pullDown, pullUp, className, style, bg }) => (\n
        \n \n {children}\n
        \n \n);\n","// @flow\nimport React from 'react';\nimport { Map, List } from 'immutable';\n\nimport { cancelablePromise } from '../../utils/promise';\nimport { postComment } from '../../network/changeset';\nimport { Button } from '../button';\n\ntype propsType = {\n token: string,\n changesetId: number,\n userDetails: Map,\n changesetIsHarmful: boolean,\n discussions: List<*>\n};\n\nexport class CommentForm extends React.PureComponent {\n postCommentPromise;\n\n state = {\n success: false,\n error: false,\n value: ''\n };\n\n componentWillUnmount() {\n this.postCommentPromise && this.postCommentPromise.cancel();\n }\n componentDidMount() {\n this.updateValue(this.props);\n }\n componentWillReceiveProps(nextProps) {\n this.updateValue(nextProps);\n }\n updateValue(props) {\n const userCommentedBefore =\n props.discussions.filter(\n item => item.get('userName') === props.userDetails.get('username')\n ).size > 0;\n if (\n this.state.value === '' &&\n props.changesetIsHarmful !== null &&\n !userCommentedBefore\n ) {\n if (props.changesetIsHarmful) {\n this.setState({ value: props.userDetails.get('message_bad') });\n } else {\n this.setState({ value: props.userDetails.get('message_good') });\n }\n }\n }\n onChange = (event: any) => {\n this.setState({ value: event.target.value });\n if (this.state.error) {\n this.setState({ error: false });\n }\n if (this.state.success) {\n this.setState({ success: false });\n }\n };\n postComment = (comment: string) => {\n if (!comment) return;\n this.postCommentPromise = cancelablePromise(\n postComment(this.props.changesetId, this.props.token, comment)\n );\n this.postCommentPromise.promise\n .then(r => {\n this.setState({ success: true });\n this.setState({ error: false });\n this.setState({ value: '' });\n })\n .catch(e => {\n console.log(e);\n this.setState({ error: true });\n this.setState({ success: false });\n });\n };\n handleSubmit = event => {\n this.postComment(this.state.value);\n };\n render() {\n return (\n
        \n {this.props.token && (\n
        \n {this.state.success && (\n
        \n Comment successfully posted.\n
        \n It will appear on OSMCha after some minutes.\n
        \n )}\n {this.state.error && (\n
        \n It was not possible to post your comment.\n
        \n )}\n
        \n
        \n {\n if (this.clicked) {\n r && r.select();\n this.clicked = false;\n }\n }}\n value={this.state.value}\n onChange={this.onChange}\n />\n
        \n \n
        \n
        \n
        \n
        \n )}\n
        \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { formatDistanceToNow, parse } from 'date-fns';\nimport AnchorifyText from 'react-anchorify-text';\n\nimport AssemblyAnchor from '../assembly_anchor';\nimport { CommentForm } from './comment';\nimport TranslateButton from './translate_button';\nimport { SignInButton } from './sign_in_button';\nimport { UserOSMLink } from './user_osm_link';\n\nclass Discussions extends React.PureComponent {\n props: {\n discussions: List<*>,\n changesetId: number,\n changesetAuthor: string,\n changesetIsHarmful: boolean\n };\n\n renderComments() {\n const { discussions, changesetAuthor } = this.props;\n\n if (discussions.size === 0) {\n return (\n
        \n \n \n \n

        {'No discussions, yet.'}

        \n
        \n );\n } else {\n return (\n
        \n {discussions.map((comment, i) => (\n \n
        \n \n By{' '}\n \n \n {comment.get('user')}\n {' '}\n \n {changesetAuthor === comment.get('user') && (\n (changeset author)\n )}\n \n \n {formatDistanceToNow(\n // eslint-disable-next-line\n parse(\n comment.get('date'),\n \"yyyy-MM-dd'T'HH:mm:ssX\",\n new Date()\n ),\n { addSuffix: true }\n )}\n \n
        \n
        \n

        \n \n \n \n

        \n
        \n
        \n \n
        \n
        \n ))}\n \n );\n }\n }\n render() {\n const {\n discussions,\n changesetId,\n changesetIsHarmful,\n changesetAuthor\n } = this.props;\n\n return (\n
        \n

        \n Discussions \n for changeset by {changesetAuthor}\n

        \n {this.props.token ? (\n this.renderComments()\n ) : (\n
        \n
        \n \n \n \n
        \n
        \n \n
        \n
        \n )}\n {this.props.token && (\n
        \n \n
        \n )}\n
        \n );\n }\n}\n\nDiscussions = connect((state: RootStateType) => ({\n token: state.auth.get('token'),\n userDetails: state.auth.get('userDetails')\n}))(Discussions);\n\nexport { Discussions };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\n\nimport { importChangesetMap } from '../../utils/cmap';\nimport { updateStyle } from '../../store/map_controls_actions';\nimport { Dropdown } from '../dropdown';\n\nclass MapOptions extends React.PureComponent {\n state = {\n actions: true,\n type: true,\n mapStyle: true,\n user: true\n };\n layerOptions = [\n {\n label: 'Mapbox Satellite',\n value: 'satellite',\n function: () => this.toggleSatellite()\n },\n {\n label: 'Mapbox Streets',\n value: 'streets',\n function: () => this.toggleStreet()\n },\n { label: 'Mapbox Dark', value: 'dark', function: () => this.toggleDark() },\n { label: 'Bing', value: 'bing', function: () => this.toggleBing() },\n {\n label: 'OpenStreetMap Carto',\n value: 'carto',\n function: () => this.toggleOsm()\n }\n ];\n getLayerDropdownDisplay = id => {\n const filteredLayer = this.layerOptions.filter(l => l.value === id);\n if (filteredLayer.length) return filteredLayer[0].label;\n return 'Select a style';\n };\n onLayerChange = layer => {\n if (layer && layer.length) {\n layer[0].function();\n this.props.updateStyle(layer[0].value);\n }\n };\n onChange = () => {\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().filterLayers()\n );\n };\n toggleSatellite = () => {\n importChangesetMap('getMapInstance').then(\n r =>\n r &&\n r() &&\n r().renderMap('mapbox://styles/openstreetmap/cjnd8lj0e10i42spfo4nsvoay')\n );\n };\n toggleDark = () => {\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().renderMap('mapbox://styles/mapbox/dark-v9')\n );\n };\n toggleStreet = () => {\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().renderMap('mapbox://styles/mapbox/streets-v9')\n );\n };\n toggleBing = () => {\n const bingStyle = {\n version: 8,\n sources: {\n 'bing-tiles': {\n type: 'raster',\n tiles: [\n 'https://ecn.t0.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=587&mkt=en-gb&n=z',\n 'https://ecn.t1.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=587&mkt=en-gb&n=z',\n 'https://ecn.t2.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=587&mkt=en-gb&n=z',\n 'https://ecn.t3.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=587&mkt=en-gb&n=z'\n ],\n attribution:\n '© Microsoft Corporation'\n }\n },\n layers: [\n {\n id: 'bing',\n type: 'raster',\n source: 'bing-tiles',\n minzoom: 0,\n maxzoom: 22\n }\n ]\n };\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().renderMap(bingStyle)\n );\n };\n toggleOsm = () => {\n const osmStyle = {\n version: 8,\n sources: {\n 'osm-tiles': {\n type: 'raster',\n tiles: [\n 'https://a.tile.openstreetmap.org/{z}/{x}/{y}.png',\n 'https://b.tile.openstreetmap.org/{z}/{x}/{y}.png',\n 'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png'\n ],\n tileSize: 256,\n attribution:\n '© OpenStreetMap contributors'\n }\n },\n layers: [\n {\n id: 'osm',\n type: 'raster',\n source: 'osm-tiles',\n minzoom: 0,\n maxzoom: 22\n }\n ]\n };\n importChangesetMap('getMapInstance').then(\n r => r && r() && r().renderMap(osmStyle)\n );\n };\n render() {\n return (\n
        \n

        Map Controls

        \n
        \n
        Filter by actions
        \n\n
          \n
        • \n \n
        • \n
        • \n \n
        • \n
        • \n \n
        • \n
        \n
        \n
        \n
        Filter by type
        \n
          \n
        • \n \n
        • \n
        • \n \n
        • \n
        • \n \n
        • \n
        \n
        \n
        \n
        Map style
        \n {}}\n onRemove={() => {}}\n options={this.layerOptions}\n onChange={this.onLayerChange}\n display={this.getLayerDropdownDisplay(this.props.style)}\n position=\"left\"\n />\n
        \n
        \n );\n }\n}\n\nMapOptions = connect(\n (state: RootStateType, props) => ({ style: state.mapControls.get('style') }),\n { updateStyle }\n)(MapOptions);\n\nexport { MapOptions };\n","import React from 'react';\n\nexport function Control({ active, onClick, children, className }: Object) {\n return (\n \n {children}\n \n );\n}\n","// @flow\n\nexport const FILTER_BINDING = {\n label: 'FILTER_BINDING',\n bindings: ['\\\\']\n};\nexport const HELP_BINDING = {\n label: 'HELP_BINDING',\n bindings: ['/', '?']\n};\nexport const NEXT_CHANGESET = {\n label: 'NEXT_CHANGESET',\n bindings: ['down', 'right']\n};\nexport const PREV_CHANGESET = {\n label: 'PREV_CHANGESET',\n bindings: ['up', 'left']\n};\nexport const REFRESH_CHANGESETS = {\n label: 'REFRESH_CHANGESETS',\n bindings: ['R', 'r']\n};\nexport const CHANGESET_DETAILS_SHOW_ALL = {\n label: 'CHANGESET_DETAILS_SHOW_ALL',\n bindings: ['0']\n};\nexport const CHANGESET_DETAILS_DETAILS = {\n label: 'CHANGESET_DETAILS_DETAILS',\n bindings: ['1']\n};\nexport const CHANGESET_DETAILS_SUSPICIOUS = {\n label: 'CHANGESET_DETAILS_SUSPICIOUS',\n bindings: ['2']\n};\nexport const CHANGESET_DETAILS_TAGS = {\n label: 'CHANGESET_DETAILS_TAGS',\n bindings: ['3']\n};\nexport const CHANGESET_DETAILS_GEOMETRY_CHANGES = {\n label: 'CHANGESET_DETAILS_GEOMETRY_CHANGES',\n bindings: ['4']\n};\nexport const CHANGESET_DETAILS_OTHER_FEATURES = {\n label: 'CHANGESET_DETAILS_OTHER_FEATURES',\n bindings: ['5']\n};\nexport const CHANGESET_DETAILS_DISCUSSIONS = {\n label: 'CHANGESET_DETAILS_DISCUSSIONS',\n bindings: ['6']\n};\nexport const CHANGESET_DETAILS_USER = {\n label: 'CHANGESET_DETAILS_USER',\n bindings: ['7']\n};\nexport const CHANGESET_DETAILS_MAP = {\n label: 'CHANGESET_DETAILS_MAP',\n bindings: ['8']\n};\nexport const VERIFY_GOOD = {\n label: 'VERIFY_GOOD',\n bindings: ['G', 'g']\n};\nexport const VERIFY_BAD = {\n label: 'VERIFY_BAD',\n bindings: ['B', 'b']\n};\nexport const VERIFY_CLEAR = {\n label: 'VERIFY_CLEAR',\n bindings: ['C', 'c', 'u', 'U']\n};\nexport const OPEN_IN_JOSM = {\n label: 'OPEN_IN_JOSM',\n bindings: ['J', 'j']\n};\nexport const OPEN_IN_ID = {\n label: 'OPEN_IN_ID',\n bindings: ['I', 'i']\n};\nexport const OPEN_IN_OSM = {\n label: 'OPEN_IN_OSM',\n bindings: ['O', 'o']\n};\nexport const OPEN_IN_LEVEL0 = {\n label: 'OPEN_IN_LEVEL0',\n bindings: ['L', 'l']\n};\nexport const OPEN_IN_ACHAVI = {\n label: 'OPEN_IN_ACHAVI',\n bindings: ['V', 'v']\n};\nexport const OPEN_IN_HDYC = {\n label: 'OPEN_IN_HDYC',\n bindings: ['H', 'h']\n};\nexport const FILTER_BY_USER = {\n label: 'FILTER_BY_USER',\n bindings: ['A', 'a']\n};\n","import React from 'react';\n\nimport { Control } from './control';\nimport { Floater } from './floater';\n\nimport {\n CHANGESET_DETAILS_DETAILS,\n CHANGESET_DETAILS_SUSPICIOUS,\n CHANGESET_DETAILS_TAGS,\n CHANGESET_DETAILS_GEOMETRY_CHANGES,\n CHANGESET_DETAILS_OTHER_FEATURES,\n CHANGESET_DETAILS_USER,\n CHANGESET_DETAILS_DISCUSSIONS,\n CHANGESET_DETAILS_MAP\n} from '../../config/bindings';\n\nexport function ControlLayout({\n bindingsState,\n features,\n discussions,\n toggleDetails,\n toggleFeatures,\n toggleOtherFeatures,\n toggleGeometryChanges,\n toggleTags,\n toggleDiscussions,\n toggleUser,\n toggleMapOptions\n}) {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n","// @flow\nimport React from 'react';\nimport Mousetrap from 'mousetrap';\nimport { Map } from 'immutable';\n\nimport { getDisplayName } from '../utils/component';\n\ntype stateType = {\n bindings: Map,\n lastKeyStroke: Map\n};\n\n/**\n * @param exclusive - flag to toggle one key and switch off all other keys\n * @prop `bindingsState` - immutable Map containing toggleState(true/false) for each of the bindings. \n * @prop `lastKeyStroke` - immutable Map containg the state of last key pressed only.\n */\nexport function keyboardToggleEnhancer(\n exclusive: boolean,\n bindings: Array<{ label: string, bindings: Array }>,\n WrappedComponent: Class>\n): Class> {\n return class wrapper extends React.PureComponent {\n static displayName = `HOCKeyboard${getDisplayName(WrappedComponent)}`;\n\n state = {\n bindings: Map(),\n lastKeyStroke: Map()\n };\n componentDidMount() {\n bindings.forEach(item =>\n Mousetrap.bind(item.bindings, (e: Event) => {\n e.preventDefault();\n if (exclusive) {\n return this.exclusiveKeyToggle(item.label);\n }\n this.toggleKey(item.label);\n })\n );\n }\n\n componentWillUnmount() {\n // unbind all bindings\n bindings.forEach(item =>\n item.bindings.forEach(b => {\n Mousetrap.unbind(b);\n })\n );\n }\n\n // allow toggling the state of a particular key\n toggleKey = (label: string) => {\n let prev = this.state.bindings;\n let lastKeyStroke = Map().set(label, !prev.get(label));\n prev = prev.set(label, !prev.get(label));\n this.setState({\n bindings: prev,\n lastKeyStroke\n });\n };\n\n // exclusively toggle this label and switch off others\n exclusiveKeyToggle = (label: string) => {\n let newBindingState = Map();\n const prevBindingValue = this.state.bindings.get(label);\n newBindingState = newBindingState.set(label, !prevBindingValue);\n this.setState({\n bindings: newBindingState,\n lastKeyStroke: newBindingState // will be same as state.bindings as size=1\n });\n };\n\n render() {\n return (\n \n );\n }\n };\n}\n","// @flow\nimport React from 'react';\nimport { Map, fromJS } from 'immutable';\nimport debounce from 'lodash.debounce';\nimport { getDisplayName } from '../utils/component';\n\ntype stateType = {\n data: Map\n};\n\n/**\n * @desc If any network request fails it silents it \n * It also sets state on first come first serve basis.\n * @param onUpdate - decides whether to do the network calls on not\n */\nexport function withFetchDataSilent(\n dataToFetch: (props: P) => Object,\n onUpdate: (P, P) => boolean,\n WrappedComponent: Class>\n): Class> {\n return class FetchDataEnhancer extends React.PureComponent<\n void,\n P,\n stateType\n > {\n static displayName = `HOCFetchData${getDisplayName(WrappedComponent)}`;\n state = {\n data: Map()\n };\n fetchedData: Object;\n initFetching: (props: P) => void;\n constructor(props) {\n super(props);\n this.initFetching = debounce(this._initFetching, 500);\n }\n componentDidMount() {\n this.initFetching(this.props);\n }\n componentWillReceiveProps(nextProps: P) {\n if (onUpdate(nextProps, this.props)) {\n this.initFetching(nextProps);\n }\n }\n _initFetching = (props: P) => {\n this.fetchedData = dataToFetch(props);\n // iterate through all of cancelable promises, one for each api request\n Object.keys(this.fetchedData).forEach(k => {\n var prom = this.fetchedData[k];\n prom.promise\n .then(x => {\n let data = this.state.data;\n data = data.set(k, fromJS(x));\n this.setState({ data });\n })\n .catch(e => console.error(e));\n });\n };\n reloadData = () => {\n this.initFetching(this.props);\n };\n componentWillUnmount() {\n this.fetchedData &&\n Object.keys(this.fetchedData).forEach(k => {\n this.fetchedData[k] && this.fetchedData[k].cancel();\n });\n }\n render() {\n return (\n \n );\n }\n };\n}\n","import { fromJS, Map } from 'immutable';\nimport { apiOSM } from '../config/constants';\nimport { API_URL } from '../config';\n\nexport function getUserDetails(uid: number, token: string): Map<'string', *> {\n const user = { uid: uid };\n const fromOSM = fetch(`${apiOSM}/user/${uid}.json`, {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' }\n })\n .then(r => r.json())\n .then(r => {\n const u = r.user;\n user.count = u.changesets.count;\n user.accountCreated = u.account_created;\n user.description = u.description;\n user.img = u.img && u.img.href;\n user.name = u.display_name;\n return fromJS(user);\n })\n .catch(e => user);\n\n const fromOSMCha = fetch(`${API_URL}/user-stats/${uid}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(r => r.json())\n .then(r => fromJS(r))\n .catch(e => new Map());\n\n return Promise.all([fromOSMCha, fromOSM]).then(([r1, r2]) => r1.merge(r2));\n}\n","import { whosThat } from '../config/constants';\nimport { handleErrors } from './aoi';\n\nexport function getUsers(input): Promise<*> {\n return fetch(`${whosThat}${input}`, {\n method: 'GET'\n })\n .then(handleErrors)\n .then(response => {\n return response.json();\n });\n}\n","// @flow\nimport { Map, List, fromJS } from 'immutable';\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport CSSGroup from 'react-transition-group/CSSTransitionGroup';\n\nimport { cancelablePromise } from '../../utils/promise';\nimport { Floater } from './floater';\nimport { Header } from './header';\nimport { User } from './user';\nimport { Features } from './features';\nimport { TagChanges } from './tag_changes';\nimport { OtherFeatures } from './other_features';\nimport { GeometryChanges } from './geometry_changes';\nimport { Box } from './box';\nimport { Discussions } from './discussions';\nimport { MapOptions } from './map_options';\nimport { ControlLayout } from './control_layout';\nimport { keyboardToggleEnhancer } from '../keyboard_enhancer';\nimport { withFetchDataSilent } from '../fetch_data_enhancer';\nimport { getUserDetails } from '../../network/openstreetmap';\nimport { getUsers } from '../../network/whosthat';\nimport {\n CHANGESET_DETAILS_DETAILS,\n CHANGESET_DETAILS_SUSPICIOUS,\n CHANGESET_DETAILS_TAGS,\n CHANGESET_DETAILS_GEOMETRY_CHANGES,\n CHANGESET_DETAILS_OTHER_FEATURES,\n CHANGESET_DETAILS_USER,\n CHANGESET_DETAILS_DISCUSSIONS,\n CHANGESET_DETAILS_MAP\n} from '../../config/bindings';\n\n// | denote strict props\ntype propsType = {|\n changesetId: number,\n currentChangeset: Map,\n // The props below come from HOCs, they are not optional!\n // to circumvent the $Diff bug ref: https://github.com/facebook/flow/issues/1601\n // have to make them optional for flow to not throw error.\n data?: Map,\n bindingsState?: Map,\n exclusiveKeyToggle?: (label: string) => any\n|};\n\n// presentational component for view/changeset.js\nexport class _Changeset extends React.PureComponent<*, propsType, *> {\n getUserDetailsPromise;\n getWhosThatPromise;\n\n state = {\n userDetails: null,\n whosThat: null\n };\n\n static defaultProps = {\n data: Map()\n };\n componentDidMount() {\n this.toggleDetails();\n }\n componentDidUpdate(prevProps) {\n if (\n !prevProps.currentChangeset.getIn(['properties', 'uid']) &&\n this.props.currentChangeset.getIn(['properties', 'uid'])\n ) {\n this.getUserDetailsPromise = cancelablePromise(\n getUserDetails(\n this.props.currentChangeset.getIn(['properties', 'uid'], null),\n this.props.token\n )\n );\n this.getUserDetailsPromise.promise\n .then(r => {\n this.setState({ userDetails: r });\n })\n .catch(e => console.log(e));\n\n this.getWhosThatPromise = cancelablePromise(\n getUsers(this.props.currentChangeset.getIn(['properties', 'uid'], ''))\n );\n this.getWhosThatPromise.promise\n .then(r => {\n this.setState({ whosThat: List(r[0].names) });\n })\n .catch(e => console.log(e));\n }\n }\n showFloaters = () => {\n const { changesetId, currentChangeset, bindingsState, data } = this.props;\n if (!bindingsState || !data) return;\n const properties = currentChangeset.get('properties');\n return (\n \n {bindingsState.get(CHANGESET_DETAILS_DETAILS.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_SUSPICIOUS.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_TAGS.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_GEOMETRY_CHANGES.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_OTHER_FEATURES.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_DISCUSSIONS.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_USER.label) && (\n \n \n \n )}\n {bindingsState.get(CHANGESET_DETAILS_MAP.label) && (\n \n \n \n )}\n \n );\n };\n\n toggleFeatures = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_SUSPICIOUS.label);\n };\n toggleOtherFeatures = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_OTHER_FEATURES.label);\n };\n toggleTags = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_TAGS.label);\n };\n toggleGeometryChanges = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_GEOMETRY_CHANGES.label);\n };\n toggleDiscussions = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_DISCUSSIONS.label);\n };\n toggleDetails = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_DETAILS.label);\n };\n toggleUser = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_USER.label);\n };\n toggleMapOptions = () => {\n this.props.exclusiveKeyToggle &&\n this.props.exclusiveKeyToggle(CHANGESET_DETAILS_MAP.label);\n };\n\n render() {\n const { bindingsState, currentChangeset } = this.props;\n const features = currentChangeset.getIn(['properties', 'features']);\n return (\n
        \n \n \n {this.showFloaters()}\n \n
        \n );\n }\n}\n\nlet Changeset = keyboardToggleEnhancer(\n true,\n [\n CHANGESET_DETAILS_DETAILS,\n CHANGESET_DETAILS_SUSPICIOUS,\n CHANGESET_DETAILS_TAGS,\n CHANGESET_DETAILS_GEOMETRY_CHANGES,\n CHANGESET_DETAILS_OTHER_FEATURES,\n CHANGESET_DETAILS_USER,\n CHANGESET_DETAILS_DISCUSSIONS,\n CHANGESET_DETAILS_MAP\n ],\n _Changeset\n);\n\n/**\n * Never use props not required by the Basecomponent in HOCs\n */\nChangeset = withFetchDataSilent(\n (props: propsType) => ({\n userDetails: cancelablePromise(\n getUserDetails(\n props.currentChangeset.getIn(['properties', 'uid'], null),\n props.token\n )\n ),\n whosThat: cancelablePromise(\n getUsers(props.currentChangeset.getIn(['properties', 'uid'], ''))\n )\n }),\n (nextProps: propsType, props: propsType) =>\n props.changesetId !== nextProps.changesetId,\n Changeset\n);\n\nChangeset = connect((state: RootStateType, props) => ({\n token: state.auth.get('token'),\n osmInfo: fromJS(state.changeset.getIn(['changesetMap', props.changesetId]))\n}))(Changeset);\n\nexport { Changeset };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map, fromJS } from 'immutable';\nimport Mousetrap from 'mousetrap';\n\nimport { Changeset as ChangesetDumb } from '../components/changeset';\n\nimport { dispatchEvent } from '../utils/dispatch_event';\n\nimport { applyFilters } from '../store/filters_actions';\nimport { FILTER_BY_USER } from '../config/bindings';\nimport type { RootStateType } from '../store';\n\nclass Changeset extends React.PureComponent {\n props: {\n errorChangeset: ?Object, // error of the latest that changeset failed\n location: Object,\n loading: boolean, // loading of the selected changesetId\n currentChangeset?: Map,\n changesetId: number,\n token: string,\n applyFilters: (Map) => mixed // base 0\n };\n componentDidMount() {\n Mousetrap.bind(FILTER_BY_USER.bindings, this.filterChangesetsByUser);\n }\n componentWillUnmount() {\n FILTER_BY_USER.bindings.forEach(k => Mousetrap.unbind(k));\n }\n filterChangesetsByUser = () => {\n if (this.props.currentChangeset) {\n const userName = this.props.currentChangeset.getIn([\n 'properties',\n 'user'\n ]);\n this.props.applyFilters(\n new Map().set(\n 'users',\n fromJS([\n {\n label: userName,\n value: userName\n }\n ])\n )\n );\n }\n };\n showChangeset = () => {\n const {\n loading,\n errorChangeset,\n currentChangeset,\n changesetId,\n token\n } = this.props;\n\n if (loading || !currentChangeset) {\n return null;\n }\n\n if (errorChangeset) {\n dispatchEvent('showToast', {\n title: `changeset:${changesetId} failed to load`,\n content: 'Try reloading osmcha',\n timeOut: 5000,\n type: 'error'\n });\n console.error(errorChangeset);\n return null;\n }\n return (\n \n );\n };\n render() {\n return (\n
        \n
        \n {this.showChangeset()}\n
        \n
        \n );\n }\n}\n\nChangeset = connect(\n (state: RootStateType, props) => ({\n changeset: state.changeset,\n location: props.location,\n changesetId: parseInt(props.match.params.id, 10),\n currentChangeset: state.changeset.getIn([\n 'changesets',\n parseInt(props.match.params.id, 10)\n ]),\n errorChangeset: state.changeset.get('errorChangeset'),\n loading: state.changeset.get('loading'),\n token: state.auth.get('token')\n }),\n { applyFilters }\n)(Changeset);\n\nexport { Changeset };\n","// @flow\nimport React from 'react';\nimport showdown from 'showdown';\nimport { cancelablePromise } from '../utils/promise';\nimport { appVersion, isDev, isStaging, isLocal } from '../config';\n\nconst converter = new showdown.Converter({\n ghCompatibleHeaderId: true,\n extensions: formatMarkdown()\n});\n\nconverter.setFlavor('github');\nconverter.setOption('simpleLineBreaks', false);\n\nfunction formatMarkdown() {\n return [\n {\n type: 'output',\n regex: /a href=/g,\n replace: 'a class=\"link\" href='\n },\n {\n type: 'output',\n regex: /\\

        /g,\n replace: '
          '\n },\n {\n type: 'output',\n regex: /\\/g,\n replace: '
        • '\n },\n {\n type: 'output',\n regex: /img src=/g,\n replace: `img\n class=\"py12 my12 border border--gray-light border--2\"\n style=\"margin-left: auto;\n margin-right: auto;\n display: block;\n \" src=`\n }\n ];\n}\n\nexport class About extends React.PureComponent {\n state = {\n about: null\n };\n cancellablePromise = null;\n componentDidMount() {\n this.cancellablePromise = cancelablePromise(\n fetch(\n 'https://raw.githubusercontent.com/mapbox/osmcha-frontend/master/ABOUT.md'\n ).then(r => r.text())\n );\n this.cancellablePromise.promise\n .then(markdown => this.setState({ about: converter.makeHtml(markdown) }))\n .catch(e => {});\n }\n componentWillUnmount() {\n this.cancellablePromise && this.cancellablePromise.cancel();\n }\n render() {\n return (\n
          \n
          \n OSMCha Version {appVersion}\n {isDev && ' Dev'}\n {isLocal && ' Local'}\n {isStaging && ' Staging'}\n
          \n \n
          \n );\n }\n}\n","import React from 'react';\n\nexport const Stats = () =>
          stats here
          ;\n","// @flow\nimport React from 'react';\nimport Select from 'react-select';\nimport { fromJS } from 'immutable';\nimport type { filterType } from './';\n\nexport class Radio extends React.PureComponent {\n props: {\n name: string,\n display: string,\n type: string,\n placeholder: string,\n options: Array,\n value: filterType,\n onChange: (string, value?: filterType) => any\n };\n onChangeLocal = (data: Object) => {\n if (!data || data.value === '') {\n return this.props.onChange(this.props.name); // always sends 1 size array to keep things consistent with multiselect InputTypes\n }\n this.props.onChange(this.props.name, fromJS([data])); // always sends 1 size array to keep things consistent with multiselect InputTypes\n };\n render() {\n const { name, options, placeholder, value } = this.props;\n return (\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { fromJS } from 'immutable';\nimport type { filterType } from './';\n\nexport class Text extends React.Component {\n props: {\n name: string,\n display: string,\n type: string,\n placeholder: string,\n value: filterType,\n className: string,\n onChange: (string, value?: filterType) => any,\n min: ?string,\n max: ?string\n };\n static defaultProps = {\n className: ''\n };\n state = {\n isValid: true\n };\n handleFormChange = (event: any) => {\n const target = event.target;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n const name = target.name;\n this.setState({ isValid: target.validity.valid });\n if (!value || value === '') {\n return this.props.onChange(name);\n }\n this.props.onChange(\n name,\n fromJS([\n // allways sends 1 size array to keep things consistent\n {\n label: value,\n value\n }\n ])\n );\n };\n render() {\n const {\n name,\n type,\n placeholder,\n display,\n value,\n className,\n min,\n max\n } = this.props;\n const { isValid } = this.state;\n const errorClass = 'border border--1 border--red';\n return (\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { fromJS } from 'immutable';\nimport { Creatable, Async } from 'react-select';\nimport { API_URL } from '../../config';\nimport type { filterType } from './';\n\nexport class MultiSelect extends React.PureComponent {\n props: {\n name: string,\n display: string,\n value: filterType,\n type: string,\n placeholder: string,\n options: Array,\n dataURL: ?string,\n onChange: (string, value?: filterType) => any,\n showAllToggle: boolean,\n token: string\n };\n state = {\n allToggle: this.props.name.slice(0, 4) === 'all_'\n };\n getAsyncOptions = () => {\n if (!this.props.dataURL) return;\n return fetch(`${API_URL}/${this.props.dataURL}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: this.props.token ? `Token ${this.props.token}` : ''\n }\n })\n .then(response => {\n return response.json();\n })\n .then(json => {\n const data = json\n .filter(d => d.for_changeset)\n .map(d => ({ ...d, label: d.name, value: d.id }));\n return { options: data };\n });\n };\n onChangeLocal = (data: ?Array) => {\n if (!Array.isArray(data)) return;\n this.sendData(this.state.allToggle, data);\n };\n sendData = (allToggle: boolean, data: Array) => {\n let name =\n this.props.name.slice(0, 4) === 'all_'\n ? this.props.name.slice(4)\n : this.props.name;\n\n name = `${allToggle ? 'all_' : ''}${name}`;\n if (data.length === 0) return this.props.onChange(name);\n var processed = data.map(o => ({ label: o.label, value: o.value })); // remove any bogus keys\n this.props.onChange(name, fromJS(processed));\n };\n renderSelect = () => {\n const { name, options, placeholder, value, display, dataURL } = this.props;\n if (dataURL)\n return (\n `Add ${label} to ${display}`}\n name={name}\n className=\"\"\n value={value && value.toJS()}\n loadOptions={this.getAsyncOptions}\n onChange={this.onChangeLocal} // have to add an identifier for filter name\n placeholder={placeholder}\n />\n );\n return (\n `Add ${label} to ${display}`}\n name={name}\n value={value && value.toJS()}\n options={options}\n onChange={this.onChangeLocal}\n placeholder={placeholder}\n />\n );\n };\n handleToggle = (e: Event) => {\n let { value } = this.props;\n value = value && value.toJS();\n if (value) {\n this.sendData(!this.state.allToggle, value);\n }\n this.setState({\n allToggle: !this.state.allToggle\n });\n };\n render() {\n return (\n
          \n {this.props.showAllToggle && (\n \n \n
          \n \n \n
          \n
          \n
          \n )}\n {this.renderSelect()}\n
          \n );\n }\n}\n\nexport class MappingTeamMultiSelect extends MultiSelect {\n getAsyncOptions = () => {\n if (!this.props.dataURL) return;\n return fetch(`${API_URL}/${this.props.dataURL}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: this.props.token ? `Token ${this.props.token}` : ''\n }\n })\n .then(response => {\n return response.json();\n })\n .then(json => {\n const data = json.map(d => {\n if (d.trusted) {\n return { ...d, label: `${d.name} (verified)`, value: d.name };\n } else {\n return {\n ...d,\n label: d.name.replace('(verified)', ''),\n value: d.name\n };\n }\n });\n return { options: data };\n });\n };\n sendData = (allToggle: boolean, data: Array) => {\n let name =\n this.props.name.slice(0, 4) === 'all_'\n ? this.props.name.slice(4)\n : this.props.name;\n\n name = `${allToggle ? 'all_' : ''}${name}`;\n if (data.length === 0) return this.props.onChange(name);\n var processed = data.map(o => ({ label: o.label, value: o.value })); // remove any bogus keys\n this.props.onChange(name, fromJS(processed));\n };\n}\n","import { nominatimUrl } from '../config/constants';\nimport { handleErrors } from './aoi';\n\nexport function nominatimSearch(input, type): Promise<*> {\n return fetch(\n `${nominatimUrl}?polygon_geojson=1&format=json&${type}=${input}`,\n {\n method: 'GET'\n }\n )\n .then(handleErrors)\n .then(response => {\n return response.json();\n });\n}\n","// @flow\nimport React from 'react';\nimport { fromJS } from 'immutable';\nimport debounce from 'lodash.debounce';\nimport { Async } from 'react-select';\nimport Select from 'react-select';\n\nimport area from '@turf/area';\nimport bbox from '@turf/bbox';\nimport simplify from '@turf/simplify';\nimport truncate from '@turf/truncate';\nimport MapboxDraw from '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw';\n\nimport { nominatimSearch } from '../../network/nominatim';\nimport { mapboxAccessToken } from '../../config/constants';\nimport { importChangesetMap } from '../../utils/cmap';\n\nexport class LocationSelect extends React.PureComponent {\n props: {\n name: string,\n display: string,\n value: Object,\n type: string,\n placeholder: string,\n options: Array,\n onChange: (string, value: Object) => any\n };\n state = {\n geometry: Object,\n location: '',\n queryType: 'q',\n lastSearch: new Date()\n };\n queryTypeOptions = [\n { value: 'q', label: 'Any' },\n { value: 'city', label: 'City' },\n { value: 'county', label: 'County' },\n { value: 'state', label: 'State' },\n { value: 'country', label: 'Country' }\n ];\n map = null;\n draw = null;\n\n updateMap(data) {\n if (this.map.getSource('feature')) {\n this.map.getSource('feature').setData(data);\n } else {\n this.map.addSource('feature', {\n type: 'geojson',\n data: {\n type: 'Feature',\n geometry: data\n }\n });\n }\n if (this.map.getLayer('geometry') === undefined) {\n this.map.addLayer({\n id: 'geometry',\n type: 'fill',\n source: 'feature',\n paint: {\n 'fill-color': '#088',\n 'fill-opacity': 0.6\n }\n });\n }\n this.setState({ geometry: data });\n this.props.onChange(\n this.props.name,\n fromJS([{ label: data, value: data }])\n );\n const geom_bbox = bbox(data);\n this.map.fitBounds([geom_bbox.slice(0, 2), geom_bbox.slice(2)], {\n padding: 20\n });\n }\n\n componentDidMount() {\n importChangesetMap('getGL').then((getGL: any) => {\n if (getGL) {\n var mapboxgl = getGL();\n mapboxgl.accessToken = mapboxAccessToken;\n const map = new mapboxgl.Map({\n container: 'geometry-map',\n style: 'mapbox://styles/mapbox/light-v9'\n });\n this.map = map;\n this.draw = new MapboxDraw({\n displayControlsDefault: false,\n controls: {\n polygon: true\n }\n });\n map.addControl(this.draw);\n\n map.on('draw.create', this.drawingUpdate);\n map.on('draw.modechange', this.clearBeforeDraw);\n map.on('draw.delete', this.drawingUpdate);\n map.on('draw.update', this.drawingUpdate);\n map.on('style.load', () => {\n try {\n this.updateMap(\n this.props.value\n .get('0')\n .get('value')\n .toJS()\n );\n } catch (e) {\n if (e instanceof TypeError) {\n }\n }\n });\n }\n });\n }\n\n clearBeforeDraw = e => {\n if (e.mode === 'draw_polygon') {\n this.clearMap();\n this.draw.changeMode('draw_polygon');\n }\n };\n clearMap = () => {\n this.draw.deleteAll();\n this.props.onChange(this.props.name, null);\n if (this.map.getSource('feature')) {\n this.map.getSource('feature').setData({});\n }\n if (this.map.getLayer('geometry')) {\n this.map.removeLayer('geometry');\n }\n };\n drawingUpdate = e => {\n const drawingData = this.draw.getAll();\n if (\n drawingData &&\n drawingData.features.length &&\n drawingData.features[0].geometry\n ) {\n this.updateMap(\n truncate(drawingData.features[0].geometry, {\n precision: 6,\n coordinates: 2\n })\n );\n } else {\n this.clearMap();\n }\n };\n\n getAsyncOptions = (input: string, cb: (e: ?Error, any) => void) => {\n if (input.length >= 3) {\n return nominatimSearch(input, this.state.queryType)\n .then(json => {\n if (!Array.isArray(json)) return cb(null, { options: [] });\n\n const data = json.map(d => ({\n label: d.display_name,\n value: d.geojson\n }));\n return cb(null, { options: data });\n })\n .catch(e => cb(e, null));\n } else {\n return cb(null, { options: [] });\n }\n };\n onChangeLocal = (data: ?Array) => {\n if (data) {\n this.draw.deleteAll();\n const tolerance = area(data.value) / 10 ** 6 < 1000 ? 0.01 : 0.1;\n const simplified_bounds = simplify(data.value, {\n tolerance: tolerance,\n highQuality: true\n });\n this.updateMap(\n truncate(simplified_bounds, { precision: 6, coordinates: 2 })\n );\n }\n };\n handleQueryTypeChange = value => {\n this.setState({ queryType: value });\n };\n renderSelect = () => {\n const { name, placeholder, value } = this.props;\n return (\n this.getAsyncOptions(input, cb),\n 500\n )}\n onChange={this.onChangeLocal}\n placeholder={placeholder}\n />\n );\n };\n render() {\n return (\n
          \n
          \n
          \n \n
          \n
          {this.renderSelect()}
          \n
          \n
          \n
          \n
          \n \n Clear All\n \n
          \n
          \n
          \n
          \n );\n }\n}\n","import React from 'react';\nimport CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';\nimport { isMobile } from '../../utils';\n\nexport function Wrapper({\n display,\n children,\n description,\n handleFocus = () => {},\n name,\n hasValue\n}) {\n const mobile = isMobile();\n\n return (\n handleFocus(name)}\n onFocus={() => handleFocus(name)}\n >\n
          \n \n {hasValue && (\n \n \n \n )}\n \n {display} \n
          \n
          \n \n {children}\n \n {!mobile && (\n \n \n \n {description && (\n \n {description}\n \n )}\n \n \n \n )}\n
          \n \n );\n}\n","// @flow\nimport React from 'react';\nimport { Map, fromJS } from 'immutable';\nimport Select from 'react-select';\nimport type { filtersType } from './';\n\nexport class Meta extends React.PureComponent {\n options: Array<*>;\n props: {\n placeholder: string,\n name: string,\n activeFilters: filtersType,\n metaOf: Array,\n options: Array,\n replaceFiltersState: filtersType => void\n };\n handleChange = (data: Object) => {\n let { activeFilters } = this.props;\n if (!activeFilters) activeFilters = new Map();\n this.props.metaOf.forEach(f => {\n activeFilters = activeFilters.delete(f);\n });\n if (data && data.value) {\n activeFilters = activeFilters.merge(fromJS(data.value));\n }\n this.props.replaceFiltersState(activeFilters);\n };\n findCurrentValue = () => {\n const { activeFilters } = this.props;\n let value;\n if (activeFilters) {\n activeFilters.forEach((v, k) => {\n this.props.options.forEach(option => {\n if (\n Object.keys(option.value)[0] === k &&\n v.getIn([0, 'value']) === option.value[k][0].value\n ) {\n value = option;\n }\n });\n });\n }\n return value;\n };\n render() {\n const { name, placeholder } = this.props;\n let value = this.findCurrentValue();\n return (\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { fromJS } from 'immutable';\nimport DatePicker from 'react-datepicker';\nimport { format, parse } from 'date-fns';\nimport type { filterType } from './';\n\nimport 'react-datepicker/dist/react-datepicker.css';\n\nexport class DateField extends React.Component {\n props: {\n name: string,\n display: string,\n type: string,\n placeholder: string,\n value: filterType,\n className: string,\n onChange: (string, value?: filterType) => any,\n min: ?string,\n max: ?string\n };\n static defaultProps = {\n className: ''\n };\n handleDateChange = date => {\n const name = this.props.name;\n if (date) {\n const value = format(date, 'yyyy-MM-dd');\n this.props.onChange(\n name,\n fromJS([\n // allways sends 1 size array to keep things consistent\n {\n label: value,\n value\n }\n ])\n );\n } else {\n this.props.onChange(name);\n }\n };\n render() {\n const { placeholder, display, value, className, min, max } = this.props;\n const hasValue = value && value.getIn([0, 'value']);\n return (\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport debounce from 'lodash.debounce';\nimport { fromJS } from 'immutable';\n\nimport { mapboxAccessToken } from '../config/constants';\nimport { importChangesetMap } from '../utils/cmap';\n\nexport class BBoxPicker extends React.Component {\n update = debounce(() => {\n if (!this.map) return;\n let bounds: {\n getSouth: () => number,\n getWest: () => number,\n getNorth: () => number,\n getEast: () => number\n } =\n this.map && this.map.getBounds(); // ne, sw / lat, lng\n\n let s = bounds.getSouth().toFixed(4);\n let w = bounds.getWest().toFixed(4);\n let n = bounds.getNorth().toFixed(4);\n let e = bounds.getEast().toFixed(4);\n let wsen = [w, s, e, n].join(',');\n this.props.onChange(\n this.props.name,\n fromJS([\n {\n label: wsen,\n value: wsen\n }\n ])\n );\n }, 600);\n\n map = null;\n componentDidMount() {\n importChangesetMap('getGL').then((getGL: any) => {\n if (getGL) {\n var mapboxgl = getGL();\n mapboxgl.accessToken = mapboxAccessToken;\n if (this.props.value) {\n // let bbox = this.props.value.getIn(['0', 'value'], '').split(',');\n }\n const map = new mapboxgl.Map({\n container: 'map',\n style: 'mapbox://styles/mapbox/light-v9'\n });\n map.on('dragend', this.update);\n map.on('zoomend', this.update);\n map.on('touchend', this.update);\n this.map = map;\n }\n });\n }\n componentWillUnmount() {\n this.map && this.map.remove();\n }\n clearBbox = () => {\n this.props.onChange(this.props.name, null);\n };\n\n render() {\n return (\n
          \n \n Clear\n
          \n
          \n
          \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { Loading } from './loading';\n\ntype propTypes = {\n loading: boolean\n};\n\nexport function loadingEnhancer(\n WrappedComponent: Class>\n): Class> {\n return class PureRendered extends React.PureComponent<\n void,\n P & propTypes,\n *\n > {\n render() {\n return this.props.loading\n ? \n : ;\n }\n };\n}\n","// @flow\nimport React from 'react';\n\nimport {\n Text,\n Radio,\n MappingTeamMultiSelect,\n MultiSelect,\n Wrapper,\n Meta,\n DateField,\n LocationSelect\n} from './';\n\nimport { BBoxPicker } from '../bbox_picker';\nimport { loadingEnhancer } from '../loading_enhancer';\nimport filters from '../../config/filters.json';\nimport { getDefaultFromDate } from '../../utils/filters';\nimport type { filterType, filtersType } from './';\n\nconst defaultDate = getDefaultFromDate().getIn(['date__gte']);\n\nvar filtersData = filters.filter(f => {\n return !f.ignore;\n});\ntype propsType = {|\n filters: filtersType,\n loading: boolean,\n active: string,\n token: string,\n handleChange: (name: string, values?: filterType) => void,\n handleFocus: (name: string) => void,\n replaceFiltersState: (filters: filtersType) => void,\n handleToggleAll: (name: string, values?: filterType) => void\n|};\nclass FiltersList extends React.PureComponent {\n renderFilters = (f: Object, k: number) => {\n const propsToSend = {\n name: f.name,\n type: f.type,\n display: f.display,\n value: this.props.filters.get(f.name),\n placeholder: f.placeholder,\n options: f.options || [],\n onChange: this.props.handleChange,\n dataURL: f.data_url,\n min: f.min,\n max: f.max\n };\n const wrapperProps = {\n name: f.name,\n handleFocus: this.props.handleFocus,\n hasValue: this.props.filters.has(f.name),\n display: f.display,\n key: k,\n description: this.props.active === f.name && f.description\n };\n if (f.range && f.type === 'number') {\n const gteValue = this.props.filters.get(f.name + '__gte');\n const lteValue = this.props.filters.get(f.name + '__lte');\n return (\n \n \n \n \n \n \n );\n }\n if (!f.range && f.type === 'number') {\n return (\n \n \n \n );\n }\n if (f.range && f.type === 'date') {\n let gteValue = this.props.filters.get(f.name + '__gte');\n if (f.name === 'date') {\n gteValue = this.props.filters.get(f.name + '__gte') || defaultDate;\n }\n const lteValue = this.props.filters.get(f.name + '__lte');\n const today = new Date();\n return (\n \n \n \n \n \n \n );\n }\n if (f.type === 'location') {\n return (\n \n \n \n );\n }\n if (f.type === 'text') {\n return (\n \n \n \n );\n }\n if (f.type === 'radio') {\n return (\n \n \n \n );\n }\n if (f.type === 'meta') {\n return (\n this.props.filters.has(fi))}\n >\n \n \n );\n }\n if (f.type === 'text_comma') {\n let { name, value, onChange } = propsToSend;\n if (f.all) {\n onChange = this.props.handleToggleAll;\n }\n if (f.all && this.props.filters.has(`all_${f.name}`)) {\n name = `all_${f.name}`;\n value = this.props.filters.get(name);\n }\n\n return (\n \n {name.endsWith('_teams') ? (\n \n ) : (\n \n )}\n \n );\n }\n if (f.type === 'map') {\n return (\n \n )\n }\n >\n \n \n );\n }\n };\n render() {\n return (\n
          \n

          \n Basic\n

          \n {filtersData\n .slice(0, 5)\n .map((f: Object, k) => this.renderFilters(f, k))}\n

          \n OSM Features\n

          \n {filtersData\n .slice(5, 6)\n .map((f: Object, k) => this.renderFilters(f, k))}\n \n

          \n Flags\n

          \n {filtersData\n .slice(6, 8)\n .map((f: Object, k) => this.renderFilters(f, k))}\n \n\n

          \n Review\n

          \n {filtersData\n .slice(8, 12)\n .map((f: Object, k) => this.renderFilters(f, k))}\n \n\n

          \n Users & Teams\n

          \n {filtersData\n .slice(12, 19)\n .map((f: Object, k) => this.renderFilters(f, k))}\n \n\n

          \n Changeset Details\n

          \n {filtersData.slice(19).map((f: Object, k) => this.renderFilters(f, k))}\n \n
          \n );\n }\n}\nFiltersList = loadingEnhancer(FiltersList);\nexport { FiltersList };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport { push } from 'react-router-redux';\n\nimport { cancelablePromise } from '../../utils/promise';\nimport { fetchAllAOIs } from '../../network/aoi';\nimport { Button } from '../button';\nimport { Dropdown } from '../dropdown';\nimport { API_URL } from '../../config';\n\nclass SaveAOI extends React.PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n editing: false,\n value: props.name\n };\n }\n ref;\n clicked = false;\n onClick = event => {\n this.clicked = true;\n this.setState({ editing: true, value: this.props.name });\n };\n onChange = (event: any) => {\n this.setState({ value: event.target.value });\n };\n onKeyDown = event => {\n if (event.keyCode === 13) {\n this.handleSubmit(event);\n } else if (event.keyCode === 27) {\n this.setState({\n editing: false,\n value: this.props.name\n });\n this.clicked = false;\n }\n };\n handleSubmit = event => {\n this.setState({\n editing: false\n });\n const aoiList = this.props.aoiList.filter(\n aoi => aoi.value === this.props.aoiId\n );\n if (this.props.aoiId && aoiList.length) {\n this.props.updateAOI(this.props.aoiId, this.state.value);\n } else {\n this.props.createAOI(this.state.value);\n }\n };\n // handleFocus = event => {\n // event.target.select();\n // };\n render() {\n return (\n \n {this.state.editing ? (\n \n {\n if (this.clicked) {\n r.select();\n this.clicked = false;\n }\n }}\n value={this.state.value}\n onChange={this.onChange}\n onKeyDown={this.onKeyDown}\n />\n \n \n ) : (\n \n )}\n \n );\n }\n}\n\ntype filterProps = {\n createAOI: string => void,\n updateAOI: string => void,\n removeAOI: string => void,\n loading: boolean,\n search: string,\n token?: string,\n aoiName?: string,\n aoiId?: string,\n handleApply: () => void,\n handleClear: () => void,\n loadAoiId: string => void,\n location: Object,\n push: any => any\n};\n\nclass FiltersHeader extends React.Component {\n getAoisPromise;\n state = {\n aoiList: []\n };\n\n componentDidMount() {\n this.getAois();\n }\n\n componentWillUnmount() {\n this.getAoisPromise && this.getAoisPromise.cancel();\n }\n\n getAois() {\n if (this.props.token) {\n this.getAoisPromise = cancelablePromise(fetchAllAOIs(this.props.token));\n this.getAoisPromise.promise\n .then(r => {\n let aoiList = r.features.map(aoi => {\n return { label: aoi.properties.name, value: aoi.id };\n });\n this.setState({ aoiList: aoiList });\n })\n .catch(e => console.log(e));\n }\n }\n\n renderRssLink() {\n if (this.props.aoiId) {\n return (\n \n \n \n \n \n );\n }\n }\n\n renderAoiLink() {\n if (this.props.aoiId) {\n return (\n \n navigator.clipboard.writeText(\n `${API_URL.replace('/api/v1', '')}/?aoi=${this.props.aoiId}`\n )\n }\n title=\"Copy filter URL\"\n >\n \n \n \n \n );\n }\n }\n\n onAoiSelect = (arr: Array) => {\n if (arr.length === 1) {\n this.props.push({\n ...this.props.location,\n search: `aoi=${arr[0].value}`,\n path: '/filters'\n });\n } else if (arr.length > 1) {\n throw new Error('filter select array is big');\n }\n };\n\n renderFilterInfo() {\n const dropdown = (\n {}}\n onRemove={() => {}}\n position=\"left\"\n />\n );\n if (this.props.token && this.state.aoiList.length) {\n return {dropdown};\n }\n }\n\n render() {\n var save_aoi = '';\n if (this.props.token) {\n save_aoi = (\n \n );\n }\n\n return (\n
          \n \n {this.renderFilterInfo()}\n \n \n \n Filters\n {this.props.aoiId && / {this.props.aoiName}}\n {this.renderAoiLink()}\n {this.renderRssLink()}\n \n \n \n {save_aoi}\n \n Reset\n \n \n \n \n \n \n \n \n
          \n );\n }\n}\n\nFiltersHeader = connect(\n (state: RootStateType, props) => ({\n location: props.location\n }),\n {\n push\n }\n)(FiltersHeader);\n\nexport { FiltersHeader };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { push } from 'react-router-redux';\n\nimport { Map, List, fromJS, is } from 'immutable';\n\nimport { checkForNewChangesets } from '../store/changesets_page_actions';\nimport { applyFilters } from '../store/filters_actions';\nimport { applyUpdateAOI, applyCreateAOI } from '../store/aoi_actions';\nimport { modal } from '../store/modal_actions';\n\nimport { FiltersList } from '../components/filters/filters_list';\nimport { FiltersHeader } from '../components/filters/filters_header';\n\nimport { deleteAOI } from '../network/aoi';\nimport type { RootStateType } from '../store';\nimport { delayPromise, gaSendEvent, isMobile } from '../utils';\n\nimport type { filterType, filtersType } from '../components/filters';\nconst NEW_AOI = 'unnamed *';\n\ntype propsType = {|\n filters: filtersType,\n loading: boolean,\n aoi: Object,\n token: string,\n location: Object,\n features: ?List>,\n checkForNewChangesets: boolean => any,\n push: (location: Object) => void,\n applyFilters: (filtersType, path?: string) => mixed, // base 0\n applyCreateAOI: (name?: string, filtersType) => mixed,\n applyUpdateAOI: (aoiId?: string, name?: string, filtersType) => mixed,\n modal: any => any\n|};\n\ntype stateType = {\n filters: filtersType,\n active: string\n};\nconst noDateGte: filterType = fromJS({\n date__gte: [{ label: '', value: '' }]\n});\n\nclass Filters extends React.PureComponent {\n state = {\n filters: this.props.filters,\n active: ''\n // aoiName: this.props.aoi.getIn(['properties', 'name'], NEW_AOI)\n };\n componentWillReceiveProps(nextProps: propsType) {\n if (!is(this.props.filters, nextProps.filters)) {\n this.setState({\n filters: nextProps.filters\n });\n }\n }\n handleFocus = (name: string) => {\n this.setState({\n active: name\n });\n };\n handleApply = () => {\n // in case the user clicks on apply when filter\n // loaded AOI.\n if (JSON.stringify(this.state.filters.toJSON()).length > 7000) {\n this.props.modal({\n kind: 'error',\n title: 'Use Save Filter',\n description:\n 'Your filter is too big to be applied. You need to Save your Filter to be able to see the results.'\n });\n } else {\n if (is(this.state.filters, this.props.filters)) {\n this.props.push({\n ...this.props.location,\n pathname: '/'\n });\n return;\n }\n this.props.applyFilters(this.state.filters, '/');\n this.sendToAnalytics();\n // show user if there were any new changesets\n // incase service had cached the request\n delayPromise(3000).promise.then(() =>\n this.props.checkForNewChangesets(true)\n );\n }\n };\n sendToAnalytics = () => {\n const filters = this.state.filters;\n filters.forEach((v, k) => {\n v.forEach(vv => {\n gaSendEvent({\n category: 'Filters',\n action: k,\n label: vv.get('label')\n });\n });\n });\n };\n handleChange = (name: string, values?: filterType) => {\n let filters = this.state.filters;\n // if someone cleared date__gte filter\n // we use the convention defined at `noDateGte`\n // to signify no default gte.\n if (name === 'date__gte' && values == null) {\n filters = filters.merge(noDateGte);\n } else if (values == null) {\n // clear this filter\n filters = filters.delete(name);\n } else {\n filters = filters.set(name, values);\n }\n return this.setState({\n filters\n });\n };\n handleToggleAll = (name: string, values?: filterType) => {\n let filters = this.state.filters;\n const isAll = name.slice(0, 4) === 'all_';\n // delete the opposite value\n if (isAll) {\n filters = filters.delete(name.slice(4));\n } else {\n filters = filters.delete('all_' + name);\n }\n // regularly handle change\n if (!values) {\n filters = filters.delete(name);\n } else {\n filters = filters.set(name, values);\n }\n return this.setState({ filters });\n };\n replaceFiltersState = filters => {\n this.setState({ filters });\n };\n handleClear = () => {\n this.props.applyFilters(new Map(), '/');\n };\n loadAoiId = (aoiId: string) => {\n this.props.push({\n ...this.props.location,\n search: `aoi=${aoiId}`\n });\n };\n getAOIName = () => {\n if (this.props.loading) return '';\n return this.props.aoi.getIn(['properties', 'name'], NEW_AOI);\n };\n getAOIId = (aoiId: string) => {\n if (this.props.loading) return '';\n return this.props.aoi.get('id');\n };\n removeAOI = (aoiId: string) => {\n if (aoiId === this.props.aoi.get('id')) {\n this.handleClear();\n }\n deleteAOI(this.props.token, aoiId).catch(e => console.error(e));\n };\n createAOI = (name: string) => {\n this.props.applyCreateAOI(name, this.state.filters);\n };\n updateAOI = (aoiId: string, name: string) => {\n this.props.applyUpdateAOI(aoiId, name, this.state.filters);\n };\n render() {\n const mobile = isMobile();\n\n return (\n \n \n \n \n );\n }\n}\n\nFilters = connect(\n (state: RootStateType, props) => ({\n filters: state.filters.get('filters'),\n aoi: state.aoi.get('aoi'),\n loading: state.filters.get('loading'),\n features: state.changesetsPage.getIn(['currentPage', 'features']),\n location: props.location,\n token: state.auth.get('token')\n }),\n {\n checkForNewChangesets,\n applyFilters,\n applyCreateAOI,\n applyUpdateAOI,\n push,\n modal\n }\n)(Filters);\n\nexport { Filters };\n","// @flow\nimport React from 'react';\n\nexport function NumberOfComments({ count }: { count: ?number }) {\n return (\n 1 ? 's' : ''}`}>\n {count}\n \n \n \n \n );\n}\n","// @flow\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nimport { CreateDeleteModify } from '../create_delete_modify';\nimport { NumberOfComments } from './comments';\nimport { getObjAsQueryParam } from '../../utils/query_params';\n\nimport thumbsUp from '../../assets/thumbs-up.svg';\nimport thumbsDown from '../../assets/thumbs-down.svg';\n\nexport function SecondaryLine({ changesetId, date, properties }: Object) {\n return (\n \n \n \n {changesetId}\n \n {properties.get('checked') ? (\n \n {properties.get('harmful') ? (\n \n ) : (\n \n )}\n {properties.get('check_user') && (\n {`by ${properties.get(\n 'check_user'\n )}`}\n )}\n \n ) : null}\n \n \n {properties.get('comments_count') > 0 && (\n \n )}\n \n \n \n );\n}\n// // // \n","// @flow\nimport React from 'react';\nimport { Reasons } from '../reasons';\n\nexport function PrimaryLine({ reasons, comment, tags }: Object) {\n return (\n \n

          \n {comment}\n

          \n \n \n
          \n );\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { formatDistanceToNow, parse } from 'date-fns';\n\nimport { useIsUserListed } from '../../hooks/UseIsUserListed';\n\nfunction TitleComponent({\n properties,\n wasOpen,\n date,\n trustedlist,\n watchlisted\n}: Object) {\n const [isInTrustedlist, isInWatchlist] = useIsUserListed(\n properties.get('user'),\n properties.get('uid'),\n trustedlist,\n watchlisted\n );\n\n return (\n
          \n \n \n {properties.get('user') || OSM User}\n {isInTrustedlist && (\n \n \n \n )}\n {isInWatchlist && (\n \n \n \n )}\n \n \n  \n {formatDistanceToNow(\n // eslint-disable-next-line\n parse(date, \"yyyy-MM-dd'T'HH:mm:ssX\", new Date()),\n { addSuffix: true }\n )}\n \n \n
          \n );\n}\n\nconst Title = connect((state: RootStateType, props) => ({\n trustedlist: state.trustedlist.get('trustedlist'),\n watchlisted: state.watchlist.get('watchlist')\n}))(TitleComponent);\n\nexport { Title };\n","// @flow\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport { Map } from 'immutable';\n\nimport { SecondaryLine } from './secondary_line';\nimport { PrimaryLine } from './primary_line';\nimport { Title } from './title';\nimport { history } from '../../store/history';\n\nexport class Row extends React.Component {\n props: {\n properties: Map,\n active: ?boolean,\n changesetId: number,\n inputRef: ?(any) => any\n };\n\n shouldComponentUpdate(nextProps: Object) {\n return (\n nextProps.properties !== this.props.properties ||\n this.props.active ||\n nextProps.active\n );\n }\n\n wasOpen = false;\n\n render() {\n const { properties, changesetId, active, inputRef, ...other } = this.props;\n if (!this.wasOpen) {\n // way to show read/unread state without\n // performance compromise. The moment component\n // gets active we set wasOpen to true and never\n // toggle it back to any other state.\n this.wasOpen = this.props.active;\n }\n\n let borderClass = 'border-l border-l--4 border-color-neutral';\n if (properties.get('harmful') === true)\n borderClass = 'border-l border-l--4 border-color-bad';\n if (properties.get('harmful') === false)\n borderClass = 'border-l border-l--4 border-color-good';\n\n let backgroundClass = '';\n\n backgroundClass += active ? 'light-blue' : this.wasOpen ? 'bg-darken5' : '';\n return (\n \n history.push({\n search: window.location.search,\n pathname: `/changesets/${changesetId}`\n })\n }\n >\n
          \n \n \n \n \n \n \n
          \n \n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { Row } from './row';\nimport { SignInButton } from '../changeset/sign_in_button.js';\nimport { elementInViewport } from '../../utils/element_in_view';\nimport { loadingEnhancer } from '../loading_enhancer';\n\ntype propTypes = {\n currentPage: ?Map,\n activeChangesetId: ?number,\n pageIndex: number\n};\n\nclass List extends React.Component {\n shouldComponentUpdate(nextProps: propTypes) {\n return (\n nextProps.activeChangesetId !== this.props.activeChangesetId ||\n nextProps.currentPage !== this.props.currentPage\n );\n }\n\n handleScroll = (r: HTMLElement) => {\n if (!r) return;\n if (!elementInViewport(r)) {\n r.scrollIntoView({ block: 'end', behavior: 'smooth' });\n }\n };\n\n render() {\n if (\n !this.props.token &&\n ['/about', '/filters', '/user', '/'].includes(this.props.location)\n ) {\n return (\n
          \n
          \n \n \n \n
          \n
          \n \n
          \n
          \n );\n }\n\n return (\n
            \n
            \n {this.props.currentPage &&\n this.props.currentPage.get('features').map((f, k) => (\n \n ))}\n
            \n
          \n );\n }\n}\n\nList = loadingEnhancer(List);\nList = connect((state: RootStateType, props) => ({\n token: state.auth.get('token')\n}))(List);\n\nexport { List };\n","// @flow\nimport React from 'react';\n\nexport class PageRange extends React.PureComponent {\n render() {\n return (\n \n {typeof this.props.page === 'number'\n ? this.props.page + 1\n : \n \n }\n \n );\n }\n _onClick = () => {\n this.props.getChangesetsPage(this.props.pageIndex);\n };\n}\n","// @flow\nimport React from 'react';\nimport { Range } from 'immutable';\n\nimport { PageRange } from './page_range';\nimport { PAGE_SIZE } from '../../config/constants';\n\nconst RANGE = 6;\n\nfunction range(start, end) {\n return Range(start, end).map((k, i) => i + start);\n}\n\nexport function Footer({\n pageIndex,\n getChangesetsPage,\n count\n}: {\n pageIndex: number,\n getChangesetsPage: (number, ?boolean) => mixed,\n count: ?number\n}) {\n const base = parseInt(pageIndex / RANGE, 10) * RANGE;\n let maxPageCount = 0;\n if (count && !Number.isNaN(count)) {\n maxPageCount = Math.ceil(count / PAGE_SIZE);\n }\n return (\n
          \n \n {range(base, Math.min(base + RANGE, maxPageCount)).map(n =>\n \n )}\n = maxPageCount}\n pageIndex={pageIndex + 1}\n active={false}\n getChangesetsPage={getChangesetsPage}\n />\n
          \n );\n}\n","// @flow\nimport React from 'react';\nimport { NavLink } from 'react-router-dom';\nimport { Dropdown } from '../dropdown';\nimport { Button } from '../button';\nimport numberWithCommas from '../../utils/number_with_commas.js';\nimport filtersConfig from '../../config/filters.json';\n\nexport function Header({\n filters,\n handleFilterOrderBy,\n location,\n diffLoading,\n diff,\n currentPage,\n reloadCurrentPage\n}: Object) {\n const valueData = [];\n const options = filtersConfig.filter(f => f.name === 'order_by')[0].options;\n if (filters.get('order_by')) {\n options.forEach(o => {\n if (filters.getIn(['order_by', 0, 'value']) === o.value) {\n valueData.push(o);\n }\n });\n }\n return (\n
          \n
          \n {}}\n onRemove={() => {}}\n onChange={handleFilterOrderBy}\n value={valueData}\n options={filtersConfig.filter(f => f.name === 'order_by')[0].options}\n display={(valueData[0] && valueData[0].label) || 'Order by'}\n position=\"left\"\n />\n -1 ? '/' : '/filters'\n }}\n >\n \n \n
          \n 0 ? 'bg-darken10' : 'bg-gray-faint'\n } flex-child align-items--center`}\n >\n \n \n {(currentPage &&\n numberWithCommas(currentPage.getIn(['count'], 0))) ||\n 0}{' '}\n changesets.\n \n \n {diffLoading ? (\n \n ) : (\n \n {diff > 0 ? `${diff} new` : ''}\n \n )}\n \n \n \n
          \n );\n}\n","//@flow\n\nexport default function numberWithCommas(num: number): string {\n return num.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n}\n","// @flow\nimport React from 'react';\nimport { API_URL } from '../../config';\nimport { Map } from 'immutable';\nimport { Dropdown } from '../dropdown';\nimport { cancelablePromise } from '../../utils/promise';\n\n// TOFIX Needs cleanup.\n\nlet cacheTagsData;\nexport class Tags extends React.PureComponent {\n props: {\n changesetId: number,\n disabled: boolean,\n currentChangeset: Map,\n handleChangesetModifyTag: (number, Map, Object, boolean) => mixed\n };\n\n state: {\n options: Array,\n allTags: Array\n };\n\n state = {\n allTags: {},\n options: []\n };\n\n tagsData = cacheTagsData;\n\n componentDidMount() {\n this.getAsyncOptions();\n }\n\n getAsyncOptions = () => {\n if (!this.tagsData) {\n this.tagsData = cancelablePromise(\n fetch(`${API_URL}/tags/`).then(response => {\n return response.json();\n })\n );\n }\n\n return this.tagsData.promise\n .then(json => {\n let data = {};\n let selectData = json.filter(d => d.is_visible && d.for_changeset);\n\n selectData.forEach(d => {\n data[d.name] = { ...d, value: d.id, label: d.name };\n });\n this.setState({\n allTags: data,\n options: selectData.map(d => ({ label: d.name, value: d.id }))\n });\n })\n .catch(e => {});\n };\n\n componentWillUnmount() {\n if (this.tagsData) {\n cacheTagsData = this.tagsData;\n this.tagsData.cancel();\n }\n }\n\n onAdd = (obj: Object) => {\n if (!obj) return;\n const {\n changesetId,\n currentChangeset,\n handleChangesetModifyTag\n } = this.props;\n handleChangesetModifyTag(changesetId, currentChangeset, obj, false);\n };\n\n onRemove = (obj: Object) => {\n if (!obj) return;\n const {\n changesetId,\n currentChangeset,\n handleChangesetModifyTag\n } = this.props;\n handleChangesetModifyTag(changesetId, currentChangeset, obj, true);\n };\n\n defaultValue = new Map();\n\n render() {\n if (!this.props.currentChangeset) return null;\n\n const value = this.props.currentChangeset\n .getIn(['properties', 'tags'], this.defaultValue)\n .toJS()\n .map(t => ({\n value: t.id,\n label: t.name\n }));\n\n if (this.state.options) {\n return (\n {}}\n display={`Tags${value.length > 0 ? ` (${value.length})` : ''}`}\n position=\"right\"\n />\n );\n } else {\n return null;\n }\n }\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { is, List as ImmutableList, Map, fromJS } from 'immutable';\nimport { push } from 'react-router-redux';\nimport type { RootStateType } from '../store';\n\nimport {\n getChangesetsPage,\n checkForNewChangesets\n} from '../store/changesets_page_actions';\n\nimport { applyFilters } from '../store/filters_actions';\n\nimport { List } from '../components/list';\nimport { Footer } from '../components/list/footer';\nimport { Header } from '../components/list/header';\nimport { keyboardToggleEnhancer } from '../components/keyboard_enhancer';\nimport {\n NEXT_CHANGESET,\n PREV_CHANGESET,\n FILTER_BINDING,\n HELP_BINDING,\n REFRESH_CHANGESETS\n} from '../config/bindings';\n\ntype propsType = {\n location: Object,\n loading: boolean,\n error: Object,\n currentPage: ?Map,\n diff: number,\n diffLoading: boolean,\n pageIndex: number,\n activeChangesetId: ?number,\n filters: Map>,\n aoiId: ?string,\n lastKeyStroke: Map,\n getChangesetsPage: (number, ?boolean) => mixed, // base 0\n checkForNewChangesets: boolean => any,\n push: Object => mixed,\n applyFilters: (Map>) => mixed // base 0\n};\n\nclass ChangesetsList extends React.PureComponent {\n checkUpdate = null;\n maxPageCount = Infinity;\n\n // constructor(props: propsType) {\n // super(props);\n // this.props.getChangesetsPage(props.pageIndex);\n // this.checkUpdate = delayPromise(2000);\n // this.checkUpdate.promise.then(() => this.props.checkForNewChangesets(true));\n // }\n componentWillUnmount() {\n this.checkUpdate && this.checkUpdate.cancel();\n }\n\n goUpDownToChangeset = (direction: number) => {\n if (!this.props.currentPage) return;\n let features = this.props.currentPage.get('features');\n if (features) {\n let index = features.findIndex(\n f => f.get('id') === this.props.activeChangesetId\n );\n index += direction;\n const nextFeature = features.get(index);\n if (nextFeature) {\n const location = {\n ...this.props.location, // clone it\n pathname: `/changesets/${nextFeature.get('id')}`\n };\n this.props.push(location);\n }\n }\n };\n\n toggleFilters() {\n if (this.props.location && this.props.location.pathname === '/filters') {\n const location = {\n ...this.props.location, // clone it\n pathname: '/'\n };\n this.props.push(location);\n } else {\n const location = {\n ...this.props.location, // clone it\n pathname: '/filters'\n };\n this.props.push(location);\n }\n }\n\n toggleHelp() {\n if (\n this.props.location &&\n this.props.location.pathname.startsWith('/about')\n ) {\n const location = {\n ...this.props.location, // clone it\n pathname: '/'\n };\n this.props.push(location);\n } else {\n console.log(...this.props.location);\n const location = {\n ...this.props.location, // clone it\n pathname: '/about'\n };\n this.props.push(location);\n }\n }\n\n componentWillReceiveProps(nextProps: propsType) {\n const lastKeyStroke: Map = nextProps.lastKeyStroke;\n if (is(this.props.lastKeyStroke, lastKeyStroke)) return;\n switch (lastKeyStroke.keySeq().first()) {\n case FILTER_BINDING.label: {\n this.toggleFilters();\n break;\n }\n case HELP_BINDING.label: {\n this.toggleHelp();\n break;\n }\n case NEXT_CHANGESET.label: {\n this.goUpDownToChangeset(1);\n break;\n }\n case PREV_CHANGESET.label: {\n this.goUpDownToChangeset(-1);\n break;\n }\n case REFRESH_CHANGESETS.label: {\n this.reloadCurrentPage();\n break;\n }\n default: {\n return;\n }\n }\n }\n\n handleFilterOrderBy = (selected: Array<*>) => {\n let mergedFilters;\n mergedFilters = this.props.filters.set('order_by', fromJS(selected));\n this.props.applyFilters(mergedFilters);\n };\n\n reloadCurrentPage = () => {\n this.props.getChangesetsPage(this.props.pageIndex, true);\n };\n\n render() {\n const {\n filters,\n currentPage,\n loading,\n location,\n diff,\n diffLoading,\n activeChangesetId,\n pageIndex,\n getChangesetsPage\n } = this.props;\n\n return (\n
          \n \n \n \n
          \n );\n }\n}\n\nChangesetsList = keyboardToggleEnhancer(\n false,\n [\n NEXT_CHANGESET,\n PREV_CHANGESET,\n FILTER_BINDING,\n HELP_BINDING,\n REFRESH_CHANGESETS\n ],\n ChangesetsList\n);\n\nChangesetsList = connect(\n (state: RootStateType, props) => ({\n location: state.routing.location,\n loading: state.changesetsPage.get('loading'),\n error: state.changesetsPage.get('error'),\n currentPage: state.changesetsPage.get('currentPage'),\n diff: state.changesetsPage.get('diff'),\n diffLoading: state.changesetsPage.get('diffLoading'),\n pageIndex: state.changesetsPage.get('pageIndex') || 0,\n activeChangesetId: state.changeset.get('changesetId'),\n filters: state.filters.get('filters'),\n aoiId: state.aoi.get('aoi').get('id')\n }),\n {\n // actions\n getChangesetsPage,\n checkForNewChangesets,\n applyFilters,\n push\n }\n)(ChangesetsList);\nexport { ChangesetsList };\n","import React from 'react';\nimport { isMobile } from '../utils';\n\nexport function Navbar({\n className,\n title,\n titleClassName = '',\n buttons,\n buttonsClassName = ''\n}) {\n const mobile = isMobile();\n\n return (\n \n
          \n {title || ''}\n
          \n
          {buttons}
          \n \n );\n}\n","import React from 'react';\nimport { Dropdown } from '../dropdown';\nimport thumbsUp from '../../assets/thumbs-up.svg';\nimport thumbsDown from '../../assets/thumbs-down.svg';\n\nexport function Verify({\n changeset,\n options,\n className,\n onChange,\n value,\n onClear,\n username,\n checkUser\n}) {\n if (changeset.getIn(['properties', 'checked'])) {\n const isHarmful = changeset.getIn(['properties', 'harmful']);\n return (\n \n \n \n {checkUser ? <>{checkUser} : Verified}\n \n \n \n \n \n );\n }\n\n return (\n
          \n {}}\n onRemove={() => {}}\n options={options}\n onChange={onChange}\n display=\"Verify\"\n position=\"right\"\n />\n
          \n );\n}\n","import React from 'react';\n\nimport { importChangesetMap } from '../../utils/cmap';\nimport { Dropdown } from '../dropdown';\nimport { isMobile } from '../../utils';\n\nfunction openEditor(selected) {\n importChangesetMap('getMapInstance')\n .then(r => r && r() && r().map)\n .then(map => {\n let baseUrl;\n if (selected && selected[0].value === 'iD') {\n baseUrl = 'https://www.openstreetmap.org/edit?editor=id&';\n }\n if (selected && selected[0].value === 'RapiD') {\n baseUrl = 'https://mapwith.ai/rapid?';\n }\n if (baseUrl) {\n const center = map.getCenter();\n const zoom = map.getZoom();\n let windowObjectReference = window.open('editor - OSMCha');\n windowObjectReference.location.href = `${baseUrl}#map=${zoom}/${center.lat}/${center.lng}`;\n }\n });\n}\n\nexport function OpenIn({ display, changesetId, coordinates, className }) {\n const mobile = isMobile();\n const options = [\n {\n label: 'Achavi',\n value: 'Achavi',\n href: `https://overpass-api.de/achavi/?changeset=${changesetId}&relations=true`\n },\n {\n label: 'iD',\n value: 'iD'\n },\n {\n label: 'JOSM',\n value: 'JOSM',\n href: `http://127.0.0.1:8111/import?url=https://www.openstreetmap.org/api/0.6/changeset/${changesetId}/download`\n },\n {\n label: 'Level0',\n value: 'Level0',\n href: `http://level0.osmz.ru/?url=changeset/${changesetId}`\n },\n {\n label: 'RapiD',\n value: 'RapiD'\n }\n ];\n if (mobile) {\n options.unshift({\n label: 'OSM.org',\n value: 'OSM.org',\n href: `https://www.openstreetmap.org/changeset/${changesetId}`\n });\n }\n\n return (\n
          \n {}}\n onRemove={() => {}}\n value={[]}\n onChange={openEditor}\n options={options}\n display={display}\n position=\"left\"\n />\n
          \n );\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Link } from 'react-router-dom';\nimport { is, Map } from 'immutable';\n\nimport { keyboardToggleEnhancer } from '../components/keyboard_enhancer';\nimport { Tags } from '../components/changeset/tags';\nimport { Navbar } from '../components/navbar';\nimport { Verify } from '../components/changeset/verify';\nimport { OpenIn } from '../components/changeset/open_in';\nimport { isMobile } from '../utils';\n\nimport {\n VERIFY_BAD,\n VERIFY_GOOD,\n VERIFY_CLEAR,\n OPEN_IN_JOSM,\n OPEN_IN_ID,\n OPEN_IN_OSM,\n OPEN_IN_LEVEL0,\n OPEN_IN_ACHAVI,\n OPEN_IN_HDYC\n} from '../config/bindings';\nimport { API_URL } from '../config/index';\n\nimport {\n handleChangesetModifyTag,\n handleChangesetModifyHarmful\n} from '../store/changeset_actions';\nimport type { RootStateType } from '../store';\n\ntype propsType = {\n changesetId: number,\n location: Object,\n currentChangeset: Map,\n username: ?string,\n lastKeyStroke: Map,\n handleChangesetModifyTag: (number, Map, Object, boolean) => mixed,\n handleChangesetModifyHarmful: (number, Map, boolean | -1) => mixed\n};\n\nclass NavbarChangeset extends React.PureComponent {\n componentWillReceiveProps(nextProps: propsType) {\n if (!this.props.currentChangeset) return;\n const lastKeyStroke: Map = nextProps.lastKeyStroke;\n if (is(this.props.lastKeyStroke, lastKeyStroke)) return;\n switch (lastKeyStroke.keySeq().first()) {\n case VERIFY_BAD.label: {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n true\n );\n break;\n }\n case VERIFY_CLEAR.label: {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n -1\n );\n break;\n }\n case VERIFY_GOOD.label: {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n false\n );\n break;\n }\n case OPEN_IN_JOSM.label: {\n if (!this.props.changesetId) return;\n const url = `http://127.0.0.1:8111/import?url=https://www.openstreetmap.org/api/0.6/changeset/${this.props.changesetId}/download`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_ID.label: {\n if (!this.props.changesetId || !this.props.currentChangeset) return;\n const coordinates = this.props.currentChangeset.getIn([\n 'geometry',\n 'coordinates',\n 0,\n 0\n ]);\n const url = `https://www.openstreetmap.org/edit?changeset=${\n this.props.changesetId\n }#map=15/${coordinates && coordinates.get('1')}/${coordinates &&\n coordinates.get('0')}`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_OSM.label: {\n if (!this.props.changesetId) return;\n const url = `https://www.openstreetmap.org/changeset/${this.props.changesetId}`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_LEVEL0.label: {\n if (!this.props.changesetId) return;\n const url = `http://level0.osmz.ru/?url=changeset/${this.props.changesetId}`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_ACHAVI.label: {\n if (!this.props.changesetId) return;\n const url = `https://overpass-api.de/achavi/?changeset=${this.props.changesetId}`;\n window.open(url, '_blank');\n break;\n }\n case OPEN_IN_HDYC.label: {\n const user: string = this.props.currentChangeset.getIn(\n ['properties', 'user'],\n ''\n );\n const url = `https://hdyc.neis-one.org/?${user}`;\n window.open(url, '_blank');\n break;\n }\n default: {\n return;\n }\n }\n }\n\n handleVerify = (arr: Array) => {\n if (arr.length === 1) {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n arr[0].value // whether harmful is true or false\n );\n } else if (arr.length > 1) {\n throw new Error('verify array is big');\n }\n };\n\n handleVerifyClear = () => {\n this.props.handleChangesetModifyHarmful(\n this.props.changesetId,\n this.props.currentChangeset,\n -1\n );\n };\n\n isChecked = () =>\n this.props.currentChangeset &&\n this.props.currentChangeset.getIn(['properties', 'checked']);\n\n render() {\n const mobile = isMobile();\n\n return (\n \n {mobile && (\n \n \n ☰\n {' '}\n \n )}\n {!mobile && (\n <>\n
          \n Changeset: {this.props.changesetId}\n \n \n navigator.clipboard.writeText(\n `${API_URL.replace('/api/v1', '')}/changesets/${\n this.props.changesetId\n }`\n )\n }\n title=\"Copy OSMCha Changeset URL\"\n >\n \n \n \n \n \n \n \n \n \n \n
          \n \n )}\n \n \n }\n buttonsClassName=\"flex-parent\"\n buttons={\n this.props.currentChangeset && (\n <>\n {this.props.currentChangeset.getIn([\n 'properties',\n 'check_user'\n ]) && (\n \n )}\n \n \n )\n }\n />\n );\n }\n}\n\nNavbarChangeset = keyboardToggleEnhancer(\n false,\n [\n VERIFY_BAD,\n VERIFY_GOOD,\n VERIFY_CLEAR,\n OPEN_IN_JOSM,\n OPEN_IN_ID,\n OPEN_IN_OSM,\n OPEN_IN_LEVEL0,\n OPEN_IN_ACHAVI,\n OPEN_IN_HDYC\n ],\n NavbarChangeset\n);\n\nNavbarChangeset = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n changesetId: parseInt(state.changeset.get('changesetId'), 10),\n currentChangeset: state.changeset.getIn([\n 'changesets',\n parseInt(state.changeset.get('changesetId'), 10)\n ]),\n username: state.auth.getIn(['userDetails', 'username'])\n }),\n { handleChangesetModifyTag, handleChangesetModifyHarmful }\n)(NavbarChangeset);\n\nexport { NavbarChangeset };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { Link } from 'react-router-dom';\nimport { push } from 'react-router-redux';\n\nimport { Button } from '../components/button';\nimport { Navbar } from '../components/navbar';\nimport { Dropdown } from '../components/dropdown';\n\nimport { createPopup } from '../utils/create_popup';\nimport { handlePopupCallback, isMobile } from '../utils';\nimport { osmAuthUrl } from '../config/constants';\nimport { isDev, isLocal } from '../config';\n\nimport {\n getOAuthToken,\n getFinalToken,\n logUserOut\n} from '../store/auth_actions';\n\nimport type { RootStateType } from '../store';\n\nclass NavbarSidebar extends React.PureComponent {\n props: {\n changesetId: ?number,\n location: Object,\n avatar: ?string,\n currentChangeset: Map,\n username: ?string,\n token: ?string,\n oAuthToken: ?string,\n getOAuthToken: () => mixed,\n getFinalToken: string => mixed,\n logUserOut: () => mixed,\n push: any => any\n };\n\n handleLoginClick = () => {\n var oAuthToken = this.props.oAuthToken;\n if (!oAuthToken) return;\n\n let url;\n if (isDev || isLocal) {\n url = `/local-landing.html#${oAuthToken}`;\n } else {\n url = `${osmAuthUrl}?oauth_token=${oAuthToken}`;\n }\n\n createPopup('oauth_popup', url);\n handlePopupCallback().then(oAuthObj => {\n this.props.getFinalToken(oAuthObj.oauth_verifier);\n });\n };\n\n onUserMenuSelect = (arr: Array) => {\n const username = this.props.username;\n\n if (arr.length === 1) {\n if (arr[0].url === '/logout') {\n this.props.logUserOut();\n return;\n }\n if (arr[0].url === '/my-changesets') {\n this.props.push({\n ...this.props.location,\n search: `filters={\"users\":[{\"label\":\"${username}\",\"value\":\"${username}\"}],\"date__gte\":[{\"label\":\"\",\"value\":\"\"}]}`,\n pathname: '/'\n });\n return;\n }\n if (arr[0].url === '/my-reviews') {\n this.props.push({\n ...this.props.location,\n search: `filters={\"checked_by\":[{\"label\":\"${username}\",\"value\":\"${username}\"}],\"date__gte\":[{\"label\":\"\",\"value\":\"\"}]}`,\n pathname: '/'\n });\n return;\n }\n this.props.push({\n ...this.props.location,\n search: this.props.location.search,\n pathname: arr[0].url\n });\n } else if (arr.length > 1) {\n throw new Error('filter select array is big');\n }\n };\n\n renderUserMenuOptions() {\n const username = this.props.username;\n\n return (\n \n {username}\n \n ) : (\n 'User'\n )\n }\n options={[\n { label: 'Account settings', url: '/user' },\n {\n label: 'My changesets',\n url: '/my-changesets'\n },\n {\n label: 'My reviews',\n url: '/my-reviews'\n },\n { label: 'My saved filters', url: '/saved-filters' },\n { label: 'My teams', url: '/teams' },\n { label: 'My trusted users list', url: '/trusted-users' },\n { label: 'My watchlist', url: '/watchlist' },\n { label: 'Logout', url: '/logout' }\n ]}\n onChange={this.onUserMenuSelect}\n value={[]}\n onAdd={() => {}}\n onRemove={() => {}}\n position=\"right\"\n />\n );\n }\n\n render() {\n const mobile = isMobile();\n\n return (\n <>\n \n OSM\n Cha\n \n }\n buttons={\n
          \n \n \n \n \n \n {this.props.token ? (\n
          {this.renderUserMenuOptions()}
          \n ) : (\n \n Sign in\n \n )}\n
          \n }\n />\n \n );\n }\n}\n\nNavbarSidebar = connect(\n (state: RootStateType, props) => ({\n location: state.routing.location,\n changesetId: parseInt(state.changeset.get('changesetId'), 10),\n currentChangeset: state.changeset.getIn([\n 'changesets',\n parseInt(state.changeset.get('changesetId'), 10)\n ]),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n username: state.auth.getIn(['userDetails', 'username']),\n avatar: state.auth.getIn(['userDetails', 'avatar'])\n }),\n {\n getOAuthToken,\n getFinalToken,\n logUserOut,\n push\n }\n)(NavbarSidebar);\n\nexport { NavbarSidebar };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport Notify from 'react-notification-system';\n\nimport type { RootStateType } from '../store';\n\nimport {\n dismissModalCallback,\n activateModalCallback\n} from '../store/modal_actions';\n\nclass Modal extends React.PureComponent {\n props: {\n title: ?string,\n description: ?string,\n kind: 'error' | 'success',\n dismiss: ?boolean,\n autoDismiss: ?boolean,\n dismissModalCallback: number => any,\n activateModalCallback: number => any,\n position: ?string,\n callbackLabel: ?string,\n error: Object,\n uid: number\n };\n static defaultProps = {\n title: 'Error',\n description: 'Oops there was a problem. Please reload the app.',\n autoDismiss: 5,\n dismiss: true,\n position: 'tr',\n kind: 'error'\n };\n ref = null;\n componentDidMount() {\n if (this.props.error) {\n this.sendNotification(this.props);\n }\n }\n componentWillUpdate(nextProps: Object) {\n this.sendNotification(nextProps);\n }\n sendNotification = nextProps => {\n const uid = nextProps.uid;\n if (!this.ref) return;\n this.ref.addNotification({\n uid,\n title: nextProps.title,\n message:\n (nextProps.error && nextProps.error.message) || nextProps.description,\n level: nextProps.kind,\n autoDismiss: nextProps.autoDismiss,\n position: nextProps.position,\n dismissible: nextProps.dismiss,\n action: nextProps.callbackLabel && {\n label: nextProps.callbackLabel,\n callback: () => nextProps.activateModalCallback(uid)\n },\n onRemove: () => {\n nextProps.dismissModalCallback(uid);\n }\n });\n };\n addRef = r => {\n this.ref = r;\n };\n render() {\n return ;\n }\n}\nModal = connect(\n (state: RootStateType) => ({\n error: state.modal.get('error'),\n callback: state.modal.get('callback'),\n callbackLabel: state.modal.get('callbackLabel'),\n title: state.modal.get('title'),\n description: state.modal.get('description'),\n dismiss: state.modal.get('dismiss'),\n position: state.modal.get('position'),\n autoDismiss: state.modal.get('autoDismiss'),\n kind: state.modal.get('kind'),\n uid: state.modal.get('uid')\n }),\n { dismissModalCallback, activateModalCallback }\n)(Modal);\n\nexport { Modal };\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\n\nimport { Button } from '../button';\nimport { applyUpdateUserDetails } from '../../store/auth_actions';\nimport type { RootStateType } from '../../store';\nimport thumbsUp from '../../assets/thumbs-up.svg';\nimport thumbsDown from '../../assets/thumbs-down.svg';\n\nclass EditUserDetails extends React.PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n message_good: props.userDetails.get('message_good'),\n message_bad: props.userDetails.get('message_bad'),\n comment_feature: props.userDetails.get('comment_feature')\n };\n }\n componentWillReceiveProps(nextProps) {\n this.setState({ message_good: nextProps.userDetails.get('message_good') });\n this.setState({ message_bad: nextProps.userDetails.get('message_bad') });\n this.setState({\n comment_feature: nextProps.userDetails.get('comment_feature')\n });\n }\n onChangeMessageGood = (event: any) => {\n this.setState({ message_good: event.target.value });\n };\n onChangeMessageBad = (event: any) => {\n this.setState({ message_bad: event.target.value });\n };\n handleSubmit = event => {\n this.props.applyUpdateUserDetails(\n this.state.message_good,\n this.state.message_bad,\n this.state.comment_feature\n );\n };\n renderGoodBadImg(isGood) {\n return (\n \n );\n }\n\n render() {\n return (\n
          \n \n

          \n Default comment for changesets reviewed as GOOD{' '}\n {this.renderGoodBadImg(true)}:\n

          \n
          \n \n \n

          \n Default comment for changesets reviewed as BAD{' '}\n {this.renderGoodBadImg()}:\n

          \n
          \n \n \n
          \n );\n }\n}\nEditUserDetails = connect(\n (state: RootStateType, props) => ({\n userDetails: state.auth.getIn(['userDetails'], Map())\n }),\n {\n applyUpdateUserDetails\n }\n)(EditUserDetails);\n\nexport { EditUserDetails };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport type { filtersType } from '../components/filters';\nimport { Avatar } from '../components/avatar';\nimport { Button } from '../components/button';\nimport { EditUserDetails } from '../components/user/details';\nimport { isMobile } from '../utils';\nimport type { RootStateType } from '../store';\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n filters: filtersType,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any\n};\nclass User extends React.PureComponent {\n state = {\n userValues: null\n };\n onUserChange = (value: ?Array) => {\n if (Array.isArray(value) && value.length === 0)\n return this.setState({ userValues: null });\n this.setState({\n userValues: value\n });\n };\n render() {\n const userDetails = this.props.userDetails;\n const mobile = isMobile();\n return (\n \n
          \n \n Account Settings\n \n\n \n \n Logout\n \n \n
          \n
          \n \n \n \n

          \n Welcome,{' '}\n {userDetails.get('username')\n ? userDetails.get('username')\n : 'stranger'}\n !\n

          \n
           
          \n
          \n \n
          \n

          \n Info\n

          \n \n

          OSMCha ID:

          \n

          {userDetails.get('id')}

          \n
          \n \n

          OSM ID:

          \n

          {userDetails.get('uid')}

          \n
          \n \n

          Username:

          \n

          {userDetails.get('username')}

          \n
          \n {userDetails.get('is_staff') && (\n \n

          Staff:

          \n

          Yes

          \n
          \n )}\n \n

          API key:

          \n

          \n Token {this.props.token}\n \n navigator.clipboard.writeText(`Token ${this.props.token}`)\n }\n title=\"Copy Authorization Token\"\n >\n \n \n \n

          \n

          \n \n\n {this.props.token && (\n
          \n
          \n

          \n Review Comments Template\n

          \n \n
          \n
          \n )}\n
          \n \n \n );\n }\n}\n\nUser = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n changesetId: parseInt(state.changeset.get('changesetId'), 10),\n currentChangeset: state.changeset.getIn([\n 'changesets',\n parseInt(state.changeset.get('changesetId'), 10)\n ]),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map()),\n avatar: state.auth.getIn(['userDetails', 'avatar'])\n }),\n {\n logUserOut,\n modal,\n push\n }\n)(User);\n\nexport { User };\n","import React from 'react';\n\nimport { isMobile } from '../utils';\nimport { Avatar } from './avatar';\n\nexport function SecondaryPagesHeader({ title, avatar }) {\n const mobile = isMobile();\n\n return (\n \n \n \n \n \n {title}\n \n \n );\n}\n","import React from 'react';\n\nexport function CustomURL({ href, children, iconName, className }: Object) {\n return (\n \n {iconName && (\n \n \n \n )}\n \n );\n}\n","import React from 'react';\n\nexport const BlockMarkup = ({ children }) => (\n
          \n
          \n {children}\n
          \n
          \n);\n","// @flow\nimport React from 'react';\nimport { Link } from 'react-router-dom';\nimport { push } from 'react-router-redux';\nimport { connect } from 'react-redux';\nimport { Map, List } from 'immutable';\n\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { applyFilters } from '../store/filters_actions';\nimport { cancelablePromise, isMobile } from '../utils';\nimport { fetchAllAOIs } from '../network/aoi';\nimport { createAOI, deleteAOI } from '../network/aoi';\nimport { withFetchDataSilent } from '../components/fetch_data_enhancer';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport { Button } from '../components/button';\nimport { CustomURL } from '../components/customURL';\nimport { BlockMarkup } from '../components/user/block_markup';\nimport type { filtersType } from '../components/filters';\nimport type { RootStateType } from '../store';\nimport { API_URL } from '../config';\n\nclass SaveButton extends React.PureComponent {\n constructor(props) {\n super(props);\n this.state = {\n editing: false\n };\n }\n ref;\n clicked = false;\n onClick = event => {\n this.clicked = true;\n this.setState({ editing: true });\n };\n onChange = (event: any) => {\n this.setState({ value: event.target.value });\n };\n onKeyDown = event => {\n if (event.keyCode === 13) {\n this.setState({\n editing: false\n });\n this.props.onCreate(this.state.value);\n } else if (event.keyCode === 27) {\n this.setState({\n editing: false\n });\n this.clicked = false;\n }\n };\n onSave = event => {\n this.setState({\n editing: false\n });\n this.props.onCreate(this.state.value);\n };\n render() {\n return (\n \n {this.state.editing ? (\n \n {\n if (this.clicked) {\n r && r.select();\n this.clicked = false;\n }\n }}\n value={this.state.value}\n onChange={this.onChange}\n onKeyDown={this.onKeyDown}\n />\n \n \n ) : (\n \n )}\n \n );\n }\n}\n\nconst AOIsBlock = ({ data, activeAoiId, removeAoi }) => (\n \n \n \n {data.getIn(['properties', 'name'])}\n {activeAoiId === data.getIn(['id']) ? '*' : ''}\n \n ({data.getIn(['id'])})\n \n \n \n {activeAoiId === data.getIn(['id']) ? 'Active' : 'Load'}\n \n \n \n \n \n);\n\nconst ListFortified = ({\n onAdd,\n onRemove,\n data,\n TargetBlock,\n propsToPass,\n SaveComp\n}) => (\n
          \n {data.map((e, i) => (\n \n ))}\n {SaveComp}\n
          \n);\n\ntype propsType = {\n avatar: ?string,\n aoiId: ?string,\n token: string,\n data: Map,\n location: Object,\n filters: filtersType,\n userDetails: Map,\n applyFilters: (filtersType, path?: string) => mixed, // base\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any\n};\nclass SavedFilters extends React.PureComponent {\n createAOIPromise;\n state = {\n userValues: null\n };\n componentWillUnmount() {\n this.createAOIPromise && this.createAOIPromise.cancel();\n }\n\n addToWatchList = ({ username, uid }: { username: string, uid: string }) => {\n if (!username || !uid) return;\n this.props.addToWatchlist({ username, uid });\n };\n removeFromWatchList = (uid: number) => {\n if (!uid) return;\n this.props.removeFromWatchlist(uid);\n };\n addToTrustedList = ({ username }: { username: string }) => {\n if (!username) return;\n this.props.addToTrustedlist(username);\n };\n removeFromTrustedList = (username: string) => {\n if (!username) return;\n this.props.removeFromTrustedlist(username);\n };\n // aoi\n loadAoiId = (aoiId: ?string) => {\n if (!aoiId) return;\n this.props.push({\n ...this.props.location,\n search: `aoi=${aoiId}`,\n path: '/filters'\n });\n };\n createAOI = (name: string) => {\n if (name === '' || !name) return;\n this.createAOIPromise = cancelablePromise(\n createAOI(this.props.token, name, this.props.filters)\n );\n\n this.createAOIPromise.promise\n .then(r => r && this.loadAoiId(r.id))\n .catch(e => console.error(e));\n };\n removeAOI = (aoiId: string) => {\n if (!aoiId) return;\n deleteAOI(this.props.token, aoiId)\n .then(r => {\n if (aoiId === this.props.aoiId) {\n this.props.applyFilters(new Map(), '/user');\n } else {\n // const location = {\n // ...this.props.location, // clone it\n // pathname: '/user'\n // };\n this.props.reloadData();\n }\n this.props.modal({\n kind: 'success',\n title: 'Filter Deleted ',\n description: `The ${aoiId} was deleted`\n });\n })\n .catch(e => {\n this.props.reloadData();\n this.props.modal({\n kind: 'error',\n title: 'Deletion failed ',\n error: e\n });\n });\n };\n onUserChange = (value: ?Array) => {\n if (Array.isArray(value) && value.length === 0)\n return this.setState({ userValues: null });\n this.setState({\n userValues: value\n });\n };\n render() {\n const mobile = isMobile();\n\n return (\n \n \n
          \n
          \n {this.props.token && (\n
          \n
          \n

          \n My saved filters\n

          \n }\n />\n
          \n
          \n )}\n
          \n
          \n \n );\n }\n}\n/**\n * Never use props not required by the Basecomponent in HOCs\n */\nSavedFilters = withFetchDataSilent(\n (props: propsType) => ({\n aoi: cancelablePromise(fetchAllAOIs(props.token))\n }),\n (nextProps: propsType, props: propsType) => true,\n SavedFilters\n);\n\nSavedFilters = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n filters: state.filters.get('filters'),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map()),\n avatar: state.auth.getIn(['userDetails', 'avatar']),\n aoiId: state.filters.getIn(['aoi', 'id'], null)\n }),\n {\n applyFilters,\n logUserOut,\n modal,\n push\n }\n)(SavedFilters);\n\nexport { SavedFilters };\n","// @flow\nimport React from 'react';\nimport { Button } from '../button';\nimport { handleErrors } from '../../network/aoi';\n\nexport class WatchListUser extends React.Component {\n state = {\n username: '',\n uid: '',\n isValidUsername: true,\n isValidUid: true,\n verified: false\n };\n setUsername = (event: any) => {\n const target = event.target;\n const value = target.value;\n this.setState({ username: value, isValidUsername: true, verified: false });\n };\n setUid = (event: any) => {\n const target = event.target;\n const value = target.value;\n this.setState({ uid: value, isValidUid: true, verified: false });\n };\n fetchUsername = (username: string) =>\n fetch(\n `https://www.openstreetmap.org/api/0.6/changesets?display_name=${this.state.username}`\n )\n .then(handleErrors)\n .then(r => r.text())\n .then(r => {\n try {\n const parser = new DOMParser();\n const xml = parser.parseFromString(r, 'text/xml');\n return (\n xml.getElementsByTagName('osm')[0] &&\n xml\n .getElementsByTagName('osm')[0]\n .firstElementChild.getAttribute('uid')\n );\n } catch (e) {\n handleErrors();\n }\n });\n\n fetchUid = (uid: string) =>\n fetch(`https://www.openstreetmap.org/api/0.6/user/${uid}.json`)\n .then(handleErrors)\n .then(r => r.json());\n\n verifyInput = () => {\n if (this.state.uid.length > 0 && this.state.username.length === 0) {\n this.fetchUid(this.state.uid)\n .then(r => ({\n uid: r.user.id.toString(),\n username: r.user.display_name\n }))\n .then(r =>\n this.setState({\n username: r.username,\n uid: r.uid,\n verified: true,\n isValidUsername: true,\n isValidUid: true\n })\n )\n .catch(r => this.setState({ isValidUid: false, verified: false }));\n } else if (this.state.username.length > 0 && this.state.uid.length === 0) {\n this.fetchUsername(this.state.username)\n .then(r => ({\n uid: r.toString(),\n username: this.state.username\n }))\n .then(x => {\n return x;\n })\n .then(r =>\n this.setState({\n username: r.username,\n uid: r.uid,\n verified: true,\n isValidUsername: true,\n isValidUid: true\n })\n )\n .catch(r => this.setState({ isValidUsername: false, verified: false }));\n } else if (this.state.uid.length > 0 && this.state.username.length > 0) {\n Promise.all([\n this.fetchUid(this.state.uid).then(r => ({\n uid: r.id,\n username: r.name\n })),\n this.fetchUsername(this.state.username).then(r => ({\n uid: r.id,\n username: r.name\n }))\n ])\n .then(resp => {\n if (\n resp[0].uid === resp[1].uid &&\n resp[0].username === resp[1].username\n ) {\n window.alert('The user is valid');\n this.setState({ verified: true });\n } else {\n this.setState({ isValidUsername: false, isValidUid: false });\n }\n })\n .catch(e =>\n this.setState({ isValidUsername: false, isValidUid: false })\n );\n }\n };\n onAdd = () => {\n const username = this.state.username;\n const uid = this.state.uid;\n if (username && username.length > 0 && uid && uid.length > 0) {\n this.props.onSave(username, uid);\n } else {\n this.setState({ isValidUsername: false, isValidUid: false });\n }\n };\n\n render() {\n const errorClass = 'border border--1 border--red';\n return (\n \n \n \n \n \n Add\n \n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { Button } from '../button';\n\nexport class TrustedListUser extends React.Component {\n state = {\n username: ''\n };\n\n onAdd = () => {\n const username = this.state.username;\n if (username && username.length > 0) {\n this.props.onSave(username);\n this.setState({ username: '' });\n }\n };\n\n render() {\n return (\n \n this.setState({ username: e.target.value })}\n placeholder=\"Username\"\n type=\"text\"\n />\n \n \n );\n }\n}\n","import React from 'react';\n\nimport { Button } from '../button';\nimport { WatchListUser } from './watchlist_user';\nimport { TrustedListUser } from './trustedlist_user';\n\nexport class SaveUser extends React.PureComponent {\n state = {\n showInput: false\n };\n onSave = (username, uid) => {\n if (this.props.forWatchlist) {\n if (!username || !uid) return;\n this.props.onCreate({ username, uid });\n this.setState({ showInput: false });\n } else {\n if (!username) return;\n this.props.onCreate({ username });\n this.setState({ showInput: false });\n }\n };\n render() {\n return (\n \n {this.state.showInput ? (\n \n {this.props.forWatchlist ? (\n \n ) : (\n \n )}\n \n ) : (\n this.setState({ showInput: true })}\n >\n Add+\n \n )}\n \n );\n }\n}\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map, List } from 'immutable';\nimport { push } from 'react-router-redux';\nimport { Link } from 'react-router-dom';\n\nimport { getObjAsQueryParam, isMobile } from '../utils';\nimport { BlockMarkup } from '../components/user/block_markup';\nimport { SaveUser } from '../components/user/save_user';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport {\n addToTrustedlist,\n removeFromTrustedlist\n} from '../store/trustedlist_actions';\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { Button } from '../components/button';\nimport type { RootStateType } from '../store';\n\nconst TrustedListBlock = ({ data, removeFromTrustedList }) => (\n \n \n {data}\n \n \n \n OSMCha\n \n \n \n \n);\n\nconst ListFortified = ({\n onAdd,\n onRemove,\n data,\n TargetBlock,\n propsToPass,\n SaveComp\n}) => (\n
          \n {data.map((e, i) => (\n \n ))}\n {SaveComp}\n
          \n);\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any,\n trustedList: Map,\n addToTrustedlist: string => void,\n removeFromTrustedlist: string => void\n};\nclass TrustedUsers extends React.PureComponent {\n state = {\n userValues: null\n };\n addToTrustedList = ({ username }: { username: string }) => {\n if (!username) return;\n this.props.addToTrustedlist(username);\n };\n removeFromTrustedList = (username: string) => {\n if (!username) return;\n this.props.removeFromTrustedlist(username);\n };\n onUserChange = (value: ?Array) => {\n if (Array.isArray(value) && value.length === 0)\n return this.setState({ userValues: null });\n this.setState({\n userValues: value\n });\n };\n render() {\n let trustedUsers = this.props.trustedList ? this.props.trustedList : List();\n trustedUsers = trustedUsers.sortBy(\n a => a,\n (a: string, b: string) => a.localeCompare(b)\n );\n const mobile = isMobile();\n\n return (\n \n \n
          \n
          \n {this.props.token && (\n
          \n
          \n

          \n My trusted users list\n

          \n }\n />\n
          \n
          \n )}\n
          \n
          \n \n );\n }\n}\n\nTrustedUsers = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n trustedList: state.trustedlist.get('trustedlist'),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map()),\n avatar: state.auth.getIn(['userDetails', 'avatar'])\n }),\n {\n logUserOut,\n modal,\n push,\n addToTrustedlist,\n removeFromTrustedlist\n }\n)(TrustedUsers);\n\nexport { TrustedUsers };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map, List } from 'immutable';\nimport { push } from 'react-router-redux';\nimport { Link } from 'react-router-dom';\n\nimport { getObjAsQueryParam, isMobile } from '../utils';\nimport { BlockMarkup } from '../components/user/block_markup';\nimport { SaveUser } from '../components/user/save_user';\nimport {\n addToWatchlist,\n removeFromWatchlist\n} from '../store/watchlist_actions';\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { Button } from '../components/button';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport type { RootStateType } from '../store';\n\nconst WatchListBlock = ({ data, removeFromWatchList }) => (\n \n \n {data.getIn(['username'])}\n ({data.getIn(['uid'])})\n \n \n \n OSMCha\n \n removeFromWatchList(data.getIn(['uid']))}\n >\n Remove\n \n \n \n);\n\nconst ListFortified = ({\n onAdd,\n onRemove,\n data,\n TargetBlock,\n propsToPass,\n SaveComp\n}) => (\n
          \n {data.map((e, i) => (\n \n ))}\n {SaveComp}\n
          \n);\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any,\n watchlisted: Map,\n addToWatchlist: string => void,\n removeFromWatchlist: string => void\n};\nclass Watchlist extends React.PureComponent {\n state = {\n userValues: null\n };\n // blacklist\n addToWatchList = ({ username, uid }: { username: string, uid: string }) => {\n if (!username || !uid) return;\n this.props.addToWatchlist({ username, uid });\n };\n removeFromWatchList = (uid: number) => {\n if (!uid) return;\n this.props.removeFromWatchlist(uid);\n };\n onUserChange = (value: ?Array) => {\n if (Array.isArray(value) && value.length === 0)\n return this.setState({ userValues: null });\n this.setState({\n userValues: value\n });\n };\n render() {\n let watchList = this.props.watchlisted ? this.props.watchlisted : List();\n watchList = watchList.sortBy(\n a => a.get('username'),\n (a: string, b: string) => a.localeCompare(b)\n );\n const mobile = isMobile();\n\n return (\n \n \n \n
          \n {this.props.token && (\n
          \n
          \n

          \n My watched users list\n

          \n \n }\n />\n
          \n
          \n )}\n {this.props.token && (\n \n \n Filter changesets\n \n \n )}\n
          \n \n \n );\n }\n}\n\nWatchlist = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n watchlisted: state.watchlist.get('watchlist'),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map()),\n avatar: state.auth.getIn(['userDetails', 'avatar'])\n }),\n {\n logUserOut,\n modal,\n push,\n addToWatchlist,\n removeFromWatchlist\n }\n)(Watchlist);\n\nexport { Watchlist };\n","import { API_URL } from '../config';\nimport { handleErrors } from './aoi';\n\nexport function createMappingTeam(token: string, name: string, users: string) {\n return fetch(`${API_URL}/mapping-team/`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n name,\n users\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchMappingTeam(token: string, id: number) {\n return fetch(`${API_URL}/mapping-team/${id}/`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\nexport function deleteMappingTeam(token: string, id: number) {\n return fetch(`${API_URL}/mapping-team/${id}/`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n }).then(handleErrors);\n}\n\nexport function fetchUserMappingTeams(token: string, owner: string) {\n return fetch(`${API_URL}/mapping-team/?owner=${owner}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function fetchTrustedMappingTeams(token: string) {\n return fetch(`${API_URL}/mapping-team/?trusted=true`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n }\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n\nexport function updateMappingTeam(\n token: string,\n id: number,\n name: ?string,\n users: ?object\n) {\n return fetch(`${API_URL}/mapping-team/${id}`, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: token ? `Token ${token}` : ''\n },\n body: JSON.stringify({\n name,\n users\n })\n })\n .then(handleErrors)\n .then(res => {\n return res.json();\n });\n}\n","import React, { useEffect, useState } from 'react';\nimport { Link } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport { format } from 'date-fns';\nimport DatePicker from 'react-datepicker';\nimport 'react-datepicker/dist/react-datepicker.css';\n\nimport { Button } from '../button';\n\nconst NewTeam = props => {\n const [teamName, setTeamName] = useState('');\n const [teamUsers, setTeamUsers] = useState([{}]);\n const [editing, setEditing] = useState(props.editing || false);\n const [validationErrorMessage, setValidationErrorMessage] = useState('');\n\n useEffect(() => {\n if (props.activeTeam) {\n setTeamName(props.activeTeam.get('name'));\n let users = [];\n props.activeTeam.get('users').map(user =>\n users.push({\n username: user.get('username'),\n uid: user.get('uid'),\n joined: user.get('joined'),\n left: user.get('left')\n })\n );\n let cleanedUsers = [];\n users.forEach((user, k) => {\n let u = Object.fromEntries(\n Object.entries(user).filter(([_, v]) => v !== undefined)\n );\n cleanedUsers.push(u);\n });\n setTeamUsers([...cleanedUsers]);\n }\n }, [props.activeTeam]);\n\n const onClickRemoveUser = idx => {\n let teamUsersToUpdate = [...teamUsers];\n teamUsersToUpdate.splice(idx, 1);\n setTeamUsers(teamUsersToUpdate);\n };\n\n const onClickAddAnotherUser = () => setTeamUsers([...teamUsers, {}]);\n\n const onChangeInput = (property, value, idx) => {\n let teamUsersToUpdate = [...teamUsers];\n teamUsersToUpdate[idx] = { ...teamUsersToUpdate[idx], [property]: value };\n setTeamUsers(teamUsersToUpdate);\n };\n\n const validateData = () => {\n if (!teamName) {\n return { valid: false, error: 'Team name cannot be empty.' };\n }\n if (teamUsers) {\n try {\n if (\n teamUsers.filter(i => i.hasOwnProperty('username')).length ===\n teamUsers.length\n ) {\n return { valid: true };\n } else {\n return {\n valid: false,\n error: 'The username field should not be empty.'\n };\n }\n } catch (err) {\n return {\n valid: false,\n error: 'Verify if there is some wrong user information.'\n };\n }\n } else {\n return { valid: false, error: 'Users cannot be empty' };\n }\n };\n\n const onSave = e => {\n const validation = validateData();\n\n if (validation.valid) {\n if (props.activeTeam) {\n props.onChange(props.activeTeam.get('id'), teamName, teamUsers);\n setValidationErrorMessage('');\n } else {\n props.onCreate(teamName, teamUsers);\n setEditing(false);\n setValidationErrorMessage('');\n }\n } else {\n setValidationErrorMessage(validation.error);\n }\n };\n\n return (\n
          \n {editing ? (\n <>\n {props.activeTeam ? (\n <>\n ) : (\n

          Add a new mapping team

          \n )}\n <>\n \n Users\n {teamUsers.map((user, k) => (\n
          \n \n \n \n \n \n
          \n ))}\n \n\n

          \n The mapping team members are public and can be\n visualized by any logged in OSMCha user.\n

          \n\n {validationErrorMessage && (\n \n {validationErrorMessage}\n \n )}\n\n \n {props.userIsOwner && (\n \n )}\n {props.activeTeam ? (\n \n Back to teams\n \n ) : (\n setEditing(false)}\n >\n Cancel\n \n )}\n \n \n \n ) : (\n <>\n \n \n )}\n
          \n );\n};\n\nNewTeam.propTypes = {\n teamUsers: PropTypes.arrayOf(PropTypes.object),\n teamName: PropTypes.string,\n editing: PropTypes.bool,\n validationErrorMessage: PropTypes.string,\n onClickRemoveUser: PropTypes.func,\n onClickAddAnotherUser: PropTypes.func,\n onChangeInput: PropTypes.func,\n onSave: PropTypes.func,\n validateData: PropTypes.func\n};\n\nexport default NewTeam;\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map, List } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { cancelablePromise, isMobile } from '../utils';\nimport {\n createMappingTeam,\n fetchUserMappingTeams,\n deleteMappingTeam\n} from '../network/mapping_team';\nimport { Link } from 'react-router-dom';\nimport { withFetchDataSilent } from '../components/fetch_data_enhancer';\nimport { Button } from '../components/button';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport { BlockMarkup } from '../components/user/block_markup';\nimport type { RootStateType } from '../store';\n\nimport NewTeam from '../components/teams/new_team';\n\nexport type teamsOptionsType = Map<'label' | 'value', ?string>;\nexport type teamType = List;\nexport type teamsType = Map;\n\nconst TeamsBlock = ({ data, removeTeam, editTeam }) => (\n \n \n {data.get('name')}\n \n \n \n Filter team changesets\n \n \n Edit\n \n \n \n \n);\n\nconst ListFortified = ({\n onAdd,\n onRemove,\n data,\n TargetBlock,\n propsToPass,\n SaveComp\n}) => (\n
          \n {data.map((e, i) => (\n \n ))}\n {SaveComp}\n
          \n);\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any\n};\n\nclass MappingTeams extends React.PureComponent {\n createTeamPromise;\n state = {\n userValues: null,\n addingTeam: false\n };\n\n componentWillUnmount() {\n this.createTeamPromise && this.createTeamPromise.cancel();\n }\n\n createTeam = (name: string, users: object) => {\n if (name === '' || !name || !users) return;\n this.setState({ addingTeam: true });\n this.createTeamPromise = cancelablePromise(\n createMappingTeam(this.props.token, name, users)\n );\n this.createTeamPromise.promise\n .then(r => {\n this.props.modal({\n kind: 'success',\n title: 'Team Created ',\n description: `The team ${name} was created successfully!`\n });\n this.props.reloadData();\n this.setState({ addingTeam: false });\n })\n .catch(e => console.error(e));\n };\n\n removeTeam = (teamId: string) => {\n if (!teamId) return;\n deleteMappingTeam(this.props.token, teamId)\n .then(r => {\n this.props.modal({\n kind: 'success',\n title: 'Team Deleted ',\n description: `The team with id ${teamId} was deleted`\n });\n this.props.reloadData();\n })\n .catch(e => {\n this.props.reloadData();\n this.props.modal({\n kind: 'error',\n title: 'Deletion failed ',\n error: e\n });\n });\n };\n\n render() {\n const mobile = isMobile();\n\n return (\n \n \n
          \n
          \n {this.props.token && (\n
          \n
          \n

          \n My mapping teams\n

          \n \n }\n />\n
          \n
          \n )}\n
          \n
          \n \n );\n }\n}\n/**\n * Never use props not required by the Basecomponent in HOCs\n */\nMappingTeams = withFetchDataSilent(\n (props: propsType) => ({\n teams: cancelablePromise(\n fetchUserMappingTeams(props.token, props.userDetails.get('username'))\n )\n }),\n (nextProps: propsType, props: propsType) => true,\n MappingTeams\n);\n\nMappingTeams = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map())\n }),\n {\n modal,\n logUserOut,\n push\n }\n)(MappingTeams);\n\nexport { MappingTeams };\n","// @flow\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Map } from 'immutable';\nimport { push } from 'react-router-redux';\n\nimport { modal } from '../store/modal_actions';\nimport { logUserOut } from '../store/auth_actions';\nimport { cancelablePromise } from '../utils/promise';\nimport {\n fetchMappingTeam,\n updateMappingTeam,\n deleteMappingTeam\n} from '../network/mapping_team';\nimport { withFetchDataSilent } from '../components/fetch_data_enhancer';\nimport { SecondaryPagesHeader } from '../components/secondary_pages_header';\nimport { SignIn } from '../components/sign_in';\nimport type { RootStateType } from '../store';\nimport NewTeam from '../components/teams/new_team';\nimport { isMobile } from '../utils';\n\ntype propsType = {\n avatar: ?string,\n token: string,\n data: Map,\n location: Object,\n userDetails: Map,\n reloadData: () => any,\n logUserOut: () => any,\n push: any => any,\n modal: any => any\n};\nclass EditMappingTeam extends React.PureComponent {\n updateTeamPromise;\n state = {\n userValues: null\n };\n\n componentWillUnmount() {\n this.createTeamPromise && this.createTeamPromise.cancel();\n }\n\n editTeam = (id: string, name: string, users: object) => {\n if (name === '' || !name || !users) return;\n this.updateTeamPromise = cancelablePromise(\n updateMappingTeam(this.props.token, id, name, users)\n );\n this.updateTeamPromise.promise\n .then(r => {\n this.props.modal({\n kind: 'success',\n title: 'Team Updated ',\n description: `The team ${name} was updated successfully!`\n });\n this.props.reloadData();\n })\n .catch(e => {\n this.props.modal({\n kind: 'error',\n title: 'Update failed ',\n error: e\n });\n console.error(e);\n });\n };\n\n removeTeam = (teamId: string) => {\n if (!teamId) return;\n deleteMappingTeam(this.props.token, teamId)\n .then(r => {\n this.props.modal({\n kind: 'success',\n title: 'Team Deleted ',\n description: `The team with id ${teamId} was deleted`\n });\n this.props.reloadData();\n })\n .catch(e => {\n this.props.reloadData();\n this.props.modal({\n kind: 'error',\n title: 'Deletion failed ',\n error: e\n });\n });\n };\n\n render() {\n const mobile = isMobile();\n\n return (\n \n \n {this.props.token ? (\n
          \n
          \n
          \n
          \n

          \n Editing mapping team: \n {this.props.data.getIn(['team', 'name'])}\n

          \n \n
          \n
          \n
          \n
          \n ) : (\n \n )}\n \n );\n }\n}\n/**\n * Never use props not required by the Basecomponent in HOCs\n */\nEditMappingTeam = withFetchDataSilent(\n (props: propsType) => ({\n team: cancelablePromise(fetchMappingTeam(props.token, props.teamId))\n }),\n (nextProps: propsType, props: propsType) => true,\n EditMappingTeam\n);\n\nEditMappingTeam = connect(\n (state: RootStateType, props) => ({\n location: props.location,\n teamId: parseInt(props.match.params.id, 10),\n oAuthToken: state.auth.get('oAuthToken'),\n token: state.auth.get('token'),\n userDetails: state.auth.getIn(['userDetails'], Map())\n }),\n {\n modal,\n logUserOut,\n push\n }\n)(EditMappingTeam);\n\nexport { EditMappingTeam };\n","import React from 'react';\nimport { Route } from 'react-router-dom';\n\nimport { Changeset } from './views/changeset';\nimport { About } from './views/about';\nimport { Stats } from './views/stats';\nimport { Filters } from './views/filters';\nimport { ChangesetsList } from './views/changesets_list';\nimport { CMap } from './views/map';\nimport { NavbarChangeset } from './views/navbar_changeset';\nimport { NavbarSidebar } from './views/navbar_sidebar';\n// import { Home } from './views/home';\nimport { Modal } from './views/modal';\nimport { User } from './views/user';\nimport { SavedFilters } from './views/saved_filters';\nimport { TrustedUsers } from './views/trusted_users';\nimport { Watchlist } from './views/watchlist';\nimport { MappingTeams } from './views/teams';\nimport { EditMappingTeam } from './views/edit_team';\n\nexport const AppMobile = () => {\n return (\n <>\n
          \n \n \n \n }\n />\n \n \n \n \n \n \n \n \n \n \n
          \n \n \n );\n};\n","// @flow\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nimport { appVersion, isDev, isStaging, isLocal } from '../config';\nimport banner from '../assets/banner.png';\nimport work_flow from '../assets/work_flow.png';\n\nexport function Home() {\n return (\n
          \n
           
          \n
          \n \"OSMCHA\"\n \n
          \n
           
          \n
          \n
          \n v{appVersion}\n {isDev && ' Dev'}\n {isStaging && ' Staging'}\n {isLocal && ' Local'}\n
          \n
          \n \n \n \n {' '}\n Guide\n {' '}\n |{' '}\n \n \n \n {' '}\n GitHub\n {' '}\n |{' '}\n \n \n \n {' '}\n File an issue\n \n
          \n
          \n
           
          \n
          \n );\n}\n","import React from 'react';\nimport { Route } from 'react-router-dom';\nimport CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup';\n\nimport { Changeset } from './views/changeset';\nimport { About } from './views/about';\nimport { Stats } from './views/stats';\nimport { Filters } from './views/filters';\nimport { ChangesetsList } from './views/changesets_list';\nimport { CMap } from './views/map';\nimport { NavbarChangeset } from './views/navbar_changeset';\nimport { NavbarSidebar } from './views/navbar_sidebar';\nimport { Home } from './views/home';\nimport { Modal } from './views/modal';\nimport { User } from './views/user';\nimport { SavedFilters } from './views/saved_filters';\nimport { TrustedUsers } from './views/trusted_users';\nimport { Watchlist } from './views/watchlist';\nimport { MappingTeams } from './views/teams';\nimport { EditMappingTeam } from './views/edit_team';\n\nexport const AppDesktop = () => {\n return (\n <>\n
          \n
          \n \n \n
          \n
          \n (\n \n \n \n \n }\n />\n \n \n \n \n \n \n \n \n \n \n )}\n />\n
          \n
          \n \n \n );\n};\n","// @flow\nimport React, { Component } from 'react';\nimport { Map } from 'immutable';\n\nimport { isMobile } from './utils';\nimport { AppMobile } from './AppMobile';\nimport { AppDesktop } from './AppDesktop';\n\nimport { gaPageView } from './utils/analytics';\nimport { getSearchObj } from './utils/query_params';\n\nexport class App extends Component {\n resize = null;\n componentDidMount() {\n if (document && document.body) {\n var filters = getSearchObj(window.location.search).getIn(\n ['filters'],\n Map()\n );\n if (filters && filters.size > 0) {\n filters = filters\n .keySeq()\n .sort((a, b) => a.localeCompare(b))\n .join(',');\n gaPageView(`/?filters=${filters}`);\n } else {\n gaPageView('/');\n }\n }\n }\n render() {\n const mobile = isMobile();\n if (mobile) {\n return ;\n } else {\n return ;\n }\n }\n}\n","// @flow\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { ConnectedRouter } from 'react-router-redux';\nimport { Provider } from 'react-redux';\nimport ReactGA from 'react-ga';\nimport Raven from 'raven-js';\nimport { history } from './store/history';\nimport { store } from './store';\nimport { isDev, stack, appVersion } from './config';\nimport { unregisterServiceWorker } from './serviceworker';\n\nimport './assets/index.css';\nimport 'animate.css/animate.css';\nimport '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';\nimport 'react-select/dist/react-select.css';\n\nimport { App } from './app';\n\nReactGA.initialize('UA-100686765-1', {\n gaOptions: {\n anonymizeIp: true,\n screenResolution: `${window.screen.availWidth}X${window.screen.availHeight}`,\n appName: stack\n }\n});\n\nif (process.env.NODE_ENV === 'production') {\n Raven.config('https://5637ef87f5794e2fb9e1e5fe9119688d@sentry.io/175926', {\n release: appVersion,\n environment: process.env.NODE_ENV,\n debug: isDev\n }).install();\n}\n// if (process.env.NODE_ENV !== 'production') {\n// const { whyDidYouUpdate } = require('why-did-you-update');\n// whyDidYouUpdate(React);\n// }\nReactDOM.render(\n \n \n \n \n ,\n document.getElementById('root')\n);\nunregisterServiceWorker();\n","// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nexport function registerServiceWorker() {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh\" message in your web app.\n const r = window.confirm(\n 'New version of OSMCha is available. Would you like to reload?'\n );\n if (r) {\n window.location.reload();\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n });\n }\n}\n\nexport function unregisterServiceWorker() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","module.exports = __webpack_public_path__ + \"static/media/thumbs-up.13d765c5.svg\";","module.exports = __webpack_public_path__ + \"static/media/thumbs-down.7e04a82a.svg\";","module.exports = \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/AAAAF5jcHJ0AAABXAAAAAt3dHB0AAABaAAAABRia3B0AAABfAAAABRyWFlaAAABkAAAABRnWFlaAAABpAAAABRiWFlaAAABuAAAABRyVFJDAAABzAAAAEBnVFJDAAABzAAAAEBiVFJDAAABzAAAAEBkZXNjAAAAAAAAAANjMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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