{"version":3,"sources":["components/Sidebar.module.css","components/App.module.css","components/Map.module.css","store/initialState.js","data/emptyGeoJSON.js","utils/index.js","constants/index.js","reducers/layer-reducer.js","lib/api.js","actions/index.js","sagas/index.js","reducers/index.js","store/index.js","components/Map.js","components/Draw.js","components/Sidebar.js","components/App.js","index.js"],"names":["module","exports","layer","past","present","future","emptyGeoJSON","type","features","findIndexById","compose","findIndex","propEq","prop","concatById","arr1","arr2","localArr1","localArr2","keys","map","forEach","f","index","indexOf","id","GET_LAYER_HISTORY_FROM_API","UNDO_LAYER_TO_LOCAL_STORAGE","REDO_LAYER_TO_LOCAL_STORAGE","RESET_LAYER_TO_LOCAL_STORAGE","UPDATE_LAYER_TO_API","DELETE_FEATURES_FROM_LAYER_STORAGE","ADD_FEATURES_TO_LAYER_STORAGE","COMBINE_FEATURES_TO_LAYER_STORAGE","UNCOMBINE_FEATURES_TO_LAYER_STORAGE","L","lensProp","updateFeatures","state","action","concat","set","replaceFeatures","feature","deleteFeatures","withDeletedAt","removeFeatures","reject","includes","undoFeatures","length","newPresent","redoFeatures","newFuture","addFeatures","combineFeatures","deleteAction","deletedFeatures","addAction","createdFeatures","window","localforage","DRAW_KEY","emptyLayer","initialState","get","a","getItem","setItem","update","res","undefined","destroy","undo","redo","add","reset","removeItem","combine","getLayerHistoryFromApi","setLayerHistory","undoLayerToLocalStorage","undoLayer","redoLayerToLocalStorage","redoLayer","resetLayerToLocalStorage","resetLayer","updateLayerToApi","deleteFeaturesFromLayerStorage","addFeaturesToLayerStorage","combineFeaturesToLayerStorage","uncombineFeaturesToLayerStorage","uncombineFeatures","rootSaga","getLayerFromApi","makeGetRequest","makeUpdateRequest","makeDeleteRequest","makeUndoRequest","makeRedoRequest","addFeatureToLayerStorage","makeCreateRequest","makeResetRequest","combineFeatureToLayerStorage","makeCombineRequest","uncombineFeatureToLayerStorage","makeUncombineRequest","all","takeEvery","call","Api","put","combineReducers","sagaMiddleware","createSagaMiddleware","middleware","store","createStore","reducers","composeWithDevTools","applyMiddleware","run","saga","Map","props","useState","style","ReactMapboxGl","accessToken","process","className","classes","containerStyle","height","children","connect","dispatch","bindActionCreators","save","remove","uncombine","control","useRef","selectedFeatures","useEffect","Object","current","draw","getAll","deleteAll","noOp","ref","drawControl","onDrawCreate","properties","createdAt","Date","now","onDrawDelete","deletedAt","onDrawCombine","onDrawUncombine","onDrawUpdate","onDrawSelectionChange","event","updatedAt","onDrawActionable","onDrawModeChange","onDrawRender","Button","variant","size","onClick","confirm","App","ReactDOM","render","document","getElementById"],"mappings":"oFACAA,EAAOC,QAAU,CAAC,QAAU,yBAAyB,YAAY,6B,mBCAjED,EAAOC,QAAU,CAAC,IAAM,iBAAiB,WAAW,sBAAsB,aAAa,wBAAwB,WAAW,wB,mBCA1HD,EAAOC,QAAU,CAAC,IAAM,mB,6NCDT,GACbC,MAAO,CACLC,KAAM,GACNC,QAAS,GACTC,OAAQ,KCCGC,EALM,CACnBC,KAAM,oBACNC,SAAU,I,wGCCCC,EAAgBC,YAC3BC,IACAC,YAAO,MACPC,YAAK,OAIMC,EAAa,SAACC,EAAMC,GAE/B,IAAMC,EAAS,YAAOF,GAChBG,EAAS,YAAOF,GAGhBG,EAAOC,YAAIP,YAAK,MAAOI,GAS7B,OAPAC,EAAUG,SAAQ,SAAAC,GAChB,IAAMC,EAAQC,YAAQF,EAAEG,GAAIN,IACd,GAAVI,IACFN,EAAUM,GAASD,MAIhBL,GCzBIS,EAA6B,6BAG7BC,EAA8B,8BAE9BC,EAA8B,8BAE9BC,EAA+B,+BAI/BC,EAAsB,sBAGtBC,EAAqC,qCAGrCC,EAAgC,gCAGhCC,EAAoC,oCAGpCC,EAAsC,sC,yjBCPpC,IAuBTC,EAAI,CACR3B,SAAU4B,YAAS,aAGd,SAASC,EAAeC,EAAOC,GAAS,IACrCpC,EAA0BmC,EAA1BnC,KAAMC,EAAoBkC,EAApBlC,QAASC,EAAWiC,EAAXjC,OACvB,MAAO,CACLF,KAAMqC,YAAO,CAACpC,GAA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,SAAAC,GACzB,OAAOC,6BACL,CACEhE,KAAMQ,GACNP,KAAMS,GACNP,MAAOS,IAETmD,KAIWD,EA5BC,SAAAX,GAAU,IAChBnD,EAAsBmD,EAAtBnD,KAAMC,EAAgBkD,EAAhBlD,KAAME,EAAUgD,EAAVhD,MACpB,OACE,2BAAOsD,UAAWC,KAAO,SACvB,0CACA,+FACA,kKACA,kBAACsC,GAAA,EAAD,CAAQvC,UAAWC,KAAQ,aAAcuC,QAAQ,eAAeC,KAAK,KAAKC,QAASnG,GAAnF,QACA,kBAACgG,GAAA,EAAD,CAAQvC,UAAWC,KAAQ,aAAcuC,QAAQ,eAAeC,KAAK,KAAKC,QAASlG,GAAnF,QACA,kBAAC+F,GAAA,EAAD,CAAQvC,UAAWC,KAAQ,aAAcuC,QAAQ,eAAeC,KAAK,KAAKC,QAAS,kBAAMhH,OAAOiH,QAAQ,6CAA+CjG,IAAU,OAAjK,aCASkG,GAXH,WACV,OACE,yBAAK5C,UAAWC,KAAO,KACrB,kBAAC,GAAD,MACA,kBAAC,GAAD,KACE,kBAAC,GAAD,SCFR4C,IAASC,OACP,kBAAC,IAAD,CAAU5D,MAAOA,IACf,kBAAC,GAAD,OAEF6D,SAASC,eAAe,W","file":"static/js/main.552b7b09.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"Sidebar\":\"Sidebar_Sidebar__c0TTh\",\"margin-10\":\"Sidebar_margin-10__aP5WM\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"App\":\"App_App__2s_Fq\",\"App-logo\":\"App_App-logo__1OUG0\",\"App-header\":\"App_App-header__3TyHG\",\"App-link\":\"App_App-link__1zUGJ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"Map\":\"Map_Map__3pu-C\"};","export default {\n layer: {\n past: [],\n present: {},\n future: []\n }\n};\n","const emptyGeoJSON = {\n type: 'FeatureCollection',\n features: []\n}\n\nexport default emptyGeoJSON;","import { compose, findIndex, prop, propEq, map, indexOf } from 'ramda';\n\n// (Object, Array) => Integer\nexport const findIndexById = compose(\n findIndex,\n propEq('id'),\n prop('id')\n)\n\n// ([Object], [Object])\nexport const concatById = (arr1, arr2) => {\n // don't allow for side effects outside of function\n const localArr1 = [...arr1];\n const localArr2 = [...arr2];\n\n // get all ids from arr1\n const keys = map(prop('id'), localArr1);\n\n localArr2.forEach(f => {\n const index = indexOf(f.id, keys);\n if (index != -1) {\n localArr1[index] = f;\n }\n });\n\n return localArr1;\n}","export const GET_LAYER_HISTORY_FROM_API = \"GET_LAYER_HISTORY_FROM_API\";\nexport const SET_LAYER_HISTORY = \"SET_LAYER_HISTORY\";\n\nexport const UNDO_LAYER_TO_LOCAL_STORAGE = \"UNDO_LAYER_TO_LOCAL_STORAGE\";\nexport const UNDO_LAYER = \"UNDO_LAYER\";\nexport const REDO_LAYER_TO_LOCAL_STORAGE = \"REDO_LAYER_TO_LOCAL_STORAGE\";\nexport const REDO_LAYER = \"REDO_LAYER\";\nexport const RESET_LAYER_TO_LOCAL_STORAGE = \"RESET_LAYER_TO_LOCAL_STORAGE\";\nexport const RESET_LAYER = \"RESET_LAYER\";\n\n\nexport const UPDATE_LAYER_TO_API = \"UPDATE_LAYER_TO_API\";\nexport const UPDATE_FEATURES = \"UPDATE_FEATURES\";\n\nexport const DELETE_FEATURES_FROM_LAYER_STORAGE = \"DELETE_FEATURES_FROM_LAYER_STORAGE\";\nexport const DELETE_FEATURES = \"DELETE_FEATURES\";\n\nexport const ADD_FEATURES_TO_LAYER_STORAGE = \"ADD_FEATURES_TO_LAYER_STORAGE\";\nexport const ADD_FEATURES = \"ADD_FEATURES\";\n\nexport const COMBINE_FEATURES_TO_LAYER_STORAGE = \"COMBINE_FEATURES_TO_LAYER_STORAGE\";\nexport const COMBINE_FEATURES = \"COMBINE_FEATURES\";\n\nexport const UNCOMBINE_FEATURES_TO_LAYER_STORAGE = \"UNCOMBINE_FEATURES_TO_LAYER_STORAGE\";\nexport const UNCOMBINE_FEATURES = \"UNCOMBINE_FEATURES\"","import { concat, includes, lensProp, map, prop, reject, set } from 'ramda';\nimport { findIndexById, concatById } from '../utils';\nimport {\n SET_LAYER_HISTORY,\n UNDO_LAYER,\n REDO_LAYER,\n RESET_LAYER,\n UPDATE_FEATURES,\n DELETE_FEATURES,\n ADD_FEATURES,\n COMBINE_FEATURES,\n UNCOMBINE_FEATURES\n} from \"../constants\";\n\nimport initialState from '../store/initialState';\n\nexport default (state = initialState.layer, action) => {\n switch (action.type) {\n case SET_LAYER_HISTORY:\n return action.layer;\n case ADD_FEATURES:\n return addFeatures(state, action);\n case UPDATE_FEATURES:\n return updateFeatures(state, action);\n case DELETE_FEATURES:\n return deleteFeatures(state, action);\n case UNDO_LAYER:\n return undoFeatures(state);\n case REDO_LAYER:\n return redoFeatures(state);\n case RESET_LAYER:\n return action.layer;\n case COMBINE_FEATURES:\n case UNCOMBINE_FEATURES:\n return combineFeatures(state, action);\n }\n return state;\n};\n\nconst L = {\n features: lensProp('features')\n};\n\nexport function updateFeatures(state, action) {\n const { past, present, future } = state;\n return {\n past: concat([present], past),\n present: set(\n L.features,\n replaceFeatures(present.features, action.features),\n present\n ),\n future\n }\n}\n\n// @TODO: remove the unnecessary branching\nexport function replaceFeatures(arr1, arr2) {\n /* Don't manipulate present object */\n var localArr1 = [...arr1];\n for (let feature of arr2) {\n const index = findIndexById(feature)(localArr1);\n if (index > -1) {\n localArr1[index] = feature;\n }\n }\n\n return localArr1;\n}\n\nexport function deleteFeatures(state, action) {\n const { past, present, future } = state;\n\n const withDeletedAt = concatById(present.features, action.features);\n\n return {\n past: concat([{ ...present, features: withDeletedAt }], past),\n present: set(\n L.features,\n removeFeatures(present.features, action.features),\n present\n ),\n future\n }\n}\n\n// @IDEA: try placing these 2 arrays into List Containers\nexport function removeFeatures(arr1, arr2) {\n const keys = map(prop('id'), arr2);\n const predicate = f => includes(f.id, keys);\n return reject(predicate, arr1);\n}\n\nexport function undoFeatures(state) {\n const { past, present, future } = state;\n\n if (past.length == 0) return state;\n\n var [newPresent, ...newPast] = past;\n\n return {\n past: newPast,\n present: newPresent,\n future: concat([present], future)\n };\n}\n\nexport function redoFeatures(state) {\n const { past, present, future } = state;\n\n if (future.length == 0) return state;\n\n var [newPresent, ...newFuture] = future;\n\n return {\n past: concat([present], past),\n present: newPresent,\n future: newFuture\n };\n}\n\nexport function addFeatures(state, action) {\n const { past, present, future } = state;\n\n // prevent adding multiple empty GeoJSONs to the past\n const newPast = (present.features.length == 0 && past.length > 1) ? past : concat([present], past)\n\n return {\n past: newPast,\n present: set(\n L.features,\n concat(present.features, action.features),\n present\n ),\n future\n }\n}\n\nexport function combineFeatures(state, action) {\n // delete old\n const deleteAction = { ...action, features: action.deletedFeatures };\n // add new\n const addAction = { ...action, features: action.createdFeatures };\n return {\n ...addFeatures(deleteFeatures(state, deleteAction), addAction)\n };\n}\n","import localforage from \"localforage\";\n\nimport initialState from \"../store/initialState\";\nimport emptyGeoJSON from '../data/emptyGeoJSON';\nimport { updateFeatures, deleteFeatures, undoFeatures, redoFeatures, addFeatures, combineFeatures } from '../reducers/layer-reducer';\n\nwindow.localforage = localforage;\n\nconst DRAW_KEY = \"draw_layer\";\n\nconst emptyLayer = {\n layer: {\n ...initialState.layer,\n present: emptyGeoJSON\n }\n}\n\nconst get = async () => {\n const layer = await localforage.getItem(DRAW_KEY);\n return layer || emptyLayer;\n};\n\nconst set = async layer => {\n await localforage.setItem(DRAW_KEY, { layer });\n return layer;\n};\n\nconst update = async action => {\n const res = await get();\n if (typeof res == 'undefined') return undefined;\n const { layer } = res;\n\n await localforage.setItem(DRAW_KEY, { layer: updateFeatures(layer, action) })\n\n return layer;\n};\n\nconst destroy = async action => {\n const res = await get();\n if (typeof res == 'undefined') return undefined;\n const { layer } = res;\n\n await localforage.setItem(DRAW_KEY, { layer: deleteFeatures(layer, action) })\n\n return layer;\n};\n\nconst undo = async action => {\n const res = await get();\n if (typeof res == 'undefined') return undefined;\n const { layer } = res;\n\n await localforage.setItem(DRAW_KEY, { layer: undoFeatures(layer) })\n\n return layer;\n};\n\nconst redo = async action => {\n const res = await get();\n if (typeof res == 'undefined') return undefined;\n const { layer } = res;\n\n await localforage.setItem(DRAW_KEY, { layer: redoFeatures(layer) })\n\n return layer;\n};\n\nconst add = async action => {\n const res = await get();\n if (typeof res == 'undefined') return undefined;\n const { layer } = res;\n\n await localforage.setItem(DRAW_KEY, { layer: addFeatures(layer, action) })\n\n return layer;\n}\n\nconst reset = async () => {\n await localforage.removeItem(DRAW_KEY)\n const res = await get();\n\n if (typeof res == 'undefined') return undefined;\n const { layer } = res;\n\n return layer;\n};\n\n// is just a combination of destroy & add\nconst combine = async action => {\n const res = await get();\n if (typeof res == 'undefined') return undefined;\n const { layer } = res;\n await localforage.setItem(DRAW_KEY, { layer: combineFeatures(layer, action) });\n\n return layer;\n};\n\nexport default {\n get,\n set,\n update,\n destroy,\n undo,\n redo,\n add,\n reset,\n combine\n};\n","import {\n GET_LAYER_HISTORY_FROM_API,\n SET_LAYER_HISTORY,\n UNDO_LAYER,\n REDO_LAYER,\n RESET_LAYER,\n UPDATE_LAYER_TO_API,\n UPDATE_FEATURES,\n DELETE_FEATURES_FROM_LAYER_STORAGE,\n DELETE_FEATURES,\n UNDO_LAYER_TO_LOCAL_STORAGE,\n REDO_LAYER_TO_LOCAL_STORAGE,\n RESET_LAYER_TO_LOCAL_STORAGE,\n ADD_FEATURES_TO_LAYER_STORAGE,\n ADD_FEATURES,\n COMBINE_FEATURES_TO_LAYER_STORAGE,\n COMBINE_FEATURES,\n UNCOMBINE_FEATURES_TO_LAYER_STORAGE,\n UNCOMBINE_FEATURES\n} from \"../constants\";\n\nexport const getLayerHistoryFromApi = () => ({\n type: GET_LAYER_HISTORY_FROM_API\n});\nexport const setLayerHistory = layer => ({ type: SET_LAYER_HISTORY, layer });\n\nexport const undoLayerToLocalStorage = () => ({ type: UNDO_LAYER_TO_LOCAL_STORAGE })\nexport const undoLayer = () => ({ type: UNDO_LAYER });\nexport const redoLayerToLocalStorage = () => ({ type: REDO_LAYER_TO_LOCAL_STORAGE })\nexport const redoLayer = () => ({ type: REDO_LAYER });\nexport const resetLayerToLocalStorage = () => ({ type: RESET_LAYER_TO_LOCAL_STORAGE })\nexport const resetLayer = layer => ({ type: RESET_LAYER, layer });\n\nexport const updateLayerToApi = features => ({ type: UPDATE_LAYER_TO_API, features });\nexport const updateFeatures = features => ({ type: UPDATE_FEATURES, features });\n\nexport const deleteFeaturesFromLayerStorage = features => ({ type: DELETE_FEATURES_FROM_LAYER_STORAGE, features })\nexport const deleteFeatures = features => ({ type: DELETE_FEATURES, features })\n\nexport const addFeaturesToLayerStorage = features => ({ type: ADD_FEATURES_TO_LAYER_STORAGE, features })\nexport const addFeatures = features => ({ type: ADD_FEATURES, features })\n\nexport const combineFeaturesToLayerStorage = ({ deletedFeatures, createdFeatures }) => ({ type: COMBINE_FEATURES_TO_LAYER_STORAGE, deletedFeatures, createdFeatures })\nexport const combineFeatures = ({ deletedFeatures, createdFeatures }) => ({ type: COMBINE_FEATURES, deletedFeatures, createdFeatures })\n\nexport const uncombineFeaturesToLayerStorage = ({ deletedFeatures, createdFeatures }) => ({ type: UNCOMBINE_FEATURES_TO_LAYER_STORAGE, deletedFeatures, createdFeatures })\nexport const uncombineFeatures = ({ deletedFeatures, createdFeatures }) => ({ type: UNCOMBINE_FEATURES, deletedFeatures, createdFeatures })","import { all, call, put, takeEvery } from \"redux-saga/effects\";\n\nimport Api from \"../lib/api\";\n\nimport { setLayerHistory, updateFeatures, deleteFeatures, undoLayer, redoLayer, addFeatures, resetLayer, combineFeatures, uncombineFeatures } from \"../actions\";\nimport {\n GET_LAYER_HISTORY_FROM_API, UPDATE_LAYER_TO_API,\n DELETE_FEATURES_FROM_LAYER_STORAGE, UNDO_LAYER_TO_LOCAL_STORAGE,\n REDO_LAYER_TO_LOCAL_STORAGE,\n ADD_FEATURES_TO_LAYER_STORAGE,\n RESET_LAYER_TO_LOCAL_STORAGE,\n COMBINE_FEATURES_TO_LAYER_STORAGE,\n UNCOMBINE_FEATURES_TO_LAYER_STORAGE,\n} from \"../constants\";\n\nexport default function* rootSaga() {\n yield all([getLayerFromApi(), updateLayerToApi(), deleteFeaturesFromLayerStorage(), undoLayerToLocalStorage(), redoLayerToLocalStorage(), addFeatureToLayerStorage(), resetLayerToLocalStorage(), combineFeatureToLayerStorage(), uncombineFeatureToLayerStorage()]);\n}\n\nexport function* getLayerFromApi() {\n yield takeEvery(GET_LAYER_HISTORY_FROM_API, makeGetRequest);\n}\n\nexport function* makeGetRequest() {\n const { layer } = yield call(Api.get);\n yield put(setLayerHistory(layer));\n}\n\nexport function* updateLayerToApi() {\n yield takeEvery(UPDATE_LAYER_TO_API, makeUpdateRequest);\n}\n\nexport function* makeUpdateRequest(action) {\n yield call(Api.update, action);\n yield put(updateFeatures(action.features));\n}\n\nexport function* deleteFeaturesFromLayerStorage() {\n yield takeEvery(DELETE_FEATURES_FROM_LAYER_STORAGE, makeDeleteRequest);\n}\n\nexport function* makeDeleteRequest(action) {\n yield call(Api.destroy, action);\n yield put(deleteFeatures(action.features));\n}\n\nexport function* undoLayerToLocalStorage() {\n yield takeEvery(UNDO_LAYER_TO_LOCAL_STORAGE, makeUndoRequest);\n}\n\nexport function* makeUndoRequest() {\n yield call(Api.undo);\n yield put(undoLayer());\n}\n\nexport function* redoLayerToLocalStorage() {\n yield takeEvery(REDO_LAYER_TO_LOCAL_STORAGE, makeRedoRequest);\n}\n\nexport function* makeRedoRequest() {\n yield call(Api.redo);\n yield put(redoLayer());\n}\n\nexport function* addFeatureToLayerStorage() {\n yield takeEvery(ADD_FEATURES_TO_LAYER_STORAGE, makeCreateRequest);\n}\n\nexport function* makeCreateRequest(action) {\n yield call(Api.add, action);\n yield put(addFeatures(action.features));\n}\n\nexport function* resetLayerToLocalStorage() {\n yield takeEvery(RESET_LAYER_TO_LOCAL_STORAGE, makeResetRequest);\n}\n\nexport function* makeResetRequest() {\n const layer = yield call(Api.reset);\n\n yield put(resetLayer(layer));\n}\n\nexport function* combineFeatureToLayerStorage() {\n yield takeEvery(COMBINE_FEATURES_TO_LAYER_STORAGE, makeCombineRequest);\n}\n\nexport function* makeCombineRequest(action) {\n yield call(Api.combine, action);\n yield put(combineFeatures(action));\n}\n\nexport function* uncombineFeatureToLayerStorage() {\n yield takeEvery(UNCOMBINE_FEATURES_TO_LAYER_STORAGE, makeUncombineRequest);\n}\n\nexport function* makeUncombineRequest(action) {\n yield call(Api.combine, action);\n yield put(uncombineFeatures(action));\n}","import { combineReducers } from \"redux\";\n\nimport layer from \"./layer-reducer\";\n\nexport default combineReducers({\n layer\n});\n","import { applyMiddleware, createStore } from \"redux\";\nimport { composeWithDevTools } from \"redux-devtools-extension\";\n\nimport createSagaMiddleware from \"redux-saga\";\nimport saga from \"../sagas\";\n\nimport reducers from \"../reducers\";\nimport initialState from \"./initialState\";\n\nconst sagaMiddleware = createSagaMiddleware();\n\nconst middleware = [sagaMiddleware];\n\nconst store = createStore(\n reducers,\n initialState,\n composeWithDevTools(applyMiddleware(...middleware))\n);\n\n/* The saga begins! */\nsagaMiddleware.run(saga);\n\nexport default store;\n","import React, { useState } from \"react\";\nimport ReactMapboxGl from \"react-mapbox-gl\";\nimport PropTypes from \"prop-types\";\nimport classes from \"./Map.module.css\";\n\nconst Map = props => {\n const [style, setStyle] = useState(\"mapbox://styles/mapbox/dark-v9\");\n const { REACT_APP_MAPBOX_ACCESS_TOKEN: accessToken } = process.env;\n const Map = ReactMapboxGl({\n accessToken\n });\n\n return (\n