-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsrc_app_world_world_module_ts-es5.js.map
1 lines (1 loc) · 83.6 KB
/
src_app_world_world_module_ts-es5.js.map
1
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEA;AACAA;AACA,mDAAiDC,KAAjD,EAAwDA,GAAxD,EAAwD;AACxDC;;AACA;AAAA;AAAA;AACA;;AACA;AACA,SANA;;AAOA;AACA,OATA;;AAWA;AACA;AACA;;AAEA;AACA;AAAmBC;AAAnB,WAAgCC,0BAAhC,EAAgCC,cAAhC;AACA;;AAEA;AACAC;AAA+CC;AAA/C;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;;AACAJ;AACA;AACA;AACA;AACA;AACA;AACA;;AACAA;AACAK,gDADA;AAEAC,gDAFA;AAGAC,+CAHA;AAIAC,6CAJA;AAKAC,8CALA;AAMAC,gDANA;AAOAC,gDAPA;AAQAC,qCARA;AASAC,qCATA;AAUAC,+CAVA;AAWAC,iDAXA;AAYAC,iDAZA;AAaAC,mDAbA;AAcAC,oBAdA;AAeAC;AAfA;AAiBA;AACA;AACA;AACA;AACA;AACA;;AACAnB;AACAK,0BADA;AAEAC,0BAFA;AAGAC,6BAHA;AAIAC,uBAJA;AAKAC,wBALA;AAMAC,8BANA;AAOAC,8BAPA;AAQAC,mBARA;AASAC,mBATA;AAUAC,6BAVA;AAWAC,2BAXA;AAYAC,2BAZA;AAaAC,iCAbA;AAcAC,0CAdA;AAeAC;AAfA;AAiBA;AACA;AACA;AACA;AACA;AACA;;AACAnB;AACAoB,4BADA;AAEAf,4BAFA;AAGAC,4BAHA;AAIAE,4BAJA;AAKAC,gCALA;AAMAC,8BANA;AAOAC,8BAPA;AAQAC,mBARA;AASAC,mBATA;AAUAC,wBAVA;AAWAC,8BAXA;AAYAC,8BAZA;AAaAG;AAbA;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BE;AAAA;;AAC9B;AAAiBC;AAAjB;;AACA;AACAC;AACA;;AACA;AACAA;AACA;;AACAA;AACAA;AACA;AACA;;AACAvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AAAA;;AACA;AAAA;;AACA;AAAA;;AACA;AAAA;;AACA;AAAA;;AACA;AAAA;;AACA;AAAA;AAPA;AASA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AACAC,yBADA;AAEAE;AAFA;AAIA;AACA;;AACAxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AACA;AACK,WAFL,GAEKA,OAFL;AAGA;;AACArB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B,wDAAkDI,yBAAlD,EAA6EA,IAA7E,EAA6E;AAC7E;;AACA;AACA;AACA;;AACA,4BAAwBC,gCAAxB,EAA0DA,GAA1D,EAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;;AACA;AACAJ,2BADA;AAEAE;AAFA;AAIA;AACA;;AACAxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AACA;AACK,WAFL,GAEKA,OAFL;AAGA;;AACArB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AACA;AACA;;AACA;AACAC,8BADA;AAEAE;AAFA;AAIA;AACA;;AACAxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AACA;AACK,WAFL,GAEKA,OAFL;AAGA;;AACArB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AAAeC;AAAf;;AACA;AACAK;AACA;;AACA;AACAA;AACA;;AACAA;AACA;AACA;;AACA3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AACAC,mCADA;AAEAE;AAFA;AAIA;AACA;;AACAxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AACAC,8BADA;AAEAE;AAFA;AAIA;AACA;;AACAxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AACAC,gCADA;AAEAE;AAFA;AAIA;AACA;;AACAxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BqB;AAAA;;AAC9B;AACAC,sCADA;AAEAM;AAFA;AAIA;AACA;;AACA5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAAgC6B;AAAA;;AAChC;AACA;AACA;;AACA;AACA;AACA;;AACA7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA4B8B;AAAA;;AAC5B;;AACA;AACA;AACA;;AACA;AACA;;AACA9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA4B8B;AAAA;;AAC5B;;AACA;AACA;AACA;;AACA;AACA;;AACA9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;;AACA;AACA+B;AACA;;AACA;AACA;;AACA/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAAmCgC;AAAA;;AACnC;AAAgCC;AAAA;;AAChC;AACA;AACA;;AACA;AACA;;AACAjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAAmCgC;AAAA;;AACnC;AAAgCC;AAAA;;AAChC;AACA;AACA;;AACA;;AACA;AACA;AACA;;AACA;;AACA;AACA;AACA;;AACA;AACA;;AACAjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA;AACA;AACA;;AACAkC;AACA;AACA;AACA;AACK,WAJL;AAKA;;AACAlC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACAA,wCA9rBA,CA+rBA;;AACA;AACA;AACA;;AACAA;;AACA;AACA;AACA;;AACAA;;AACA;AACA;AACA;;AACAA;;AACA;AACA;AACA;;AACAA;;AACA;AACA;AACA;;AACAA;;AACA;AACA;AACA;;AACAA;;AACA;AACA;AACA;;AACAA;AACC,OA5tBD;AA8tBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACAmC,uBADA;AAEA,wBAFA;AAGAC,gCAHA;AAIAC,8BAJA;AAKAC,0BALA;AAMAC,+BANA;AAOAC,8BAPA;AAQAC,0BARA;AASAC,2BATA;AAUAC,wBAVA;AAWAC,yBAXA;AAYAC,0BAZA;AAaAC,4BAbA;AAcAC,8BAdA;AAeAC,+BAfA;AAgBAC,qCAhBA;AAiBAC,mCAjBA;AAkBAC,8BAlBA;AAmBAC,gCAnBA;AAoBAC,sCApBA;AAqBAC,yBArBA;AAsBAC,mCAtBA;AAuBAC,mCAvBA;AAwBAC,mCAxBA;AAyBAC,oCAzBA;AA0BAC,oCA1BA;AA2BAC,oCA3BA;AA4BAC,iCA5BA;AA6BAC,+BA7BA;AA8BAC,4BA9BA;AA+BAC,4BA/BA;AAgCAC,gCAhCA;AAiCAC,8BAjCA;AAkCAC,mCAlCA;AAmCAC,mCAnCA;AAoCAC,qCApCA;AAqCAC,qCArCA;AAsCAC,qCAtCA;AAuCAC,kCAvCA;AAwCAC;AAxCA;AA2CA;AAEA;AACAtE;AAA+CC;AAA/C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA;AACA;;AACAJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA,WAHA,CAIA;;;AACA;AACA;AACA;AACA;AACA,WAJA,MAKA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA,4DAAsDyB,cAAtD,EAAsEA,IAAtE,EAAsE;AACtE;;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;;AACAzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;;AACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA;AACA;AACA;;AACA;AACA;;AACAA;AACC,OAnND;AAqNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACAmC,uBADA;AAEA,0BAFA;AAGAC,kCAHA;AAIAsC,6BAJA;AAKAC,8BALA;AAMAC,mCANA;AAOAC,gCAPA;AAQAC,8BARA;AASAC,iCATA;AAUAC,4BAVA;AAWAC;AAXA;AAcA;AAEA;AACA9E;AAA+CC;AAA/C,WADA,CAIA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BiB;AAAA;;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,oDACA6D,iEADA;AAEA;AACA;;AACAlF;AACC,OAzCD;AA2CA;AAEA;AACAG;AAA+CC;AAA/C,WADA,CAIA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AAA8BiB;AAAA,WAD9B,CAEA;;;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDACA6D,uDADA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA;AACA;AACAC;AACA;AACA;;AACAnF;AACC,OA5DD;AA8DA;;AAEA;AACA;AACA;;AACA;AACA;AACA;;AACA;AACAwB;AACA;AACAF,yBADA;AAEAoB;AACApB,yBADA;AAEAE;AAFA,WAFA;AAMA4D;AANA;AAQA;;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;;AACA;AACA;;AACA;AACA;;AACA;AACA;;AACA;AACA;;AACA;AACA;;AACA;AACA;;AACA;AACA;;AACA;AACA;AAlBA,SADA,CAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,QACA;;;AACA;AACA;;AACA,sBAAgBtF,uBAAhB,EAAyCA,GAAzC,EAAyC;AACzCuF;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACAC;AACA,SARA,MASA;AACAA;AACA;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;AACA;AACAC;;AACA;AACAC;AACAC;AACA,aAHA,MAIA;AACAD;AACAE;AACA;AACA,WAVA,MAWA;AACAH;;AACA;AACAC;AACAG;AACA,aAHA,MAIA;AACAH;AACAI;AACA;AACA;;AACAC;AACAC;;AACA;AACA;AACAC;AACAF;AACAL;AACA;AACA;;AACA;AACA,OA/CA;AAgDA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;;AACA,gDAA4C1F,KAA5C,EAAmDA,GAAnD,EAAmD;AACnD;AACAkG;;AACA,6BAA2BH,SAA3B,EAAsCA,MAAtC,EAAsC;AACtC;;AACA;AACAN;;AACA;AACAE;AACA,eAFA,MAGA;AACAC;AACA;AACA,aARA,MASA;AACAH;;AACA;AACAI;AACA,eAFA,MAGA;AACAC;AACA;AACA;;AACAK;AACA;AACA;;AACA;AACA,OA9BA;AA+BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,uBADA;AAEAC,wBAFA;AAGAC;AAAiBF,4BAAjB;AAAiBC;AAAjB;AAHA;AAKA,OAXA;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCACAE,oBADA,EAEAA,oBAFA,EAGAA,oBAHA,EAIAA,qBAJA,EAKAA,qBALA,EAMAA,sBANA,EAOAA,qBAPA,EAQAA,qBARA;;AAUA;AACAC;AACAC;AACA;AACA;;AACA;AACA,OAxBA,EA0BA;;;AACA;AAAoBzE,mBAApB;AAAoB0E;AAApB;;A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D,GACCK;;;;4HAECD,qBAAkB;AAAAE;AAAAlN,oBAFnBiN,yDAEmB;AAAA;AAFP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCcXE;;;;;yBAAAA;AAAW;;;cAAXA;;;kBANF,CACPC,yDADO,EAEPC,+DAFO,EAGPC,qEAHO;;;;4HAMEH,cAAW;AAAAI,yBAbpBC,4DAaoB,EAZpBC,qEAYoB,EAXpBA,qEAWoB,EAVpBC,kEAUoB,EATpBC,gEASoB,EARpBC,0EAQoB;AARFV,oBAGlBE,yDAHkB,EAIlBC,+DAJkB,EAKlBC,qEALkB;AAQE;AAHF;;;;","names":["__assign","i","s","exports","fn","module","Object","value","centimeters","centimetres","degrees","feet","inches","kilometers","kilometres","meters","metres","miles","millimeters","millimetres","nauticalmiles","radians","yards","acres","options","type","feat","coordinates","_i","j","fc","geometries","precision","units","angle","originalUnit","finalUnit","bbox","__proto__","__moduleExports","earthRadius","factors","unitsFactors","areaFactors","feature","geometry","point","points","polygon","polygons","lineString","lineStrings","featureCollection","multiLineString","multiPoint","multiPolygon","geometryCollection","round","radiansToLength","lengthToRadians","lengthToDegrees","bearingToAzimuth","radiansToDegrees","degreesToRadians","convertLength","convertArea","isNumber","isObject","validateBBox","validateId","radians2degrees","degrees2radians","distanceToDegrees","distanceToRadians","radiansToDistance","bearingToAngle","convertDistance","getCoord","getCoords","containsNumber","geojsonType","featureOf","collectionOf","getGeom","getType","Math","bear","properties","BASE32_CODES_DICT","numberOfChars","mid","hash_value","minLon","maxLon","minLat","maxLat","bits","bitsTotal","chars","hashValue","isLon","latitude","longitude","error","encodeNeighbor","neighbor_lat","neighbor_lon","log","GeoFireQuery","opts","defaultOpts","rxjs__WEBPACK_IMPORTED_MODULE_0__","complete","rxjs__WEBPACK_IMPORTED_MODULE_2__","queries","pipe","radiusBuffer","console","map","distance","bearing","val","hitMetadata","sort","orderBy","field","startAt","geohash","endAt","end","id","_a","v","rxjs__WEBPACK_IMPORTED_MODULE_6__","unsubscribe","includeProps","features","toPromise","GeoFireClient","geopoint","_angular_core__WEBPACK_IMPORTED_MODULE_9__","location_r13","MapComponent","mapboxService","angularFirestore","store","activatedRoute","cacheService","notificationService","loadingService","geofirex__WEBPACK_IMPORTED_MODULE_2__","firebase_app__WEBPACK_IMPORTED_MODULE_3__","selectSnapshot","src_app_shared_auth_auth_state__WEBPACK_IMPORTED_MODULE_0__","startLoading","initialize","container","once","resizeMap","collection","valueChanges","idField","doc","uid","kingdom","geofirex","query","ref","within","position","max","power","subscribe","kingdoms","quests","shops","warning","forEach","addMarker","src_app_shared_type_common_type__WEBPACK_IMPORTED_MODULE_4__","snapshot","params","quest","shop","refreshMarkers","stopLoading","getStores","stores","getLocations","locations","getFactions","factions","filter","faction","addShopByClick","addQuestByClick","addKingdomByClick","populateMapByClick","terminalize","selectors","decls","vars","consts","template","ctx","state","auth","routes","path","component","_map_map_component__WEBPACK_IMPORTED_MODULE_0__","WorldRoutingModule","_angular_router__WEBPACK_IMPORTED_MODULE_2__","imports","WorldModule","_angular_common__WEBPACK_IMPORTED_MODULE_8__","_shared_shared_module__WEBPACK_IMPORTED_MODULE_2__","_world_routing_module__WEBPACK_IMPORTED_MODULE_0__","declarations","_map_map_component__WEBPACK_IMPORTED_MODULE_1__","_marker_marker_component__WEBPACK_IMPORTED_MODULE_3__","_popup_popup_component__WEBPACK_IMPORTED_MODULE_4__","_popup_deal_component__WEBPACK_IMPORTED_MODULE_6__","_popup_adventure_component__WEBPACK_IMPORTED_MODULE_5__"],"sources":["webpack:///node_modules/geofirex/dist/index.esm.js","webpack:///src/app/world/map/map.component.html","webpack:///src/app/world/map/map.component.ts","webpack:///src/app/world/world-routing.module.ts","webpack:///src/app/world/world.module.ts"],"sourcesContent":["import { Subject, Observable, combineLatest } from 'rxjs';\nimport { map, takeUntil, shareReplay, finalize, first } from 'rxjs/operators';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nfunction unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar helpers = createCommonjsModule(function (module, exports) {\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * @module helpers\n */\n/**\n * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.\n *\n * @memberof helpers\n * @type {number}\n */\nexports.earthRadius = 6371008.8;\n/**\n * Unit of measurement factors using a spherical (non-ellipsoid) earth radius.\n *\n * @memberof helpers\n * @type {Object}\n */\nexports.factors = {\n centimeters: exports.earthRadius * 100,\n centimetres: exports.earthRadius * 100,\n degrees: exports.earthRadius / 111325,\n feet: exports.earthRadius * 3.28084,\n inches: exports.earthRadius * 39.370,\n kilometers: exports.earthRadius / 1000,\n kilometres: exports.earthRadius / 1000,\n meters: exports.earthRadius,\n metres: exports.earthRadius,\n miles: exports.earthRadius / 1609.344,\n millimeters: exports.earthRadius * 1000,\n millimetres: exports.earthRadius * 1000,\n nauticalmiles: exports.earthRadius / 1852,\n radians: 1,\n yards: exports.earthRadius / 1.0936,\n};\n/**\n * Units of measurement factors based on 1 meter.\n *\n * @memberof helpers\n * @type {Object}\n */\nexports.unitsFactors = {\n centimeters: 100,\n centimetres: 100,\n degrees: 1 / 111325,\n feet: 3.28084,\n inches: 39.370,\n kilometers: 1 / 1000,\n kilometres: 1 / 1000,\n meters: 1,\n metres: 1,\n miles: 1 / 1609.344,\n millimeters: 1000,\n millimetres: 1000,\n nauticalmiles: 1 / 1852,\n radians: 1 / exports.earthRadius,\n yards: 1 / 1.0936,\n};\n/**\n * Area of measurement factors based on 1 square meter.\n *\n * @memberof helpers\n * @type {Object}\n */\nexports.areaFactors = {\n acres: 0.000247105,\n centimeters: 10000,\n centimetres: 10000,\n feet: 10.763910417,\n inches: 1550.003100006,\n kilometers: 0.000001,\n kilometres: 0.000001,\n meters: 1,\n metres: 1,\n miles: 3.86e-7,\n millimeters: 1000000,\n millimetres: 1000000,\n yards: 1.195990046,\n};\n/**\n * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.\n *\n * @name feature\n * @param {Geometry} geometry input geometry\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a GeoJSON Feature\n * @example\n * var geometry = {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 50]\n * };\n *\n * var feature = turf.feature(geometry);\n *\n * //=feature\n */\nfunction feature(geom, properties, options) {\n if (options === void 0) { options = {}; }\n var feat = { type: \"Feature\" };\n if (options.id === 0 || options.id) {\n feat.id = options.id;\n }\n if (options.bbox) {\n feat.bbox = options.bbox;\n }\n feat.properties = properties || {};\n feat.geometry = geom;\n return feat;\n}\nexports.feature = feature;\n/**\n * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates.\n * For GeometryCollection type use `helpers.geometryCollection`\n *\n * @name geometry\n * @param {string} type Geometry Type\n * @param {Array<any>} coordinates Coordinates\n * @param {Object} [options={}] Optional Parameters\n * @returns {Geometry} a GeoJSON Geometry\n * @example\n * var type = \"Point\";\n * var coordinates = [110, 50];\n * var geometry = turf.geometry(type, coordinates);\n * // => geometry\n */\nfunction geometry(type, coordinates, options) {\n switch (type) {\n case \"Point\": return point(coordinates).geometry;\n case \"LineString\": return lineString(coordinates).geometry;\n case \"Polygon\": return polygon(coordinates).geometry;\n case \"MultiPoint\": return multiPoint(coordinates).geometry;\n case \"MultiLineString\": return multiLineString(coordinates).geometry;\n case \"MultiPolygon\": return multiPolygon(coordinates).geometry;\n default: throw new Error(type + \" is invalid\");\n }\n}\nexports.geometry = geometry;\n/**\n * Creates a {@link Point} {@link Feature} from a Position.\n *\n * @name point\n * @param {Array<number>} coordinates longitude, latitude position (each in decimal degrees)\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<Point>} a Point feature\n * @example\n * var point = turf.point([-75.343, 39.984]);\n *\n * //=point\n */\nfunction point(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"Point\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\nexports.point = point;\n/**\n * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates.\n *\n * @name points\n * @param {Array<Array<number>>} coordinates an array of Points\n * @param {Object} [properties={}] Translate these properties to each Feature\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection<Point>} Point Feature\n * @example\n * var points = turf.points([\n * [-75, 39],\n * [-80, 45],\n * [-78, 50]\n * ]);\n *\n * //=points\n */\nfunction points(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return point(coords, properties);\n }), options);\n}\nexports.points = points;\n/**\n * Creates a {@link Polygon} {@link Feature} from an Array of LinearRings.\n *\n * @name polygon\n * @param {Array<Array<Array<number>>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<Polygon>} Polygon Feature\n * @example\n * var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' });\n *\n * //=polygon\n */\nfunction polygon(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {\n var ring = coordinates_1[_i];\n if (ring.length < 4) {\n throw new Error(\"Each LinearRing of a Polygon must have 4 or more Positions.\");\n }\n for (var j = 0; j < ring[ring.length - 1].length; j++) {\n // Check if first point of Polygon contains two numbers\n if (ring[ring.length - 1][j] !== ring[0][j]) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n }\n }\n var geom = {\n type: \"Polygon\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\nexports.polygon = polygon;\n/**\n * Creates a {@link Polygon} {@link FeatureCollection} from an Array of Polygon coordinates.\n *\n * @name polygons\n * @param {Array<Array<Array<Array<number>>>>} coordinates an array of Polygon coordinates\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection<Polygon>} Polygon FeatureCollection\n * @example\n * var polygons = turf.polygons([\n * [[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]],\n * [[[-15, 42], [-14, 46], [-12, 41], [-17, 44], [-15, 42]]],\n * ]);\n *\n * //=polygons\n */\nfunction polygons(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return polygon(coords, properties);\n }), options);\n}\nexports.polygons = polygons;\n/**\n * Creates a {@link LineString} {@link Feature} from an Array of Positions.\n *\n * @name lineString\n * @param {Array<Array<number>>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<LineString>} LineString Feature\n * @example\n * var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'});\n * var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]], {name: 'line 2'});\n *\n * //=linestring1\n * //=linestring2\n */\nfunction lineString(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be an array of two or more positions\");\n }\n var geom = {\n type: \"LineString\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\nexports.lineString = lineString;\n/**\n * Creates a {@link LineString} {@link FeatureCollection} from an Array of LineString coordinates.\n *\n * @name lineStrings\n * @param {Array<Array<Array<number>>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection<LineString>} LineString FeatureCollection\n * @example\n * var linestrings = turf.lineStrings([\n * [[-24, 63], [-23, 60], [-25, 65], [-20, 69]],\n * [[-14, 43], [-13, 40], [-15, 45], [-10, 49]]\n * ]);\n *\n * //=linestrings\n */\nfunction lineStrings(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return lineString(coords, properties);\n }), options);\n}\nexports.lineStrings = lineStrings;\n/**\n * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}.\n *\n * @name featureCollection\n * @param {Feature[]} features input features\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {FeatureCollection} FeatureCollection of Features\n * @example\n * var locationA = turf.point([-75.343, 39.984], {name: 'Location A'});\n * var locationB = turf.point([-75.833, 39.284], {name: 'Location B'});\n * var locationC = turf.point([-75.534, 39.123], {name: 'Location C'});\n *\n * var collection = turf.featureCollection([\n * locationA,\n * locationB,\n * locationC\n * ]);\n *\n * //=collection\n */\nfunction featureCollection(features, options) {\n if (options === void 0) { options = {}; }\n var fc = { type: \"FeatureCollection\" };\n if (options.id) {\n fc.id = options.id;\n }\n if (options.bbox) {\n fc.bbox = options.bbox;\n }\n fc.features = features;\n return fc;\n}\nexports.featureCollection = featureCollection;\n/**\n * Creates a {@link Feature<MultiLineString>} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiLineString\n * @param {Array<Array<Array<number>>>} coordinates an array of LineStrings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<MultiLineString>} a MultiLineString feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiLine = turf.multiLineString([[[0,0],[10,10]]]);\n *\n * //=multiLine\n */\nfunction multiLineString(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiLineString\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\nexports.multiLineString = multiLineString;\n/**\n * Creates a {@link Feature<MultiPoint>} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPoint\n * @param {Array<Array<number>>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<MultiPoint>} a MultiPoint feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPt = turf.multiPoint([[0,0],[10,10]]);\n *\n * //=multiPt\n */\nfunction multiPoint(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiPoint\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\nexports.multiPoint = multiPoint;\n/**\n * Creates a {@link Feature<MultiPolygon>} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPolygon\n * @param {Array<Array<Array<Array<number>>>>} coordinates an array of Polygons\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<MultiPolygon>} a multipolygon feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]);\n *\n * //=multiPoly\n *\n */\nfunction multiPolygon(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiPolygon\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\nexports.multiPolygon = multiPolygon;\n/**\n * Creates a {@link Feature<GeometryCollection>} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name geometryCollection\n * @param {Array<Geometry>} geometries an array of GeoJSON Geometries\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array<number>} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature<GeometryCollection>} a GeoJSON GeometryCollection Feature\n * @example\n * var pt = turf.geometry(\"Point\", [100, 0]);\n * var line = turf.geometry(\"LineString\", [[101, 0], [102, 1]]);\n * var collection = turf.geometryCollection([pt, line]);\n *\n * // => collection\n */\nfunction geometryCollection(geometries, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"GeometryCollection\",\n geometries: geometries,\n };\n return feature(geom, properties, options);\n}\nexports.geometryCollection = geometryCollection;\n/**\n * Round number to precision\n *\n * @param {number} num Number\n * @param {number} [precision=0] Precision\n * @returns {number} rounded number\n * @example\n * turf.round(120.4321)\n * //=120\n *\n * turf.round(120.4321, 2)\n * //=120.43\n */\nfunction round(num, precision) {\n if (precision === void 0) { precision = 0; }\n if (precision && !(precision >= 0)) {\n throw new Error(\"precision must be a positive number\");\n }\n var multiplier = Math.pow(10, precision || 0);\n return Math.round(num * multiplier) / multiplier;\n}\nexports.round = round;\n/**\n * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name radiansToLength\n * @param {number} radians in radians across the sphere\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, or kilometers inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} distance\n */\nfunction radiansToLength(radians, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = exports.factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return radians * factor;\n}\nexports.radiansToLength = radiansToLength;\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name lengthToRadians\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, or kilometers inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} radians\n */\nfunction lengthToRadians(distance, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = exports.factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return distance / factor;\n}\nexports.lengthToRadians = lengthToRadians;\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet\n *\n * @name lengthToDegrees\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, or kilometers inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} degrees\n */\nfunction lengthToDegrees(distance, units) {\n return radiansToDegrees(lengthToRadians(distance, units));\n}\nexports.lengthToDegrees = lengthToDegrees;\n/**\n * Converts any bearing angle from the north line direction (positive clockwise)\n * and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line\n *\n * @name bearingToAzimuth\n * @param {number} bearing angle, between -180 and +180 degrees\n * @returns {number} angle between 0 and 360 degrees\n */\nfunction bearingToAzimuth(bearing) {\n var angle = bearing % 360;\n if (angle < 0) {\n angle += 360;\n }\n return angle;\n}\nexports.bearingToAzimuth = bearingToAzimuth;\n/**\n * Converts an angle in radians to degrees\n *\n * @name radiansToDegrees\n * @param {number} radians angle in radians\n * @returns {number} degrees between 0 and 360 degrees\n */\nfunction radiansToDegrees(radians) {\n var degrees = radians % (2 * Math.PI);\n return degrees * 180 / Math.PI;\n}\nexports.radiansToDegrees = radiansToDegrees;\n/**\n * Converts an angle in degrees to radians\n *\n * @name degreesToRadians\n * @param {number} degrees angle between 0 and 360 degrees\n * @returns {number} angle in radians\n */\nfunction degreesToRadians(degrees) {\n var radians = degrees % 360;\n return radians * Math.PI / 180;\n}\nexports.degreesToRadians = degreesToRadians;\n/**\n * Converts a length to the requested unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @param {number} length to be converted\n * @param {Units} [originalUnit=\"kilometers\"] of the length\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted length\n */\nfunction convertLength(length, originalUnit, finalUnit) {\n if (originalUnit === void 0) { originalUnit = \"kilometers\"; }\n if (finalUnit === void 0) { finalUnit = \"kilometers\"; }\n if (!(length >= 0)) {\n throw new Error(\"length must be a positive number\");\n }\n return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);\n}\nexports.convertLength = convertLength;\n/**\n * Converts a area to the requested unit.\n * Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches\n * @param {number} area to be converted\n * @param {Units} [originalUnit=\"meters\"] of the distance\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted distance\n */\nfunction convertArea(area, originalUnit, finalUnit) {\n if (originalUnit === void 0) { originalUnit = \"meters\"; }\n if (finalUnit === void 0) { finalUnit = \"kilometers\"; }\n if (!(area >= 0)) {\n throw new Error(\"area must be a positive number\");\n }\n var startFactor = exports.areaFactors[originalUnit];\n if (!startFactor) {\n throw new Error(\"invalid original units\");\n }\n var finalFactor = exports.areaFactors[finalUnit];\n if (!finalFactor) {\n throw new Error(\"invalid final units\");\n }\n return (area / startFactor) * finalFactor;\n}\nexports.convertArea = convertArea;\n/**\n * isNumber\n *\n * @param {*} num Number to validate\n * @returns {boolean} true/false\n * @example\n * turf.isNumber(123)\n * //=true\n * turf.isNumber('foo')\n * //=false\n */\nfunction isNumber(num) {\n return !isNaN(num) && num !== null && !Array.isArray(num) && !/^\\s*$/.test(num);\n}\nexports.isNumber = isNumber;\n/**\n * isObject\n *\n * @param {*} input variable to validate\n * @returns {boolean} true/false\n * @example\n * turf.isObject({elevation: 10})\n * //=true\n * turf.isObject('foo')\n * //=false\n */\nfunction isObject(input) {\n return (!!input) && (input.constructor === Object);\n}\nexports.isObject = isObject;\n/**\n * Validate BBox\n *\n * @private\n * @param {Array<number>} bbox BBox to validate\n * @returns {void}\n * @throws Error if BBox is not valid\n * @example\n * validateBBox([-180, -40, 110, 50])\n * //=OK\n * validateBBox([-180, -40])\n * //=Error\n * validateBBox('Foo')\n * //=Error\n * validateBBox(5)\n * //=Error\n * validateBBox(null)\n * //=Error\n * validateBBox(undefined)\n * //=Error\n */\nfunction validateBBox(bbox) {\n if (!bbox) {\n throw new Error(\"bbox is required\");\n }\n if (!Array.isArray(bbox)) {\n throw new Error(\"bbox must be an Array\");\n }\n if (bbox.length !== 4 && bbox.length !== 6) {\n throw new Error(\"bbox must be an Array of 4 or 6 numbers\");\n }\n bbox.forEach(function (num) {\n if (!isNumber(num)) {\n throw new Error(\"bbox must only contain numbers\");\n }\n });\n}\nexports.validateBBox = validateBBox;\n/**\n * Validate Id\n *\n * @private\n * @param {string|number} id Id to validate\n * @returns {void}\n * @throws Error if Id is not valid\n * @example\n * validateId([-180, -40, 110, 50])\n * //=Error\n * validateId([-180, -40])\n * //=Error\n * validateId('Foo')\n * //=OK\n * validateId(5)\n * //=OK\n * validateId(null)\n * //=Error\n * validateId(undefined)\n * //=Error\n */\nfunction validateId(id) {\n if (!id) {\n throw new Error(\"id is required\");\n }\n if ([\"string\", \"number\"].indexOf(typeof id) === -1) {\n throw new Error(\"id must be a number or a string\");\n }\n}\nexports.validateId = validateId;\n// Deprecated methods\nfunction radians2degrees() {\n throw new Error(\"method has been renamed to `radiansToDegrees`\");\n}\nexports.radians2degrees = radians2degrees;\nfunction degrees2radians() {\n throw new Error(\"method has been renamed to `degreesToRadians`\");\n}\nexports.degrees2radians = degrees2radians;\nfunction distanceToDegrees() {\n throw new Error(\"method has been renamed to `lengthToDegrees`\");\n}\nexports.distanceToDegrees = distanceToDegrees;\nfunction distanceToRadians() {\n throw new Error(\"method has been renamed to `lengthToRadians`\");\n}\nexports.distanceToRadians = distanceToRadians;\nfunction radiansToDistance() {\n throw new Error(\"method has been renamed to `radiansToLength`\");\n}\nexports.radiansToDistance = radiansToDistance;\nfunction bearingToAngle() {\n throw new Error(\"method has been renamed to `bearingToAzimuth`\");\n}\nexports.bearingToAngle = bearingToAngle;\nfunction convertDistance() {\n throw new Error(\"method has been renamed to `convertLength`\");\n}\nexports.convertDistance = convertDistance;\n});\n\nvar index = unwrapExports(helpers);\nvar helpers_1 = helpers.earthRadius;\nvar helpers_2 = helpers.factors;\nvar helpers_3 = helpers.unitsFactors;\nvar helpers_4 = helpers.areaFactors;\nvar helpers_5 = helpers.feature;\nvar helpers_6 = helpers.geometry;\nvar helpers_7 = helpers.point;\nvar helpers_8 = helpers.points;\nvar helpers_9 = helpers.polygon;\nvar helpers_10 = helpers.polygons;\nvar helpers_11 = helpers.lineString;\nvar helpers_12 = helpers.lineStrings;\nvar helpers_13 = helpers.featureCollection;\nvar helpers_14 = helpers.multiLineString;\nvar helpers_15 = helpers.multiPoint;\nvar helpers_16 = helpers.multiPolygon;\nvar helpers_17 = helpers.geometryCollection;\nvar helpers_18 = helpers.round;\nvar helpers_19 = helpers.radiansToLength;\nvar helpers_20 = helpers.lengthToRadians;\nvar helpers_21 = helpers.lengthToDegrees;\nvar helpers_22 = helpers.bearingToAzimuth;\nvar helpers_23 = helpers.radiansToDegrees;\nvar helpers_24 = helpers.degreesToRadians;\nvar helpers_25 = helpers.convertLength;\nvar helpers_26 = helpers.convertArea;\nvar helpers_27 = helpers.isNumber;\nvar helpers_28 = helpers.isObject;\nvar helpers_29 = helpers.validateBBox;\nvar helpers_30 = helpers.validateId;\nvar helpers_31 = helpers.radians2degrees;\nvar helpers_32 = helpers.degrees2radians;\nvar helpers_33 = helpers.distanceToDegrees;\nvar helpers_34 = helpers.distanceToRadians;\nvar helpers_35 = helpers.radiansToDistance;\nvar helpers_36 = helpers.bearingToAngle;\nvar helpers_37 = helpers.convertDistance;\n\nvar helpers$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n 'default': index,\n __moduleExports: helpers,\n earthRadius: helpers_1,\n factors: helpers_2,\n unitsFactors: helpers_3,\n areaFactors: helpers_4,\n feature: helpers_5,\n geometry: helpers_6,\n point: helpers_7,\n points: helpers_8,\n polygon: helpers_9,\n polygons: helpers_10,\n lineString: helpers_11,\n lineStrings: helpers_12,\n featureCollection: helpers_13,\n multiLineString: helpers_14,\n multiPoint: helpers_15,\n multiPolygon: helpers_16,\n geometryCollection: helpers_17,\n round: helpers_18,\n radiansToLength: helpers_19,\n lengthToRadians: helpers_20,\n lengthToDegrees: helpers_21,\n bearingToAzimuth: helpers_22,\n radiansToDegrees: helpers_23,\n degreesToRadians: helpers_24,\n convertLength: helpers_25,\n convertArea: helpers_26,\n isNumber: helpers_27,\n isObject: helpers_28,\n validateBBox: helpers_29,\n validateId: helpers_30,\n radians2degrees: helpers_31,\n degrees2radians: helpers_32,\n distanceToDegrees: helpers_33,\n distanceToRadians: helpers_34,\n radiansToDistance: helpers_35,\n bearingToAngle: helpers_36,\n convertDistance: helpers_37\n});\n\nvar helpers_1$1 = ( helpers$1 && index ) || helpers$1;\n\nvar invariant = createCommonjsModule(function (module, exports) {\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n\r\n/**\r\n * Unwrap a coordinate from a Point Feature, Geometry or a single coordinate.\r\n *\r\n * @name getCoord\r\n * @param {Array<number>|Geometry<Point>|Feature<Point>} coord GeoJSON Point or an Array of numbers\r\n * @returns {Array<number>} coordinates\r\n * @example\r\n * var pt = turf.point([10, 10]);\r\n *\r\n * var coord = turf.getCoord(pt);\r\n * //= [10, 10]\r\n */\r\nfunction getCoord(coord) {\r\n if (!coord) {\r\n throw new Error(\"coord is required\");\r\n }\r\n if (!Array.isArray(coord)) {\r\n if (coord.type === \"Feature\" && coord.geometry !== null && coord.geometry.type === \"Point\") {\r\n return coord.geometry.coordinates;\r\n }\r\n if (coord.type === \"Point\") {\r\n return coord.coordinates;\r\n }\r\n }\r\n if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {\r\n return coord;\r\n }\r\n throw new Error(\"coord must be GeoJSON Point or an Array of numbers\");\r\n}\r\nexports.getCoord = getCoord;\r\n/**\r\n * Unwrap coordinates from a Feature, Geometry Object or an Array\r\n *\r\n * @name getCoords\r\n * @param {Array<any>|Geometry|Feature} coords Feature, Geometry Object or an Array\r\n * @returns {Array<any>} coordinates\r\n * @example\r\n * var poly = turf.polygon([[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]);\r\n *\r\n * var coords = turf.getCoords(poly);\r\n * //= [[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]\r\n */\r\nfunction getCoords(coords) {\r\n if (Array.isArray(coords)) {\r\n return coords;\r\n }\r\n // Feature\r\n if (coords.type === \"Feature\") {\r\n if (coords.geometry !== null) {\r\n return coords.geometry.coordinates;\r\n }\r\n }\r\n else {\r\n // Geometry\r\n if (coords.coordinates) {\r\n return coords.coordinates;\r\n }\r\n }\r\n throw new Error(\"coords must be GeoJSON Feature, Geometry Object or an Array\");\r\n}\r\nexports.getCoords = getCoords;\r\n/**\r\n * Checks if coordinates contains a number\r\n *\r\n * @name containsNumber\r\n * @param {Array<any>} coordinates GeoJSON Coordinates\r\n * @returns {boolean} true if Array contains a number\r\n */\r\nfunction containsNumber(coordinates) {\r\n if (coordinates.length > 1 && helpers_1$1.isNumber(coordinates[0]) && helpers_1$1.isNumber(coordinates[1])) {\r\n return true;\r\n }\r\n if (Array.isArray(coordinates[0]) && coordinates[0].length) {\r\n return containsNumber(coordinates[0]);\r\n }\r\n throw new Error(\"coordinates must only contain numbers\");\r\n}\r\nexports.containsNumber = containsNumber;\r\n/**\r\n * Enforce expectations about types of GeoJSON objects for Turf.\r\n *\r\n * @name geojsonType\r\n * @param {GeoJSON} value any GeoJSON object\r\n * @param {string} type expected GeoJSON type\r\n * @param {string} name name of calling function\r\n * @throws {Error} if value is not the expected type.\r\n */\r\nfunction geojsonType(value, type, name) {\r\n if (!type || !name) {\r\n throw new Error(\"type and name required\");\r\n }\r\n if (!value || value.type !== type) {\r\n throw new Error(\"Invalid input to \" + name + \": must be a \" + type + \", given \" + value.type);\r\n }\r\n}\r\nexports.geojsonType = geojsonType;\r\n/**\r\n * Enforce expectations about types of {@link Feature} inputs for Turf.\r\n * Internally this uses {@link geojsonType} to judge geometry types.\r\n *\r\n * @name featureOf\r\n * @param {Feature} feature a feature with an expected geometry type\r\n * @param {string} type expected GeoJSON type\r\n * @param {string} name name of calling function\r\n * @throws {Error} error if value is not the expected type.\r\n */\r\nfunction featureOf(feature, type, name) {\r\n if (!feature) {\r\n throw new Error(\"No feature passed\");\r\n }\r\n if (!name) {\r\n throw new Error(\".featureOf() requires a name\");\r\n }\r\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\r\n throw new Error(\"Invalid input to \" + name + \", Feature with geometry required\");\r\n }\r\n if (!feature.geometry || feature.geometry.type !== type) {\r\n throw new Error(\"Invalid input to \" + name + \": must be a \" + type + \", given \" + feature.geometry.type);\r\n }\r\n}\r\nexports.featureOf = featureOf;\r\n/**\r\n * Enforce expectations about types of {@link FeatureCollection} inputs for Turf.\r\n * Internally this uses {@link geojsonType} to judge geometry types.\r\n *\r\n * @name collectionOf\r\n * @param {FeatureCollection} featureCollection a FeatureCollection for which features will be judged\r\n * @param {string} type expected GeoJSON type\r\n * @param {string} name name of calling function\r\n * @throws {Error} if value is not the expected type.\r\n */\r\nfunction collectionOf(featureCollection, type, name) {\r\n if (!featureCollection) {\r\n throw new Error(\"No featureCollection passed\");\r\n }\r\n if (!name) {\r\n throw new Error(\".collectionOf() requires a name\");\r\n }\r\n if (!featureCollection || featureCollection.type !== \"FeatureCollection\") {\r\n throw new Error(\"Invalid input to \" + name + \", FeatureCollection required\");\r\n }\r\n for (var _i = 0, _a = featureCollection.features; _i < _a.length; _i++) {\r\n var feature = _a[_i];\r\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\r\n throw new Error(\"Invalid input to \" + name + \", Feature with geometry required\");\r\n }\r\n if (!feature.geometry || feature.geometry.type !== type) {\r\n throw new Error(\"Invalid input to \" + name + \": must be a \" + type + \", given \" + feature.geometry.type);\r\n }\r\n }\r\n}\r\nexports.collectionOf = collectionOf;\r\n/**\r\n * Get Geometry from Feature or Geometry Object\r\n *\r\n * @param {Feature|Geometry} geojson GeoJSON Feature or Geometry Object\r\n * @returns {Geometry|null} GeoJSON Geometry Object\r\n * @throws {Error} if geojson is not a Feature or Geometry Object\r\n * @example\r\n * var point = {\r\n * \"type\": \"Feature\",\r\n * \"properties\": {},\r\n * \"geometry\": {\r\n * \"type\": \"Point\",\r\n * \"coordinates\": [110, 40]\r\n * }\r\n * }\r\n * var geom = turf.getGeom(point)\r\n * //={\"type\": \"Point\", \"coordinates\": [110, 40]}\r\n */\r\nfunction getGeom(geojson) {\r\n if (geojson.type === \"Feature\") {\r\n return geojson.geometry;\r\n }\r\n return geojson;\r\n}\r\nexports.getGeom = getGeom;\r\n/**\r\n * Get GeoJSON object's type, Geometry type is prioritize.\r\n *\r\n * @param {GeoJSON} geojson GeoJSON object\r\n * @param {string} [name=\"geojson\"] name of the variable to display in error message\r\n * @returns {string} GeoJSON type\r\n * @example\r\n * var point = {\r\n * \"type\": \"Feature\",\r\n * \"properties\": {},\r\n * \"geometry\": {\r\n * \"type\": \"Point\",\r\n * \"coordinates\": [110, 40]\r\n * }\r\n * }\r\n * var geom = turf.getType(point)\r\n * //=\"Point\"\r\n */\r\nfunction getType(geojson, name) {\r\n if (geojson.type === \"FeatureCollection\") {\r\n return \"FeatureCollection\";\r\n }\r\n if (geojson.type === \"GeometryCollection\") {\r\n return \"GeometryCollection\";\r\n }\r\n if (geojson.type === \"Feature\" && geojson.geometry !== null) {\r\n return geojson.geometry.type;\r\n }\r\n return geojson.type;\r\n}\r\nexports.getType = getType;\n});\n\nvar index$1 = unwrapExports(invariant);\nvar invariant_1 = invariant.getCoord;\nvar invariant_2 = invariant.getCoords;\nvar invariant_3 = invariant.containsNumber;\nvar invariant_4 = invariant.geojsonType;\nvar invariant_5 = invariant.featureOf;\nvar invariant_6 = invariant.collectionOf;\nvar invariant_7 = invariant.getGeom;\nvar invariant_8 = invariant.getType;\n\nvar invariant$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n 'default': index$1,\n __moduleExports: invariant,\n getCoord: invariant_1,\n getCoords: invariant_2,\n containsNumber: invariant_3,\n geojsonType: invariant_4,\n featureOf: invariant_5,\n collectionOf: invariant_6,\n getGeom: invariant_7,\n getType: invariant_8\n});\n\nvar invariant_1$1 = ( invariant$1 && index$1 ) || invariant$1;\n\nvar C__Users_jeffd23_apps_geofirex_node_modules__turf_distance = createCommonjsModule(function (module, exports) {\nObject.defineProperty(exports, \"__esModule\", { value: true });\n\n\n//http://en.wikipedia.org/wiki/Haversine_formula\n//http://www.movable-type.co.uk/scripts/latlong.html\n/**\n * Calculates the distance between two {@link Point|points} in degrees, radians, miles, or kilometers.\n * This uses the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula) to account for global curvature.\n *\n * @name distance\n * @param {Coord} from origin point\n * @param {Coord} to destination point\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers\n * @returns {number} distance between the two points\n * @example\n * var from = turf.point([-75.343, 39.984]);\n * var to = turf.point([-75.534, 39.123]);\n * var options = {units: 'miles'};\n *\n * var distance = turf.distance(from, to, options);\n *\n * //addToMap\n * var addToMap = [from, to];\n * from.properties.distance = distance;\n * to.properties.distance = distance;\n */\nfunction distance(from, to, options) {\n if (options === void 0) { options = {}; }\n var coordinates1 = invariant_1$1.getCoord(from);\n var coordinates2 = invariant_1$1.getCoord(to);\n var dLat = helpers_1$1.degreesToRadians((coordinates2[1] - coordinates1[1]));\n var dLon = helpers_1$1.degreesToRadians((coordinates2[0] - coordinates1[0]));\n var lat1 = helpers_1$1.degreesToRadians(coordinates1[1]);\n var lat2 = helpers_1$1.degreesToRadians(coordinates2[1]);\n var a = Math.pow(Math.sin(dLat / 2), 2) +\n Math.pow(Math.sin(dLon / 2), 2) * Math.cos(lat1) * Math.cos(lat2);\n return helpers_1$1.radiansToLength(2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), options.units);\n}\nexports.default = distance;\n});\n\nvar turfDistance = unwrapExports(C__Users_jeffd23_apps_geofirex_node_modules__turf_distance);\n\nvar bearing_1 = createCommonjsModule(function (module, exports) {\nObject.defineProperty(exports, \"__esModule\", { value: true });\n\n\n// http://en.wikipedia.org/wiki/Haversine_formula\n// http://www.movable-type.co.uk/scripts/latlong.html\n/**\n * Takes two {@link Point|points} and finds the geographic bearing between them,\n * i.e. the angle measured in degrees from the north line (0 degrees)\n *\n * @name bearing\n * @param {Coord} start starting Point\n * @param {Coord} end ending Point\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.final=false] calculates the final bearing if true\n * @returns {number} bearing in decimal degrees, between -180 and 180 degrees (positive clockwise)\n * @example\n * var point1 = turf.point([-75.343, 39.984]);\n * var point2 = turf.point([-75.534, 39.123]);\n *\n * var bearing = turf.bearing(point1, point2);\n *\n * //addToMap\n * var addToMap = [point1, point2]\n * point1.properties['marker-color'] = '#f00'\n * point2.properties['marker-color'] = '#0f0'\n * point1.properties.bearing = bearing\n */\nfunction bearing(start, end, options) {\n if (options === void 0) { options = {}; }\n // Reverse calculation\n if (options.final === true) {\n return calculateFinalBearing(start, end);\n }\n var coordinates1 = invariant_1$1.getCoord(start);\n var coordinates2 = invariant_1$1.getCoord(end);\n var lon1 = helpers_1$1.degreesToRadians(coordinates1[0]);\n var lon2 = helpers_1$1.degreesToRadians(coordinates2[0]);\n var lat1 = helpers_1$1.degreesToRadians(coordinates1[1]);\n var lat2 = helpers_1$1.degreesToRadians(coordinates2[1]);\n var a = Math.sin(lon2 - lon1) * Math.cos(lat2);\n var b = Math.cos(lat1) * Math.sin(lat2) -\n Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1);\n return helpers_1$1.radiansToDegrees(Math.atan2(a, b));\n}\n/**\n * Calculates Final Bearing\n *\n * @private\n * @param {Coord} start starting Point\n * @param {Coord} end ending Point\n * @returns {number} bearing\n */\nfunction calculateFinalBearing(start, end) {\n // Swap start & end\n var bear = bearing(end, start);\n bear = (bear + 180) % 360;\n return bear;\n}\nexports.default = bearing;\n});\n\nvar turfBearing = unwrapExports(bearing_1);\n\nfunction distance(from, to) {\r\n return turfDistance(toGeoJSONFeature(from), toGeoJSONFeature(to));\r\n}\r\nfunction bearing(from, to) {\r\n return turfBearing(toGeoJSONFeature(from), toGeoJSONFeature(to));\r\n}\r\nfunction toGeoJSONFeature(coordinates, props) {\r\n coordinates = flip(coordinates);\r\n return {\r\n type: 'Feature',\r\n geometry: {\r\n type: 'Point',\r\n coordinates: coordinates\r\n },\r\n properties: props\r\n };\r\n}\r\nfunction flip(arr) {\r\n return [arr[1], arr[0]];\r\n}\r\nfunction setPrecsion(km) {\r\n switch (true) {\r\n case km <= 0.00477:\r\n return 9;\r\n case km <= 0.0382:\r\n return 8;\r\n case km <= 0.153:\r\n return 7;\r\n case km <= 1.22:\r\n return 6;\r\n case km <= 4.89:\r\n return 5;\r\n case km <= 39.1:\r\n return 4;\r\n case km <= 156:\r\n return 3;\r\n case km <= 1250:\r\n return 2;\r\n default:\r\n return 1;\r\n }\r\n // 1\t≤ 5,000km\t×\t5,000km\r\n // 2\t≤ 1,250km\t×\t625km\r\n // 3\t≤ 156km\t×\t156km\r\n // 4\t≤ 39.1km\t×\t19.5km\r\n // 5\t≤ 4.89km\t×\t4.89km\r\n // 6\t≤ 1.22km\t×\t0.61km\r\n // 7\t≤ 153m\t×\t153m\r\n // 8\t≤ 38.2m\t×\t19.1m\r\n // 9\t≤ 4.77m\t×\t4.77m\r\n}\r\n/////// NGEOHASH ////////\r\nvar BASE32_CODES = '0123456789bcdefghjkmnpqrstuvwxyz';\r\nvar BASE32_CODES_DICT = {};\r\nfor (var i = 0; i < BASE32_CODES.length; i++) {\r\n BASE32_CODES_DICT[BASE32_CODES.charAt(i)] = i;\r\n}\r\nvar ENCODE_AUTO = 'auto';\r\n/**\r\n * Significant Figure Hash Length\r\n *\r\n * This is a quick and dirty lookup to figure out how long our hash\r\n * should be in order to guarantee a certain amount of trailing\r\n * significant figures. This was calculated by determining the error:\r\n * 45/2^(n-1) where n is the number of bits for a latitude or\r\n * longitude. Key is # of desired sig figs, value is minimum length of\r\n * the geohash.\r\n * @type Array\r\n */\r\n// Desired sig figs: 0 1 2 3 4 5 6 7 8 9 10\r\nvar SIGFIG_HASH_LENGTH = [0, 5, 7, 8, 11, 12, 13, 15, 16, 17, 18];\r\n/**\r\n * Encode\r\n *\r\n * Create a Geohash out of a latitude and longitude that is\r\n * `numberOfChars` long.\r\n *\r\n * @param {Number|String} latitude\r\n * @param {Number|String} longitude\r\n * @param {Number} numberOfChars\r\n * @returns {String}\r\n */\r\nvar encode = function (latitude, longitude, numberOfChars) {\r\n if (numberOfChars === ENCODE_AUTO) {\r\n if (typeof latitude === 'number' || typeof longitude === 'number') {\r\n throw new Error('string notation required for auto precision.');\r\n }\r\n var decSigFigsLat = latitude.split('.')[1].length;\r\n var decSigFigsLong = longitude.split('.')[1].length;\r\n var numberOfSigFigs = Math.max(decSigFigsLat, decSigFigsLong);\r\n numberOfChars = SIGFIG_HASH_LENGTH[numberOfSigFigs];\r\n }\r\n else if (numberOfChars === undefined) {\r\n numberOfChars = 9;\r\n }\r\n var chars = [], bits = 0, bitsTotal = 0, hash_value = 0, maxLat = 90, minLat = -90, maxLon = 180, minLon = -180, mid;\r\n while (chars.length < numberOfChars) {\r\n if (bitsTotal % 2 === 0) {\r\n mid = (maxLon + minLon) / 2;\r\n if (longitude > mid) {\r\n hash_value = (hash_value << 1) + 1;\r\n minLon = mid;\r\n }\r\n else {\r\n hash_value = (hash_value << 1) + 0;\r\n maxLon = mid;\r\n }\r\n }\r\n else {\r\n mid = (maxLat + minLat) / 2;\r\n if (latitude > mid) {\r\n hash_value = (hash_value << 1) + 1;\r\n minLat = mid;\r\n }\r\n else {\r\n hash_value = (hash_value << 1) + 0;\r\n maxLat = mid;\r\n }\r\n }\r\n bits++;\r\n bitsTotal++;\r\n if (bits === 5) {\r\n var code = BASE32_CODES[hash_value];\r\n chars.push(code);\r\n bits = 0;\r\n hash_value = 0;\r\n }\r\n }\r\n return chars.join('');\r\n};\r\n/**\r\n * Decode Bounding Box\r\n *\r\n * Decode hashString into a bound box matches it. Data returned in a four-element array: [minlat, minlon, maxlat, maxlon]\r\n * @param {String} hash_string\r\n * @returns {Array}\r\n */\r\nvar decode_bbox = function (hash_string) {\r\n var isLon = true, maxLat = 90, minLat = -90, maxLon = 180, minLon = -180, mid;\r\n var hashValue = 0;\r\n for (var i = 0, l = hash_string.length; i < l; i++) {\r\n var code = hash_string[i].toLowerCase();\r\n hashValue = BASE32_CODES_DICT[code];\r\n for (var bits = 4; bits >= 0; bits--) {\r\n var bit = (hashValue >> bits) & 1;\r\n if (isLon) {\r\n mid = (maxLon + minLon) / 2;\r\n if (bit === 1) {\r\n minLon = mid;\r\n }\r\n else {\r\n maxLon = mid;\r\n }\r\n }\r\n else {\r\n mid = (maxLat + minLat) / 2;\r\n if (bit === 1) {\r\n minLat = mid;\r\n }\r\n else {\r\n maxLat = mid;\r\n }\r\n }\r\n isLon = !isLon;\r\n }\r\n }\r\n return [minLat, minLon, maxLat, maxLon];\r\n};\r\n/**\r\n * Decode\r\n *\r\n * Decode a hash string into pair of latitude and longitude. A javascript object is returned with keys `latitude`,\r\n * `longitude` and `error`.\r\n * @param {String} hashString\r\n * @returns {Object}\r\n */\r\nvar decode = function (hashString) {\r\n var bbox = decode_bbox(hashString);\r\n var lat = (bbox[0] + bbox[2]) / 2;\r\n var lon = (bbox[1] + bbox[3]) / 2;\r\n var latErr = bbox[2] - lat;\r\n var lonErr = bbox[3] - lon;\r\n return {\r\n latitude: lat,\r\n longitude: lon,\r\n error: { latitude: latErr, longitude: lonErr }\r\n };\r\n};\r\n/**\r\n * Neighbors\r\n *\r\n * Returns all neighbors' hashstrings clockwise from north around to northwest\r\n * 7 0 1\r\n * 6 x 2\r\n * 5 4 3\r\n * @param {String} hash_string\r\n * @returns {encoded neighborHashList|Array}\r\n */\r\nvar neighbors = function (hash_string) {\r\n var hashstringLength = hash_string.length;\r\n var lonlat = decode(hash_string);\r\n var lat = lonlat.latitude;\r\n var lon = lonlat.longitude;\r\n var latErr = lonlat.error.latitude * 2;\r\n var lonErr = lonlat.error.longitude * 2;\r\n var neighbor_lat, neighbor_lon;\r\n var neighborHashList = [\r\n encodeNeighbor(1, 0),\r\n encodeNeighbor(1, 1),\r\n encodeNeighbor(0, 1),\r\n encodeNeighbor(-1, 1),\r\n encodeNeighbor(-1, 0),\r\n encodeNeighbor(-1, -1),\r\n encodeNeighbor(0, -1),\r\n encodeNeighbor(1, -1)\r\n ];\r\n function encodeNeighbor(neighborLatDir, neighborLonDir) {\r\n neighbor_lat = lat + neighborLatDir * latErr;\r\n neighbor_lon = lon + neighborLonDir * lonErr;\r\n return encode(neighbor_lat, neighbor_lon, hashstringLength);\r\n }\r\n return neighborHashList;\r\n};\n\n// import { firestore } from './interfaces';\r\nvar defaultOpts = { units: 'km', log: false };\r\nvar GeoFireQuery = /** @class */ (function () {\r\n function GeoFireQuery(app, ref) {\r\n this.app = app;\r\n this.ref = ref;\r\n if (typeof ref === 'string') {\r\n this.ref = this.app.firestore().collection(ref);\r\n }\r\n }\r\n // GEO QUERIES\r\n /**\r\n * Queries the Firestore collection based on geograpic radius\r\n * @param {FirePoint} center the starting point for the query, i.e gfx.point(lat, lng)\r\n * @param {number} radius the radius to search from the centerpoint\r\n * @param {string} field the document field that contains the FirePoint data\r\n * @param {GeoQueryOptions} opts=defaultOpts\r\n * @returns {Observable<GeoQueryDocument>} sorted by nearest to farthest\r\n */\r\n GeoFireQuery.prototype.within = function (center, radius, field, opts) {\r\n var _this = this;\r\n opts = __assign(__assign({}, defaultOpts), opts);\r\n var tick = Date.now();\r\n var precision = setPrecsion(radius);\r\n var radiusBuffer = radius * 1.02; // buffer for edge distances\r\n var centerHash = center.geohash.substr(0, precision);\r\n var area = neighbors(centerHash).concat(centerHash);\r\n var _a = center.geopoint, centerLat = _a.latitude, centerLng = _a.longitude;\r\n // Used to cancel the individual geohash subscriptions\r\n var complete = new Subject();\r\n // Map geohash neighbors to individual queries\r\n var queries = area.map(function (hash) {\r\n var query = _this.queryPoint(hash, field);\r\n return createStream(query).pipe(snapToData(), takeUntil(complete));\r\n });\r\n // Combine all queries concurrently\r\n var combo = combineLatest.apply(void 0, queries).pipe(map(function (arr) {\r\n // Combine results into a single array\r\n var reduced = arr.reduce(function (acc, cur) { return acc.concat(cur); });\r\n // Filter by radius\r\n var filtered = reduced.filter(function (val) {\r\n var _a = val[field].geopoint, latitude = _a.latitude, longitude = _a.longitude;\r\n return (distance([centerLat, centerLng], [latitude, longitude]) <=\r\n radiusBuffer);\r\n });\r\n // Optional logging\r\n if (opts.log) {\r\n console.group('GeoFireX Query');\r\n console.log(\"\\uD83C\\uDF10 Center \" + [centerLat, centerLng] + \". Radius \" + radius);\r\n console.log(\"\\uD83D\\uDCCD Hits: \" + reduced.length);\r\n console.log(\"\\u231A Elapsed time: \" + (Date.now() - tick) + \"ms\");\r\n console.log(\"\\uD83D\\uDFE2 Within Radius: \" + filtered.length);\r\n console.groupEnd();\r\n }\r\n // Map and sort to final output\r\n return filtered\r\n .map(function (val) {\r\n var _a = val[field].geopoint, latitude = _a.latitude, longitude = _a.longitude;\r\n var hitMetadata = {\r\n distance: distance([centerLat, centerLng], [latitude, longitude]),\r\n bearing: bearing([centerLat, centerLng], [latitude, longitude])\r\n };\r\n return __assign(__assign({}, val), { hitMetadata: hitMetadata });\r\n })\r\n .sort(function (a, b) { return a.hitMetadata.distance - b.hitMetadata.distance; });\r\n }), shareReplay(1), finalize(function () {\r\n opts.log && console.log('✋ Query complete');\r\n complete.next(true);\r\n }));\r\n return combo;\r\n };\r\n GeoFireQuery.prototype.queryPoint = function (geohash, field) {\r\n var end = geohash + '~';\r\n return this.ref\r\n .orderBy(field + \".geohash\")\r\n .startAt(geohash)\r\n .endAt(end);\r\n };\r\n return GeoFireQuery;\r\n}());\r\nfunction snapToData(id) {\r\n if (id === void 0) { id = 'id'; }\r\n return map(function (querySnapshot) {\r\n return querySnapshot.docs.map(function (v) {\r\n var _a;\r\n return __assign(__assign({}, (id ? (_a = {}, _a[id] = v.id, _a) : null)), v.data());\r\n });\r\n });\r\n}\r\n/**\r\ninternal, do not use. Converts callback to Observable.\r\n */\r\nfunction createStream(input) {\r\n return new Observable(function (observer) {\r\n var unsubscribe = input.onSnapshot(function (val) { return observer.next(val); }, function (err) { return observer.error(err); });\r\n return { unsubscribe: unsubscribe };\r\n });\r\n}\r\n/**\r\n * RxJS operator that converts a collection to a GeoJSON FeatureCollection\r\n * @param {string} field the document field that contains the FirePoint\r\n * @param {boolean=false} includeProps\r\n */\r\nfunction toGeoJSON(field, includeProps) {\r\n if (includeProps === void 0) { includeProps = false; }\r\n return map(function (data) {\r\n return {\r\n type: 'FeatureCollection',\r\n features: data.map(function (v) {\r\n return toGeoJSONFeature([v[field].geopoint.latitude, v[field].geopoint.longitude], includeProps ? __assign({}, v) : {});\r\n })\r\n };\r\n });\r\n}\r\n/**\r\n * Helper function to convert any query from an RxJS Observable to a Promise\r\n * Example usage: await get( collection.within(a, b, c) )\r\n * @param {Observable<any>} observable\r\n * @returns {Promise<any>}\r\n */\r\nfunction get(observable) {\r\n return observable.pipe(first()).toPromise();\r\n}\n\nvar GeoFireClient = /** @class */ (function () {\r\n function GeoFireClient(app) {\r\n this.app = app;\r\n }\r\n /**\r\n * Creates reference to a Firestore collection that can be used to make geoqueries\r\n * @param {firestore.CollectionReference | firestore.Query | string} ref path to collection\r\n * @returns {GeoFireQuery}\r\n */\r\n GeoFireClient.prototype.query = function (ref) {\r\n return new GeoFireQuery(this.app, ref);\r\n };\r\n /**\r\n * Creates an object with a geohash. Save it to a field in Firestore to make geoqueries.\r\n * @param {number} latitude\r\n * @param {number} longitude\r\n * @returns FirePoint\r\n */\r\n GeoFireClient.prototype.point = function (latitude, longitude) {\r\n return {\r\n geopoint: new this.app.firestore.GeoPoint(latitude, longitude),\r\n geohash: encode(latitude, longitude, 9)\r\n };\r\n };\r\n /**\r\n * Haversine distance between points\r\n * @param {FirePoint} from\r\n * @param {FirePoint} to\r\n * @returns number\r\n */\r\n GeoFireClient.prototype.distance = function (from, to) {\r\n return distance([from.geopoint.latitude, from.geopoint.longitude], [to.geopoint.latitude, to.geopoint.longitude]);\r\n };\r\n /**\r\n * Haversine bearing between points\r\n * @param {FirePoint} from\r\n * @param {FirePoint} to\r\n * @returns number\r\n */\r\n GeoFireClient.prototype.bearing = function (from, to) {\r\n return bearing([from.geopoint.latitude, from.geopoint.longitude], [to.geopoint.latitude, to.geopoint.longitude]);\r\n };\r\n return GeoFireClient;\r\n}());\r\n/**\r\n * Initialize the library by passing it your Firebase app\r\n * @param {firestore.FirebaseApp} app\r\n * @returns GeoFireClient\r\n */\r\nfunction init(app) {\r\n return new GeoFireClient(app);\r\n}\n\nexport { GeoFireClient, GeoFireQuery, get, init, toGeoJSON };\n","<div id=\"map\" class=\"map-container\"></div>\r\n\r\n<div class=\"map-admin\">\r\n <button mat-mini-fab color=\"primary\" [matMenuTriggerFor]=\"adminMenu\"><mat-icon>security</mat-icon></button>\r\n\r\n <mat-menu #adminMenu=\"matMenu\">\r\n <button mat-menu-item [matMenuTriggerFor]=\"kingdomMenu\"><mat-icon>person</mat-icon>Bot</button>\r\n <button mat-menu-item [matMenuTriggerFor]=\"shopMenu\"><mat-icon>attach_money</mat-icon>Tienda</button>\r\n <button mat-menu-item [matMenuTriggerFor]=\"questMenu\"><mat-icon>search</mat-icon>Lugar</button>\r\n <button mat-menu-item (click)=\"populateMap()\"><mat-icon>map</mat-icon>Mapa</button>\r\n </mat-menu>\r\n\r\n <mat-menu #kingdomMenu=\"matMenu\">\r\n <button mat-menu-item *ngFor=\"let faction of factions\" (click)=\"addKingdom(faction.id)\" class=\"map-admin-button\"><img [src]=\"faction.marker\" [alt]=\"faction.name | translate\">{{ faction.name | translate }}</button>\r\n </mat-menu>\r\n\r\n <mat-menu #shopMenu=\"matMenu\">\r\n <button mat-menu-item *ngFor=\"let store of stores\" (click)=\"addShop(store.id)\" class=\"map-admin-button\"><img [src]=\"store.image\" [alt]=\"store.name | translate\">{{ store.name | translate }}</button>\r\n </mat-menu>\r\n\r\n <mat-menu #questMenu=\"matMenu\">\r\n <button mat-menu-item *ngFor=\"let location of locations\" (click)=\"addQuest(location.id)\" class=\"map-admin-button\"><img [src]=\"location.image | translate\" [alt]=\"location.name\">{{ location.name | translate }}</button>\r\n </mat-menu>\r\n</div>\r\n","import { Component, OnInit, OnDestroy } from '@angular/core';\r\nimport { MapboxService } from 'src/app/services/mapbox.service';\r\nimport { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';\r\nimport { AuthState } from 'src/app/shared/auth/auth.state';\r\nimport { Store, Select } from '@ngxs/store';\r\nimport { AngularFirestore } from '@angular/fire/firestore';\r\nimport * as geofirex from 'geofirex';\r\nimport * as firebase from 'firebase/app';\r\nimport { Observable, combineLatest } from 'rxjs';\r\nimport { switchMap } from 'rxjs/operators';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { CacheService } from 'src/app/services/cache.service';\r\nimport { NotificationService } from 'src/app/services/notification.service';\r\nimport { MarkerType, LocationType, StoreType, FactionType } from 'src/app/shared/type/common.type';\r\nimport { GeoFireClient } from 'geofirex';\r\nimport { LoadingService } from 'src/app/services/loading.service';\r\n\r\n@UntilDestroy()\r\n@Component({\r\n selector: 'app-map',\r\n templateUrl: './map.component.html',\r\n styleUrls: ['./map.component.scss'],\r\n})\r\nexport class MapComponent implements OnInit, OnDestroy {\r\n\r\n geofirex: GeoFireClient = geofirex.init(firebase);\r\n uid: string = this.store.selectSnapshot(AuthState.getUserUID);\r\n container = 'map';\r\n locations: any[] = [];\r\n stores: any[] = [];\r\n factions: any[] = [];\r\n @Select((state: any) => state.auth.kingdom) kingdom$: Observable<any>;\r\n\r\n constructor(\r\n public mapboxService: MapboxService,\r\n private angularFirestore: AngularFirestore,\r\n private store: Store,\r\n private activatedRoute: ActivatedRoute,\r\n private cacheService: CacheService,\r\n private notificationService: NotificationService,\r\n private loadingService: LoadingService,\r\n ) {\r\n this.loadingService.startLoading();\r\n }\r\n\r\n async ngOnInit(): Promise<void> {\r\n this.mapboxService.initialize(this.container);\r\n this.mapboxService.map.once('load', async () => {\r\n // resize map in case drawer has changed\r\n this.mapboxService.resizeMap();\r\n // print icons surrounding kingdom\r\n combineLatest([\r\n this.angularFirestore.collection<any>('kingdoms').valueChanges({ idField: 'fid' }),\r\n this.angularFirestore.doc<any>(`kingdoms/${this.uid}`).valueChanges()\r\n .pipe(switchMap((kingdom: any) => this.geofirex.query(this.angularFirestore.collection<any>('quests').ref).within(kingdom.position, Math.max(1000, kingdom.power) / 1000, 'position'))),\r\n this.angularFirestore.doc<any>(`kingdoms/${this.uid}`).valueChanges()\r\n .pipe(switchMap((kingdom: any) => this.geofirex.query(this.angularFirestore.collection<any>('shops').ref).within(kingdom.position, Math.max(1000, kingdom.power) / 1000, 'position'))),\r\n ])\r\n .pipe(untilDestroyed(this))\r\n .subscribe(([kingdoms, quests, shops]) => {\r\n this.notificationService.warning('world.map.update');\r\n // this.mapboxService.clearMarkers();\r\n kingdoms.forEach((kingdom: any) => {\r\n this.mapboxService.addMarker(kingdom, MarkerType.KINGDOM, kingdom.id === this.uid,\r\n this.activatedRoute.snapshot.params.kingdom\r\n ? this.activatedRoute.snapshot.params.kingdom === kingdom.id\r\n : false,\r\n );\r\n });\r\n quests.forEach((quest: any) => this.mapboxService.addMarker(quest, MarkerType.QUEST, false, false));\r\n shops.forEach((shop: any) => this.mapboxService.addMarker(shop, MarkerType.SHOP, false, false));\r\n this.mapboxService.refreshMarkers();\r\n });\r\n this.loadingService.stopLoading();\r\n });\r\n // menus\r\n this.stores = await this.cacheService.getStores();\r\n this.locations = await this.cacheService.getLocations();\r\n this.factions = (await this.cacheService.getFactions()).filter((faction: any) => faction.id !== 'grey');\r\n }\r\n\r\n addShop(type: StoreType): void {\r\n this.notificationService.warning('world.map.add');\r\n this.mapboxService.addShopByClick(type);\r\n }\r\n\r\n addQuest(type: LocationType): void {\r\n this.notificationService.warning('world.map.add');\r\n this.mapboxService.addQuestByClick(type);\r\n }\r\n\r\n addKingdom(type: FactionType): void {\r\n this.notificationService.warning('world.map.add');\r\n this.mapboxService.addKingdomByClick(type);\r\n }\r\n\r\n populateMap(): void {\r\n this.notificationService.warning('world.map.add');\r\n this.mapboxService.populateMapByClick();\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.mapboxService.terminalize();\r\n }\r\n\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { Routes, RouterModule } from '@angular/router';\r\nimport { MapComponent } from './map/map.component';\r\n\r\nconst routes: Routes = [\r\n { path: 'map/:kingdom', component: MapComponent },\r\n { path: 'map', component: MapComponent },\r\n];\r\n\r\n@NgModule({\r\n imports: [RouterModule.forChild(routes)],\r\n exports: [RouterModule],\r\n})\r\nexport class WorldRoutingModule { }\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { WorldRoutingModule } from './world-routing.module';\r\nimport { MapComponent } from './map/map.component';\r\nimport { SharedModule } from '../shared/shared.module';\r\nimport { MarkerComponent } from './marker/marker.component';\r\nimport { PopupComponent } from './popup/popup.component';\r\nimport { AdventureComponent } from './popup/adventure.component';\r\nimport { DealComponent } from './popup/deal.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n MapComponent,\r\n MarkerComponent,\r\n MarkerComponent,\r\n PopupComponent,\r\n DealComponent,\r\n AdventureComponent,\r\n ],\r\n imports: [\r\n CommonModule,\r\n SharedModule,\r\n WorldRoutingModule,\r\n ],\r\n})\r\nexport class WorldModule { }\r\n"]}