@blaze-cms/plugin-google-maps-fe 0.146.0-tooltips.5 → 0.146.0-tooltips.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/lib/GoogleMaps/GoogleMaps.js +6 -6
  3. package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
  4. package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
  5. package/lib/GoogleMaps/GoogleMapsHtml.js.map +1 -1
  6. package/lib/GoogleMaps/GoogleMapsRender.js.map +1 -1
  7. package/lib/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
  8. package/lib/GoogleMaps/helpers/build-map-shapes.js +4 -4
  9. package/lib/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
  10. package/lib/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
  11. package/lib/GoogleMaps/helpers/build-query.js +2 -2
  12. package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
  13. package/lib/GoogleMaps/helpers/build-shapes-configs.js +9 -9
  14. package/lib/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
  15. package/lib/GoogleMaps/helpers/get-center-coordinates.js +1 -1
  16. package/lib/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
  17. package/lib/GoogleMaps/helpers/get-image-ids.js +2 -2
  18. package/lib/GoogleMaps/helpers/get-image-ids.js.map +1 -1
  19. package/lib/GoogleMaps/helpers/get-path.js.map +1 -1
  20. package/lib/GoogleMaps/helpers/index.js.map +1 -1
  21. package/lib/GoogleMaps/helpers/set-map-options.js.map +1 -1
  22. package/lib/GoogleMaps/helpers/set-shapes.js +10 -10
  23. package/lib/GoogleMaps/helpers/set-shapes.js.map +1 -1
  24. package/lib/GoogleMaps/hooks/index.js.map +1 -1
  25. package/lib/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
  26. package/lib/GoogleMaps/hooks/use-get-images.js.map +1 -1
  27. package/lib/GoogleMaps/index.js.map +1 -1
  28. package/lib/GoogleMaps/queries.js.map +1 -1
  29. package/lib/constants.js.map +1 -1
  30. package/lib/index.js +3 -3
  31. package/lib/index.js.map +1 -1
  32. package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
  33. package/lib-es/GoogleMaps/GoogleMapsFactory.js.map +1 -1
  34. package/lib-es/GoogleMaps/GoogleMapsHtml.js.map +1 -1
  35. package/lib-es/GoogleMaps/GoogleMapsRender.js.map +1 -1
  36. package/lib-es/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
  37. package/lib-es/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
  38. package/lib-es/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
  39. package/lib-es/GoogleMaps/helpers/build-query.js.map +1 -1
  40. package/lib-es/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
  41. package/lib-es/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
  42. package/lib-es/GoogleMaps/helpers/get-image-ids.js.map +1 -1
  43. package/lib-es/GoogleMaps/helpers/get-path.js.map +1 -1
  44. package/lib-es/GoogleMaps/helpers/index.js.map +1 -1
  45. package/lib-es/GoogleMaps/helpers/set-map-options.js.map +1 -1
  46. package/lib-es/GoogleMaps/helpers/set-shapes.js.map +1 -1
  47. package/lib-es/GoogleMaps/hooks/index.js.map +1 -1
  48. package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
  49. package/lib-es/GoogleMaps/hooks/use-get-images.js.map +1 -1
  50. package/lib-es/GoogleMaps/index.js.map +1 -1
  51. package/lib-es/GoogleMaps/queries.js.map +1 -1
  52. package/lib-es/constants.js.map +1 -1
  53. package/lib-es/index.js.map +1 -1
  54. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.146.0-tooltips.8](https://github.com/thebyte9/blaze/compare/v0.146.0-tooltips.7...v0.146.0-tooltips.8) (2025-03-27)
7
+
8
+ **Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
9
+
10
+
11
+
12
+
13
+
14
+ # [0.146.0-tooltips.6](https://github.com/thebyte9/blaze/compare/v0.146.0-tooltips.5...v0.146.0-tooltips.6) (2025-03-04)
15
+
16
+ **Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
17
+
18
+
19
+
20
+
21
+
6
22
  # [0.146.0-tooltips.5](https://github.com/thebyte9/blaze/compare/v0.146.0-tooltips.4...v0.146.0-tooltips.5) (2025-02-28)
7
23
 
8
24
  **Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.array.iterator.js");
4
- require("core-js/modules/es.object.define-property.js");
5
- require("core-js/modules/es.object.get-own-property-descriptor.js");
6
4
  require("core-js/modules/es.string.iterator.js");
7
5
  require("core-js/modules/es.weak-map.js");
8
6
  require("core-js/modules/web.dom-collections.iterator.js");
7
+ require("core-js/modules/es.object.define-property.js");
8
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
9
9
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
10
10
  var _typeof3 = require("@babel/runtime/helpers/typeof");
11
11
  Object.defineProperty(exports, "__esModule", {
@@ -15,14 +15,14 @@ exports["default"] = void 0;
15
15
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
16
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
17
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
18
- require("core-js/modules/es.array.concat.js");
19
18
  require("core-js/modules/es.array.every.js");
20
- require("core-js/modules/es.array.for-each.js");
21
- require("core-js/modules/es.date.to-string.js");
22
- require("core-js/modules/es.function.name.js");
23
19
  require("core-js/modules/es.object.to-string.js");
20
+ require("core-js/modules/es.date.to-string.js");
24
21
  require("core-js/modules/es.regexp.to-string.js");
22
+ require("core-js/modules/es.function.name.js");
23
+ require("core-js/modules/es.array.for-each.js");
25
24
  require("core-js/modules/web.dom-collections.for-each.js");
25
+ require("core-js/modules/es.array.concat.js");
26
26
  var _react = _interopRequireWildcard(require("react"));
27
27
  var _propTypes = _interopRequireDefault(require("prop-types"));
28
28
  var _client = require("@apollo/client");
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMaps.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_client","_router","_reactPageBuilder","_customHooks","_lodash","_helpers","_constants","_GoogleMapsHtml","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof3","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","shouldNotUpdate","props","nextProps","_ref","functions","funcs","nextFuncs","noPropChange","isEqual","omit","noFuncChange","length","every","fn","toString","GoogleMaps","_ref2","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","_objectWithoutProperties2","router","useRouter","_useInView","useInView","IN_VIEW_CONFIG","_useInView2","_slicedToArray2","isIntersecting","mapRef","client","useApolloClient","_useState","useState","_useState2","map","setMap","useEffect","options","setMapOptions","onLoad","initialMap","window","google","maps","Map","current","_centerCoordinates","_centerCoordinates$","lat","latitude","lng","longitude","setCenter","bounds","LatLngBounds","forEach","_ref3","extend","LatLng","fitBounds","script","document","createElement","SCRIPT","src","concat","GOOGLE_MAPS_SCRIPT","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","LOAD","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","_typeof2","addZoomListener","propTypes","PropTypes","array","string","func","object","defaultProps","_default","exports","React","memo","withTitle"],"sources":["../../src/GoogleMaps/GoogleMaps.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useApolloClient } from '@apollo/client';\nimport { useRouter } from 'next/router';\nimport { withTitle } from '@blaze-cms/react-page-builder';\nimport { useInView } from '@blaze-react/utils/lib/customHooks';\nimport { functions, isEqual, omit } from 'lodash';\nimport { setMapOptions, addZoomListener } from './helpers';\nimport { GOOGLE_MAPS_SCRIPT, LOAD, SCRIPT, IN_VIEW_CONFIG } from '../constants';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst shouldNotUpdate = (props, nextProps) => {\n const [funcs, nextFuncs] = [functions(props), functions(nextProps)];\n const noPropChange = isEqual(omit(props, funcs), omit(nextProps, nextFuncs));\n const noFuncChange =\n funcs.length === nextFuncs.length &&\n funcs.every(fn => props[fn].toString() === nextProps[fn].toString());\n return noPropChange && noFuncChange;\n};\n\nconst GoogleMaps = ({\n type,\n name,\n modifier,\n elementTitle,\n imageData,\n onMount,\n onMountProps,\n parent,\n mapShapes,\n centerCoordinates,\n ...otherProps\n}) => {\n const router = useRouter();\n const [isIntersecting, mapRef] = useInView(IN_VIEW_CONFIG);\n const client = useApolloClient();\n const [map, setMap] = useState();\n\n useEffect(() => {\n const options = setMapOptions(otherProps);\n const onLoad = () => {\n const initialMap = new window.google.maps.Map(mapRef.current, options);\n if (centerCoordinates.length === 1) {\n const [{ latitude: lat, longitude: lng }] = centerCoordinates;\n initialMap.setCenter({ lat, lng });\n } else {\n const bounds = new window.google.maps.LatLngBounds();\n centerCoordinates.forEach(({ latitude, longitude }) => {\n bounds.extend(new window.google.maps.LatLng(latitude, longitude));\n });\n initialMap.fitBounds(bounds);\n }\n setMap(initialMap);\n };\n\n if (!window.google) {\n const script = document.createElement(SCRIPT);\n script.src = `${GOOGLE_MAPS_SCRIPT}${process.env.GOOGLE_MAPS_API_KEY}`;\n document.head.append(script);\n script.addEventListener(LOAD, onLoad);\n return () => script.removeEventListener(LOAD, onLoad);\n }\n\n onLoad();\n\n if (map) {\n map.setOptions(options);\n const { enableGeolocation } = otherProps;\n const shouldActivateGeolocation = enableGeolocation && navigator.geolocation;\n if (shouldActivateGeolocation) {\n navigator.geolocation.getCurrentPosition(\n position => {\n const center = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n map.setCenter(center);\n },\n () => {}\n );\n }\n }\n\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (map && typeof onMount === `function`) onMount(map, onMountProps);\n if (isIntersecting) addZoomListener(map, router, mapShapes, imageData, client);\n\n return <GoogleMapsHtml mapRef={mapRef} />;\n};\n\nGoogleMaps.propTypes = {\n mapShapes: PropTypes.array,\n imageData: PropTypes.array,\n type: PropTypes.string,\n name: PropTypes.string,\n modifier: PropTypes.string,\n elementTitle: PropTypes.string,\n onMount: PropTypes.func,\n onMountProps: PropTypes.object,\n parent: PropTypes.object,\n centerCoordinates: PropTypes.array\n};\n\nGoogleMaps.defaultProps = {\n mapShapes: [],\n imageData: [],\n centerCoordinates: [],\n type: '',\n name: '',\n modifier: '',\n elementTitle: '',\n onMount: null,\n onMountProps: null,\n parent: {}\n};\n\nexport default React.memo(withTitle(GoogleMaps), shouldNotUpdate);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAR,sBAAA,CAAAF,OAAA;AAA8C,IAAAW,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,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9F,eAAA,WAAc;IAAC4D,MAAM,EAAEA;EAAO,CAAE,CAAC;AAC3C,CAAC;AAEDtB,UAAU,CAACgF,SAAS,GAAG;EACrBtE,SAAS,EAAEuE,qBAAS,CAACC,KAAK;EAC1B5E,SAAS,EAAE2E,qBAAS,CAACC,KAAK;EAC1BhF,IAAI,EAAE+E,qBAAS,CAACE,MAAM;EACtBhF,IAAI,EAAE8E,qBAAS,CAACE,MAAM;EACtB/E,QAAQ,EAAE6E,qBAAS,CAACE,MAAM;EAC1B9E,YAAY,EAAE4E,qBAAS,CAACE,MAAM;EAC9B5E,OAAO,EAAE0E,qBAAS,CAACG,IAAI;EACvB5E,YAAY,EAAEyE,qBAAS,CAACI,MAAM;EAC9B5E,MAAM,EAAEwE,qBAAS,CAACI,MAAM;EACxB1E,iBAAiB,EAAEsE,qBAAS,CAACC;AAC/B,CAAC;AAEDlF,UAAU,CAACsF,YAAY,GAAG;EACxB5E,SAAS,EAAE,EAAE;EACbJ,SAAS,EAAE,EAAE;EACbK,iBAAiB,EAAE,EAAE;EACrBT,IAAI,EAAE,EAAE;EACRC,IAAI,EAAE,EAAE;EACRC,QAAQ,EAAE,EAAE;EACZC,YAAY,EAAE,EAAE;EAChBE,OAAO,EAAE,IAAI;EACbC,YAAY,EAAE,IAAI;EAClBC,MAAM,EAAE,CAAC;AACX,CAAC;AAAC,IAAA8E,QAAA,GAAAC,OAAA,2BAEaC,iBAAK,CAACC,IAAI,CAAC,IAAAC,2BAAS,EAAC3F,UAAU,CAAC,EAAEf,eAAe,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"GoogleMaps.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_client","_router","_reactPageBuilder","_customHooks","_lodash","_helpers","_constants","_GoogleMapsHtml","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof3","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","shouldNotUpdate","props","nextProps","_ref","functions","funcs","nextFuncs","noPropChange","isEqual","omit","noFuncChange","length","every","fn","toString","GoogleMaps","_ref2","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","_objectWithoutProperties2","router","useRouter","_useInView","useInView","IN_VIEW_CONFIG","_useInView2","_slicedToArray2","isIntersecting","mapRef","client","useApolloClient","_useState","useState","_useState2","map","setMap","useEffect","options","setMapOptions","onLoad","initialMap","window","google","maps","Map","current","_centerCoordinates","_centerCoordinates$","lat","latitude","lng","longitude","setCenter","bounds","LatLngBounds","forEach","_ref3","extend","LatLng","fitBounds","script","document","createElement","SCRIPT","src","concat","GOOGLE_MAPS_SCRIPT","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","LOAD","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","_typeof2","addZoomListener","propTypes","PropTypes","array","string","func","object","defaultProps","_default","exports","React","memo","withTitle"],"sources":["../../src/GoogleMaps/GoogleMaps.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useApolloClient } from '@apollo/client';\nimport { useRouter } from 'next/router';\nimport { withTitle } from '@blaze-cms/react-page-builder';\nimport { useInView } from '@blaze-react/utils/lib/customHooks';\nimport { functions, isEqual, omit } from 'lodash';\nimport { setMapOptions, addZoomListener } from './helpers';\nimport { GOOGLE_MAPS_SCRIPT, LOAD, SCRIPT, IN_VIEW_CONFIG } from '../constants';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst shouldNotUpdate = (props, nextProps) => {\n const [funcs, nextFuncs] = [functions(props), functions(nextProps)];\n const noPropChange = isEqual(omit(props, funcs), omit(nextProps, nextFuncs));\n const noFuncChange =\n funcs.length === nextFuncs.length &&\n funcs.every(fn => props[fn].toString() === nextProps[fn].toString());\n return noPropChange && noFuncChange;\n};\n\nconst GoogleMaps = ({\n type,\n name,\n modifier,\n elementTitle,\n imageData,\n onMount,\n onMountProps,\n parent,\n mapShapes,\n centerCoordinates,\n ...otherProps\n}) => {\n const router = useRouter();\n const [isIntersecting, mapRef] = useInView(IN_VIEW_CONFIG);\n const client = useApolloClient();\n const [map, setMap] = useState();\n\n useEffect(() => {\n const options = setMapOptions(otherProps);\n const onLoad = () => {\n const initialMap = new window.google.maps.Map(mapRef.current, options);\n if (centerCoordinates.length === 1) {\n const [{ latitude: lat, longitude: lng }] = centerCoordinates;\n initialMap.setCenter({ lat, lng });\n } else {\n const bounds = new window.google.maps.LatLngBounds();\n centerCoordinates.forEach(({ latitude, longitude }) => {\n bounds.extend(new window.google.maps.LatLng(latitude, longitude));\n });\n initialMap.fitBounds(bounds);\n }\n setMap(initialMap);\n };\n\n if (!window.google) {\n const script = document.createElement(SCRIPT);\n script.src = `${GOOGLE_MAPS_SCRIPT}${process.env.GOOGLE_MAPS_API_KEY}`;\n document.head.append(script);\n script.addEventListener(LOAD, onLoad);\n return () => script.removeEventListener(LOAD, onLoad);\n }\n\n onLoad();\n\n if (map) {\n map.setOptions(options);\n const { enableGeolocation } = otherProps;\n const shouldActivateGeolocation = enableGeolocation && navigator.geolocation;\n if (shouldActivateGeolocation) {\n navigator.geolocation.getCurrentPosition(\n position => {\n const center = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n map.setCenter(center);\n },\n () => {}\n );\n }\n }\n\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (map && typeof onMount === `function`) onMount(map, onMountProps);\n if (isIntersecting) addZoomListener(map, router, mapShapes, imageData, client);\n\n return <GoogleMapsHtml mapRef={mapRef} />;\n};\n\nGoogleMaps.propTypes = {\n mapShapes: PropTypes.array,\n imageData: PropTypes.array,\n type: PropTypes.string,\n name: PropTypes.string,\n modifier: PropTypes.string,\n elementTitle: PropTypes.string,\n onMount: PropTypes.func,\n onMountProps: PropTypes.object,\n parent: PropTypes.object,\n centerCoordinates: PropTypes.array\n};\n\nGoogleMaps.defaultProps = {\n mapShapes: [],\n imageData: [],\n centerCoordinates: [],\n type: '',\n name: '',\n modifier: '',\n elementTitle: '',\n onMount: null,\n onMountProps: null,\n parent: {}\n};\n\nexport default React.memo(withTitle(GoogleMaps), shouldNotUpdate);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAR,sBAAA,CAAAF,OAAA;AAA8C,IAAAW,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAd,wBAAAc,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,QAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,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CAAC;AAEDlF,UAAU,CAACsF,YAAY,GAAG;EACxB5E,SAAS,EAAE,EAAE;EACbJ,SAAS,EAAE,EAAE;EACbK,iBAAiB,EAAE,EAAE;EACrBT,IAAI,EAAE,EAAE;EACRC,IAAI,EAAE,EAAE;EACRC,QAAQ,EAAE,EAAE;EACZC,YAAY,EAAE,EAAE;EAChBE,OAAO,EAAE,IAAI;EACbC,YAAY,EAAE,IAAI;EAClBC,MAAM,EAAE,CAAC;AACX,CAAC;AAAC,IAAA8E,QAAA,GAAAC,OAAA,2BAEaC,iBAAK,CAACC,IAAI,CAAC,IAAAC,2BAAS,EAAC3F,UAAU,CAAC,EAAEf,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsFactory.js","names":["_react","_interopRequireDefault","require","_propTypes","_reactPageBuilder","_helpers","_GoogleMapsRender","_GoogleMapsHtml","_excluded","GoogleMapsFactory","_ref","entityGroups","parent","otherProps","_objectWithoutProperties2","_useGetEntitySchemasA","useGetEntitySchemasAsObj","map","_ref2","entity","data","loading","error","createElement","message","shapeConfigs","buildShapesConfig","_extends2","propTypes","PropTypes","object","array","defaultProps","_default","exports"],"sources":["../../src/GoogleMaps/GoogleMapsFactory.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGetEntitySchemasAsObj } from '@blaze-cms/react-page-builder';\nimport { buildShapesConfig } from './helpers';\nimport GoogleMapsRender from './GoogleMapsRender';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst GoogleMapsFactory = ({ entityGroups, parent, ...otherProps }) => {\n const { data, loading, error } = useGetEntitySchemasAsObj(\n entityGroups.map(({ entity }) => entity)\n );\n\n if (loading) return <GoogleMapsHtml />;\n if (error) return error.message;\n\n const shapeConfigs = buildShapesConfig(data, entityGroups, parent);\n\n return (\n <GoogleMapsRender\n shapeConfigs={shapeConfigs}\n entityGroups={entityGroups}\n parent={parent}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsFactory.propTypes = {\n parent: PropTypes.object,\n entityGroups: PropTypes.array\n};\n\nGoogleMapsFactory.defaultProps = {\n parent: {},\n entityGroups: []\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA8C,IAAAM,SAAA;AAE9C,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAAgD;EAAA,IAA1CC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAKC,UAAU,OAAAC,yBAAA,aAAAJ,IAAA,EAAAF,SAAA;EAC9D,IAAAO,qBAAA,GAAiC,IAAAC,0CAAwB,EACvDL,YAAY,CAACM,GAAG,CAAC,UAAAC,KAAA;MAAA,IAAGC,MAAM,GAAAD,KAAA,CAANC,MAAM;MAAA,OAAOA,MAAM;IAAA,EACzC,CAAC;IAFOC,IAAI,GAAAL,qBAAA,CAAJK,IAAI;IAAEC,OAAO,GAAAN,qBAAA,CAAPM,OAAO;IAAEC,KAAK,GAAAP,qBAAA,CAALO,KAAK;EAI5B,IAAID,OAAO,EAAE,oBAAOrB,MAAA,YAAAuB,aAAA,CAAChB,eAAA,WAAc,MAAE,CAAC;EACtC,IAAIe,KAAK,EAAE,OAAOA,KAAK,CAACE,OAAO;EAE/B,IAAMC,YAAY,GAAG,IAAAC,0BAAiB,EAACN,IAAI,EAAET,YAAY,EAAEC,MAAM,CAAC;EAElE,oBACEZ,MAAA,YAAAuB,aAAA,CAACjB,iBAAA,WAAgB,MAAAqB,SAAA;IACfF,YAAY,EAAEA,YAAa;IAC3Bd,YAAY,EAAEA,YAAa;IAC3BC,MAAM,EAAEA;EAAO,GACXC,UAAU,CACf,CAAC;AAEN,CAAC;AAEDJ,iBAAiB,CAACmB,SAAS,GAAG;EAC5BhB,MAAM,EAAEiB,qBAAS,CAACC,MAAM;EACxBnB,YAAY,EAAEkB,qBAAS,CAACE;AAC1B,CAAC;AAEDtB,iBAAiB,CAACuB,YAAY,GAAG;EAC/BpB,MAAM,EAAE,CAAC,CAAC;EACVD,YAAY,EAAE;AAChB,CAAC;AAAC,IAAAsB,QAAA,GAAAC,OAAA,cAEazB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"GoogleMapsFactory.js","names":["_react","_interopRequireDefault","require","_propTypes","_reactPageBuilder","_helpers","_GoogleMapsRender","_GoogleMapsHtml","_excluded","GoogleMapsFactory","_ref","entityGroups","parent","otherProps","_objectWithoutProperties2","_useGetEntitySchemasA","useGetEntitySchemasAsObj","map","_ref2","entity","data","loading","error","createElement","message","shapeConfigs","buildShapesConfig","_extends2","propTypes","PropTypes","object","array","defaultProps","_default","exports"],"sources":["../../src/GoogleMaps/GoogleMapsFactory.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGetEntitySchemasAsObj } from '@blaze-cms/react-page-builder';\nimport { buildShapesConfig } from './helpers';\nimport GoogleMapsRender from './GoogleMapsRender';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst GoogleMapsFactory = ({ entityGroups, parent, ...otherProps }) => {\n const { data, loading, error } = useGetEntitySchemasAsObj(\n entityGroups.map(({ entity }) => entity)\n );\n\n if (loading) return <GoogleMapsHtml />;\n if (error) return error.message;\n\n const shapeConfigs = buildShapesConfig(data, entityGroups, parent);\n\n return (\n <GoogleMapsRender\n shapeConfigs={shapeConfigs}\n entityGroups={entityGroups}\n parent={parent}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsFactory.propTypes = {\n parent: PropTypes.object,\n entityGroups: PropTypes.array\n};\n\nGoogleMapsFactory.defaultProps =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AAC;AAEN,CAAC;AAEDJ,iBAAiB,CAACmB,SAAS,GAAG;EAC5BhB,MAAM,EAAEiB,qBAAS,CAACC,MAAM;EACxBnB,YAAY,EAAEkB,qBAAS,CAACE;AAC1B,CAAC;AAEDtB,iBAAiB,CAACuB,YAAY,GAAG;EAC/BpB,MAAM,EAAE,CAAC,CAAC;EACVD,YAAY,EAAE;AAChB,CAAC;AAAC,IAAAsB,QAAA,GAAAC,OAAA,cAEazB,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsHtml.js","names":["_react","_interopRequireDefault","require","_propTypes","GoogleMapsFactory","_ref","mapRef","createElement","className","concat","ref","propTypes","PropTypes","object","defaultProps","_default","exports"],"sources":["../../src/GoogleMaps/GoogleMapsHtml.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst GoogleMapsFactory = ({ mapRef }) => (\n <div className={`google-maps ${!mapRef ? 'loading' : ''}`} ref={mapRef} />\n);\n\nGoogleMapsFactory.propTypes = {\n mapRef: PropTypes.object\n};\n\nGoogleMapsFactory.defaultProps = {\n mapRef: null\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA;EAAA,IAAMC,MAAM,GAAAD,IAAA,CAANC,MAAM;EAAA,oBACjCN,MAAA,YAAAO,aAAA;IAAKC,SAAS,iBAAAC,MAAA,CAAiB,CAACH,MAAM,GAAG,SAAS,GAAG,EAAE,CAAG;IAACI,GAAG,EAAEJ;EAAO,CAAE,CAAC;AAAA,CAC3E;AAEDF,iBAAiB,CAACO,SAAS,GAAG;EAC5BL,MAAM,EAAEM,qBAAS,CAACC;AACpB,CAAC;AAEDT,iBAAiB,CAACU,YAAY,GAAG;EAC/BR,MAAM,EAAE;AACV,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,cAEaZ,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"GoogleMapsHtml.js","names":["_react","_interopRequireDefault","require","_propTypes","GoogleMapsFactory","_ref","mapRef","createElement","className","concat","ref","propTypes","PropTypes","object","defaultProps","_default","exports"],"sources":["../../src/GoogleMaps/GoogleMapsHtml.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst GoogleMapsFactory = ({ mapRef }) => (\n <div className={`google-maps ${!mapRef ? 'loading' : ''}`} ref={mapRef} />\n);\n\nGoogleMapsFactory.propTypes = {\n mapRef: PropTypes.object\n};\n\nGoogleMapsFactory.defaultProps = {\n mapRef: null\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA;EAAA,IAAMC,MAAM,GAAAD,IAAA,CAANC,MAAM;EAAA,oBACjCN,MAAA,YAAAO,aAAA;IAAKC,SAAS,iBAAAC,MAAA,CAAiB,CAACH,MAAM,GAAG,SAAS,GAAG,EAAE,CAAG;IAACI,GAAG,EAAEJ;EAAO,CAAE,CAAC;AAAA,CAC3E;AAEDF,iBAAiB,CAACO,SAAS,GAAG;EAC5BL,MAAM,EAAEM,qBAAS,CAACC;AACpB,CAAC;AAEDT,iBAAiB,CAACU,YAAY,GAAG;EAC/BR,MAAM,EAAE;AACV,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,cAEaZ,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"GoogleMapsRender.js","names":["_react","_interopRequireDefault","require","_propTypes","_lodash","_client","_reactPageBuilder","_hooks","_helpers","_GoogleMaps","_GoogleMapsHtml","_excluded","defaultQuery","getAction","GoogleMapsRender","_ref","shapeConfigs","entityGroups","id","otherProps","_objectWithoutProperties2","defaultZoom","_buildQuery","buildQuery","query","_useQuery","useQuery","skip","data","loading","error","mapShapes","buildMapShapes","imageIds","getImageIds","_useGetImages","useGetImages","_useGetImages$data","_useGetImages$data2","imageData","getFiles","imagesLoading","imagesError","createElement","centerCoordinates","getCenterCoordinates","shouldDisplayMap","isNumber","length","_extends2","key","slug","propTypes","PropTypes","array","string","centerLatitude","number","centerLongitude","defaultProps","_default","exports"],"sources":["../../src/GoogleMaps/GoogleMapsRender.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isNumber from 'lodash.isnumber';\nimport { useQuery } from '@apollo/client';\nimport { getAction } from '@blaze-cms/react-page-builder';\nimport { useGetImages } from './hooks';\nimport { buildQuery, getImageIds, getCenterCoordinates, buildMapShapes } from './helpers';\nimport GoogleMaps from './GoogleMaps';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst defaultQuery = getAction('getPublishedPages', 'id');\n\nconst GoogleMapsRender = ({ shapeConfigs, entityGroups, id, ...otherProps }) => {\n const { defaultZoom } = otherProps;\n const { query } = buildQuery(shapeConfigs);\n const { data, loading, error } = useQuery(query || defaultQuery, {\n skip: !query\n });\n\n const mapShapes = buildMapShapes(shapeConfigs, data);\n const imageIds = getImageIds(mapShapes);\n const {\n data: { getFiles: imageData } = {},\n loading: imagesLoading,\n error: imagesError\n } = useGetImages(imageIds);\n if (loading || imagesLoading) return <GoogleMapsHtml />;\n if (error || imagesError) return null;\n\n const centerCoordinates = getCenterCoordinates(mapShapes, otherProps);\n const shouldDisplayMap = isNumber(defaultZoom) && !!centerCoordinates.length;\n\n if (!shouldDisplayMap) return null;\n\n return (\n <GoogleMaps\n key={otherProps.slug}\n centerCoordinates={centerCoordinates}\n mapShapes={mapShapes}\n imageData={imageData}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsRender.propTypes = {\n entityGroups: PropTypes.array,\n id: PropTypes.string,\n shapeConfigs: PropTypes.array,\n centerLatitude: PropTypes.number,\n centerLongitude: PropTypes.number,\n defaultZoom: PropTypes.number\n};\n\nGoogleMapsRender.defaultProps = {\n entityGroups: [],\n shapeConfigs: [],\n id: '',\n centerLatitude: null,\n centerLongitude: null,\n defaultZoom: null\n};\n\nexport default GoogleMapsRender;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,eAAA,GAAAT,sBAAA,CAAAC,OAAA;AAA8C,IAAAS,SAAA;AAE9C,IAAMC,YAAY,GAAG,IAAAC,2BAAS,EAAC,mBAAmB,EAAE,IAAI,CAAC;AAEzD,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAA0D;EAAA,IAApDC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,EAAE,GAAAH,IAAA,CAAFG,EAAE;IAAKC,UAAU,OAAAC,yBAAA,aAAAL,IAAA,EAAAJ,SAAA;EACvE,IAAQU,WAAW,GAAKF,UAAU,CAA1BE,WAAW;EACnB,IAAAC,WAAA,GAAkB,IAAAC,mBAAU,EAACP,YAAY,CAAC;IAAlCQ,KAAK,GAAAF,WAAA,CAALE,KAAK;EACb,IAAAC,SAAA,GAAiC,IAAAC,gBAAQ,EAACF,KAAK,IAAIZ,YAAY,EAAE;MAC/De,IAAI,EAAE,CAACH;IACT,CAAC,CAAC;IAFMI,IAAI,GAAAH,SAAA,CAAJG,IAAI;IAAEC,OAAO,GAAAJ,SAAA,CAAPI,OAAO;IAAEC,K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,EAAEH,qBAAS,CAACI,MAAM;EAChCC,eAAe,EAAEL,qBAAS,CAACI,MAAM;EACjCpC,WAAW,EAAEgC,qBAAS,CAACI;AACzB,CAAC;AAED3C,gBAAgB,CAAC6C,YAAY,GAAG;EAC9B1C,YAAY,EAAE,EAAE;EAChBD,YAAY,EAAE,EAAE;EAChBE,EAAE,EAAE,EAAE;EACNsC,cAAc,EAAE,IAAI;EACpBE,eAAe,EAAE,IAAI;EACrBrC,WAAW,EAAE;AACf,CAAC;AAAC,IAAAuC,QAAA,GAAAC,OAAA,cAEa/C,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"GoogleMapsRender.js","names":["_react","_interopRequireDefault","require","_propTypes","_lodash","_client","_reactPageBuilder","_hooks","_helpers","_GoogleMaps","_GoogleMapsHtml","_excluded","defaultQuery","getAction","GoogleMapsRender","_ref","shapeConfigs","entityGroups","id","otherProps","_objectWithoutProperties2","defaultZoom","_buildQuery","buildQuery","query","_useQuery","useQuery","skip","data","loading","error","mapShapes","buildMapShapes","imageIds","getImageIds","_useGetImages","useGetImages","_useGetImages$data","_useGetImages$data2","imageData","getFiles","imagesLoading","imagesError","createElement","centerCoordinates","getCenterCoordinates","shouldDisplayMap","isNumber","length","_extends2","key","slug","propTypes","PropTypes","array","string","centerLatitude","number","centerLongitude","defaultProps","_default","exports"],"sources":["../../src/GoogleMaps/GoogleMapsRender.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isNumber from 'lodash.isnumber';\nimport { useQuery } from '@apollo/client';\nimport { getAction } from '@blaze-cms/react-page-builder';\nimport { useGetImages } from './hooks';\nimport { buildQuery, getImageIds, getCenterCoordinates, buildMapShapes } from './helpers';\nimport GoogleMaps from './GoogleMaps';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst defaultQuery = getAction('getPublishedPages', 'id');\n\nconst GoogleMapsRender = ({ shapeConfigs, entityGroups, id, ...otherProps }) => {\n const { defaultZoom } = otherProps;\n const { query } = buildQuery(shapeConfigs);\n const { data, loading, error } = useQuery(query || defaultQuery, {\n skip: !query\n });\n\n const mapShapes = buildMapShapes(shapeConfigs, data);\n const imageIds = getImageIds(mapShapes);\n const {\n data: { getFiles: imageData } = {},\n loading: imagesLoading,\n error: imagesError\n } = useGetImages(imageIds);\n if (loading || imagesLoading) return <GoogleMapsHtml />;\n if (error || imagesError) return null;\n\n const centerCoordinates = getCenterCoordinates(mapShapes, otherProps);\n const shouldDisplayMap = isNumber(defaultZoom) && !!centerCoordinates.length;\n\n if (!shouldDisplayMap) return null;\n\n return (\n <GoogleMaps\n key={otherProps.slug}\n centerCoordinates={centerCoordinates}\n mapShapes={mapShapes}\n imageData={imageData}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsRender.propTypes = {\n entityGroups: PropTypes.array,\n id: PropTypes.string,\n shapeConfigs: PropTypes.array,\n centerLatitude: PropTypes.number,\n centerLongitude: PropTypes.number,\n defaultZoom: PropTypes.number\n};\n\nGoogleMapsRender.defaultProps = {\n entityGroups: [],\n shapeConfigs: [],\n id: '',\n centerLatitude: null,\n centerLongitude: null,\n defaultZoom: null\n};\n\nexport default GoogleMapsRender;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,eAAA,GAAAT,sBAAA,CAAAC,OAAA;AAA8C,IAAAS,SAAA;AAE9C,IAAMC,YAAY,GAAG,IAAAC,2BAAS,EAAC,mBAAmB,EAAE,IAAI,CAAC;AAEzD,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAg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rE,IAAM2B,gBAAgB,GAAG,IAAAC,kBAAQ,EAAC1B,WAAW,CAAC,IAAI,CAAC,CAACuB,iBAAiB,CAACI,MAAM;EAE5E,IAAI,CAACF,gBAAgB,EAAE,OAAO,IAAI;EAElC,oBACE9C,MAAA,YAAA2C,aAAA,CAAClC,WAAA,WAAU,MAAAwC,SAAA;IACTC,GAAG,EAAE/B,UAAU,CAACgC,IAAK;IACrBP,iBAAiB,EAAEA,iBAAkB;IACrCb,SAAS,EAAEA,SAAU;IACrBQ,SAAS,EAAEA;EAAU,GACjBpB,UAAU,CACf,CAAC;AAEN,CAAC;AAEDL,gBAAgB,CAACsC,SAAS,GAAG;EAC3BnC,YAAY,EAAEoC,qBAAS,CAACC,KAAK;EAC7BpC,EAAE,EAAEmC,qBAAS,CAACE,MAAM;EACpBvC,YAAY,EAAEqC,qBAAS,CAACC,KAAK;EAC7BE,cAAc,EAAEH,qBAAS,CAACI,MAAM;EAChCC,eAAe,EAAEL,qBAAS,CAACI,MAAM;EACjCpC,WAAW,EAAEgC,qBAAS,CAACI;AACzB,CAAC;AAED3C,gBAAgB,CAAC6C,YAAY,GAAG;EAC9B1C,YAAY,EAAE,EAAE;EAChBD,YAAY,EAAE,EAAE;EAChBE,EAAE,EAAE,EAAE;EACNsC,cAAc,EAAE,IAAI;EACpBE,eAAe,EAAE,IAAI;EACrBrC,WAAW,EAAE;AACf,CAAC;AAAC,IAAAuC,QAAA,GAAAC,OAAA,cAEa/C,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"add-zoom-listener.js","names":["_constants","require","_setShapes","_interopRequireDefault","addZoomListener","map","router","shapes","imageData","client","setShapes","addListener","ZOOM_CHANGED","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/add-zoom-listener.js"],"sourcesContent":["import { ZOOM_CHANGED } from '../../constants';\nimport setShapes from './set-shapes';\n\nconst addZoomListener = (map, router, shapes, imageData, client) => {\n if (!map) return;\n setShapes(map, router, shapes, imageData);\n map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData, client));\n};\n\nexport default addZoomListener;\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAMG,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,MAAM,EAAK;EAClE,IAAI,CAACJ,GAAG,EAAE;EACV,IAAAK,qBAAS,EAACL,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,CAAC;EACzCH,GAAG,CAACM,WAAW,CAACC,uBAAY,EAAE;IAAA,OAAM,IAAAF,qBAAS,EAACL,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,MAAM,CAAC;EAAA,EAAC;AACxF,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,cAEaV,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"add-zoom-listener.js","names":["_constants","require","_setShapes","_interopRequireDefault","addZoomListener","map","router","shapes","imageData","client","setShapes","addListener","ZOOM_CHANGED","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/add-zoom-listener.js"],"sourcesContent":["import { ZOOM_CHANGED } from '../../constants';\nimport setShapes from './set-shapes';\n\nconst addZoomListener = (map, router, shapes, imageData, client) => {\n if (!map) return;\n setShapes(map, router, shapes, imageData);\n map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData, client));\n};\n\nexport default addZoomListener;\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAMG,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,MAAM,EAAK;EAClE,IAAI,CAACJ,GAAG,EAAE;EACV,IAAAK,qBAAS,EAACL,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,CAAC;EACzCH,GAAG,CAACM,WAAW,CAACC,uBAAY,EAAE;IAAA,OAAM,IAAAF,qBAAS,EAACL,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,MAAM,CAAC;EAAA,EAAC;AACxF,CAAC;AAAC,IAAAI,QAAA,GAAAC,OAAA,cAEaV,eAAe"}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.object.keys.js");
3
4
  require("core-js/modules/es.symbol.js");
4
5
  require("core-js/modules/es.array.filter.js");
5
- require("core-js/modules/es.object.define-properties.js");
6
- require("core-js/modules/es.object.define-property.js");
7
6
  require("core-js/modules/es.object.get-own-property-descriptor.js");
8
7
  require("core-js/modules/es.object.get-own-property-descriptors.js");
9
- require("core-js/modules/es.object.keys.js");
8
+ require("core-js/modules/es.object.define-properties.js");
9
+ require("core-js/modules/es.object.define-property.js");
10
10
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
11
11
  Object.defineProperty(exports, "__esModule", {
12
12
  value: true
@@ -14,9 +14,9 @@ Object.defineProperty(exports, "__esModule", {
14
14
  exports["default"] = void 0;
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
16
  require("core-js/modules/es.array.for-each.js");
17
- require("core-js/modules/es.array.is-array.js");
18
17
  require("core-js/modules/es.object.to-string.js");
19
18
  require("core-js/modules/web.dom-collections.for-each.js");
19
+ require("core-js/modules/es.array.is-array.js");
20
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
22
  var getLatLonValues = function getLatLonValues(keys, data) {
@@ -1 +1 @@
1
- {"version":3,"file":"build-map-shapes.js","names":["getLatLonValues","keys","data","length","key","shift","getLatLong","latProp","lonProp","shape","latitude","longitude","latKeys","split","lonKeys","lat","lon","buildMapShapes","shapesOptions","shapesData","mapShapes","forEach","shapeKey","entityOptions","shapeOptions","dataSummaries","enableInfoPane","shapeData","Array","isArray","results","url","_getLatLong","formatedShape","_objectSpread","push","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-map-shapes.js"],"sourcesContent":["const getLatLonValues = (keys, data) => {\n if (keys.length === 1) return data[keys];\n const key = keys.shift();\n return getLatLonValues(keys, data[key]);\n};\n\nconst getLatLong = (latProp, lonProp, shape, data) => {\n const { latitude, longitude } = shape;\n\n if (!latProp || !lonProp) return { latitude, longitude };\n const latKeys = latProp.split('.');\n const lonKeys = lonProp.split('.');\n const lat = getLatLonValues(latKeys, data);\n const lon = getLatLonValues(lonKeys, data);\n\n return { latitude: lat, longitude: lon };\n};\n\nconst buildMapShapes = (shapesOptions, shapesData) => {\n if (!shapesData) return [];\n const mapShapes = [];\n shapesOptions.forEach(shape => {\n const { shapeKey, entityOptions, shapeOptions } = shape;\n const { dataSummaries, enableInfoPane } = entityOptions;\n\n const shapeData = Array.isArray(shapesData[shapeKey])\n ? shapesData[shapeKey]\n : shapesData[shapeKey].results;\n if (!shapeData) return;\n const { latProp, lonProp } = entityOptions;\n\n shapeData.forEach(data => {\n const { url } = data;\n const { latitude, longitude } = getLatLong(latProp, lonProp, shapeOptions, data);\n\n const formatedShape = {\n ...shapeOptions,\n latitude,\n longitude,\n dataSummaries,\n enableInfoPane,\n url,\n shapeData: data\n };\n\n mapShapes.push(formatedShape);\n });\n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AAkCb,KAAK,CAA/Ca,QAAQ;MAAEC,aAAa,GAAmBd,KAAK,CAArCc,aAAa;MAAEC,YAAY,GAAKf,KAAK,CAAtBe,YAAY;IAC7C,IAAQC,aAAa,GAAqBF,aAAa,CAA/CE,aAAa;MAAEC,cAAc,GAAKH,aAAa,CAAhCG,cAAc;IAErC,IAAMC,SAAS,GAAGC,KAAK,CAACC,OAAO,CAACV,UAAU,CAACG,QAAQ,CAAC,CAAC,GACjDH,UAAU,CAACG,QAAQ,CAAC,GACpBH,UAAU,CAACG,QAAQ,CAAC,CAACQ,OAAO;IAChC,IAAI,CAACH,SAAS,EAAE;IAChB,IAAQpB,OAAO,GAAcgB,aAAa,CAAlChB,OAAO;MAAEC,OAAO,GAAKe,aAAa,CAAzBf,OAAO;IAExBmB,SAAS,CAACN,OAAO,CAAC,UAAAnB,IAAI,EAAI;MACxB,IAAQ6B,GAAG,GAAK7B,IAAI,CAAZ6B,GAAG;MACX,IAAAC,WAAA,GAAgC1B,UAAU,CAACC,OAAO,EAAEC,OAAO,EAAEgB,YAAY,EAAEtB,IAAI,CAAC;QAAxEQ,QAAQ,GAAAsB,WAAA,CAARtB,QAAQ;QAAEC,SAAS,GAAAqB,WAAA,CAATrB,SAAS;MAE3B,IAAMsB,aAAa,GAAAC,aAAA,CAAAA,aAAA,KACdV,YAAY;QACfd,QAAQ,EAARA,QAAQ;QACRC,SAAS,EAATA,SAAS;QACTc,aAAa,EAAbA,aAAa;QACbC,cAAc,EAAdA,cAAc;QACdK,GAAG,EAAHA,GAAG;QACHJ,SAAS,EAAEzB;MAAI,EAChB;MAEDkB,SAAS,CAACe,IAAI,CAACF,aAAa,CAAC;IAC/B,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOb,SAAS;AAClB,CAAC;AAAC,IAAAgB,QAAA,GAAAC,OAAA,cAEapB,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"build-map-shapes.js","names":["getLatLonValues","keys","data","length","key","shift","getLatLong","latProp","lonProp","shape","latitude","longitude","latKeys","split","lonKeys","lat","lon","buildMapShapes","shapesOptions","shapesData","mapShapes","forEach","shapeKey","entityOptions","shapeOptions","dataSummaries","enableInfoPane","shapeData","Array","isArray","results","url","_getLatLong","formatedShape","_objectSpread","push","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-map-shapes.js"],"sourcesContent":["const getLatLonValues = (keys, data) => {\n if (keys.length === 1) return data[keys];\n const key = keys.shift();\n return getLatLonValues(keys, data[key]);\n};\n\nconst getLatLong = (latProp, lonProp, shape, data) => {\n const { latitude, longitude } = shape;\n\n if (!latProp || !lonProp) return { latitude, longitude };\n const latKeys = latProp.split('.');\n const lonKeys = lonProp.split('.');\n const lat = getLatLonValues(latKeys, data);\n const lon = getLatLonValues(lonKeys, data);\n\n return { latitude: lat, longitude: lon };\n};\n\nconst buildMapShapes = (shapesOptions, shapesData) => {\n if (!shapesData) return [];\n const mapShapes = [];\n shapesOptions.forEach(shape => {\n const { shapeKey, entityOptions, shapeOptions } = shape;\n const { dataSummaries, enableInfoPane } = entityOptions;\n\n const shapeData = Array.isArray(shapesData[shapeKey])\n ? shapesData[shapeKey]\n : shapesData[shapeKey].results;\n if (!shapeData) return;\n const { latProp, lonProp } = entityOptions;\n\n shapeData.forEach(data => {\n const { url } = data;\n const { latitude, longitude } = getLatLong(latProp, lonProp, shapeOptions, data);\n\n const formatedShape = {\n ...shapeOptions,\n latitude,\n longitude,\n dataSummaries,\n enableInfoPane,\n url,\n shapeData: data\n };\n\n mapShapes.push(formatedShape);\n });\n });\n\n return mapShapes;\n};\n\nexport default buildMapShapes;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,IAAI,EAAEC,IAAI,EAAK;EACtC,IAAID,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE,OAAOD,IAAI,CAACD,IAAI,CAAC;EACxC,IAAMG,GAAG,GAAGH,IAAI,CAACI,KAAK,CAAC,CAAC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AC,GACjDH,UAAU,CAACG,QAAQ,CAAC,GACpBH,UAAU,CAACG,QAAQ,CAAC,CAACQ,OAAO;IAChC,IAAI,CAACH,SAAS,EAAE;IAChB,IAAQpB,OAAO,GAAcgB,aAAa,CAAlChB,OAAO;MAAEC,OAAO,GAAKe,aAAa,CAAzBf,OAAO;IAExBmB,SAAS,CAACN,OAAO,CAAC,UAAAnB,IAAI,EAAI;MACxB,IAAQ6B,GAAG,GAAK7B,IAAI,CAAZ6B,GAAG;MACX,IAAAC,WAAA,GAAgC1B,UAAU,CAACC,OAAO,EAAEC,OAAO,EAAEgB,YAAY,EAAEtB,IAAI,CAAC;QAAxEQ,QAAQ,GAAAsB,WAAA,CAARtB,QAAQ;QAAEC,SAAS,GAAAqB,WAAA,CAATrB,SAAS;MAE3B,IAAMsB,aAAa,GAAAC,aAAA,CAAAA,aAAA,KACdV,YAAY;QACfd,QAAQ,EAARA,QAAQ;QACRC,SAAS,EAATA,SAAS;QACTc,aAAa,EAAbA,aAAa;QACbC,cAAc,EAAdA,cAAc;QACdK,GAAG,EAAHA,GAAG;QACHJ,SAAS,EAAEzB;MAAI,EAChB;MAEDkB,SAAS,CAACe,IAAI,CAACF,aAAa,CAAC;IAC/B,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOb,SAAS;AAClB,CAAC;AAAC,IAAAgB,QAAA,GAAAC,OAAA,cAEapB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"build-map-type-ids.js","names":["_constants","require","buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","ROADMAP","push","SATELLITE","TERRAIN","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-map-type-ids.js"],"sourcesContent":["import { ROADMAP, SATELLITE, TERRAIN } from '../../constants';\n\nconst buildMapTypeIds = (enableSatelliteView, enableTerrainScreen) => {\n const mapTypeIds = [ROADMAP];\n if (enableSatelliteView) mapTypeIds.push(SATELLITE);\n if (enableTerrainScreen) mapTypeIds.push(TERRAIN);\n return mapTypeIds;\n};\n\nexport default buildMapTypeIds;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,mBAAmB,EAAEC,mBAAmB,EAAK;EACpE,IAAMC,UAAU,GAAG,CAACC,kBAAO,CAAC;EAC5B,IAAIH,mBAAmB,EAAEE,UAAU,CAACE,IAAI,CAACC,oBAAS,CAAC;EACnD,IAAIJ,mBAAmB,EAAEC,UAAU,CAACE,IAAI,CAACE,kBAAO,CAAC;EACjD,OAAOJ,UAAU;AACnB,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,cAEaT,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"build-map-type-ids.js","names":["_constants","require","buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","ROADMAP","push","SATELLITE","TERRAIN","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-map-type-ids.js"],"sourcesContent":["import { ROADMAP, SATELLITE, TERRAIN } from '../../constants';\n\nconst buildMapTypeIds = (enableSatelliteView, enableTerrainScreen) => {\n const mapTypeIds = [ROADMAP];\n if (enableSatelliteView) mapTypeIds.push(SATELLITE);\n if (enableTerrainScreen) mapTypeIds.push(TERRAIN);\n return mapTypeIds;\n};\n\nexport default buildMapTypeIds;\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,mBAAmB,EAAEC,mBAAmB,EAAK;EACpE,IAAMC,UAAU,GAAG,CAACC,kBAAO,CAAC;EAC5B,IAAIH,mBAAmB,EAAEE,UAAU,CAACE,IAAI,CAACC,oBAAS,CAAC;EACnD,IAAIJ,mBAAmB,EAAEC,UAAU,CAACE,IAAI,CAACE,kBAAO,CAAC;EACjD,OAAOJ,UAAU;AACnB,CAAC;AAAC,IAAAK,QAAA,GAAAC,OAAA,cAEaT,eAAe"}
@@ -7,11 +7,11 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
- require("core-js/modules/es.array.concat.js");
11
- require("core-js/modules/es.array.index-of.js");
12
10
  require("core-js/modules/es.array.join.js");
13
11
  require("core-js/modules/es.array.map.js");
12
+ require("core-js/modules/es.array.concat.js");
14
13
  require("core-js/modules/es.array.slice.js");
14
+ require("core-js/modules/es.array.index-of.js");
15
15
  require("core-js/modules/es.string.trim.js");
16
16
  var _queries = require("../queries");
17
17
  var buildQuery = function buildQuery(entityConfigs) {
@@ -1 +1 @@
1
- {"version":3,"file":"build-query.js","names":["_queries","require","buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","concat","toUpperCase","slice","filterQueryKey","indexOf","push","apply","_toConsumableArray2","props","trim","singleItemQuery","generateFiltersQuery","JSON","stringify","generateIdsQuery","join","query","generateQuery","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';\n\nconst buildQuery = entityConfigs => {\n const entityIds = [];\n const rawQueryStringified = '';\n const queryString = entityConfigs\n .map(entityConfig => {\n const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;\n if (!action) return '';\n const formatedEntity = `${entity[0].toUpperCase()}${entity.slice(1)}`;\n const filterQueryKey =\n action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;\n\n entityIds.push(...ids);\n const props = propsQuery.trim() || 'id';\n const singleItemQuery = filtersObject\n ? generateFiltersQuery(shapeKey, props, JSON.stringify(filtersObject), filterQueryKey)\n : generateIdsQuery(shapeKey, props, action, ids);\n\n return singleItemQuery;\n })\n .join(' ');\n\n return {\n query: queryString ? generateQuery(queryString) : '',\n ids: entityIds,\n rawQueryStringified\n };\n};\n\nexport default buildQuery;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AAe;EACxB,CAAC,CAAC,CACDK,IAAI,CAAC,GAAG,CAAC;EAEZ,OAAO;IACLC,KAAK,EAAE1B,WAAW,GAAG,IAAA2B,sBAAa,EAAC3B,WAAW,CAAC,GAAG,EAAE;IACpDI,GAAG,EAAEN,SAAS;IACdC,mBAAmB,EAAnBA;EACF,CAAC;AACH,CAAC;AAAC,IAAA6B,QAAA,GAAAC,OAAA,cAEajC,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"build-query.js","names":["_queries","require","buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","concat","toUpperCase","slice","filterQueryKey","indexOf","push","apply","_toConsumableArray2","props","trim","singleItemQuery","generateFiltersQuery","JSON","stringify","generateIdsQuery","join","query","generateQuery","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';\n\nconst buildQuery = entityConfigs => {\n const entityIds = [];\n const rawQueryStringified = '';\n const queryString = entityConfigs\n .map(entityConfig => {\n const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;\n if (!action) return '';\n const formatedEntity = `${entity[0].toUpperCase()}${entity.slice(1)}`;\n const filterQueryKey =\n action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;\n\n entityIds.push(...ids);\n const props = propsQuery.trim() || 'id';\n const singleItemQuery = filtersObject\n ? generateFiltersQuery(shapeKey, props, JSON.stringify(filtersObject), filterQueryKey)\n : generateIdsQuery(shapeKey, props, action, ids);\n\n return singleItemQuery;\n })\n .join(' ');\n\n return {\n query: queryString ? generateQuery(queryString) : '',\n ids: entityIds,\n rawQueryStringified\n };\n};\n\nexport default buildQuery;\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAGC,aAAa,EAAI;EAClC,IAAMC,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,GAAG,EAAE;IACpDI,GAAG,EAAEN,SAAS;IACdC,mBAAmB,EAAnBA;EACF,CAAC;AACH,CAAC;AAAC,IAAA6B,QAAA,GAAAC,OAAA,cAEajC,UAAU"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.symbol.js");
4
- require("core-js/modules/es.object.define-properties.js");
5
- require("core-js/modules/es.object.define-property.js");
6
4
  require("core-js/modules/es.object.get-own-property-descriptor.js");
7
5
  require("core-js/modules/es.object.get-own-property-descriptors.js");
6
+ require("core-js/modules/es.object.define-properties.js");
7
+ require("core-js/modules/es.object.define-property.js");
8
8
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
9
9
  Object.defineProperty(exports, "__esModule", {
10
10
  value: true
@@ -12,17 +12,17 @@ Object.defineProperty(exports, "__esModule", {
12
12
  exports["default"] = void 0;
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
+ require("core-js/modules/es.string.trim.js");
16
+ require("core-js/modules/es.array.reduce.js");
17
+ require("core-js/modules/es.object.to-string.js");
18
+ require("core-js/modules/es.array.includes.js");
19
+ require("core-js/modules/es.string.includes.js");
15
20
  require("core-js/modules/es.array.concat.js");
16
21
  require("core-js/modules/es.array.filter.js");
22
+ require("core-js/modules/es.object.keys.js");
23
+ require("core-js/modules/es.array.map.js");
17
24
  require("core-js/modules/es.array.find.js");
18
25
  require("core-js/modules/es.array.for-each.js");
19
- require("core-js/modules/es.array.includes.js");
20
- require("core-js/modules/es.array.map.js");
21
- require("core-js/modules/es.array.reduce.js");
22
- require("core-js/modules/es.object.keys.js");
23
- require("core-js/modules/es.object.to-string.js");
24
- require("core-js/modules/es.string.includes.js");
25
- require("core-js/modules/es.string.trim.js");
26
26
  require("core-js/modules/web.dom-collections.for-each.js");
27
27
  var _lodash = _interopRequireDefault(require("lodash.flatten"));
28
28
  var _constants = require("../../constants");
@@ -1 +1 @@
1
- {"version":3,"file":"build-shapes-configs.js","names":["_lodash","_interopRequireDefault","require","_constants","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getPropValues","properties","reduce","acc","property","includes","_property$split","split","_property$split2","_slicedToArray2","relationName","relationProp","concat","trim","getUpdatedPropsQuery","propsQuery","entityData","_entityData$propertie","_entityData$dynamicPr","dynamicProperties","_Object$keys$filter","prop","URL","_Object$keys$filter2","url","hasImage","IMAGE_ID","updatedPropsQuery","buildFilterQueryString","_filter$split","_filter$split2","filterKey","filterValue","filterKeyword","bool","should","match","buildFilters","filters","filterQueryProps","map","buiildShapeProps","shape","shapeKey","dataSummaries","parentId","entityGroup","_shape$displayItems","displayItems","filterBy","latProp","lonProp","entity","actions","relations","action","getAllPublished","getAll","dataSummaryProps","_ref","propsToDisplay","propsToDisplayValues","flatten","_ref2","propertiesToDisplay","propsToDisplayString","ids","filtersObject","formatProp","ID","undefined","_prop$split","_prop$split2","mainProp","nestedProp","idProp","find","_ref3","localField","buildShapesConfig","schemas","entityGroups","parent","itemId","itemEntity","shapeGroups","i","shapes","_entityGroup$dataSumm","Boolean","shapeIndex","shapeValues","shapeOptions","entityOptions","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-shapes-configs.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { IMAGE_ID, URL, ID } from '../../constants';\n\nconst getPropValues = properties =>\n properties\n .reduce((acc, property) => {\n if (property.includes('.')) {\n const [relationName, relationProp] = property.split('.');\n return `${acc} ${relationName} { ${relationProp} }`;\n }\n return `${acc} ${property}`;\n }, '')\n .trim();\n\nconst getUpdatedPropsQuery = (propsQuery, entityData) => {\n const { properties = {}, dynamicProperties = {} } = entityData;\n\n const [url] = Object.keys(dynamicProperties).filter(prop => prop === URL);\n const hasImage = !!Object.keys(properties).filter(prop => prop === IMAGE_ID).length;\n\n let updatedPropsQuery = hasImage ? `${propsQuery} ${IMAGE_ID}` : propsQuery;\n updatedPropsQuery = url ? `${updatedPropsQuery} ${URL}` : updatedPropsQuery;\n\n return updatedPropsQuery;\n};\n\nconst buildFilterQueryString = filter => {\n const [filterKey, filterValue] = filter.split('/');\n const filterKeyword = `${filterKey}.keyword`;\n return { bool: { should: [{ match: { [filterKeyword]: filterValue } }] } };\n};\n\nconst buildFilters = filters => {\n if (!filters || !filters.length) return null;\n const filterQueryProps = filters.map(buildFilterQueryString);\n return { bool: { should: filterQueryProps } };\n};\n\nconst buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {\n const { displayItems = [], filterBy } = shape;\n const { latProp, lonProp, entity } = entityGroup;\n const { actions, relations } = entityData;\n const action = actions ? actions.getAllPublished || actions.getAll : '';\n\n const dataSummaryProps = dataSummaries\n .reduce((acc, { propsToDisplay }) => {\n const propsToDisplayValues = flatten(\n propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay)\n );\n const propsToDisplayString = getPropValues(propsToDisplayValues);\n\n return `${acc} ${propsToDisplayString}`;\n }, '')\n .trim();\n const ids = [];\n displayItems.length ? ids.push(displayItems[0]) : ids.push(parentId);\n\n const filtersObject = buildFilters(filterBy);\n let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';\n propsQuery = getUpdatedPropsQuery(propsQuery, entityData);\n if (latProp && lonProp) {\n propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(\n lonProp,\n relations\n )}`;\n }\n if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;\n\n return {\n shapeKey,\n entity,\n propsQuery,\n ids,\n action,\n filtersObject\n };\n};\n\nconst formatProp = (prop, relations = []) => {\n if (!prop.includes('.')) return prop;\n\n const [mainProp, nestedProp] = prop.split('.');\n const idProp = relations.find(({ localField }) => localField === mainProp) ? 'id ' : '';\n return `${mainProp}{${idProp}${nestedProp}}`;\n};\n\nconst buildShapesConfig = (schemas, entityGroups, parent) => {\n if (!schemas || !entityGroups) return [];\n const { itemId, itemEntity } = parent;\n const shapeGroups = [];\n entityGroups.forEach((entityGroup, i) => {\n const { entity, shapes, dataSummaries = [] } = entityGroup;\n const parentId = entity === itemEntity && itemId;\n if (!entity) return null;\n const entityData = schemas[entity] || {};\n\n shapes.filter(Boolean).forEach((shape, shapeIndex) => {\n const shapeKey = `shape${i}${shapeIndex}`;\n const shapeValues = buiildShapeProps(\n shape,\n shapeKey,\n dataSummaries,\n parentId,\n entityData,\n entityGroup\n );\n shapeGroups.push({ ...shapeValues, shapeOptions: shape, entityOptions: entityGroup });\n });\n });\n\n return shapeGroups;\n};\n\nexport default buildShapesConfig;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAoD,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CA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D,IAAM/C,QAAQ,WAAA/B,MAAA,CAAW0E,CAAC,EAAA1E,MAAA,CAAG8E,UAAU,CAAE;MACzC,IAAMC,WAAW,GAAGlD,gBAAgB,CAClCC,KAAK,EACLC,QAAQ,EACRC,aAAa,EACbC,QAAQ,EACR7B,UAAU,EACV8B,WACF,CAAC;MACDuC,WAAW,CAAC/F,IAAI,CAAAE,aAAA,CAAAA,aAAA,KAAMmG,WAAW;QAAEC,YAAY,EAAElD,KAAK;QAAEmD,aAAa,EAAE/C;MAAW,EAAE,CAAC;IACvF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOuC,WAAW;AACpB,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,cAEahB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"build-shapes-configs.js","names":["_lodash","_interopRequireDefault","require","_constants","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getPropValues","properties","reduce","acc","property","includes","_property$split","split","_property$split2","_slicedToArray2","relationName","relationProp","concat","trim","getUpdatedPropsQuery","propsQuery","entityData","_entityData$propertie","_entityData$dynamicPr","dynamicProperties","_Object$keys$filter","prop","URL","_Object$keys$filter2","url","hasImage","IMAGE_ID","updatedPropsQuery","buildFilterQueryString","_filter$split","_filter$split2","filterKey","filterValue","filterKeyword","bool","should","match","buildFilters","filters","filterQueryProps","map","buiildShapeProps","shape","shapeKey","dataSummaries","parentId","entityGroup","_shape$displayItems","displayItems","filterBy","latProp","lonProp","entity","actions","relations","action","getAllPublished","getAll","dataSummaryProps","_ref","propsToDisplay","propsToDisplayValues","flatten","_ref2","propertiesToDisplay","propsToDisplayString","ids","filtersObject","formatProp","ID","undefined","_prop$split","_prop$split2","mainProp","nestedProp","idProp","find","_ref3","localField","buildShapesConfig","schemas","entityGroups","parent","itemId","itemEntity","shapeGroups","i","shapes","_entityGroup$dataSumm","Boolean","shapeIndex","shapeValues","shapeOptions","entityOptions","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-shapes-configs.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { IMAGE_ID, URL, ID } from '../../constants';\n\nconst getPropValues = properties =>\n properties\n .reduce((acc, property) => {\n if (property.includes('.')) {\n const [relationName, relationProp] = property.split('.');\n return `${acc} ${relationName} { ${relationProp} }`;\n }\n return `${acc} ${property}`;\n }, '')\n .trim();\n\nconst getUpdatedPropsQuery = (propsQuery, entityData) => {\n const { properties = {}, dynamicProperties = {} } = entityData;\n\n const [url] = Object.keys(dynamicProperties).filter(prop => prop === URL);\n const hasImage = !!Object.keys(properties).filter(prop => prop === IMAGE_ID).length;\n\n let updatedPropsQuery = hasImage ? `${propsQuery} ${IMAGE_ID}` : propsQuery;\n updatedPropsQuery = url ? `${updatedPropsQuery} ${URL}` : updatedPropsQuery;\n\n return updatedPropsQuery;\n};\n\nconst buildFilterQueryString = filter => {\n const [filterKey, filterValue] = filter.split('/');\n const filterKeyword = `${filterKey}.keyword`;\n return { bool: { should: [{ match: { [filterKeyword]: filterValue } }] } };\n};\n\nconst buildFilters = filters => {\n if (!filters || !filters.length) return null;\n const filterQueryProps = filters.map(buildFilterQueryString);\n return { bool: { should: filterQueryProps } };\n};\n\nconst buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {\n const { displayItems = [], filterBy } = shape;\n const { latProp, lonProp, entity } = entityGroup;\n const { actions, relations } = entityData;\n const action = actions ? actions.getAllPublished || actions.getAll : '';\n\n const dataSummaryProps = dataSummaries\n .reduce((acc, { propsToDisplay }) => {\n const propsToDisplayValues = flatten(\n propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay)\n );\n const propsToDisplayString = getPropValues(propsToDisplayValues);\n\n return `${acc} ${propsToDisplayString}`;\n }, '')\n .trim();\n const ids = [];\n displayItems.length ? ids.push(displayItems[0]) : ids.push(parentId);\n\n const filtersObject = buildFilters(filterBy);\n let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';\n propsQuery = getUpdatedPropsQuery(propsQuery, entityData);\n if (latProp && lonProp) {\n propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(\n lonProp,\n relations\n )}`;\n }\n if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;\n\n return {\n shapeKey,\n entity,\n propsQuery,\n ids,\n action,\n filtersObject\n };\n};\n\nconst formatProp = (prop, relations = []) => {\n if (!prop.includes('.')) return prop;\n\n const [mainProp, nestedProp] = prop.split('.');\n const idProp = relations.find(({ localField }) => localField === mainProp) ? 'id ' : '';\n return `${mainProp}{${idProp}${nestedProp}}`;\n};\n\nconst buildShapesConfig = (schemas, entityGroups, parent) => {\n if (!schemas || !entityGroups) return [];\n const { itemId, itemEntity } = parent;\n const shapeGroups = [];\n entityGroups.forEach((entityGroup, i) => {\n const { entity, shapes, dataSummaries = [] } = entityGroup;\n const parentId = entity === itemEntity && itemId;\n if (!entity) return null;\n const entityData = schemas[entity] || {};\n\n shapes.filter(Boolean).forEach((shape, shapeIndex) => {\n const shapeKey = `shape${i}${shapeIndex}`;\n const shapeValues = buiildShapeProps(\n shape,\n shapeKey,\n dataSummaries,\n parentId,\n entityData,\n entityGroup\n );\n shapeGroups.push({ ...shapeValues, shapeOptions: shape, entityOptions: entityGroup });\n });\n });\n\n return shapeGroups;\n};\n\nexport default buildShapesConfig;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAoD,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA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AEmC,MAAM,GAAyBzC,WAAW,CAA1CyC,MAAM;MAAAC,qBAAA,GAAyB1C,WAAW,CAAlCF,aAAa;MAAbA,aAAa,GAAA4C,qBAAA,cAAG,EAAE,GAAAA,qBAAA;IAC1C,IAAM3C,QAAQ,GAAGO,MAAM,KAAKgC,UAAU,IAAID,MAAM;IAChD,IAAI,CAAC/B,MAAM,EAAE,OAAO,IAAI;IACxB,IAAMpC,UAAU,GAAGgE,OAAO,CAAC5B,MAAM,CAAC,IAAI,CAAC,CAAC;IAExCmC,MAAM,CAACpG,MAAM,CAACsG,OAAO,CAAC,CAAC9F,OAAO,CAAC,UAAC+C,KAAK,EAAEgD,UAAU,EAAK;MACpD,IAAM/C,QAAQ,WAAA/B,MAAA,CAAW0E,CAAC,EAAA1E,MAAA,CAAG8E,UAAU,CAAE;MACzC,IAAMC,WAAW,GAAGlD,gBAAgB,CAClCC,KAAK,EACLC,QAAQ,EACRC,aAAa,EACbC,QAAQ,EACR7B,UAAU,EACV8B,WACF,CAAC;MACDuC,WAAW,CAAC/F,IAAI,CAAAE,aAAA,CAAAA,aAAA,KAAMmG,WAAW;QAAEC,YAAY,EAAElD,KAAK;QAAEmD,aAAa,EAAE/C;MAAW,EAAE,CAAC;IACvF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOuC,WAAW;AACpB,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,cAEahB,iBAAiB"}
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
  require("core-js/modules/es.array.filter.js");
10
- require("core-js/modules/es.array.for-each.js");
11
10
  require("core-js/modules/es.object.to-string.js");
11
+ require("core-js/modules/es.array.for-each.js");
12
12
  require("core-js/modules/web.dom-collections.for-each.js");
13
13
  var _lodash = _interopRequireDefault(require("lodash.isnumber"));
14
14
  var getCenterCoordinates = function getCenterCoordinates(mapShapes, otherProps) {
@@ -1 +1 @@
1
- {"version":3,"file":"get-center-coordinates.js","names":["_lodash","_interopRequireDefault","require","getCenterCoordinates","mapShapes","otherProps","centerCoordinates","centerLatitude","centerLongitude","useDefaultCenter","isNumber","latitude","longitude","useAsCenterShapes","filter","_ref","useAsCenter","shapesForCenter","length","forEach","_ref2","push","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/get-center-coordinates.js"],"sourcesContent":["import isNumber from 'lodash.isnumber';\n\nconst getCenterCoordinates = (mapShapes, otherProps) => {\n const centerCoordinates = [];\n\n const { centerLatitude, centerLongitude } = otherProps;\n const useDefaultCenter =\n centerLatitude !== 0 &&\n centerLongitude !== 0 &&\n isNumber(centerLatitude) &&\n isNumber(centerLongitude);\n\n if (useDefaultCenter) return [{ latitude: centerLatitude, longitude: centerLongitude }];\n\n const useAsCenterShapes = mapShapes.filter(({ useAsCenter }) => useAsCenter);\n const shapesForCenter = useAsCenterShapes.length ? useAsCenterShapes : mapShapes;\n shapesForCenter.forEach(({ latitude, longitude }) => {\n if (isNumber(latitude) && isNumber(longitude)) centerCoordinates.push({ latitude, longitude });\n });\n\n return centerCoordinates;\n};\n\nexport default getCenterCoordinates;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAIC,SAAS,EAAEC,UAAU,EAAK;EACtD,IAAMC,iBAAiB,GAAG,EAAE;EAE5B,IAAQC,cAAc,GAAsBF,UAAU,CAA9CE,cAAc;IAAEC,eAAe,GAAKH,UAAU,CAA9BG,eAAe;EACvC,IAAMC,gBAAgB,GACpBF,cAAc,KAAK,CAAC,IACpBC,eAAe,KAAK,CAAC,IACrB,IAAAE,kBAAQ,EAACH,cAAc,CAAC,IACxB,IAAAG,kBAAQ,EAACF,eAAe,CAAC;EAE3B,IAAIC,gBAAgB,EAAE,OAAO,CAAC;IAAEE,QAAQ,EAAEJ,cAAc;IAAEK,SAAS,EAAEJ;EAAgB,CAAC,CAAC;EAEvF,IAAMK,iBAAiB,GAAGT,SAAS,CAACU,MAAM,CAAC,UAAAC,IAAA;IAAA,IAAGC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAA,OAAOA,WAAW;EAAA,EAAC;EAC5E,IAAMC,eAAe,GAAGJ,iBAAiB,CAACK,MAAM,GAAGL,iBAAiB,GAAGT,SAAS;EAChFa,eAAe,CAACE,OAAO,CAAC,UAAAC,KAAA,EAA6B;IAAA,IAA1BT,QAAQ,GAAAS,KAAA,CAART,QAAQ;MAAEC,SAAS,GAAAQ,KAAA,CAATR,SAAS;IAC5C,IAAI,IAAAF,kBAAQ,EAACC,QAAQ,CAAC,IAAI,IAAAD,kBAAQ,EAACE,SAAS,CAAC,EAAEN,iBAAiB,CAACe,IAAI,CAAC;MAAEV,QAAQ,EAARA,QAAQ;MAAEC,SAAS,EAATA;IAAU,CAAC,CAAC;EAChG,CAAC,CAAC;EAEF,OAAON,iBAAiB;AAC1B,CAAC;AAAC,IAAAgB,QAAA,GAAAC,OAAA,cAEapB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"get-center-coordinates.js","names":["_lodash","_interopRequireDefault","require","getCenterCoordinates","mapShapes","otherProps","centerCoordinates","centerLatitude","centerLongitude","useDefaultCenter","isNumber","latitude","longitude","useAsCenterShapes","filter","_ref","useAsCenter","shapesForCenter","length","forEach","_ref2","push","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/get-center-coordinates.js"],"sourcesContent":["import isNumber from 'lodash.isnumber';\n\nconst getCenterCoordinates = (mapShapes, otherProps) => {\n const centerCoordinates = [];\n\n const { centerLatitude, centerLongitude } = otherProps;\n const useDefaultCenter =\n centerLatitude !== 0 &&\n centerLongitude !== 0 &&\n isNumber(centerLatitude) &&\n isNumber(centerLongitude);\n\n if (useDefaultCenter) return [{ latitude: centerLatitude, longitude: centerLongitude }];\n\n const useAsCenterShapes = mapShapes.filter(({ useAsCenter }) => useAsCenter);\n const shapesForCenter = useAsCenterShapes.length ? useAsCenterShapes : mapShapes;\n shapesForCenter.forEach(({ latitude, longitude }) => {\n if (isNumber(latitude) && isNumber(longitude)) centerCoordinates.push({ latitude, longitude });\n });\n\n return centerCoordinates;\n};\n\nexport default getCenterCoordinates;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAIC,SAAS,EAAEC,UAAU,EAAK;EACtD,IAAMC,iBAAiB,GAAG,EAAE;EAE5B,IAAQC,cAAc,GAAsBF,UAAU,CAA9CE,cAAc;IAAEC,eAAe,GAAKH,UAAU,CAA9BG,eAAe;EACvC,IAAMC,gBAAgB,GACpBF,cAAc,KAAK,CAAC,IACpBC,eAAe,KAAK,CAAC,IACrB,IAAAE,kBAAQ,EAACH,cAAc,CAAC,IACxB,IAAAG,kBAAQ,EAACF,eAAe,CAAC;EAE3B,IAAIC,gBAAgB,EAAE,OAAO,CAAC;IAAEE,QAAQ,EAAEJ,cAAc;IAAEK,SAAS,EAAEJ;EAAgB,CAAC,CAAC;EAEvF,IAAMK,iBAAiB,GAAGT,SAAS,CAACU,MAAM,CAAC,UAAAC,IAAA;IAAA,IAAGC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAA,OAAOA,WAAW;EAAA,EAAC;EAC5E,IAAMC,eAAe,GAAGJ,iBAAiB,CAACK,MAAM,GAAGL,iBAAiB,GAAGT,SAAS;EAChFa,eAAe,CAACE,OAAO,CAAC,UAAAC,KAAA,EAA6B;IAAA,IAA1BT,QAAQ,GAAAS,KAAA,CAART,QAAQ;MAAEC,SAAS,GAAAQ,KAAA,CAATR,SAAS;IAC5C,IAAI,IAAAF,kBAAQ,EAACC,QAAQ,CAAC,IAAI,IAAAD,kBAAQ,EAACE,SAAS,CAAC,EAAEN,iBAAiB,CAACe,IAAI,CAAC;MAAEV,QAAQ,EAARA,QAAQ;MAAEC,SAAS,EAATA;IAAU,CAAC,CAAC;EAChG,CAAC,CAAC;EAEF,OAAON,iBAAiB;AAC1B,CAAC;AAAC,IAAAgB,QAAA,GAAAC,OAAA,cAEapB,oBAAoB"}
@@ -8,11 +8,11 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports["default"] = void 0;
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  require("core-js/modules/es.array.for-each.js");
11
- require("core-js/modules/es.array.iterator.js");
12
11
  require("core-js/modules/es.object.to-string.js");
12
+ require("core-js/modules/web.dom-collections.for-each.js");
13
+ require("core-js/modules/es.array.iterator.js");
13
14
  require("core-js/modules/es.set.js");
14
15
  require("core-js/modules/es.string.iterator.js");
15
- require("core-js/modules/web.dom-collections.for-each.js");
16
16
  require("core-js/modules/web.dom-collections.iterator.js");
17
17
  var getImageIds = function getImageIds(mapShapes) {
18
18
  var ids = [];
@@ -1 +1 @@
1
- {"version":3,"file":"get-image-ids.js","names":["getImageIds","mapShapes","ids","forEach","_ref","shapeData","imageId","push","_toConsumableArray2","Set","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/get-image-ids.js"],"sourcesContent":["const getImageIds = mapShapes => {\n const ids = [];\n mapShapes.forEach(({ shapeData, imageId }) => {\n if (imageId) ids.push(imageId);\n if (shapeData.imageId) ids.push(shapeData.imageId);\n });\n return [...new Set(ids)];\n};\n\nexport default getImageIds;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAGC,SAAS,EAAI;EAC/B,IAAMC,GAAG,GAAG,EAAE;EACdD,SAAS,CAACE,OAAO,CAAC,UAAAC,IAAA,EAA4B;IAAA,IAAzBC,SAAS,GAAAD,IAAA,CAATC,SAAS;MAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACrC,IAAIA,OAAO,EAAEJ,GAAG,CAACK,IAAI,CAACD,OAAO,CAAC;IAC9B,IAAID,SAAS,CAACC,OAAO,EAAEJ,GAAG,CAACK,IAAI,CAACF,SAAS,CAACC,OAAO,CAAC;EACpD,CAAC,CAAC;EACF,WAAAE,mBAAA,aAAW,IAAIC,GAAG,CAACP,GAAG,CAAC;AACzB,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,cAEaX,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"get-image-ids.js","names":["getImageIds","mapShapes","ids","forEach","_ref","shapeData","imageId","push","_toConsumableArray2","Set","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/get-image-ids.js"],"sourcesContent":["const getImageIds = mapShapes => {\n const ids = [];\n mapShapes.forEach(({ shapeData, imageId }) => {\n if (imageId) ids.push(imageId);\n if (shapeData.imageId) ids.push(shapeData.imageId);\n });\n return [...new Set(ids)];\n};\n\nexport default getImageIds;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAGC,SAAS,EAAI;EAC/B,IAAMC,GAAG,GAAG,EAAE;EACdD,SAAS,CAACE,OAAO,CAAC,UAAAC,IAAA,EAA4B;IAAA,IAAzBC,SAAS,GAAAD,IAAA,CAATC,SAAS;MAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACrC,IAAIA,OAAO,EAAEJ,GAAG,CAACK,IAAI,CAACD,OAAO,CAAC;IAC9B,IAAID,SAAS,CAACC,OAAO,EAAEJ,GAAG,CAACK,IAAI,CAACF,SAAS,CAACC,OAAO,CAAC;EACpD,CAAC,CAAC;EACF,WAAAE,mBAAA,aAAW,IAAIC,GAAG,CAACP,GAAG,CAAC;AACzB,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,cAEaX,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","lat","latitude","lng","longitude","push","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/get-path.js"],"sourcesContent":["const getPath = paths =>\n paths.reduce((acc, path) => {\n const { latitude: lat, longitude: lng } = path;\n acc.push({ lat, lng });\n return acc;\n }, []);\n\nexport default getPath;\n"],"mappings":";;;;;;;;;AAAA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAGC,KAAK;EAAA,OACnBA,KAAK,CAACC,MAAM,CAAC,UAACC,GAAG,EAAEC,IAAI,EAAK;IAC1B,IAAkBC,GAAG,GAAqBD,IAAI,CAAtCE,QAAQ;MAAkBC,GAAG,GAAKH,IAAI,CAAvBI,SAAS;IAChCL,GAAG,CAACM,IAAI,CAAC;MAAEJ,GAAG,EAAHA,GAAG;MAAEE,GAAG,EAAHA;IAAI,CAAC,CAAC;IACtB,OAAOJ,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;AAAA;AAAC,IAAAO,QAAA,GAAAC,OAAA,cAEMX,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","lat","latitude","lng","longitude","push","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/get-path.js"],"sourcesContent":["const getPath = paths =>\n paths.reduce((acc, path) => {\n const { latitude: lat, longitude: lng } = path;\n acc.push({ lat, lng });\n return acc;\n }, []);\n\nexport default getPath;\n"],"mappings":";;;;;;;;;AAAA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAGC,KAAK;EAAA,OACnBA,KAAK,CAACC,MAAM,CAAC,UAACC,GAAG,EAAEC,IAAI,EAAK;IAC1B,IAAkBC,GAAG,GAAqBD,IAAI,CAAtCE,QAAQ;MAAkBC,GAAG,GAAKH,IAAI,CAAvBI,SAAS;IAChCL,GAAG,CAACM,IAAI,CAAC;MAAEJ,GAAG,EAAHA,GAAG;MAAEE,GAAG,EAAHA;IAAI,CAAC,CAAC;IACtB,OAAOJ,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;AAAA;AAAC,IAAAO,QAAA,GAAAC,OAAA,cAEMX,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_addZoomListener","_interopRequireDefault","require","_buildQuery","_getImageIds","_buildShapesConfigs","_setMapOptions","_getCenterCoordinates","_buildMapShapes"],"sources":["../../../src/GoogleMaps/helpers/index.js"],"sourcesContent":["import addZoomListener from './add-zoom-listener';\nimport buildQuery from './build-query';\nimport getImageIds from './get-image-ids';\nimport buildShapesConfig from './build-shapes-configs';\nimport setMapOptions from './set-map-options';\nimport getCenterCoordinates from './get-center-coordinates';\nimport buildMapShapes from './build-map-shapes';\n\nexport {\n addZoomListener,\n buildQuery,\n getImageIds,\n buildShapesConfig,\n setMapOptions,\n getCenterCoordinates,\n buildMapShapes\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,mBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,qBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,eAAA,GAAAP,sBAAA,CAAAC,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_addZoomListener","_interopRequireDefault","require","_buildQuery","_getImageIds","_buildShapesConfigs","_setMapOptions","_getCenterCoordinates","_buildMapShapes"],"sources":["../../../src/GoogleMaps/helpers/index.js"],"sourcesContent":["import addZoomListener from './add-zoom-listener';\nimport buildQuery from './build-query';\nimport getImageIds from './get-image-ids';\nimport buildShapesConfig from './build-shapes-configs';\nimport setMapOptions from './set-map-options';\nimport getCenterCoordinates from './get-center-coordinates';\nimport buildMapShapes from './build-map-shapes';\n\nexport {\n addZoomListener,\n buildQuery,\n getImageIds,\n buildShapesConfig,\n setMapOptions,\n getCenterCoordinates,\n buildMapShapes\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,mBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,qBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,eAAA,GAAAP,sBAAA,CAAAC,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"set-map-options.js","names":["_buildMapTypeIds","_interopRequireDefault","require","_constants","setCustomColor","featureType","color","elementType","ELEMENT_GEOMETRY","stylers","getFeatureStyles","_ref","_ref$enableRoads","enableRoads","enableFeatureTransportation","enableFeatureLabels","enableFeaturePoi","enableFeatureBoundaries","customColors","push","apply","_toConsumableArray2","DISABLE_LABELS_STYLES","DISABLE_BOUNDARIES_STYLES","DISABLE_POI_STYLES","DISABLE_TRANSPORTATION_STYLES","setMapOptions","otherProps","centerLatitude","centerLongitude","defaultZoom","enableZoom","maxZoom","minZoom","enablePan","enableStreetView","enableFullScreen","enableSatelliteView","enableTerrainScreen","waterColor","landscapeColor","landscapeColorAll","mapType","concat","FEATURE_TYPE_MAP","ALL","center","lat","lng","zoom","gestureHandling","COOPERATIVE","NONE","panControl","zoomControl","disableDoubleClickZoom","streetViewControl","fullscreenControl","mapTypeControl","mapTypeControlOptions","mapTypeIds","buildMapTypeIds","mapTypeId","DEFAULT_SELECT_VALUE","undefined","styles","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/set-map-options.js"],"sourcesContent":["import buildMapTypeIds from './build-map-type-ids';\nimport {\n COOPERATIVE,\n NONE,\n ELEMENT_GEOMETRY,\n FEATURE_TYPE_MAP,\n ALL,\n DISABLE_TRANSPORTATION_STYLES,\n DISABLE_POI_STYLES,\n DISABLE_BOUNDARIES_STYLES,\n DISABLE_LABELS_STYLES,\n DEFAULT_SELECT_VALUE\n} from '../../constants';\n\nconst setCustomColor = (featureType, color, elementType) =>\n color\n ? [\n {\n featureType,\n elementType: elementType || ELEMENT_GEOMETRY,\n stylers: [\n {\n color\n }\n ]\n }\n ]\n : [];\n\nconst getFeatureStyles = ({\n enableRoads = true,\n enableFeatureTransportation,\n enableFeatureLabels,\n enableFeaturePoi,\n enableFeatureBoundaries\n}) => {\n const customColors = [];\n // todo: enableRoads is a legacy option can be removed in later updates\n if (!enableFeatureLabels || !enableRoads) customColors.push(...DISABLE_LABELS_STYLES);\n if (!enableFeatureBoundaries || !enableRoads) customColors.push(...DISABLE_BOUNDARIES_STYLES);\n if (!enableFeaturePoi || !enableRoads) customColors.push(...DISABLE_POI_STYLES);\n if (!enableFeatureTransportation || !enableRoads) {\n customColors.push(...DISABLE_TRANSPORTATION_STYLES);\n }\n\n return customColors;\n};\n\nconst setMapOptions = otherProps => {\n const {\n centerLatitude,\n centerLongitude,\n defaultZoom,\n enableZoom,\n maxZoom,\n minZoom,\n enablePan,\n enableStreetView,\n enableFullScreen,\n enableSatelliteView,\n enableTerrainScreen,\n waterColor,\n landscapeColor,\n landscapeColorAll,\n mapType\n } = otherProps;\n\n const customColors = [\n ...getFeatureStyles(otherProps),\n ...setCustomColor(FEATURE_TYPE_MAP.waterColor, waterColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColorAll, ALL)\n ];\n\n return {\n center: { lat: centerLatitude, lng: centerLongitude },\n zoom: defaultZoom,\n maxZoom: enableZoom ? maxZoom : defaultZoom,\n minZoom: enableZoom ? minZoom : defaultZoom,\n gestureHandling: enablePan || enableZoom ? COOPERATIVE : NONE,\n panControl: enablePan,\n zoomControl: enableZoom && minZoom !== maxZoom,\n disableDoubleClickZoom: !enableZoom,\n streetViewControl: enableStreetView,\n fullscreenControl: enableFullScreen,\n mapTypeControl: enableSatelliteView || enableTerrainScreen,\n mapTypeControlOptions: {\n mapTypeIds: buildMapTypeIds(enableSatelliteView, enableTerrainScreen)\n },\n mapTypeId: !mapType || mapType === DEFAULT_SELECT_VALUE ? undefined : mapType,\n styles: customColors\n };\n};\n\nexport default setMapOptions;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAaA,IAAME,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,WAAW,EAAEC,KAAK,EAAEC,WAAW;EAAA,OACrDD,KAAK,GACD,CACE;IACED,WAAW,EAAXA,WAAW;IACXE,WAAW,EAAEA,WAAW,IAAIC,2BAAgB;IAC5CC,OAAO,EAAE,CACP;MACEH,KAAK,EAALA;IACF,CAAC;EAEL,CAAC,CACF,GACD,EAAE;AAAA;AAER,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAMhB;EAAA,IAAAC,gBAAA,GAAAD,IAAA,CALJE,WAAW;IAAXA,WAAW,GAAAD,gBAAA,cAAG,IAAI,GAAAA,gBAAA;IAClBE,2BAA2B,GAAAH,IAAA,CAA3BG,2BAA2B;IAC3BC,mBAAmB,GAAAJ,IAAA,CAAnBI,mBAAmB;IACnBC,gBAAgB,GAAAL,IAAA,CAAhBK,gBAAgB;IAChBC,uBAAuB,GAAAN,IAAA,CAAvBM,uBAAuB;EAEvB,IAAMC,YAAY,GAAG,EAAE;EACvB;EACA,IAAI,CAACH,mBAAmB,IAAI,CAACF,WAAW,EAAEK,YAAY,CAACC,IAAI,CAAAC,KAAA,CAAjBF,YAAY,MAAAG,mBAAA,aAASC,gCAAqB,EAAC;EACrF,IAAI,CAACL,uBAAuB,IAAI,CAACJ,WAAW,EAAEK,YAAY,CAACC,IAAI,CAAAC,KAAA,CAAjBF,YAAY,MAAAG,mBAAA,aAASE,oCAAyB,EAAC;EAC7F,IAAI,CAACP,gBAAgB,IAAI,CAACH,WAAW,EAAEK,YAAY,CAACC,IAAI,CAAAC,KAAA,CAAjBF,YAAY,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O;IACLC,MAAM,EAAE;MAAEC,GAAG,EAAEnB,cAAc;MAAEoB,GAAG,EAAEnB;IAAgB,CAAC;IACrDoB,IAAI,EAAEnB,WAAW;IACjBE,OAAO,EAAED,UAAU,GAAGC,OAAO,GAAGF,WAAW;IAC3CG,OAAO,EAAEF,UAAU,GAAGE,OAAO,GAAGH,WAAW;IAC3CoB,eAAe,EAAEhB,SAAS,IAAIH,UAAU,GAAGoB,sBAAW,GAAGC,eAAI;IAC7DC,UAAU,EAAEnB,SAAS;IACrBoB,WAAW,EAAEvB,UAAU,IAAIE,OAAO,KAAKD,OAAO;IAC9CuB,sBAAsB,EAAE,CAACxB,UAAU;IACnCyB,iBAAiB,EAAErB,gBAAgB;IACnCsB,iBAAiB,EAAErB,gBAAgB;IACnCsB,cAAc,EAAErB,mBAAmB,IAAIC,mBAAmB;IAC1DqB,qBAAqB,EAAE;MACrBC,UAAU,EAAE,IAAAC,2BAAe,EAACxB,mBAAmB,EAAEC,mBAAmB;IACtE,CAAC;IACDwB,SAAS,EAAE,CAACpB,OAAO,IAAIA,OAAO,KAAKqB,+BAAoB,GAAGC,SAAS,GAAGtB,OAAO;IAC7EuB,MAAM,EAAE/C;EACV,CAAC;AACH,CAAC;AAAC,IAAAgD,QAAA,GAAAC,OAAA,cAEazC,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"set-map-options.js","names":["_buildMapTypeIds","_interopRequireDefault","require","_constants","setCustomColor","featureType","color","elementType","ELEMENT_GEOMETRY","stylers","getFeatureStyles","_ref","_ref$enableRoads","enableRoads","enableFeatureTransportation","enableFeatureLabels","enableFeaturePoi","enableFeatureBoundaries","customColors","push","apply","_toConsumableArray2","DISABLE_LABELS_STYLES","DISABLE_BOUNDARIES_STYLES","DISABLE_POI_STYLES","DISABLE_TRANSPORTATION_STYLES","setMapOptions","otherProps","centerLatitude","centerLongitude","defaultZoom","enableZoom","maxZoom","minZoom","enablePan","enableStreetView","enableFullScreen","enableSatelliteView","enableTerrainScreen","waterColor","landscapeColor","landscapeColorAll","mapType","concat","FEATURE_TYPE_MAP","ALL","center","lat","lng","zoom","gestureHandling","COOPERATIVE","NONE","panControl","zoomControl","disableDoubleClickZoom","streetViewControl","fullscreenControl","mapTypeControl","mapTypeControlOptions","mapTypeIds","buildMapTypeIds","mapTypeId","DEFAULT_SELECT_VALUE","undefined","styles","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/set-map-options.js"],"sourcesContent":["import buildMapTypeIds from './build-map-type-ids';\nimport {\n COOPERATIVE,\n NONE,\n ELEMENT_GEOMETRY,\n FEATURE_TYPE_MAP,\n ALL,\n DISABLE_TRANSPORTATION_STYLES,\n DISABLE_POI_STYLES,\n DISABLE_BOUNDARIES_STYLES,\n DISABLE_LABELS_STYLES,\n DEFAULT_SELECT_VALUE\n} from '../../constants';\n\nconst setCustomColor = (featureType, color, elementType) =>\n color\n ? [\n {\n featureType,\n elementType: elementType || ELEMENT_GEOMETRY,\n stylers: [\n {\n color\n }\n ]\n }\n ]\n : [];\n\nconst getFeatureStyles = ({\n enableRoads = true,\n enableFeatureTransportation,\n enableFeatureLabels,\n enableFeaturePoi,\n enableFeatureBoundaries\n}) => {\n const customColors = [];\n // todo: enableRoads is a legacy option can be removed in later updates\n if (!enableFeatureLabels || !enableRoads) customColors.push(...DISABLE_LABELS_STYLES);\n if (!enableFeatureBoundaries || !enableRoads) customColors.push(...DISABLE_BOUNDARIES_STYLES);\n if (!enableFeaturePoi || !enableRoads) customColors.push(...DISABLE_POI_STYLES);\n if (!enableFeatureTransportation || !enableRoads) {\n customColors.push(...DISABLE_TRANSPORTATION_STYLES);\n }\n\n return customColors;\n};\n\nconst setMapOptions = otherProps => {\n const {\n centerLatitude,\n centerLongitude,\n defaultZoom,\n enableZoom,\n maxZoom,\n minZoom,\n enablePan,\n enableStreetView,\n enableFullScreen,\n enableSatelliteView,\n enableTerrainScreen,\n waterColor,\n landscapeColor,\n landscapeColorAll,\n mapType\n } = otherProps;\n\n const customColors = [\n ...getFeatureStyles(otherProps),\n ...setCustomColor(FEATURE_TYPE_MAP.waterColor, waterColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColorAll, ALL)\n ];\n\n return {\n center: { lat: centerLatitude, lng: centerLongitude },\n zoom: defaultZoom,\n maxZoom: enableZoom ? maxZoom : defaultZoom,\n minZoom: enableZoom ? minZoom : defaultZoom,\n gestureHandling: enablePan || enableZoom ? COOPERATIVE : NONE,\n panControl: enablePan,\n zoomControl: enableZoom && minZoom !== maxZoom,\n disableDoubleClickZoom: !enableZoom,\n streetViewControl: enableStreetView,\n fullscreenControl: enableFullScreen,\n mapTypeControl: enableSatelliteView || enableTerrainScreen,\n mapTypeControlOptions: {\n mapTypeIds: buildMapTypeIds(enableSatelliteView, enableTerrainScreen)\n },\n mapTypeId: !mapType || mapType === DEFAULT_SELECT_VALUE ? undefined : mapType,\n styles: customColors\n };\n};\n\nexport default setMapOptions;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAaA,IAAME,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,WAAW,EAAEC,KAAK,EAAEC,WAAW;EAAA,OACrDD,KAAK,GACD,CACE;IACED,WAAW,EAAXA,WAAW;IACXE,WAAW,EAAEA,WAAW,IAAIC,2BAAgB;IAC5CC,OAAO,EAAE,CACP;MACEH,KAAK,EAALA;IACF,CAAC;EAEL,CAAC,CACF,GACD,EAAE;AAAA;AAER,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAMhB;EAAA,IAAAC,gBAAA,GAAAD,IAAA,CALJE,WAAW;IAAXA,WAAW,GAAAD,gBAAA,cAAG,IAAI,GAAAA,gBAAA;IAClBE,2BAA2B,GAAAH,IAAA,CAA3BG,2BAA2B;IAC3BC,mBAAmB,GAAAJ,IAAA,CAAnB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M,EAAE/C;EACV,CAAC;AACH,CAAC;AAAC,IAAAgD,QAAA,GAAAC,OAAA,cAEazC,aAAa"}
@@ -2,10 +2,10 @@
2
2
 
3
3
  require("core-js/modules/es.symbol.js");
4
4
  require("core-js/modules/es.array.filter.js");
5
- require("core-js/modules/es.object.define-properties.js");
6
- require("core-js/modules/es.object.define-property.js");
7
5
  require("core-js/modules/es.object.get-own-property-descriptor.js");
8
6
  require("core-js/modules/es.object.get-own-property-descriptors.js");
7
+ require("core-js/modules/es.object.define-properties.js");
8
+ require("core-js/modules/es.object.define-property.js");
9
9
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
10
10
  Object.defineProperty(exports, "__esModule", {
11
11
  value: true
@@ -15,20 +15,20 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
15
15
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
17
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
18
- require("core-js/modules/es.array.every.js");
19
- require("core-js/modules/es.array.find.js");
20
18
  require("core-js/modules/es.array.for-each.js");
21
- require("core-js/modules/es.array.includes.js");
22
- require("core-js/modules/es.array.iterator.js");
23
- require("core-js/modules/es.array.map.js");
19
+ require("core-js/modules/es.object.to-string.js");
24
20
  require("core-js/modules/es.array.reduce.js");
25
21
  require("core-js/modules/es.object.keys.js");
26
- require("core-js/modules/es.object.to-string.js");
27
- require("core-js/modules/es.promise.js");
22
+ require("core-js/modules/es.array.includes.js");
28
23
  require("core-js/modules/es.string.includes.js");
24
+ require("core-js/modules/es.array.every.js");
25
+ require("core-js/modules/es.array.find.js");
26
+ require("core-js/modules/es.array.iterator.js");
27
+ require("core-js/modules/es.promise.js");
29
28
  require("core-js/modules/es.string.iterator.js");
30
- require("core-js/modules/web.dom-collections.for-each.js");
31
29
  require("core-js/modules/web.dom-collections.iterator.js");
30
+ require("core-js/modules/es.array.map.js");
31
+ require("core-js/modules/web.dom-collections.for-each.js");
32
32
  var _react = _interopRequireDefault(require("react"));
33
33
  var _lodash = _interopRequireDefault(require("lodash.isnumber"));
34
34
  var _server = _interopRequireDefault(require("react-dom/server"));