waygo-maps 1.0.33 → 1.0.35

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.
package/dist/bundle.js CHANGED
@@ -570,7 +570,7 @@ eval("// Currently in sync with Node.js lib/internal/util/comparisons.js\n// htt
570
570
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
571
571
 
572
572
  "use strict";
573
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _components_SliderBar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/SliderBar */ \"./src/components/SliderBar.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar CategoryBarControl = /*#__PURE__*/function (_Control) {\n function CategoryBarControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, CategoryBarControl);\n _this = _callSuper(this, CategoryBarControl, [options]);\n var categories = [{\n title: 'Energy & charging'\n }, {\n title: 'Mobility'\n }, {\n title: 'Automotive'\n }, {\n title: 'Indoor mapping'\n }, {\n title: 'Supply chain'\n }, {\n title: 'Tech data'\n }, {\n title: 'Insurance'\n }, {\n title: 'Rideshare'\n }, {\n title: 'Manufacturing'\n }, {\n title: 'Autonomous vehicles'\n }, {\n title: 'Human resources'\n }, {\n title: 'Battery tech'\n }, {\n title: 'Renewable energy'\n }];\n _this.categoryBar = new _components_SliderBar__WEBPACK_IMPORTED_MODULE_0__[\"default\"](categories, {\n container: 'category-bar'\n });\n // this.map = null;\n return _this;\n }\n _inherits(CategoryBarControl, _Control);\n return _createClass(CategoryBarControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'category-bar-control-container';\n var element = this.categoryBar.getElement();\n this.container.appendChild(element);\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.show();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(CategoryBarControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.categoryBar.on('selectNew', this._handleNewCategoryButtonSelect.bind(this));\n this.categoryBar.on('deselect', this._handleCategoryButtonDeselect.bind(this));\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n // TO RENDER DESKTOP VIEW\n var element = this.categoryBar.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n // console.log(\"DESKTOP\");\n // this.container.style.width = '400px';\n // element.style.width = '400px';\n var newWidth = this.map.mapContainer.offsetWidth;\n console.log(\"DESKTOP WIDTH\", newWidth);\n this.categoryBar.setViewForDesktop();\n\n // element.classList\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n // TO RENDER MOBILE VIEW\n // const element = this.categoryBar.getElement();\n // this.container.appendChild(element);\n // this.container.classList.remove('desktop-view');\n // this.container.classList.add('mobile-view');\n // this.container.style.width = '100%';\n // element.style.width = '100%';\n\n // console.log(\"HELLOOO\");\n // this.container.style.width = '450px';\n // this.container.style.width = `calc(${this.map.mapContainer.offsetWidth}px - 1px)`;\n // this.container.style.width = `${this.map.mapContainer.width}px`;\n // this.container.style.width = `100%`;\n // console.log(\"MOBILE\");\n // const newWidth = this.map.mapContainer.offsetWidth;\n // console.log(\"MOBILE WIDTH\", newWidth);\n var element = this.categoryBar.getElement();\n this.container.appendChild(element);\n\n // this.container.style.width = `${this.map.mapContainer.offsetWidth}px`;\n // element.style.width = '100%';\n // this.container.style.width = '100%';\n // element.style.width = `${this.map.mapContainer.offsetWidth}px`;\n var newWidth = this.map.mapContainer.offsetWidth;\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n console.log(\"MOBILE WIDTH22\", newWidth, this.map.map.getCanvasContainer().offsetWidth);\n this.categoryBar.setViewForMobile();\n // console.log(\"MOBILE WIDTH2\", newWidth);\n // setTimeout(() => {\n // const element = this.categoryBar.getElement();\n // this.container.appendChild(element);\n\n // this.container.style.width = `${this.map.mapContainer.offsetWidth}px`;\n // element.style.width = `${this.map.mapContainer.offsetWidth}px`;\n // const newWidth = this.map.mapContainer.offsetWidth;\n // this.container.classList.remove('desktop-view');\n // this.container.classList.add('mobile-view');\n\n // console.log(\"MOBILE WIDTH2\", newWidth);\n // }, 2000);\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.show();\n this.categoryBar.deselectAll();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(_) {\n this.hide();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(_) {\n // console.log(\"handling directions state in category bar control\");\n this.hide();\n }\n }, {\n key: \"_handleNewCategoryButtonSelect\",\n value: function _handleNewCategoryButtonSelect(data) {\n var query = data.query;\n this.map.setToSearchState(query);\n }\n }, {\n key: \"_handleCategoryButtonDeselect\",\n value: function _handleCategoryButtonDeselect() {\n this.map.setToDefaultState();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.show();\n this.categoryBar.deselectAllNotMatchingQuery(query);\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CategoryBarControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/CategoryBarControl.js?");
573
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _components_SliderBar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/SliderBar */ \"./src/components/SliderBar.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar CategoryBarControl = /*#__PURE__*/function (_Control) {\n function CategoryBarControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, CategoryBarControl);\n _this = _callSuper(this, CategoryBarControl, [options]);\n _this.categoryBar = new _components_SliderBar__WEBPACK_IMPORTED_MODULE_0__[\"default\"]([], {\n container: 'category-bar'\n });\n _this.map = null;\n return _this;\n }\n _inherits(CategoryBarControl, _Control);\n return _createClass(CategoryBarControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'category-bar-control-container';\n var element = this.categoryBar.getElement();\n this.container.appendChild(element);\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.show();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(CategoryBarControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.categoryBar.on('selectNew', this._handleNewCategoryButtonSelect.bind(this));\n this.categoryBar.on('deselect', this._handleCategoryButtonDeselect.bind(this));\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('load', this._handleMapLoad.bind(this));\n }\n }, {\n key: \"_handleMapLoad\",\n value: function _handleMapLoad(data) {\n var mapData = data.mapData;\n var suggestedSearchTerms = mapData.suggested_search_terms;\n if (suggestedSearchTerms) {\n this.categoryBar.updateItems(suggestedSearchTerms);\n }\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n // TO RENDER DESKTOP VIEW\n var element = this.categoryBar.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n var newWidth = this.map.mapContainer.offsetWidth;\n this.categoryBar.setViewForDesktop();\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n var element = this.categoryBar.getElement();\n this.container.appendChild(element);\n var newWidth = this.map.mapContainer.offsetWidth;\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n this.categoryBar.setViewForMobile();\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.show();\n this.categoryBar.deselectAll();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(_) {\n this.hide();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(_) {\n this.hide();\n }\n }, {\n key: \"_handleNewCategoryButtonSelect\",\n value: function _handleNewCategoryButtonSelect(data) {\n var query = data.query;\n this.map.setToSearchState(query);\n }\n }, {\n key: \"_handleCategoryButtonDeselect\",\n value: function _handleCategoryButtonDeselect() {\n this.map.setToDefaultState();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.show();\n this.categoryBar.deselectAllNotMatchingQuery(query);\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CategoryBarControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/CategoryBarControl.js?");
574
574
 
575
575
  /***/ }),
576
576
 
@@ -581,7 +581,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
581
581
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
582
582
 
583
583
  "use strict";
584
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _components_ContentPlacementView_ContentDetails__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/ContentPlacementView/ContentDetails */ \"./src/components/ContentPlacementView/ContentDetails.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar ContentPlacementControl = /*#__PURE__*/function (_Control) {\n function ContentPlacementControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, ContentPlacementControl);\n _this = _callSuper(this, ContentPlacementControl, [options]);\n _this.map = null;\n _this.contentPlacementIds = [];\n _this.currentContentPlacement = null;\n _this.contentPlacementView = null;\n // this.contentPlacementView = new ContentDetails();\n return _this;\n }\n _inherits(ContentPlacementControl, _Control);\n return _createClass(ContentPlacementControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'content-details-control-container';\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(ContentPlacementControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n if (!this.contentPlacementView) {\n return;\n }\n var element = this.contentPlacementView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n console.log('rendering search results DESKTOP');\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n if (!this.contentPlacementView) {\n return;\n }\n var element = this.contentPlacementView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n console.log('rendering search results MOBILE');\n }\n }, {\n key: \"_handleMapInitiateBack\",\n value: function _handleMapInitiateBack() {\n var currentState = this.map._stateCoordinator.state;\n if (currentState === 'selectedContent') {\n if (this.contentPlacementIds.length === 0) return;else if (this.contentPlacementIds.length === 1) {\n var stateHistory = this.map._stateCoordinator.stateHistory;\n var previousMapState = stateHistory[stateHistory.length - 2];\n stateHistory.pop();\n stateHistory.pop();\n if (previousMapState === 'search') {\n this.map.initiateSetToSearchState();\n } else {\n this.map.setToDefaultState();\n }\n } else {\n this.contentPlacementIds.pop();\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n } else if (currentState === 'directions') {\n console.log(\"THIS IS BACK IN DIRECTIONS STATE:\", this.contentPlacementIds.length);\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n }\n }, {\n key: \"_handleSelectChildContentPlacement\",\n value: function _handleSelectChildContentPlacement(data) {\n console.log(\"SELECT CHILD\", data);\n var placementId = data.placementId;\n this.contentPlacementIds.push(placementId);\n console.log(\"1. Ssssssssssss in control for select child\", this.contentPlacementIds, placementId);\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n this.contentPlacementIds = [];\n this.currentContentPlacement = null;\n this._clearViews();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(_) {\n // const { query, results } = data;\n this.hide();\n this.contentPlacementIds = [];\n this.currentContentPlacement = null;\n this._clearViews();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.contentPlacementIds = contentPlacementIds;\n this.currentContentPlacement = selectedContentPlacement;\n console.log(\"SELECTED\", selectedContentPlacement);\n this._updateContentViews();\n this.show();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(_) {\n // console.log(\"handling directions state in content placement control\");\n this.hide();\n // this.contentPlacementIds = [];\n // this.currentContentPlacement = null;\n // this._clearViews();\n }\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function () {\n var _handleSelectDirectionsButton2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var placementId;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n placementId = data.placementId;\n _context.next = 3;\n return this.map.setToDirectionsState(null, placementId);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleSelectDirectionsButton(_x) {\n return _handleSelectDirectionsButton2.apply(this, arguments);\n }\n return _handleSelectDirectionsButton;\n }()\n }, {\n key: \"_handleSelectShareButton\",\n value: function () {\n var _handleSelectShareButton2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var _this2 = this;\n var placementId, accountId, mapId, mapViewId, textToCopy;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n placementId = data.placementId;\n accountId = this.map.mapData.account_id;\n mapId = this.map.mapData.map_id;\n mapViewId = this.map.mapData.map_view_id;\n textToCopy = \"https://maps.waygomaps.com/\".concat(accountId, \"/\").concat(mapId, \"/\").concat(mapViewId, \"/selected-content/\").concat(placementId, \"/0.0,0.0,14.2,45.0,-37.0\");\n navigator.clipboard.writeText(textToCopy).then(function () {\n _this2.contentPlacementView.showCopyPopup();\n })[\"catch\"](function (err) {\n return console.error('Failed to copy text:', err);\n });\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleSelectShareButton(_x2) {\n return _handleSelectShareButton2.apply(this, arguments);\n }\n return _handleSelectShareButton;\n }()\n }, {\n key: \"_updateContentViews\",\n value: function _updateContentViews() {\n this._clearViews();\n this._render();\n }\n }, {\n key: \"_render\",\n value: function _render() {\n console.log(\"HERE IS NUMBER OF CONTENT PLACEMENTS:\", this.contentPlacementIds.length);\n if (this.contentPlacementIds.length === 0 || this.currentContentPlacement === null) return;\n this.contentPlacementView = new _components_ContentPlacementView_ContentDetails__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this.contentPlacementView.updateView(this.currentContentPlacement);\n this.contentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n this.contentPlacementView.on('selectDirectionsButton', this._handleSelectDirectionsButton.bind(this));\n this.contentPlacementView.on('selectShareButton', this._handleSelectShareButton.bind(this));\n\n // this.container.appendChild(this.contentPlacementView.getElement());\n\n this._initialize();\n\n // this._initialize();\n }\n\n // _clearViews() {\n // while (this.container.firstChild) {\n // this.container.removeChild(this.container.firstChild);\n // }\n // }\n\n // show() {\n // this.container.classList.add('visible');\n // }\n\n // hide() {\n // this.container.classList.remove('visible');\n // }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContentPlacementControl);\n\n// class ContentPlacementControl extends Control {\n// constructor(options = {}) {\n// super(options);\n// this.map = null;\n// this.contentPlacementStack = [];\n// this.searchApi = waygoMaps.getSearchApi();\n\n// this.currentView = null;\n// }\n\n// onAdd(map) {\n// this.map = map;\n\n// this.container = document.createElement('div');\n// this.container.className = 'content-details-control-container';\n\n// this.initializeEventListeners();\n// this._attachResizeListener();\n// this.hide();\n// this._initialize();\n// return this.container;\n// }\n\n// onRemove() {\n// super.onRemove();\n// }\n\n// _initialize() {\n// const containerWidth = this.map.mapContainer.offsetWidth;\n// this._configureView(containerWidth);\n// }\n\n// _configureView(width) {\n// if (width > 767) {\n// this._setViewForDesktop();\n// } else {\n// this._setViewForMobile();\n// }\n// } \n\n// _setViewForDesktop() {\n// console.log(\"SET VIEW FOR DESKTOP\");\n// this.currentView = 'desktop';\n// this._updateContentViews();\n// }\n\n// _setViewForMobile() {\n// console.log(\"SET VIEW FOR MOBILE\");\n// this.currentView = 'mobile';\n// this._updateContentViews();\n// }\n\n// _attachResizeListener() {\n// window.addEventListener('resize', () => {\n// const newWidth = this.map.mapContainer.offsetWidth;\n// // console.log(\"WIDTH\", newWidth);\n// this._configureView(newWidth); // Reconfigure based on new width\n// });\n// }\n\n// initializeEventListeners() {\n// this.map.on('setToSearchState', this._handleSearchState.bind(this));\n// this.map.on('setToDefaultState', this._handleDefaultState.bind(this));\n// this.map.on('setToSelectedContentState', this._handleSelectedContentState.bind(this));\n// }\n\n// async _handleSelectChildContentPlacement(data) {\n// const { placementId } = data;\n// const contentPlacement = await this.map.getContentPlacementDetails(placementId);\n// this.contentPlacementStack.push(contentPlacement);\n// console.log(this.contentPlacementStack);\n// this._updateContentViews();\n// }\n\n// // STATE METHODS\n// _handleDefaultState() {\n// this.hide();\n// // Should clear them too!\n// }\n\n// _handleSearchState(data) {\n// const { query, results } = data;\n// this.hide();\n// }\n\n// _handleSelectedContentState(data) {\n// const { contentPlacement } = data;\n// this.contentPlacementStack = [contentPlacement];\n// this._updateContentViews();\n// this.show();\n\n// // if (this.contentPlacementView && this.container.lastChild) {\n// // this.container.removeChild(this.container.lastChild);\n// // }\n\n// // this.contentPlacementView = new ContentDetails();\n// // this.contentPlacementView.updateView(contentPlacement);\n// // this.contentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// // this.container.appendChild(this.contentPlacementView.getElement());\n\n// // NEED TO USE this.contentPlacementStack and CURRENT WIDTH TO APPRORIATELY SET VIEWS\n// }\n\n// _updateContentViews() {\n// this._clearViews();\n\n// if (this.currentView === 'desktop') {\n// this._renderDesktopView();\n// } else {\n// this._renderMobileView();\n// }\n// }\n\n// _renderDesktopView() {\n// if (this.contentPlacementStack.length === 0) return;\n\n// const firstPlacement = this.contentPlacementStack[0];\n// const lastPlacement = this.contentPlacementStack[this.contentPlacementStack.length - 1];\n\n// const leftContentPlacementView = new ContentDetails();\n// leftContentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// leftContentPlacementView.updateView(firstPlacement);\n// this.container.appendChild(leftContentPlacementView.getElement());\n\n// if (this.contentPlacementStack.length > 1) {\n// const rightContentPlacementView = new ContentDetails();\n// rightContentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// rightContentPlacementView.updateView(lastPlacement);\n// this.container.appendChild(rightContentPlacementView.getElement());\n// }\n// }\n\n// _renderMobileView() {\n// if (this.contentPlacementStack.length === 0) return;\n\n// const lastPlacement = this.contentPlacementStack[this.contentPlacementStack.length - 1];\n\n// const mobileContentPlacementView = new ContentDetails();\n// mobileContentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n// mobileContentPlacementView.updateView(lastPlacement);\n// this.container.appendChild(mobileContentPlacementView.getElement());\n// }\n\n// _clearViews() {\n// while (this.container.firstChild) {\n// this.container.removeChild(this.container.firstChild);\n// }\n// }\n\n// // HIDE/SHOW METHODS\n// show() {\n// this.container.classList.add('visible');\n// }\n\n// hide() {\n// this.container.classList.remove('visible');\n// }\n// }\n\n// export default ContentPlacementControl;\n\n//# sourceURL=webpack://waygomaps/./src/Controls/ContentPlacementControl.js?");
584
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _components_ContentPlacementView_ContentDetails__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/ContentPlacementView/ContentDetails */ \"./src/components/ContentPlacementView/ContentDetails.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar ContentPlacementControl = /*#__PURE__*/function (_Control) {\n function ContentPlacementControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, ContentPlacementControl);\n _this = _callSuper(this, ContentPlacementControl, [options]);\n _this.map = null;\n _this.contentPlacementIds = [];\n _this.currentContentPlacement = null;\n _this.contentPlacementView = null;\n return _this;\n }\n _inherits(ContentPlacementControl, _Control);\n return _createClass(ContentPlacementControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'content-details-control-container';\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(ContentPlacementControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n if (!this.contentPlacementView) {\n return;\n }\n var element = this.contentPlacementView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n if (!this.contentPlacementView) {\n return;\n }\n var element = this.contentPlacementView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n }\n }, {\n key: \"_handleMapInitiateBack\",\n value: function _handleMapInitiateBack() {\n var currentState = this.map._stateCoordinator.state;\n if (currentState === 'selectedContent') {\n if (this.contentPlacementIds.length === 0) return;else if (this.contentPlacementIds.length === 1) {\n var stateHistory = this.map._stateCoordinator.stateHistory;\n var previousMapState = stateHistory[stateHistory.length - 2];\n stateHistory.pop();\n stateHistory.pop();\n if (previousMapState === 'search') {\n this.map.initiateSetToSearchState();\n } else {\n this.map.setToDefaultState();\n }\n } else {\n this.contentPlacementIds.pop();\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n } else if (currentState === 'directions') {\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n }\n }, {\n key: \"_handleSelectChildContentPlacement\",\n value: function _handleSelectChildContentPlacement(data) {\n var placementId = data.placementId;\n this.contentPlacementIds.push(placementId);\n this.map.setToSelectedContentState(this.contentPlacementIds);\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n this.contentPlacementIds = [];\n this.currentContentPlacement = null;\n this._clearViews();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(_) {\n this.hide();\n this.contentPlacementIds = [];\n this.currentContentPlacement = null;\n this._clearViews();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.contentPlacementIds = contentPlacementIds;\n this.currentContentPlacement = selectedContentPlacement;\n this._updateContentViews();\n this.show();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(_) {\n this.hide();\n }\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function () {\n var _handleSelectDirectionsButton2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var placementId;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n placementId = data.placementId;\n _context.next = 3;\n return this.map.setToDirectionsState(null, placementId);\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleSelectDirectionsButton(_x) {\n return _handleSelectDirectionsButton2.apply(this, arguments);\n }\n return _handleSelectDirectionsButton;\n }()\n }, {\n key: \"_handleSelectShareButton\",\n value: function () {\n var _handleSelectShareButton2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var _this2 = this;\n var placementId, accountId, mapId, mapViewId, textToCopy;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n placementId = data.placementId;\n accountId = this.map.mapData.account_id;\n mapId = this.map.mapData.map_id;\n mapViewId = this.map.mapData.map_view_id;\n textToCopy = \"https://maps.waygomaps.com/\".concat(accountId, \"/\").concat(mapId, \"/\").concat(mapViewId, \"/selected-content/\").concat(placementId, \"/0.0,0.0,14.2,45.0,-37.0\");\n navigator.clipboard.writeText(textToCopy).then(function () {\n _this2.contentPlacementView.showCopyPopup();\n })[\"catch\"](function (err) {\n return console.error('Failed to copy text:', err);\n });\n case 6:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleSelectShareButton(_x2) {\n return _handleSelectShareButton2.apply(this, arguments);\n }\n return _handleSelectShareButton;\n }()\n }, {\n key: \"_updateContentViews\",\n value: function _updateContentViews() {\n this._clearViews();\n this._render();\n }\n }, {\n key: \"_render\",\n value: function _render() {\n if (this.contentPlacementIds.length === 0 || this.currentContentPlacement === null) return;\n this.contentPlacementView = new _components_ContentPlacementView_ContentDetails__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this.contentPlacementView.updateView(this.currentContentPlacement);\n this.contentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n this.contentPlacementView.on('selectDirectionsButton', this._handleSelectDirectionsButton.bind(this));\n this.contentPlacementView.on('selectShareButton', this._handleSelectShareButton.bind(this));\n this._initialize();\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContentPlacementControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/ContentPlacementControl.js?");
585
585
 
586
586
  /***/ }),
587
587
 
@@ -592,7 +592,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
592
592
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
593
593
 
594
594
  "use strict";
595
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/DirectionsView/DirectionsView */ \"./src/components/DirectionsView/DirectionsView.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar DirectionsControl = /*#__PURE__*/function (_Control) {\n function DirectionsControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsControl);\n _this = _callSuper(this, DirectionsControl, [options]);\n _this.directionsView = null;\n _this.map = null;\n return _this;\n }\n _inherits(DirectionsControl, _Control);\n return _createClass(DirectionsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'directions-control-container';\n this.directionsView = new _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.container.appendChild(this.directionsView.getElement());\n this.initializeEventListeners();\n this.createDirectionsLineLayer();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(DirectionsControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n // this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n\n this.directionsView.on('initiate:findPath', this._handleIntiateFindPath.bind(this));\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n if (!this.directionsView) {\n return;\n }\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n console.log('rendering search results DESKTOP');\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n if (!this.directionsView) {\n return;\n }\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n console.log('rendering search results MOBILE');\n }\n }, {\n key: \"createDirectionsLineLayer\",\n value: function createDirectionsLineLayer() {\n this.map.map.addSource('directionsLineSource', {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n }\n });\n\n // Add a new layer for the line\n this.map.map.addLayer({\n 'id': 'directionsLineLayer',\n 'type': 'line',\n 'source': 'directionsLineSource',\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': '#1e1e1e',\n 'line-width': 8\n // 'line-blur': 0.9\n }\n });\n this.map.map.moveLayer('directionsLineLayer', 'special-areas');\n }\n }, {\n key: \"updateLineData\",\n value: function updateLineData(newCoordinates) {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': newCoordinates\n }\n });\n var bounds = new mapboxgl.LngLatBounds();\n newCoordinates.forEach(function (coordinate) {\n bounds.extend(coordinate);\n });\n this.map.map.fitBounds(bounds, _defineProperty(_defineProperty(_defineProperty({\n padding: 200\n }, \"padding\", {\n top: 200,\n bottom: 200,\n left: 500,\n right: 150\n }), \"maxZoom\", 15), \"duration\", 1000));\n }\n }, {\n key: \"clearLineData\",\n value: function clearLineData() {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n });\n }\n\n // _handleMapInitiateBack() {\n\n // }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n // this._clearViews();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hide();\n // this._clearViews();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n // this._updateContentViews();\n this.hide();\n this.directionsView.updateView(null, null);\n this.clearLineData();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(data) {\n var startContentPlacement = data.startContentPlacement,\n endContentPlacement = data.endContentPlacement;\n console.log(\"handling directions state in directions control\", data);\n this.show();\n this.clearLineData();\n this.directionsView.updateView(startContentPlacement, endContentPlacement);\n }\n }, {\n key: \"_handleIntiateFindPath\",\n value: function _handleIntiateFindPath(data) {\n var startContentPlacementId = data.startContentPlacementId,\n endContentPlacementId = data.endContentPlacementId;\n this.clearLineData();\n var pathResponse = this.map.findPath(startContentPlacementId, endContentPlacementId);\n console.log(\"HERE IS PATH RESPONSEEE\", pathResponse);\n var coordinates = pathResponse.coordinates,\n steps = pathResponse.steps;\n this.updateLineData(coordinates);\n this.directionsView.setSteps(steps);\n }\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function _handleSelectDirectionsButton(data) {\n var placementId = data.placementId;\n // this.map.setToDirectionsState(null, placementId);\n }\n\n // _updateContentViews() {\n // this._clearViews();\n // this._render();\n // }\n }, {\n key: \"_render\",\n value: function _render() {\n console.log('render');\n // if (this.contentPlacementIds.length === 0 || this.currentContentPlacement === null) return;\n\n // const contentPlacementView = new ContentDetails();\n // contentPlacementView.updateView(this.currentContentPlacement);\n // contentPlacementView.on('selectChildContentPlacement', this._handleSelectChildContentPlacement.bind(this));\n // contentPlacementView.on('selectDirectionsButton', this._handleSelectDirectionsButton.bind(this));\n\n // this.container.appendChild(contentPlacementView.getElement());\n }\n\n // _clearViews() {\n // while (this.container.firstChild) {\n // this.container.removeChild(this.container.firstChild);\n // }\n // }\n\n // show() {\n // this.container.classList.add('visible');\n // }\n\n // hide() {\n // this.container.classList.remove('visible');\n // }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/DirectionsControl.js?");
595
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/DirectionsView/DirectionsView */ \"./src/components/DirectionsView/DirectionsView.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar DirectionsControl = /*#__PURE__*/function (_Control) {\n function DirectionsControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsControl);\n _this = _callSuper(this, DirectionsControl, [options]);\n _this.directionsView = null;\n _this.map = null;\n return _this;\n }\n _inherits(DirectionsControl, _Control);\n return _createClass(DirectionsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'directions-control-container';\n this.directionsView = new _components_DirectionsView_DirectionsView__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.container.appendChild(this.directionsView.getElement());\n this.initializeEventListeners();\n this.createDirectionsLineLayer();\n this._attachResizeListener();\n this._initialize();\n this.hide();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(DirectionsControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n // this.map.on('initiate:back', this._handleMapInitiateBack.bind(this));\n\n this.directionsView.on('initiate:findPath', this._handleIntiateFindPath.bind(this));\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n if (!this.directionsView) {\n return;\n }\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n if (!this.directionsView) {\n return;\n }\n var element = this.directionsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n }\n }, {\n key: \"createDirectionsLineLayer\",\n value: function createDirectionsLineLayer() {\n this.map.map.addSource('directionsLineSource', {\n 'type': 'geojson',\n 'data': {\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n }\n });\n\n // Add a new layer for the line\n this.map.map.addLayer({\n 'id': 'directionsLineLayer',\n 'type': 'line',\n 'source': 'directionsLineSource',\n 'layout': {\n 'line-join': 'round',\n 'line-cap': 'round'\n },\n 'paint': {\n 'line-color': '#1e1e1e',\n 'line-width': 8\n // 'line-blur': 0.9\n }\n });\n this.map.map.moveLayer('directionsLineLayer', 'special-areas');\n }\n }, {\n key: \"updateLineData\",\n value: function updateLineData(newCoordinates) {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': newCoordinates\n }\n });\n var bounds = new mapboxgl.LngLatBounds();\n newCoordinates.forEach(function (coordinate) {\n bounds.extend(coordinate);\n });\n this.map.map.fitBounds(bounds, _defineProperty(_defineProperty(_defineProperty({\n padding: 200\n }, \"padding\", {\n top: 200,\n bottom: 200,\n left: 500,\n right: 150\n }), \"maxZoom\", 15), \"duration\", 1000));\n }\n }, {\n key: \"clearLineData\",\n value: function clearLineData() {\n this.map.map.getSource('directionsLineSource').setData({\n 'type': 'Feature',\n 'properties': {},\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n });\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.hide();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hide();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.hide();\n this.directionsView.updateView(null, null);\n this.clearLineData();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(data) {\n var startContentPlacement = data.startContentPlacement,\n endContentPlacement = data.endContentPlacement;\n this.show();\n this.clearLineData();\n this.directionsView.updateView(startContentPlacement, endContentPlacement);\n }\n }, {\n key: \"_handleIntiateFindPath\",\n value: function _handleIntiateFindPath(data) {\n var startContentPlacementId = data.startContentPlacementId,\n endContentPlacementId = data.endContentPlacementId;\n this.clearLineData();\n var pathResponse = this.map.findPath(startContentPlacementId, endContentPlacementId);\n var coordinates = pathResponse.coordinates,\n steps = pathResponse.steps;\n this.updateLineData(coordinates);\n this.directionsView.setSteps(steps);\n }\n }, {\n key: \"_handleSelectDirectionsButton\",\n value: function _handleSelectDirectionsButton(data) {\n var placementId = data.placementId;\n }\n }, {\n key: \"_render\",\n value: function _render() {\n return;\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/DirectionsControl.js?");
596
596
 
597
597
  /***/ }),
598
598
 
@@ -603,7 +603,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
603
603
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
604
604
 
605
605
  "use strict";
606
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar InteractionControl = /*#__PURE__*/function (_Control) {\n function InteractionControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, InteractionControl);\n _this = _callSuper(this, InteractionControl, [options]);\n _this.map = null;\n _this.previouslySelectedFeature = null;\n _this.previouslySelectedIcon = null;\n _this.previouslySelectedTextColor = null;\n _this.previouslySelectedTextOffset = null;\n // this.previouslyHoveredTextColor = null;\n _this.previouslyHoveredFeature = null;\n _this.originalTextColor = null;\n _this.textColorReference = {};\n _this.currentView = null; // Can be set to 'desktop' or 'mobile'\n\n _this.selectedTextColor = '#BE2E28';\n return _this;\n }\n _inherits(InteractionControl, _Control);\n return _createClass(InteractionControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'interaction-control-container';\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.createHighlightedContentLayer();\n this.createSelectedContentLayer();\n this.storeTextColorReferences();\n this.applyHoverEffectToAllSymbolLayers();\n return this.container;\n }\n }, {\n key: \"_initialize\",\n value: function _initialize() {\n var containerWidth = this.map.mapContainer.offsetWidth;\n this._configureView(containerWidth);\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(InteractionControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"_attachResizeListener\",\n value: function _attachResizeListener() {\n var _this2 = this;\n window.addEventListener('resize', function () {\n var newWidth = _this2.map.mapContainer.offsetWidth;\n _this2._configureView(newWidth);\n });\n }\n }, {\n key: \"_configureView\",\n value: function _configureView(width) {\n if (width > 767) {\n this._setViewForDesktop();\n } else {\n this._setViewForMobile();\n }\n }\n }, {\n key: \"_setViewForDesktop\",\n value: function _setViewForDesktop() {\n this.currentView = 'desktop';\n }\n }, {\n key: \"_setViewForMobile\",\n value: function _setViewForMobile() {\n this.currentView = 'mobile';\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n var _this3 = this;\n this.map.map.on('styleimagemissing', function (e) {\n var missingImage = e.id;\n console.warn(\"Image \\\"\".concat(missingImage, \"\\\" could not be loaded.\"));\n });\n this.map.map.on('click', function (e) {\n _this3._handleClick(e);\n });\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('additionalSearchResults', this._handleAdditionalSearch.bind(this));\n this.map.on('hoverSearchResult', this._handleHoverSearchResult.bind(this));\n this.map.on('hoverEndSearchResult', this._handleHoverEndSearchResult.bind(this));\n }\n }, {\n key: \"storeTextColorReferences\",\n value: function storeTextColorReferences() {\n var _this4 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n var textColor = _this4.map.map.getPaintProperty(layer.id, 'text-color');\n if (textColor !== undefined) {\n _this4.textColorReference[layer.id] = textColor; // Store the text color reference using the layer ID as the key\n }\n }\n });\n }\n }, {\n key: \"createSelectedContentLayer\",\n value: function createSelectedContentLayer() {\n this.map.map.addSource('selected-content', {\n 'type': 'geojson',\n 'data': {\n 'type': 'FeatureCollection',\n 'features': [] // Initially empty, you will add features dynamically\n }\n });\n\n // Add a layer that references this GeoJSON source and matches the styling in your Mapbox Studio project\n this.map.map.addLayer({\n 'id': 'selected-content-layer',\n 'type': 'symbol',\n // Or 'fill', 'line', etc. based on your needs\n 'source': 'selected-content',\n 'layout': {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium'],\n 'text-size': 14,\n 'text-justify': 'left',\n 'text-anchor': 'bottom-left',\n 'text-offset': [1.3, -1],\n 'icon-image': 'selected-pin',\n 'icon-size': 0.5,\n 'icon-offset': [0, -5],\n 'icon-anchor': 'bottom',\n 'symbol-z-elevate': true,\n 'text-padding': 10,\n 'icon-padding': 5\n },\n 'paint': {\n 'text-color': '#BE2E28',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"createHighlightedContentLayer\",\n value: function createHighlightedContentLayer() {\n this.map.map.addSource('highlighted-content', {\n 'type': 'geojson',\n 'data': {\n 'type': 'FeatureCollection',\n 'features': []\n }\n });\n this.map.map.addLayer({\n 'id': 'highlighted-content-layer',\n 'type': 'symbol',\n 'source': 'highlighted-content',\n 'layout': {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium'],\n 'text-size': 14,\n 'text-justify': 'left',\n 'text-anchor': 'bottom-left',\n 'text-offset': [1.2, -0.6],\n 'icon-image': 'highlightedPin',\n 'icon-size': 0.5,\n 'icon-offset': [0, -5],\n 'icon-anchor': 'bottom',\n 'symbol-z-elevate': true,\n 'text-padding': 5,\n 'icon-padding': 5\n },\n 'paint': {\n 'text-color': '#1E1E1E',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"clearSelectedContentLayer\",\n value: function clearSelectedContentLayer() {\n this.map.map.getSource('selected-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"clearHighlightedContentLayer\",\n value: function clearHighlightedContentLayer() {\n this.map.map.getSource('highlighted-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"addSelectedFeature\",\n value: function addSelectedFeature(coordinates, properties) {\n var source = this.map.map.getSource('selected-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n }\n }, {\n key: \"addHighlightedFeature\",\n value: function addHighlightedFeature(coordinates, properties) {\n var source = this.map.map.getSource('highlighted-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n return newFeature;\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.clearHighlightedContentLayer();\n this.clearSelectedContentLayer();\n this.showSymbolLayers();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hideSymbolLayers();\n this.clearSelectedContentLayer();\n this.updateLabelsForSearchResults(results);\n }\n }, {\n key: \"_handleAdditionalSearch\",\n value: function _handleAdditionalSearch(data) {\n var results = data.results;\n // console.log(\"--> HERE ARE ADDITIONAL RESULTS:\", results);\n this.updateLabelsForSearchResults(results, false);\n }\n }, {\n key: \"_handleHoverSearchResult\",\n value: function _handleHoverSearchResult(data) {\n var result = data.result;\n // console.log(\"--> HERE IS HOVERED RESULT:\", result);\n this.updateLabelForSelectedContentPlacement(result, false);\n }\n }, {\n key: \"_handleHoverEndSearchResult\",\n value: function _handleHoverEndSearchResult() {\n // const { result } = data;\n // console.log(\"--> HERE IS HOVERED RESULT:\", result);\n // this.updateLabelForSelectedContentPlacement(result);\n this.clearSelectedContentLayer();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n console.log('adding selected content pin', selectedContentPlacement);\n this.updateLabelForSelectedContentPlacement(selectedContentPlacement);\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(data) {\n console.log(\"handling directions state in interaction control\");\n }\n }, {\n key: \"hideSymbolLayers\",\n value: function hideSymbolLayers() {\n var _this5 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n // Check if the layer is a symbol layer and not 'selected' or 'highlighted'\n if (layer.type === 'symbol' && layer.id !== 'selected-content-layer' && layer.id !== 'highlighted-content-layer') {\n _this5.map.map.setLayoutProperty(layer.id, 'visibility', 'none');\n }\n });\n }\n }, {\n key: \"showSymbolLayers\",\n value: function showSymbolLayers() {\n var _this6 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n _this6.map.map.setLayoutProperty(layer.id, 'visibility', 'visible');\n }\n });\n }\n }, {\n key: \"updateLabelsForSearchResults\",\n value: function updateLabelsForSearchResults(results) {\n var _this7 = this;\n var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n this.clearHighlightedContentLayer();\n var features = [];\n results.forEach(function (result) {\n // console.log(\"RESULT:\", result);\n\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__.convertVerticesToCoordinates)([result.location], null, 10.0);\n // console.log(\"pls\", coordinates[0]);\n var coordinate = coordinates[0];\n var feature = _this7.addHighlightedFeature(coordinate, result);\n features.push(feature);\n\n // const placementId = result.placement_id;\n // const feature = this.map._findFeatureByPlacementId(placementId);\n // if (feature) {\n // const coorindates = feature.geometry.coordinates;\n // const properties = feature.properties;\n // console.log(\"HERE\", feature);\n // this.addHighlightedFeature(coorindates, properties);\n // features.push(feature);\n // }\n });\n if (features.length && animate) {\n // console.log('chek');\n var bounds = new mapboxgl.LngLatBounds();\n // console.log('chekk', bounds);\n features.forEach(function (feature) {\n // console.log('chekkk', feature.geometry.coordinates);\n bounds.extend(feature.geometry.coordinates);\n });\n if (this.currentView === 'desktop') {\n // this.map.map.resize();\n // const camera = this.map.map.cameraForBounds(bounds, {\n // padding: {\n // top: 50,\n // bottom: 500,\n // left: 600,\n // right: 50\n // },\n // maxZoom: 15,\n // });\n\n // this.map.map.easeTo({\n // ...camera, // Use the calculated camera position to keep the bounds and padding\n // pitch: 45, // Set pitch\n // bearing: -37, // Set bearing\n // duration: 1000 // Animation duration\n // });\n\n // const camera = this.map.map.cameraForBounds(bounds, {\n // padding: {\n // top: 100,\n // bottom: 100,\n // left: 100,\n // right: 100\n // },\n // maxZoom: 15,\n // });\n\n this.map.map.fitBounds(bounds, {\n padding: {\n top: 50,\n bottom: 50,\n left: 350,\n right: 50\n },\n maxZoom: 15,\n pitch: 45,\n bearing: -37,\n duration: 1000\n });\n\n // setTimeout(() => {\n // // const camera = this.map.map.cameraForBounds(bounds);\n // console.log(\"BOTTOM PADDING IN PIXELS\", camera.zoom);\n // this.map.map.easeTo({\n // // ...camera,\n // center: bounds.getCenter(),\n // zoom: camera.zoom,\n // padding: {\n // top: 0,\n // bottom: 0,\n // left: 300,\n // right: 0\n // },\n // // maxZoom: 15,\n // // minZoom: 10,\n // pitch: 45,\n // bearing: -37,\n // duration: 1000\n // });\n // }, 100); // Adjust the delay as necessary\n\n // this.map.map.flyTo({\n // center: bounds.getCenter(), // Center of the bounds\n // zoom: this.map.map.getZoom(), // Keep the current zoom level from `fitBounds`\n // pitch: 45, // Target pitch\n // bearing: -37, // Target bearing\n // duration: 1000 // Animation duration for the pitch/bearing transition\n // });\n // this.map.map.fitBounds(bounds, {\n // padding: {\n // top: 200,\n // bottom: 200,\n // left: 550,\n // right: 200\n // },\n // maxZoom: 15,\n // duration: 1000\n // });\n\n // setTimeout(() => {\n // this.map.map.flyTo({\n // center: bounds.getCenter(), // Center of the bounds\n // zoom: this.map.map.getZoom(), // Keep the current zoom level from `fitBounds`\n // pitch: 60, // Target pitch\n // bearing: 30, // Target bearing\n // duration: 1000 // Animation duration for the pitch/bearing transition\n // });\n // }, 1000);\n // this.map.map.setPitch(60);\n // this.map.map.setBearing(60);\n } else if (this.currentView === 'mobile') {\n var mapHeight = this.map.mapContainer.offsetHeight;\n var mapWidth = this.map.mapContainer.offsetWidth;\n // const bottomPaddingPercent = 55;\n var bottomPaddingPercent = 45;\n var sidePaddingPercent = 5;\n var bottomPaddingInPixels = mapHeight * (bottomPaddingPercent / 100);\n var sidePaddingInPixels = mapWidth * (sidePaddingPercent / 100);\n\n // this.map.map.fitBounds(bounds, {\n // padding: {\n // top: 200,\n // bottom: bottomPaddingInPixels,\n // left: sidePaddingInPixels,\n // right: sidePaddingInPixels\n // },\n // maxZoom: 15,\n // duration: 500\n // });\n\n this.map.map.fitBounds(bounds, {\n padding: {\n top: 150,\n bottom: bottomPaddingInPixels,\n left: sidePaddingInPixels,\n right: sidePaddingInPixels + 100\n },\n maxZoom: 16,\n pitch: 45,\n bearing: -37,\n duration: 1000\n });\n\n // const camera = this.map.map.cameraForBounds(bounds, {\n // padding: {\n // top: 0,\n // bottom: bottomPaddingInPixels,\n // left: sidePaddingInPixels,\n // right: sidePaddingInPixels\n // },\n // maxZoom: 15,\n // });\n\n // this.map.map.easeTo({\n // ...camera, // Use the calculated camera position to keep the bounds and padding\n // pitch: 45, // Set pitch\n // bearing: -37, // Set bearing\n // duration: 1000 // Animation duration\n // });\n\n // setTimeout(() => {\n // this.map.map.flyTo({\n // center: bounds.getCenter(), // Center of the bounds\n // zoom: this.map.map.getZoom(), // Keep the current zoom level from `fitBounds`\n // pitch: 45, // Target pitch\n // bearing: -37, // Target bearing\n // duration: 500 // Animatican on duration for the pitch/bearing transition\n // });\n // }, 0);\n\n // setTimeout(() => {\n // this.map.map.flyTo({\n // center: camera.getCenter(), // Center of the bounds\n // zoom: this.map.map.getZoom(), // Keep the current zoom level from `fitBounds`\n // pitch: 60, // Target pitch\n // bearing: 30, // Target bearing\n // duration: 1000 // Animatican on duration for the pitch/bearing transition\n // });\n // }, 1000);\n // this.map.map.setPitch(60);\n // this.map.map.setBearing(60);\n }\n }\n }\n }, {\n key: \"updateLabelForSelectedContentPlacement\",\n value: function updateLabelForSelectedContentPlacement(result) {\n var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n // const placementId = contentPlacement.placement_id;\n // const position = contentPlacement.position; // Should eventually use this, with scaling!\n this.clearSelectedContentLayer();\n\n // const features = this.map.map.queryRenderedFeatures({\n // // Use a filter to find the feature with the matching placementId\n // filter: ['==', ['get', 'placement_id'], placementId]\n // });\n\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__.convertVerticesToCoordinates)([result.location], null, 10.0);\n var coordinate = coordinates[0];\n var feature = this.addHighlightedFeature(coordinate, result);\n // features.push(feature);\n\n if (!result.name) {\n console.log(\"no name\");\n if (result.content) {\n console.log(\"content:\", result.content);\n if (result.content.title_key) {\n console.log(\"title key:\", result.content.title_key);\n var titleKey = result.content.title_key;\n var title = result.content.data[titleKey];\n result.name = title;\n }\n }\n }\n\n // if (features.length !== 0) {\n // const feature = features[0]\n // const coorindates = feature.geometry.coordinates;\n // const properties = feature.properties;\n\n this.addSelectedFeature(coordinate, result);\n if (animate) {\n if (this.currentView === 'desktop') {\n this.map.map.easeTo({\n center: coordinate,\n padding: {\n top: 0,\n bottom: 0,\n left: 330,\n right: 0\n },\n // zoom: 12, // Optional: Desired zoom level\n duration: 1000 // Optional: Duration of the animation in milliseconds\n });\n } else if (this.currentView === 'mobile') {\n var mapHeight = this.map.mapContainer.offsetHeight;\n var bottomPaddingPercent = 35;\n var bottomPaddingInPixels = mapHeight * (bottomPaddingPercent / 100);\n this.map.map.easeTo({\n center: coordinate,\n padding: {\n top: 0,\n bottom: bottomPaddingInPixels,\n left: 0,\n right: 0\n },\n // zoom: 12, // Optional: Desired zoom level\n duration: 1000 // Optional: Duration of the animation in milliseconds\n });\n\n // setTimeout(() => {\n // this.map.map.flyTo({\n // center: camera.getCenter(), // Center of the bounds\n // zoom: this.map.map.getZoom(), // Keep the current zoom level from `fitBounds`\n // pitch: 60, // Target pitch\n // bearing: 30, // Target bearing\n // duration: 1000 // Animatican on duration for the pitch/bearing transition\n // });\n // }, 1000);\n // this.map.map.setPitch(60);\n // this.map.map.setBearing(60);\n }\n }\n // }\n }\n }, {\n key: \"applyHoverEffectToAllSymbolLayers\",\n value: function applyHoverEffectToAllSymbolLayers() {\n var _this8 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n var layerId = layer.id;\n var defaultTextColor = _this8.textColorReference[layerId];\n _this8.map.map.on('mouseenter', layerId, function (e) {\n var feature = e.features[0];\n var placementId = feature.properties.placement_id;\n\n // this.originalTextColor = null;\n if (!_this8.previouslySelectedFeature || _this8.previouslySelectedFeature.layer.id !== feature.layer.id) {\n _this8.originalTextColor = _this8.map.map.getPaintProperty(layerId, 'text-color');\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], placementId], '#4B90F7', defaultTextColor //this.originalTextColor\n ]);\n } else {\n _this8.originalTextColor = _this8.previouslySelectedTextColor;\n var previouslySelectedPlacementId = _this8.previouslySelectedFeature.properties.placement_id;\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], placementId], '#4B90F7', ['==', ['get', 'placement_id'], previouslySelectedPlacementId], _this8.selectedTextColor, defaultTextColor //this.originalTextColor\n ]);\n }\n _this8.map.map.getCanvas().style.cursor = 'pointer';\n });\n _this8.map.map.on('mouseleave', layerId, function () {\n if (!_this8.previouslySelectedFeature) {\n _this8.map.map.setPaintProperty(layerId, 'text-color', defaultTextColor); //this.originalTextColor);\n } else {\n // If a feature is selected, maintain its selected color\n var previouslySelectedPlacementId = _this8.previouslySelectedFeature.properties.placement_id;\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], previouslySelectedPlacementId], _this8.selectedTextColor, defaultTextColor //this.originalTextColor\n ]);\n }\n _this8.map.map.getCanvas().style.cursor = 'default';\n });\n }\n });\n }\n }, {\n key: \"_handleClick\",\n value: function _handleClick(e) {\n var features = this.map.map.queryRenderedFeatures(e.point);\n var symbolFeatures = features.filter(function (feature) {\n return feature.layer.type === 'symbol';\n });\n if (symbolFeatures.length > 0) {\n var placementId = symbolFeatures[0].properties.placement_id;\n this.map.setToSelectedContentState([placementId]);\n }\n }\n\n // removeCurrentSelectedFeatureStyling() {\n // console.log('Remove styling for selected placement');\n\n // if (this.previouslySelectedFeature) {\n // this.map.map.setLayoutProperty(this.previouslySelectedFeature.layer.id, 'icon-image', this.previouslySelectedIcon);\n // this.map.map.setPaintProperty(this.previouslySelectedFeature.layer.id, 'text-color', this.previouslySelectedTextColor);\n // this.map.map.setLayoutProperty(this.previouslySelectedFeature.layer.id, 'text-offset', this.previouslySelectedTextOffset);\n\n // this.previouslySelectedFeature = null;\n // }\n // }\n\n // addStylingForSelectedPlacement(placementId) {\n // console.log('Adding styling for selected placement');\n\n // const feature = this.map._findFeatureByPlacementId(placementId);\n // const layerId = feature.layer.id;\n\n // this.previouslySelectedFeature = feature;\n // this.previouslySelectedIcon = this.map.map.getLayoutProperty(layerId, 'icon-image');\n // // this.previouslySelectedTextColor = this.map.map.getPaintProperty(layerId, 'text-color');\n // this.previouslySelectedTextColor = this.originalTextColor;\n // this.previouslySelectedTextOffset = this.map.map.getLayoutProperty(layerId, 'text-offset');\n\n // this.map.map.setLayoutProperty(layerId, 'icon-image', [\n // 'case',\n // ['==', ['get', 'placement_id'], placementId], 'selected-pin1',\n // this.previouslySelectedIcon\n // ]);\n\n // // this.map.map.setPaintProperty(layerId, 'text-color', [\n // // 'case',\n // // ['==', ['get', 'placement_id'], placementId], this.selectedTextColor,\n // // this.previouslySelectedTextColor\n // // ]);\n // this.map.map.setPaintProperty(layerId, 'text-color', [\n // 'case',\n // ['==', ['get', 'placement_id'], placementId], this.selectedTextColor,\n // this.previouslySelectedTextColor\n // ]);\n\n // console.log(\"HEHE\", this.previouslySelectedTextColor, this.originalTextColor);\n\n // this.map.map.setLayoutProperty(layerId, 'text-offset', [\n // 'case',\n // ['==', ['get', 'placement_id'], placementId], [1.3, -1.0],\n // this.previouslySelectedTextOffset\n // ]);\n\n // }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InteractionControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/InteractionControl.js?");
606
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar InteractionControl = /*#__PURE__*/function (_Control) {\n function InteractionControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, InteractionControl);\n _this = _callSuper(this, InteractionControl, [options]);\n _this.map = null;\n _this.previouslySelectedFeature = null;\n _this.previouslySelectedIcon = null;\n _this.previouslySelectedTextColor = null;\n _this.previouslySelectedTextOffset = null;\n _this.previouslyHoveredFeature = null;\n _this.originalTextColor = null;\n _this.textColorReference = {};\n _this.currentView = null; // Can be set to 'desktop' or 'mobile'\n\n _this.selectedTextColor = '#BE2E28';\n return _this;\n }\n _inherits(InteractionControl, _Control);\n return _createClass(InteractionControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'interaction-control-container';\n this.initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.createHighlightedContentLayer();\n this.createSelectedContentLayer();\n this.storeTextColorReferences();\n this.applyHoverEffectToAllSymbolLayers();\n return this.container;\n }\n }, {\n key: \"_initialize\",\n value: function _initialize() {\n var containerWidth = this.map.mapContainer.offsetWidth;\n this._configureView(containerWidth);\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(InteractionControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"_attachResizeListener\",\n value: function _attachResizeListener() {\n var _this2 = this;\n window.addEventListener('resize', function () {\n var newWidth = _this2.map.mapContainer.offsetWidth;\n _this2._configureView(newWidth);\n });\n }\n }, {\n key: \"_configureView\",\n value: function _configureView(width) {\n if (width > 767) {\n this._setViewForDesktop();\n } else {\n this._setViewForMobile();\n }\n }\n }, {\n key: \"_setViewForDesktop\",\n value: function _setViewForDesktop() {\n this.currentView = 'desktop';\n }\n }, {\n key: \"_setViewForMobile\",\n value: function _setViewForMobile() {\n this.currentView = 'mobile';\n }\n }, {\n key: \"initializeEventListeners\",\n value: function initializeEventListeners() {\n var _this3 = this;\n this.map.map.on('styleimagemissing', function (e) {\n var missingImage = e.id;\n console.warn(\"Image \\\"\".concat(missingImage, \"\\\" could not be loaded.\"));\n });\n this.map.map.on('click', function (e) {\n _this3._handleClick(e);\n });\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('additionalSearchResults', this._handleAdditionalSearch.bind(this));\n this.map.on('hoverSearchResult', this._handleHoverSearchResult.bind(this));\n this.map.on('hoverEndSearchResult', this._handleHoverEndSearchResult.bind(this));\n }\n }, {\n key: \"storeTextColorReferences\",\n value: function storeTextColorReferences() {\n var _this4 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n var textColor = _this4.map.map.getPaintProperty(layer.id, 'text-color');\n if (textColor !== undefined) {\n _this4.textColorReference[layer.id] = textColor; // Store the text color reference using the layer ID as the key\n }\n }\n });\n }\n }, {\n key: \"createSelectedContentLayer\",\n value: function createSelectedContentLayer() {\n this.map.map.addSource('selected-content', {\n 'type': 'geojson',\n 'data': {\n 'type': 'FeatureCollection',\n 'features': [] // Initially empty, you will add features dynamically\n }\n });\n\n // Add a layer that references this GeoJSON source and matches the styling in your Mapbox Studio project\n this.map.map.addLayer({\n 'id': 'selected-content-layer',\n 'type': 'symbol',\n // Or 'fill', 'line', etc. based on your needs\n 'source': 'selected-content',\n 'layout': {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium'],\n 'text-size': 14,\n 'text-justify': 'left',\n 'text-anchor': 'bottom-left',\n 'text-offset': [1.3, -1],\n 'icon-image': 'selected-pin',\n 'icon-size': 0.5,\n 'icon-offset': [0, -5],\n 'icon-anchor': 'bottom',\n 'symbol-z-elevate': true,\n 'text-padding': 10,\n 'icon-padding': 5\n },\n 'paint': {\n 'text-color': '#BE2E28',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"createHighlightedContentLayer\",\n value: function createHighlightedContentLayer() {\n this.map.map.addSource('highlighted-content', {\n 'type': 'geojson',\n 'data': {\n 'type': 'FeatureCollection',\n 'features': []\n }\n });\n this.map.map.addLayer({\n 'id': 'highlighted-content-layer',\n 'type': 'symbol',\n 'source': 'highlighted-content',\n 'layout': {\n 'text-field': ['get', 'name'],\n 'text-font': ['Inter Medium'],\n 'text-size': 14,\n 'text-justify': 'left',\n 'text-anchor': 'bottom-left',\n 'text-offset': [1.2, -0.6],\n 'icon-image': 'highlightedPin',\n 'icon-size': 0.5,\n 'icon-offset': [0, -5],\n 'icon-anchor': 'bottom',\n 'symbol-z-elevate': true,\n 'text-padding': 5,\n 'icon-padding': 5\n },\n 'paint': {\n 'text-color': '#1E1E1E',\n 'text-halo-color': '#ffffff',\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"clearSelectedContentLayer\",\n value: function clearSelectedContentLayer() {\n this.map.map.getSource('selected-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"clearHighlightedContentLayer\",\n value: function clearHighlightedContentLayer() {\n this.map.map.getSource('highlighted-content').setData({\n 'type': 'FeatureCollection',\n 'features': []\n });\n }\n }, {\n key: \"addSelectedFeature\",\n value: function addSelectedFeature(coordinates, properties) {\n var source = this.map.map.getSource('selected-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n }\n }, {\n key: \"addHighlightedFeature\",\n value: function addHighlightedFeature(coordinates, properties) {\n var source = this.map.map.getSource('highlighted-content');\n var currentData = source._data;\n var newFeature = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': coordinates\n },\n 'properties': properties\n };\n currentData.features.push(newFeature);\n source.setData(currentData);\n return newFeature;\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.clearHighlightedContentLayer();\n this.clearSelectedContentLayer();\n this.showSymbolLayers();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.hideSymbolLayers();\n this.clearSelectedContentLayer();\n this.updateLabelsForSearchResults(results);\n }\n }, {\n key: \"_handleAdditionalSearch\",\n value: function _handleAdditionalSearch(data) {\n var results = data.results;\n this.updateLabelsForSearchResults(results, false);\n }\n }, {\n key: \"_handleHoverSearchResult\",\n value: function _handleHoverSearchResult(data) {\n var result = data.result;\n this.updateLabelForSelectedContentPlacement(result, false);\n }\n }, {\n key: \"_handleHoverEndSearchResult\",\n value: function _handleHoverEndSearchResult() {\n this.clearSelectedContentLayer();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.updateLabelForSelectedContentPlacement(selectedContentPlacement);\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(data) {\n return;\n }\n }, {\n key: \"hideSymbolLayers\",\n value: function hideSymbolLayers() {\n var _this5 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol' && layer.id !== 'selected-content-layer' && layer.id !== 'highlighted-content-layer') {\n _this5.map.map.setLayoutProperty(layer.id, 'visibility', 'none');\n }\n });\n }\n }, {\n key: \"showSymbolLayers\",\n value: function showSymbolLayers() {\n var _this6 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n _this6.map.map.setLayoutProperty(layer.id, 'visibility', 'visible');\n }\n });\n }\n }, {\n key: \"updateLabelsForSearchResults\",\n value: function updateLabelsForSearchResults(results) {\n var _this7 = this;\n var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n this.clearHighlightedContentLayer();\n var features = [];\n results.forEach(function (result) {\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__.convertVerticesToCoordinates)([result.location], null, 10.0);\n var coordinate = coordinates[0];\n var feature = _this7.addHighlightedFeature(coordinate, result);\n features.push(feature);\n });\n if (features.length && animate) {\n var bounds = new mapboxgl.LngLatBounds();\n features.forEach(function (feature) {\n bounds.extend(feature.geometry.coordinates);\n });\n if (this.currentView === 'desktop') {\n this.map.map.fitBounds(bounds, {\n padding: {\n top: 50,\n bottom: 50,\n left: 350,\n right: 50\n },\n maxZoom: 15,\n pitch: 45,\n bearing: -37,\n duration: 1000\n });\n } else if (this.currentView === 'mobile') {\n var mapHeight = this.map.mapContainer.offsetHeight;\n var mapWidth = this.map.mapContainer.offsetWidth;\n var bottomPaddingPercent = 45;\n var sidePaddingPercent = 8;\n var bottomPaddingInPixels = mapHeight * (bottomPaddingPercent / 100);\n var sidePaddingInPixels = mapWidth * (sidePaddingPercent / 100);\n this.map.map.fitBounds(bounds, {\n padding: {\n top: 150,\n bottom: bottomPaddingInPixels,\n left: sidePaddingInPixels,\n right: sidePaddingInPixels + 95\n },\n maxZoom: 16,\n pitch: 45,\n bearing: -37,\n duration: 1000\n });\n }\n }\n }\n }, {\n key: \"updateLabelForSelectedContentPlacement\",\n value: function updateLabelForSelectedContentPlacement(result) {\n var animate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n this.clearSelectedContentLayer();\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_1__.convertVerticesToCoordinates)([result.location], null, 10.0);\n var coordinate = coordinates[0];\n var feature = this.addHighlightedFeature(coordinate, result);\n if (!result.name) {\n if (result.content) {\n if (result.content.title_key) {\n var titleKey = result.content.title_key;\n var title = result.content.data[titleKey];\n result.name = title;\n }\n }\n }\n this.addSelectedFeature(coordinate, result);\n if (animate) {\n if (this.currentView === 'desktop') {\n this.map.map.easeTo({\n center: coordinate,\n padding: {\n top: 0,\n bottom: 0,\n left: 330,\n right: 0\n },\n duration: 1000\n });\n } else if (this.currentView === 'mobile') {\n var mapHeight = this.map.mapContainer.offsetHeight;\n var bottomPaddingPercent = 35;\n var bottomPaddingInPixels = mapHeight * (bottomPaddingPercent / 100);\n this.map.map.easeTo({\n center: coordinate,\n padding: {\n top: 0,\n bottom: bottomPaddingInPixels,\n left: 0,\n right: 0\n },\n duration: 1000\n });\n }\n }\n }\n }, {\n key: \"applyHoverEffectToAllSymbolLayers\",\n value: function applyHoverEffectToAllSymbolLayers() {\n var _this8 = this;\n var layers = this.map.map.getStyle().layers;\n layers.forEach(function (layer) {\n if (layer.type === 'symbol') {\n var layerId = layer.id;\n var defaultTextColor = _this8.textColorReference[layerId];\n _this8.map.map.on('mouseenter', layerId, function (e) {\n var feature = e.features[0];\n var placementId = feature.properties.placement_id;\n if (!_this8.previouslySelectedFeature || _this8.previouslySelectedFeature.layer.id !== feature.layer.id) {\n _this8.originalTextColor = _this8.map.map.getPaintProperty(layerId, 'text-color');\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], placementId], '#4B90F7', defaultTextColor]);\n } else {\n _this8.originalTextColor = _this8.previouslySelectedTextColor;\n var previouslySelectedPlacementId = _this8.previouslySelectedFeature.properties.placement_id;\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], placementId], '#4B90F7', ['==', ['get', 'placement_id'], previouslySelectedPlacementId], _this8.selectedTextColor, defaultTextColor]);\n }\n _this8.map.map.getCanvas().style.cursor = 'pointer';\n });\n _this8.map.map.on('mouseleave', layerId, function () {\n if (!_this8.previouslySelectedFeature) {\n _this8.map.map.setPaintProperty(layerId, 'text-color', defaultTextColor);\n } else {\n // If a feature is selected, maintain its selected color\n var previouslySelectedPlacementId = _this8.previouslySelectedFeature.properties.placement_id;\n _this8.map.map.setPaintProperty(layerId, 'text-color', ['case', ['==', ['get', 'placement_id'], previouslySelectedPlacementId], _this8.selectedTextColor, defaultTextColor]);\n }\n _this8.map.map.getCanvas().style.cursor = 'default';\n });\n }\n });\n }\n }, {\n key: \"_handleClick\",\n value: function _handleClick(e) {\n var features = this.map.map.queryRenderedFeatures(e.point);\n var symbolFeatures = features.filter(function (feature) {\n return feature.layer.type === 'symbol';\n });\n if (symbolFeatures.length > 0) {\n var placementId = symbolFeatures[0].properties.placement_id;\n this.map.setToSelectedContentState([placementId]);\n }\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InteractionControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/InteractionControl.js?");
607
607
 
608
608
  /***/ }),
609
609
 
@@ -614,7 +614,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
614
614
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
615
615
 
616
616
  "use strict";
617
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _components_SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/SearchBox/SearchBox */ \"./src/components/SearchBox/SearchBox.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\nvar SearchBoxControl = /*#__PURE__*/function (_Control) {\n function SearchBoxControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBoxControl);\n _this = _callSuper(this, SearchBoxControl, [options]);\n _this.searchBox = new _components_SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSearchApi();\n return _this;\n }\n _inherits(SearchBoxControl, _Control);\n return _createClass(SearchBoxControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'search-box-control-container';\n var element = this.searchBox.getElement();\n this.container.appendChild(element);\n this._initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.show();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(SearchBoxControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n this.searchBox.searchBarSuggestionsView.on('selectCell', this._handleSuggestionSelect.bind(this));\n this.searchBox.searchBar.on('cancel', this._handleSearchBarCancel.bind(this));\n this.searchBox.on('search', this._handleSearchBoxSearch.bind(this));\n this.searchBox.on('selectBack', this._handleSearchBoxSelectBack.bind(this));\n this.searchBox.on('getSearchBarSuggestions', this._handleGettingSearchBarSuggestions.bind(this));\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n }\n }, {\n key: \"_handleGettingSearchBarSuggestions\",\n value: function () {\n var _handleGettingSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n query = data.query;\n currentSearch = ++this.searchBox.searchCount;\n if (!(query === '')) {\n _context.next = 5;\n break;\n }\n this.searchBox.searchBarSuggestionsView.updateResults([]);\n // this.searchBox.closeSuggestionsView();\n return _context.abrupt(\"return\");\n case 5:\n if (this.map.mapData) {\n _context.next = 7;\n break;\n }\n return _context.abrupt(\"return\");\n case 7:\n skip = 0;\n limit = 5;\n _context.prev = 9;\n _context.next = 12;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id,\n // 'e9df990cbd084934973a87fc2f3b0e74',\n // 'move-america-2024',\n // 'FTdsy9btTs6qumoZ6E8Z2Q',\n query, skip, limit);\n case 12:\n results = _context.sent;\n console.log('suggestions for', this.map.mapData, results);\n if (currentSearch === this.searchBox.searchCount) {\n this.searchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context.next = 20;\n break;\n case 17:\n _context.prev = 17;\n _context.t0 = _context[\"catch\"](9);\n if (axios__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isCancel(_context.t0)) {\n console.log('Request canceled:', _context.t0.message);\n } else {\n console.error('Search error:', _context.t0);\n }\n case 20:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[9, 17]]);\n }));\n function _handleGettingSearchBarSuggestions(_x) {\n return _handleGettingSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingSearchBarSuggestions;\n }()\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n // TO RENDER DESKTOP VIEW\n var element = this.searchBox.getElement();\n this.container.appendChild(element);\n this.container.classList.add('desktop-view');\n this.container.classList.remove('mobile-view');\n if (element) {\n this.searchBox.setViewForDesktop();\n }\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n // TO RENDER MOBILE VIEW\n var element = this.searchBox.getElement();\n this.container.appendChild(element);\n this.container.classList.add('mobile-view');\n this.container.classList.remove('desktop-view');\n // this.searchBox.setViewForMobile();\n if (element) {\n this.searchBox.setViewForMobile();\n }\n }\n }, {\n key: \"_handleSearchBoxSelectBack\",\n value: function _handleSearchBoxSelectBack() {\n this.map.initiateBack();\n }\n }, {\n key: \"_handleSearchBarCancel\",\n value: function _handleSearchBarCancel(_) {\n this.map.setToDefaultState();\n }\n }, {\n key: \"_handleSearchBoxSearch\",\n value: function _handleSearchBoxSearch(data) {\n var query = data.query;\n this.map.setToSearchState(query);\n }\n }, {\n key: \"_handleSuggestionSelect\",\n value: function _handleSuggestionSelect(data) {\n var result = data.result;\n this.map.setToSelectedContentState([result.placement_id]);\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.searchBox.searchBarSuggestionsView.clearResults();\n this.searchBox.closeSuggestionsView();\n this.searchBox.searchBar.setText(\"\");\n // this.searchBox.searchBar.input.focus();\n this.searchBox.searchBar.updateRightButtonIcon('search');\n // this.searchBox.searchBar.updateLeftButtonIcon('logo');\n console.log(\"-------> SETTING LEFT ICON: none\");\n this.searchBox.searchBar.updateLeftButtonIcon('none');\n this.show();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n console.log(\"SEARC\", query, results);\n this.searchBox.searchBar.setText(query);\n this.searchBox.searchBar.updateRightButtonIcon('cancel');\n // this.searchBox.searchBar.updateLeftButtonIcon('logo');\n this.searchBox.searchBar.updateLeftButtonIcon('none');\n this.show();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.show();\n var title_key = selectedContentPlacement.content.title_key;\n var title = selectedContentPlacement.content.data[title_key];\n console.log(\"*** 3. SELECTED CONTENT STATE:\", contentPlacementIds, selectedContentPlacement);\n this.searchBox.searchBar.setText(title);\n this.searchBox.searchBar.updateRightButtonIcon('cancel');\n var stateHistoryLength = this.map._stateCoordinator.stateHistory.length;\n if (stateHistoryLength > 2 || contentPlacementIds.length > 1) {\n console.log(\"-------> :SETTING LEFT ICON: back\", stateHistoryLength, contentPlacementIds);\n this.searchBox.searchBar.updateLeftButtonIcon('back');\n } else {\n // this.searchBox.searchBar.updateLeftButtonIcon('logo');\n console.log(\"-------> :SETTING LEFT ICON: none\", stateHistoryLength, contentPlacementIds);\n this.searchBox.searchBar.updateLeftButtonIcon('none');\n }\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(_s) {\n console.log(\"handling directions state in search box control\");\n // this.hide();\n\n var stateHistoryLength = this.map._stateCoordinator.stateHistory.length;\n if (stateHistoryLength > 2) {\n this.searchBox.searchBar.updateLeftButtonIcon('back');\n } else {\n // this.searchBox.searchBar.updateLeftButtonIcon('logo');\n this.searchBox.searchBar.updateLeftButtonIcon('none');\n }\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBoxControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/SearchBoxControl.js?");
617
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _components_SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/SearchBox/SearchBox */ \"./src/components/SearchBox/SearchBox.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\nvar SearchBoxControl = /*#__PURE__*/function (_Control) {\n function SearchBoxControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBoxControl);\n _this = _callSuper(this, SearchBoxControl, [options]);\n _this.searchBox = new _components_SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getSearchApi();\n return _this;\n }\n _inherits(SearchBoxControl, _Control);\n return _createClass(SearchBoxControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'search-box-control-container';\n var element = this.searchBox.getElement();\n this.container.appendChild(element);\n this._initializeEventListeners();\n this._attachResizeListener();\n this._initialize();\n this.show();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(SearchBoxControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n this.searchBox.searchBarSuggestionsView.on('selectCell', this._handleSuggestionSelect.bind(this));\n this.searchBox.searchBar.on('cancel', this._handleSearchBarCancel.bind(this));\n this.searchBox.on('search', this._handleSearchBoxSearch.bind(this));\n this.searchBox.on('selectBack', this._handleSearchBoxSelectBack.bind(this));\n this.searchBox.on('getSearchBarSuggestions', this._handleGettingSearchBarSuggestions.bind(this));\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.map.on('load', this._handleMapLoad.bind(this));\n }\n }, {\n key: \"_handleMapLoad\",\n value: function _handleMapLoad(data) {\n var mapData = data.mapData;\n var mapName = mapData.map_name;\n if (mapName) {\n this.searchBox.searchBar.setPlaceholderText(\"Search \".concat(mapName));\n } else {\n this.searchBox.searchBar.setPlaceholderText(\"Search\");\n }\n }\n }, {\n key: \"_handleGettingSearchBarSuggestions\",\n value: function () {\n var _handleGettingSearchBarSuggestions2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var query, currentSearch, skip, limit, results;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n query = data.query;\n currentSearch = ++this.searchBox.searchCount;\n if (!(query === '')) {\n _context.next = 5;\n break;\n }\n this.searchBox.searchBarSuggestionsView.updateResults([]);\n return _context.abrupt(\"return\");\n case 5:\n if (this.map.mapData) {\n _context.next = 7;\n break;\n }\n return _context.abrupt(\"return\");\n case 7:\n skip = 0;\n limit = 5;\n _context.prev = 9;\n _context.next = 12;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, skip, limit);\n case 12:\n results = _context.sent;\n if (currentSearch === this.searchBox.searchCount) {\n this.searchBox.searchBarSuggestionsView.updateResults(results);\n }\n _context.next = 19;\n break;\n case 16:\n _context.prev = 16;\n _context.t0 = _context[\"catch\"](9);\n if (axios__WEBPACK_IMPORTED_MODULE_3__[\"default\"].isCancel(_context.t0)) {\n console.error('Request canceled:', _context.t0.message);\n } else {\n console.error('Search error:', _context.t0);\n }\n case 19:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[9, 16]]);\n }));\n function _handleGettingSearchBarSuggestions(_x) {\n return _handleGettingSearchBarSuggestions2.apply(this, arguments);\n }\n return _handleGettingSearchBarSuggestions;\n }()\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n var element = this.searchBox.getElement();\n this.container.appendChild(element);\n this.container.classList.add('desktop-view');\n this.container.classList.remove('mobile-view');\n if (element) {\n this.searchBox.setViewForDesktop();\n }\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n var element = this.searchBox.getElement();\n this.container.appendChild(element);\n this.container.classList.add('mobile-view');\n this.container.classList.remove('desktop-view');\n if (element) {\n this.searchBox.setViewForMobile();\n }\n }\n }, {\n key: \"_handleSearchBoxSelectBack\",\n value: function _handleSearchBoxSelectBack() {\n this.map.initiateBack();\n }\n }, {\n key: \"_handleSearchBarCancel\",\n value: function _handleSearchBarCancel(_) {\n this.map.setToDefaultState();\n }\n }, {\n key: \"_handleSearchBoxSearch\",\n value: function _handleSearchBoxSearch(data) {\n var query = data.query;\n this.map.setToSearchState(query);\n }\n }, {\n key: \"_handleSuggestionSelect\",\n value: function _handleSuggestionSelect(data) {\n var result = data.result;\n this.map.setToSelectedContentState([result.placement_id]);\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.searchBox.searchBarSuggestionsView.clearResults();\n this.searchBox.closeSuggestionsView();\n this.searchBox.searchBar.setText(\"\");\n this.searchBox.searchBar.updateRightButtonIcon('search');\n this.searchBox.searchBar.updateLeftButtonIcon('none');\n this.show();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.searchBox.searchBar.setText(query);\n this.searchBox.searchBar.updateRightButtonIcon('cancel');\n this.searchBox.searchBar.updateLeftButtonIcon('none');\n this.show();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(data) {\n var contentPlacementIds = data.contentPlacementIds,\n selectedContentPlacement = data.selectedContentPlacement;\n this.show();\n var title_key = selectedContentPlacement.content.title_key;\n var title = selectedContentPlacement.content.data[title_key];\n this.searchBox.searchBar.setText(title);\n this.searchBox.searchBar.updateRightButtonIcon('cancel');\n var stateHistoryLength = this.map._stateCoordinator.stateHistory.length;\n if (stateHistoryLength > 2 || contentPlacementIds.length > 1) {\n this.searchBox.searchBar.updateLeftButtonIcon('back');\n } else {\n this.searchBox.searchBar.updateLeftButtonIcon('none');\n }\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(_) {\n var stateHistoryLength = this.map._stateCoordinator.stateHistory.length;\n if (stateHistoryLength > 2) {\n this.searchBox.searchBar.updateLeftButtonIcon('back');\n } else {\n this.searchBox.searchBar.updateLeftButtonIcon('none');\n }\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBoxControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/SearchBoxControl.js?");
618
618
 
619
619
  /***/ }),
620
620
 
@@ -625,7 +625,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
625
625
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
626
626
 
627
627
  "use strict";
628
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var webpack__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! webpack */ \"./node_modules/webpack/lib/index.js\");\n/* harmony import */ var webpack__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(webpack__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_SearchResultsView_SearchResultsView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/SearchResultsView/SearchResultsView */ \"./src/components/SearchResultsView/SearchResultsView.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\nvar SearchResultsControl = /*#__PURE__*/function (_Control) {\n function SearchResultsControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchResultsControl);\n _this = _callSuper(this, SearchResultsControl, [options]);\n _this.searchResultsView = new _components_SearchResultsView_SearchResultsView__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getSearchApi();\n _this.searchedQuery = null;\n _this.map = null;\n _this.lastSearchLength = 0;\n _this.skip = 0;\n _this.limit = 20;\n return _this;\n }\n _inherits(SearchResultsControl, _Control);\n return _createClass(SearchResultsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'search-results-control-container';\n var element = this.searchResultsView.getElement();\n this.container.appendChild(element);\n this.hide();\n this._initializeEventListeners();\n this._attachResizeListener();\n this._attachScrollListener();\n this._initialize();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(SearchResultsControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('initiate:search', this._handleInitiateSearchState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.searchResultsView.on('closeView', this._handleCloseSearchResultsView.bind(this));\n this.searchResultsView.on('selectCell', this._handleSearchResultSelect.bind(this));\n this.searchResultsView.on('hoverCell', this._handleCellHover.bind(this));\n this.searchResultsView.on('hoverOutCell', this._handleCellHoverOut.bind(this));\n }\n }, {\n key: \"_handleCellHover\",\n value: function _handleCellHover(data) {\n var result = data.result;\n console.log(\"hover cell\", result);\n this.map.fire('hoverSearchResult', {\n result: result\n });\n }\n }, {\n key: \"_handleCellHoverOut\",\n value: function _handleCellHoverOut(data) {\n var result = data.result;\n console.log(\"hover end cell\", result);\n this.map.fire('hoverEndSearchResult', {\n result: result\n });\n }\n }, {\n key: \"_attachScrollListener\",\n value: function _attachScrollListener() {\n var searchResultsElement = this.searchResultsView.getElement();\n searchResultsElement.addEventListener('scroll', this._handleScroll.bind(this));\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n // TO RENDER DESKTOP VIEW\n var element = this.searchResultsView.getElement();\n // element.style.height = '100%';\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n console.log('rendering search results DESKTOP');\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n var element = this.searchResultsView.getElement();\n // element.style.height = '40%';\n this.container.appendChild(element);\n\n // const newWidth = this.map.mapContainer.offsetWidth;\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n // console.log(\"MOBILE WIDTH22\", newWidth, this.map.map.getCanvasContainer().offsetWidth);\n console.log('rendering search results MOBILE');\n }\n }, {\n key: \"_handleScroll\",\n value: function () {\n var _handleScroll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var searchResultsElement, scrollTop, scrollHeight, clientHeight, threshold, distFromBottom, newResults;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n searchResultsElement = this.searchResultsView.getElement();\n scrollTop = searchResultsElement.scrollTop, scrollHeight = searchResultsElement.scrollHeight, clientHeight = searchResultsElement.clientHeight;\n threshold = 0;\n distFromBottom = scrollHeight - scrollTop - clientHeight + threshold; // console.log(\"Info:\", scrollHeight, scrollTop, clientHeight);\n // console.log(\"info2\",)\n if (!(distFromBottom < 10 && !this.searchResultsView.loading && this.lastSearchLength === 20)) {\n _context.next = 14;\n break;\n }\n this.searchResultsView.showLoadingCell();\n\n // console.log(\"FETCHING NEW RESULTS\");\n _context.next = 8;\n return this._getAdditionalSearchResults();\n case 8:\n newResults = _context.sent;\n this.lastSearchLength = newResults.length;\n this.searchResultsView.extendResults(newResults);\n this.skip += this.limit;\n // this.searchResultsView.hideLoadingCell();\n\n this.map.fire('additionalSearchResults', {\n results: newResults\n });\n\n // If the last search length was 20, then try to fetch new results\n\n this.searchResultsView.hideLoadingCell();\n case 14:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleScroll() {\n return _handleScroll2.apply(this, arguments);\n }\n return _handleScroll;\n }()\n }, {\n key: \"_getAdditionalSearchResults\",\n value: function () {\n var _getAdditionalSearchResults2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var query, results;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n query = this.searchedQuery; // const currentSearch = ++this.searchBox.searchCount;\n if (!(query === '')) {\n _context2.next = 4;\n break;\n }\n this.searchBox.searchBarSuggestionsView.updateResults([]);\n // this.searchBox.closeSuggestionsView();\n return _context2.abrupt(\"return\");\n case 4:\n if (this.map.mapData) {\n _context2.next = 6;\n break;\n }\n return _context2.abrupt(\"return\");\n case 6:\n _context2.prev = 6;\n _context2.next = 9;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, this.skip, this.limit);\n case 9:\n results = _context2.sent;\n return _context2.abrupt(\"return\", results);\n case 13:\n _context2.prev = 13;\n _context2.t0 = _context2[\"catch\"](6);\n if (axios.isCancel(_context2.t0)) {\n console.log('Request canceled:', _context2.t0.message);\n } else {\n console.error('Search error:', _context2.t0);\n }\n case 16:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[6, 13]]);\n }));\n function _getAdditionalSearchResults() {\n return _getAdditionalSearchResults2.apply(this, arguments);\n }\n return _getAdditionalSearchResults;\n }()\n }, {\n key: \"_handleInitiateSearchState\",\n value: function _handleInitiateSearchState() {\n this.map.setToSearchState(this.searchedQuery);\n }\n }, {\n key: \"_handleSearchResultSelect\",\n value: function _handleSearchResultSelect(data) {\n var result = data.result;\n var placementId = result.placement_id;\n this.map.setToSelectedContentState([placementId]);\n }\n }, {\n key: \"_handleCloseSearchResultsView\",\n value: function _handleCloseSearchResultsView() {\n this.map.setToDefaultState();\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.searchedQuery = null;\n this.searchResultsView.updateResults([]);\n console.log(\"hiding search results\");\n this.hide();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.searchedQuery = query;\n this.lastSearchLength = results.length;\n this.skip = this.limit;\n this.searchResultsView.updateResults([]);\n this.searchResultsView.updateView(results, query);\n this.show();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(_) {\n this.searchResultsView.updateResults([]);\n this.hide();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(data) {\n console.log(\"handling directions state in search results control\");\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchResultsControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/SearchResultsControl.js?");
628
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var webpack__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! webpack */ \"./node_modules/webpack/lib/index.js\");\n/* harmony import */ var webpack__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(webpack__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_SearchResultsView_SearchResultsView__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/SearchResultsView/SearchResultsView */ \"./src/components/SearchResultsView/SearchResultsView.js\");\n/* harmony import */ var _core_Control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/Control */ \"./src/core/Control.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _superPropGet(t, e, r, o) { var p = _get(_getPrototypeOf(1 & o ? t.prototype : t), e, r); return 2 & o ? function (t) { return p.apply(r, t); } : p; }\nfunction _get() { return _get = \"undefined\" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }\nfunction _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\nvar SearchResultsControl = /*#__PURE__*/function (_Control) {\n function SearchResultsControl() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchResultsControl);\n _this = _callSuper(this, SearchResultsControl, [options]);\n _this.searchResultsView = new _components_SearchResultsView_SearchResultsView__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getSearchApi();\n _this.searchedQuery = null;\n _this.map = null;\n _this.lastSearchLength = 0;\n _this.skip = 0;\n _this.limit = 20;\n return _this;\n }\n _inherits(SearchResultsControl, _Control);\n return _createClass(SearchResultsControl, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n this.container = document.createElement('div');\n this.container.className = 'search-results-control-container';\n var element = this.searchResultsView.getElement();\n this.container.appendChild(element);\n this.hide();\n this._initializeEventListeners();\n this._attachResizeListener();\n this._attachScrollListener();\n this._initialize();\n return this.container;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n _superPropGet(SearchResultsControl, \"onRemove\", this, 3)([]);\n }\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n this.map.on('state:default', this._handleDefaultState.bind(this));\n this.map.on('state:search', this._handleSearchState.bind(this));\n this.map.on('state:selectedContent', this._handleSelectedContentState.bind(this));\n this.map.on('initiate:search', this._handleInitiateSearchState.bind(this));\n this.map.on('state:directions', this._handleDirectionsState.bind(this));\n this.searchResultsView.on('closeView', this._handleCloseSearchResultsView.bind(this));\n this.searchResultsView.on('selectCell', this._handleSearchResultSelect.bind(this));\n this.searchResultsView.on('hoverCell', this._handleCellHover.bind(this));\n this.searchResultsView.on('hoverOutCell', this._handleCellHoverOut.bind(this));\n }\n }, {\n key: \"_handleCellHover\",\n value: function _handleCellHover(data) {\n var result = data.result;\n this.map.fire('hoverSearchResult', {\n result: result\n });\n }\n }, {\n key: \"_handleCellHoverOut\",\n value: function _handleCellHoverOut(data) {\n var result = data.result;\n this.map.fire('hoverEndSearchResult', {\n result: result\n });\n }\n }, {\n key: \"_attachScrollListener\",\n value: function _attachScrollListener() {\n var searchResultsElement = this.searchResultsView.getElement();\n searchResultsElement.addEventListener('scroll', this._handleScroll.bind(this));\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n var element = this.searchResultsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('mobile-view');\n this.container.classList.add('desktop-view');\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n var element = this.searchResultsView.getElement();\n this.container.appendChild(element);\n this.container.classList.remove('desktop-view');\n this.container.classList.add('mobile-view');\n }\n }, {\n key: \"_handleScroll\",\n value: function () {\n var _handleScroll2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var searchResultsElement, scrollTop, scrollHeight, clientHeight, threshold, distFromBottom, newResults;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n searchResultsElement = this.searchResultsView.getElement();\n scrollTop = searchResultsElement.scrollTop, scrollHeight = searchResultsElement.scrollHeight, clientHeight = searchResultsElement.clientHeight;\n threshold = 0;\n distFromBottom = scrollHeight - scrollTop - clientHeight + threshold;\n if (!(distFromBottom < 10 && !this.searchResultsView.loading && this.lastSearchLength === 20)) {\n _context.next = 14;\n break;\n }\n this.searchResultsView.showLoadingCell();\n _context.next = 8;\n return this._getAdditionalSearchResults();\n case 8:\n newResults = _context.sent;\n this.lastSearchLength = newResults.length;\n this.searchResultsView.extendResults(newResults);\n this.skip += this.limit;\n this.map.fire('additionalSearchResults', {\n results: newResults\n });\n this.searchResultsView.hideLoadingCell();\n case 14:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleScroll() {\n return _handleScroll2.apply(this, arguments);\n }\n return _handleScroll;\n }()\n }, {\n key: \"_getAdditionalSearchResults\",\n value: function () {\n var _getAdditionalSearchResults2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var query, results;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n query = this.searchedQuery;\n if (!(query === '')) {\n _context2.next = 4;\n break;\n }\n this.searchBox.searchBarSuggestionsView.updateResults([]);\n return _context2.abrupt(\"return\");\n case 4:\n if (this.map.mapData) {\n _context2.next = 6;\n break;\n }\n return _context2.abrupt(\"return\");\n case 6:\n _context2.prev = 6;\n _context2.next = 9;\n return this.searchApi.search(this.map.mapData.map_id, this.map.mapData.map_view_id, query, this.skip, this.limit);\n case 9:\n results = _context2.sent;\n return _context2.abrupt(\"return\", results);\n case 13:\n _context2.prev = 13;\n _context2.t0 = _context2[\"catch\"](6);\n if (axios.isCancel(_context2.t0)) {\n console.error('Request canceled:', _context2.t0.message);\n } else {\n console.error('Search error:', _context2.t0);\n }\n case 16:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[6, 13]]);\n }));\n function _getAdditionalSearchResults() {\n return _getAdditionalSearchResults2.apply(this, arguments);\n }\n return _getAdditionalSearchResults;\n }()\n }, {\n key: \"_handleInitiateSearchState\",\n value: function _handleInitiateSearchState() {\n this.map.setToSearchState(this.searchedQuery);\n }\n }, {\n key: \"_handleSearchResultSelect\",\n value: function _handleSearchResultSelect(data) {\n var result = data.result;\n var placementId = result.placement_id;\n this.map.setToSelectedContentState([placementId]);\n }\n }, {\n key: \"_handleCloseSearchResultsView\",\n value: function _handleCloseSearchResultsView() {\n this.map.setToDefaultState();\n }\n }, {\n key: \"_handleDefaultState\",\n value: function _handleDefaultState() {\n this.searchedQuery = null;\n this.searchResultsView.updateResults([]);\n this.hide();\n }\n }, {\n key: \"_handleSearchState\",\n value: function _handleSearchState(data) {\n var query = data.query,\n results = data.results;\n this.searchedQuery = query;\n this.lastSearchLength = results.length;\n this.skip = this.limit;\n this.searchResultsView.updateResults([]);\n this.searchResultsView.updateView(results, query);\n this.show();\n }\n }, {\n key: \"_handleSelectedContentState\",\n value: function _handleSelectedContentState(_) {\n this.searchResultsView.updateResults([]);\n this.hide();\n }\n }, {\n key: \"_handleDirectionsState\",\n value: function _handleDirectionsState(_) {\n return;\n }\n }]);\n}(_core_Control__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchResultsControl);\n\n//# sourceURL=webpack://waygomaps/./src/Controls/SearchResultsControl.js?");
629
629
 
630
630
  /***/ }),
631
631
 
@@ -640,17 +640,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
640
640
 
641
641
  /***/ }),
642
642
 
643
- /***/ "./src/api/MapApi.js":
644
- /*!***************************!*\
645
- !*** ./src/api/MapApi.js ***!
646
- \***************************/
647
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
648
-
649
- "use strict";
650
- eval("__webpack_require__.r(__webpack_exports__);\n\n\n// const BASE_URL = 'http://localhost:8080'; // Replace with your API's base URL\n\n// const getMapStyle = async (businessId, mapId, mapViewId) => {\n// try {\n// const response = await axios.get(`${BASE_URL}/map-views/v1/${businessId}/${mapId}/${mapViewId}/style`);\n// return response.data;\n// } catch (error) {\n// console.error('Error fetching map style:', error);\n// throw error;\n// }\n// };\n\n// export default getMapStyle;\n\n//# sourceURL=webpack://waygomaps/./src/api/MapApi.js?");
651
-
652
- /***/ }),
653
-
654
643
  /***/ "./src/api/MapViewApi.js":
655
644
  /*!*******************************!*\
656
645
  !*** ./src/api/MapViewApi.js ***!
@@ -680,7 +669,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
680
669
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
681
670
 
682
671
  "use strict";
683
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// src/ApiManager.js\n\n\nvar ApiManager = /*#__PURE__*/function () {\n function ApiManager(baseURL) {\n _classCallCheck(this, ApiManager);\n this.client = axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"].create({\n baseURL: baseURL\n // headers: {\n // },\n // withCredentials: true,\n });\n this.client.interceptors.request.use(function (config) {\n var apiKey = _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getApiKey();\n var accountId = _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getAccountId();\n console.log(\"intercepted request, api key: \".concat(apiKey));\n if (!apiKey) {\n console.error(\"Must include API key using waygomaps.setApiKey('YOUR-API-KEY'):\");\n return Promise.reject(new Error(\"API key is missing\"));\n }\n config.headers['Waygo-API-Key'] = apiKey;\n if (accountId) {\n config.headers['Waygo-Account'] = accountId;\n }\n if (['post', 'put'].includes(config.method)) {\n config.headers['Content-Type'] = 'application/json';\n } else {\n delete config.headers['Content-Type'];\n }\n console.log(\"here are headers:\", config.headers);\n return config;\n });\n }\n return _createClass(ApiManager, [{\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(endpoint) {\n var params,\n response,\n _args = arguments;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};\n _context.prev = 1;\n _context.next = 4;\n return this.client.get(endpoint, {\n params: params\n });\n case 4:\n response = _context.sent;\n return _context.abrupt(\"return\", response.data);\n case 8:\n _context.prev = 8;\n _context.t0 = _context[\"catch\"](1);\n throw new Error(\"GET \".concat(endpoint, \" failed: \").concat(_context.t0.message));\n case 11:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[1, 8]]);\n }));\n function get(_x) {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(endpoint, data) {\n var response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.client.post(endpoint, data);\n case 3:\n response = _context2.sent;\n return _context2.abrupt(\"return\", response.data);\n case 7:\n _context2.prev = 7;\n _context2.t0 = _context2[\"catch\"](0);\n throw new Error(\"POST \".concat(endpoint, \" failed: \").concat(_context2.t0.message));\n case 10:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 7]]);\n }));\n function post(_x2, _x3) {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(endpoint, data) {\n var response;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n _context3.next = 3;\n return this.client.put(endpoint, data);\n case 3:\n response = _context3.sent;\n return _context3.abrupt(\"return\", response.data);\n case 7:\n _context3.prev = 7;\n _context3.t0 = _context3[\"catch\"](0);\n throw new Error(\"PUT \".concat(endpoint, \" failed: \").concat(_context3.t0.message));\n case 10:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 7]]);\n }));\n function put(_x4, _x5) {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(endpoint) {\n var params,\n response,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};\n _context4.prev = 1;\n _context4.next = 4;\n return this.client[\"delete\"](endpoint, {\n params: params\n });\n case 4:\n response = _context4.sent;\n return _context4.abrupt(\"return\", response.data);\n case 8:\n _context4.prev = 8;\n _context4.t0 = _context4[\"catch\"](1);\n throw new Error(\"DELETE \".concat(endpoint, \" failed: \").concat(_context4.t0.message));\n case 11:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this, [[1, 8]]);\n }));\n function _delete(_x6) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ApiManager);\n\n//# sourceURL=webpack://waygomaps/./src/api/apiManager.js?");
672
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/lib/axios.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../WaygoMaps */ \"./src/WaygoMaps.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n// src/ApiManager.js\n\n\nvar ApiManager = /*#__PURE__*/function () {\n function ApiManager(baseURL) {\n _classCallCheck(this, ApiManager);\n this.client = axios__WEBPACK_IMPORTED_MODULE_1__[\"default\"].create({\n baseURL: baseURL\n // headers: {\n // },\n // withCredentials: true,\n });\n this.client.interceptors.request.use(function (config) {\n var apiKey = _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getApiKey();\n var accountId = _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getAccountId();\n if (!apiKey) {\n console.error(\"Must include API key using waygomaps.setApiKey('YOUR-API-KEY'):\");\n return Promise.reject(new Error(\"API key is missing\"));\n }\n config.headers['Waygo-API-Key'] = apiKey;\n if (accountId) {\n config.headers['Waygo-Account'] = accountId;\n }\n if (['post', 'put'].includes(config.method)) {\n config.headers['Content-Type'] = 'application/json';\n } else {\n delete config.headers['Content-Type'];\n }\n return config;\n });\n }\n return _createClass(ApiManager, [{\n key: \"get\",\n value: function () {\n var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(endpoint) {\n var params,\n response,\n _args = arguments;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};\n _context.prev = 1;\n _context.next = 4;\n return this.client.get(endpoint, {\n params: params\n });\n case 4:\n response = _context.sent;\n return _context.abrupt(\"return\", response.data);\n case 8:\n _context.prev = 8;\n _context.t0 = _context[\"catch\"](1);\n throw new Error(\"GET \".concat(endpoint, \" failed: \").concat(_context.t0.message));\n case 11:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[1, 8]]);\n }));\n function get(_x) {\n return _get.apply(this, arguments);\n }\n return get;\n }()\n }, {\n key: \"post\",\n value: function () {\n var _post = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(endpoint, data) {\n var response;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.client.post(endpoint, data);\n case 3:\n response = _context2.sent;\n return _context2.abrupt(\"return\", response.data);\n case 7:\n _context2.prev = 7;\n _context2.t0 = _context2[\"catch\"](0);\n throw new Error(\"POST \".concat(endpoint, \" failed: \").concat(_context2.t0.message));\n case 10:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[0, 7]]);\n }));\n function post(_x2, _x3) {\n return _post.apply(this, arguments);\n }\n return post;\n }()\n }, {\n key: \"put\",\n value: function () {\n var _put = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(endpoint, data) {\n var response;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.prev = 0;\n _context3.next = 3;\n return this.client.put(endpoint, data);\n case 3:\n response = _context3.sent;\n return _context3.abrupt(\"return\", response.data);\n case 7:\n _context3.prev = 7;\n _context3.t0 = _context3[\"catch\"](0);\n throw new Error(\"PUT \".concat(endpoint, \" failed: \").concat(_context3.t0.message));\n case 10:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this, [[0, 7]]);\n }));\n function put(_x4, _x5) {\n return _put.apply(this, arguments);\n }\n return put;\n }()\n }, {\n key: \"delete\",\n value: function () {\n var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(endpoint) {\n var params,\n response,\n _args4 = arguments;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n params = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};\n _context4.prev = 1;\n _context4.next = 4;\n return this.client[\"delete\"](endpoint, {\n params: params\n });\n case 4:\n response = _context4.sent;\n return _context4.abrupt(\"return\", response.data);\n case 8:\n _context4.prev = 8;\n _context4.t0 = _context4[\"catch\"](1);\n throw new Error(\"DELETE \".concat(endpoint, \" failed: \").concat(_context4.t0.message));\n case 11:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this, [[1, 8]]);\n }));\n function _delete(_x6) {\n return _delete2.apply(this, arguments);\n }\n return _delete;\n }()\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ApiManager);\n\n//# sourceURL=webpack://waygomaps/./src/api/apiManager.js?");
684
673
 
685
674
  /***/ }),
686
675
 
@@ -713,7 +702,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
713
702
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
714
703
 
715
704
  "use strict";
716
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentDetails: () => (/* binding */ ContentDetails),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ContentPlacementHeader */ \"./src/components/ContentPlacementView/ContentPlacementHeader.js\");\n/* harmony import */ var _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ContextualLocationView */ \"./src/components/ContentPlacementView/ContextualLocationView.js\");\n/* harmony import */ var _DetailsView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DetailsView */ \"./src/components/ContentPlacementView/DetailsView.js\");\n/* harmony import */ var _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ContentChildrenView */ \"./src/components/ContentPlacementView/ContentChildrenView.js\");\n/* harmony import */ var _utils_mapPathFinder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/mapPathFinder */ \"./src/utils/mapPathFinder.js\");\n/* harmony import */ var _assets_location_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../assets/location.svg */ \"./src/assets/location.svg\");\n/* harmony import */ var _assets_website_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/website.svg */ \"./src/assets/website.svg\");\n/* harmony import */ var _assets_copyIcon_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../assets/copyIcon.svg */ \"./src/assets/copyIcon.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\n\n\n\n\nvar ContentDetails = /*#__PURE__*/function (_Component) {\n function ContentDetails() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, ContentDetails);\n _this = _callSuper(this, ContentDetails, [options]);\n _this.contentPlacement = null;\n _this.element = document.createElement('div');\n _this.element.className = 'content-details';\n _this.header = document.createElement('div');\n _this.header.className = 'content-details-header';\n _this.contentPlacementHeader = null;\n _this.actionsView = document.createElement('div');\n _this.actionsView.className = 'content-details-section';\n _this.actionButtons = document.createElement('div');\n _this.actionButtons.className = 'content-details-action-buttons';\n _this.directionsButton = document.createElement('button');\n _this.directionsButton.className = 'content-details-directions-button';\n _this.directionsButton.textContent = 'Directions';\n _this.shareButton = document.createElement('button');\n _this.shareButton.className = 'content-details-share-button';\n _this.shareButton.textContent = 'Share';\n var copyIconElement = document.createElement('img');\n copyIconElement.src = _assets_copyIcon_svg__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n copyIconElement.className = 'copy-icon'; // Add a class for styling\n\n _this.shareButton.appendChild(copyIconElement);\n _this.locationButton = null; // new ContextualLocationView(pinIcon, contentPlacement.contextual_location);\n _this.websiteButton = null;\n _this.detailsView = null;\n _this.childrenComponents = [];\n return _this;\n }\n _inherits(ContentDetails, _Component);\n return _createClass(ContentDetails, [{\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.childrenComponents.forEach(function (childrenComponent) {\n childrenComponent.on('selectChildContentPlacement', _this2._handleSelectChildContentPlacement.bind(_this2));\n });\n this.directionsButton.addEventListener('click', this._handleDirectionsButtonSelect.bind(this));\n this.shareButton.addEventListener('click', this._handleShareButtonSelect.bind(this));\n }\n }, {\n key: \"_render\",\n value: function _render() {\n var _this3 = this;\n this.element.innerHTML = ''; // clears content\n this.header.innerHTML = '';\n this.actionsView.innerHTML = '';\n\n // Header elements\n if (this.contentPlacementHeader) {\n this.header.appendChild(this.contentPlacementHeader.getElement());\n }\n this.actionButtons.appendChild(this.directionsButton);\n this.actionButtons.appendChild(this.shareButton);\n this.header.appendChild(this.actionButtons);\n if (this.locationButton) {\n this.actionsView.appendChild(this.locationButton.getElement());\n }\n if (this.websiteButton) {\n this.actionsView.appendChild(this.websiteButton.getElement());\n }\n this.header.appendChild(this.actionsView);\n this.element.appendChild(this.header);\n\n // Details view element\n if (this.detailsView) {\n this.detailsView.innerHTML = '';\n this.element.appendChild(this.detailsView.getElement());\n }\n\n // Children view elements\n this.childrenComponents.forEach(function (childrenComponent) {\n _this3.element.appendChild(childrenComponent.getElement());\n });\n }\n }, {\n key: \"_handleShareButtonSelect\",\n value: function _handleShareButtonSelect() {\n // const textToCopy = //getWaygoPathForMapState();\n\n console.log('12');\n this.fire('selectShareButton', {\n placementId: this.contentPlacement.placement_id\n });\n\n // navigator.clipboard.writeText(textToCopy)\n // .then(() => {\n // this.showCopyPopup();\n // })\n // .catch(err => console.error('Failed to copy text:', err));\n }\n }, {\n key: \"showCopyPopup\",\n value: function showCopyPopup() {\n // Create popup element\n var popup = document.createElement('div');\n popup.className = 'copy-popup';\n popup.textContent = 'Copied to clipboard';\n\n // Position the popup below the share button\n var buttonRect = this.shareButton.getBoundingClientRect();\n var popupWidth = 120;\n popup.style.position = 'absolute';\n popup.style.left = \"\".concat(buttonRect.left + buttonRect.width / 2 - popupWidth / 2, \"px\"); // `${buttonRect.left}px`;\n popup.style.top = \"\".concat(buttonRect.bottom + window.scrollY, \"px\"); // Adjust for scroll position\n popup.style.zIndex = '9999'; // Ensure it appears on top of other components\n\n document.body.appendChild(popup);\n\n // Fade out and remove popup after 2 seconds\n setTimeout(function () {\n popup.style.opacity = '0';\n popup.style.transition = 'opacity 0.5s';\n setTimeout(function () {\n popup.remove();\n }, 500); // Wait for fade-out transition\n }, 1500); // Popup visible for 2 seconds\n }\n }, {\n key: \"_handleDirectionsButtonSelect\",\n value: function _handleDirectionsButtonSelect() {\n this.fire('selectDirectionsButton', {\n placementId: this.contentPlacement.placement_id\n });\n }\n }, {\n key: \"_handleBackArrowClick\",\n value: function _handleBackArrowClick() {\n this.fire('selectBackButton');\n }\n }, {\n key: \"_handleSelectChildContentPlacement\",\n value: function _handleSelectChildContentPlacement(data) {\n var placementId = data.placementId;\n this.fire('selectChildContentPlacement', {\n placementId: placementId\n });\n }\n }, {\n key: \"findViableAdditionalData\",\n value: function findViableAdditionalData(contentPlacement) {\n var data = contentPlacement.content.data;\n var keys = Object.keys(data);\n var titleKey = contentPlacement.content.title_key;\n var notAllowedKeys = [titleKey, 'Feature', 'Features', 'Feature ID', 'feature_id', 'Website', 'Website URL', 'LinkedIn', 'Files & media'];\n var viableData = {};\n keys.forEach(function (key) {\n var value = data[key];\n if (!notAllowedKeys.includes(key) && value !== null && value !== undefined && value !== \"\") {\n viableData[key] = value;\n }\n });\n return viableData;\n }\n }, {\n key: \"updateView\",\n value: function updateView(contentPlacement) {\n this.contentPlacement = contentPlacement;\n\n // Update the header\n this.contentPlacementHeader = new _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__[\"default\"](contentPlacement);\n\n // Update location and website buttons\n this.locationButton = new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_location_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"], contentPlacement.contextual_location);\n var websiteUrl = contentPlacement.content.data['Website'] || contentPlacement.content.data['LinkedIn'] || contentPlacement.content.data['Website URL'];\n this.websiteButton = websiteUrl ? new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_website_svg__WEBPACK_IMPORTED_MODULE_7__[\"default\"], websiteUrl, websiteUrl) : null;\n\n // Update details view with new viable data\n var viableAdditionalData = this.findViableAdditionalData(contentPlacement);\n var viableDataKeys = Object.keys(viableAdditionalData);\n this.detailsView = viableDataKeys.length > 0 ? new _DetailsView__WEBPACK_IMPORTED_MODULE_3__[\"default\"](viableAdditionalData) : null;\n\n // Update children components\n this.childrenComponents = [];\n for (var _i = 0, _Object$entries = Object.entries(contentPlacement.children); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n title = _Object$entries$_i[0],\n children = _Object$entries$_i[1];\n var childrenComponent = new _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__[\"default\"](title, children);\n this.childrenComponents.push(childrenComponent);\n }\n\n // Reset event listeners\n this._setupEventListeners();\n\n // Re-render the component with the new data\n this._render();\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContentDetails);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/ContentDetails.js?");
705
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentDetails: () => (/* binding */ ContentDetails),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ContentPlacementHeader */ \"./src/components/ContentPlacementView/ContentPlacementHeader.js\");\n/* harmony import */ var _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ContextualLocationView */ \"./src/components/ContentPlacementView/ContextualLocationView.js\");\n/* harmony import */ var _DetailsView__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DetailsView */ \"./src/components/ContentPlacementView/DetailsView.js\");\n/* harmony import */ var _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ContentChildrenView */ \"./src/components/ContentPlacementView/ContentChildrenView.js\");\n/* harmony import */ var _assets_location_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../assets/location.svg */ \"./src/assets/location.svg\");\n/* harmony import */ var _assets_website_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../assets/website.svg */ \"./src/assets/website.svg\");\n/* harmony import */ var _assets_copyIcon_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../assets/copyIcon.svg */ \"./src/assets/copyIcon.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\n\n\n\nvar ContentDetails = /*#__PURE__*/function (_Component) {\n function ContentDetails() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, ContentDetails);\n _this = _callSuper(this, ContentDetails, [options]);\n _this.contentPlacement = null;\n _this.element = document.createElement('div');\n _this.element.className = 'content-details';\n _this.header = document.createElement('div');\n _this.header.className = 'content-details-header';\n _this.contentPlacementHeader = null;\n _this.actionsView = document.createElement('div');\n _this.actionsView.className = 'content-details-section';\n _this.actionButtons = document.createElement('div');\n _this.actionButtons.className = 'content-details-action-buttons';\n _this.directionsButton = document.createElement('button');\n _this.directionsButton.className = 'content-details-directions-button';\n _this.directionsButton.textContent = 'Directions';\n _this.shareButton = document.createElement('button');\n _this.shareButton.className = 'content-details-share-button';\n _this.shareButton.textContent = 'Share';\n var copyIconElement = document.createElement('img');\n copyIconElement.src = _assets_copyIcon_svg__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n copyIconElement.className = 'copy-icon'; // Add a class for styling\n\n _this.shareButton.appendChild(copyIconElement);\n _this.locationButton = null;\n _this.websiteButton = null;\n _this.detailsView = null;\n _this.childrenComponents = [];\n return _this;\n }\n _inherits(ContentDetails, _Component);\n return _createClass(ContentDetails, [{\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.childrenComponents.forEach(function (childrenComponent) {\n childrenComponent.on('selectChildContentPlacement', _this2._handleSelectChildContentPlacement.bind(_this2));\n });\n this.directionsButton.addEventListener('click', this._handleDirectionsButtonSelect.bind(this));\n this.shareButton.addEventListener('click', this._handleShareButtonSelect.bind(this));\n }\n }, {\n key: \"_render\",\n value: function _render() {\n var _this3 = this;\n this.element.innerHTML = '';\n this.header.innerHTML = '';\n this.actionsView.innerHTML = '';\n\n // Header elements\n if (this.contentPlacementHeader) {\n this.header.appendChild(this.contentPlacementHeader.getElement());\n }\n this.actionButtons.appendChild(this.directionsButton);\n this.actionButtons.appendChild(this.shareButton);\n this.header.appendChild(this.actionButtons);\n if (this.locationButton) {\n this.actionsView.appendChild(this.locationButton.getElement());\n }\n if (this.websiteButton) {\n this.actionsView.appendChild(this.websiteButton.getElement());\n }\n this.header.appendChild(this.actionsView);\n this.element.appendChild(this.header);\n\n // Details view element\n if (this.detailsView) {\n this.detailsView.innerHTML = '';\n this.element.appendChild(this.detailsView.getElement());\n }\n\n // Children view elements\n this.childrenComponents.forEach(function (childrenComponent) {\n _this3.element.appendChild(childrenComponent.getElement());\n });\n }\n }, {\n key: \"_handleShareButtonSelect\",\n value: function _handleShareButtonSelect() {\n this.fire('selectShareButton', {\n placementId: this.contentPlacement.placement_id\n });\n }\n }, {\n key: \"showCopyPopup\",\n value: function showCopyPopup() {\n // Create popup element\n var popup = document.createElement('div');\n popup.className = 'copy-popup';\n popup.textContent = 'Copied to clipboard';\n\n // Position the popup below the share button\n var buttonRect = this.shareButton.getBoundingClientRect();\n var popupWidth = 120;\n popup.style.position = 'absolute';\n popup.style.left = \"\".concat(buttonRect.left + buttonRect.width / 2 - popupWidth / 2, \"px\"); // `${buttonRect.left}px`;\n popup.style.top = \"\".concat(buttonRect.bottom + window.scrollY, \"px\"); // Adjust for scroll position\n popup.style.zIndex = '9999'; // Ensure it appears on top of other components\n\n document.body.appendChild(popup);\n\n // Fade out and remove popup after 2 seconds\n setTimeout(function () {\n popup.style.opacity = '0';\n popup.style.transition = 'opacity 0.5s';\n setTimeout(function () {\n popup.remove();\n }, 500);\n }, 1500);\n }\n }, {\n key: \"_handleDirectionsButtonSelect\",\n value: function _handleDirectionsButtonSelect() {\n this.fire('selectDirectionsButton', {\n placementId: this.contentPlacement.placement_id\n });\n }\n }, {\n key: \"_handleBackArrowClick\",\n value: function _handleBackArrowClick() {\n this.fire('selectBackButton');\n }\n }, {\n key: \"_handleSelectChildContentPlacement\",\n value: function _handleSelectChildContentPlacement(data) {\n var placementId = data.placementId;\n this.fire('selectChildContentPlacement', {\n placementId: placementId\n });\n }\n }, {\n key: \"findViableAdditionalData\",\n value: function findViableAdditionalData(contentPlacement) {\n var data = contentPlacement.content.data;\n var keys = Object.keys(data);\n var titleKey = contentPlacement.content.title_key;\n var notAllowedKeys = [titleKey, 'Feature', 'Features', 'Feature ID', 'feature_id', 'Website', 'Website URL', 'LinkedIn', 'Files & media'];\n var viableData = {};\n keys.forEach(function (key) {\n var value = data[key];\n if (!notAllowedKeys.includes(key) && value !== null && value !== undefined && value !== \"\") {\n viableData[key] = value;\n }\n });\n return viableData;\n }\n }, {\n key: \"updateView\",\n value: function updateView(contentPlacement) {\n this.contentPlacement = contentPlacement;\n\n // Update the header\n this.contentPlacementHeader = new _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__[\"default\"](contentPlacement);\n\n // Update location and website buttons\n this.locationButton = new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_location_svg__WEBPACK_IMPORTED_MODULE_5__[\"default\"], contentPlacement.contextual_location);\n var websiteUrl = contentPlacement.content.data['Website'] || contentPlacement.content.data['LinkedIn'] || contentPlacement.content.data['Website URL'];\n this.websiteButton = websiteUrl ? new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_website_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"], websiteUrl, websiteUrl) : null;\n\n // Update details view with new viable data\n var viableAdditionalData = this.findViableAdditionalData(contentPlacement);\n var viableDataKeys = Object.keys(viableAdditionalData);\n this.detailsView = viableDataKeys.length > 0 ? new _DetailsView__WEBPACK_IMPORTED_MODULE_3__[\"default\"](viableAdditionalData) : null;\n\n // Update children components\n this.childrenComponents = [];\n for (var _i = 0, _Object$entries = Object.entries(contentPlacement.children); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n title = _Object$entries$_i[0],\n children = _Object$entries$_i[1];\n var childrenComponent = new _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__[\"default\"](title, children);\n this.childrenComponents.push(childrenComponent);\n }\n\n // Reset event listeners\n this._setupEventListeners();\n\n // Re-render the component with the new data\n this._render();\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContentDetails);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/ContentDetails.js?");
717
706
 
718
707
  /***/ }),
719
708
 
@@ -757,7 +746,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
757
746
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
758
747
 
759
748
  "use strict";
760
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../SearchBox/SearchBox */ \"./src/components/SearchBox/SearchBox.js\");\n/* harmony import */ var _DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../DirectionsView/StepsView */ \"./src/components/DirectionsView/StepsView.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _assets_pinOutlineIcon_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../assets/pinOutlineIcon.svg */ \"./src/assets/pinOutlineIcon.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\nvar DirectionsView = /*#__PURE__*/function (_Component) {\n function DirectionsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsView);\n _this = _callSuper(this, DirectionsView, [options]);\n _this.startSearchBox = new _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"](); // Create a SearchBox for the start location\n _this.endSearchBox = new _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"](); // Create a SearchBox for the end location\n\n _this.startContentPlacement = null;\n _this.endContentPlacement = null;\n _this.steps = null;\n\n // this.startLocation = \"\";\n // this.endLocation = \"FILLER\";\n // this.selectedSearchBox = null;\n // this.showSteps = false;\n\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getSearchApi();\n _this._initialize();\n return _this;\n }\n _inherits(DirectionsView, _Component);\n return _createClass(DirectionsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement(\"div\");\n this.element.className = \"directions-view\";\n this.directionsViewHeader = document.createElement(\"div\");\n this.directionsViewHeader.className = \"directions-view-header\";\n this.searchBoxesContainer = document.createElement('div');\n this.searchBoxesContainer.className = \"directions-search-boxes-container\";\n this.circlesAndSearchWrapper = document.createElement('div');\n this.circlesAndSearchWrapper.className = 'directions-circles-search-wrapper';\n var circlesContainer = this._createCirclesContainer();\n this.circlesAndSearchWrapper.appendChild(circlesContainer);\n this.startSearchBox.searchBar.updateLeftButtonIcon('none');\n this.startSearchBox.searchBar.updateRightButtonIcon('none');\n this.endSearchBox.searchBar.updateLeftButtonIcon('none');\n this.endSearchBox.searchBar.updateRightButtonIcon('none');\n this.startSearchBox.searchBar.setPlaceholderText('Choose starting point');\n this.endSearchBox.searchBar.setPlaceholderText('Choose destination');\n this.searchBoxesContainer.appendChild(this.startSearchBox.getElement());\n this.searchBoxesContainer.appendChild(this.endSearchBox.getElement());\n this.circlesAndSearchWrapper.appendChild(this.searchBoxesContainer);\n this.directionsViewHeader.appendChild(this.circlesAndSearchWrapper);\n this._render();\n this._setupEventListeners();\n }\n }, {\n key: \"_createCirclesContainer\",\n value: function _createCirclesContainer() {\n var circlesContainer = document.createElement('div');\n circlesContainer.className = \"directions-circles-container\";\n\n // Create the two large circles (start and end)\n var startCircle = document.createElement('div');\n startCircle.className = \"large-circle\";\n var endCircle = document.createElement('div');\n endCircle.className = \"end-circle\";\n\n // const endIcon = document.createElement('img');\n // endIcon.src = pinOutlineIcon;\n // endIcon.className = \"end-icon\";\n\n // Create the three small circles\n var smallCircle1 = document.createElement('div');\n smallCircle1.className = \"small-circle\";\n var smallCircle2 = document.createElement('div');\n smallCircle2.className = \"small-circle\";\n var smallCircle3 = document.createElement('div');\n smallCircle3.className = \"small-circle\";\n\n // Append the circles to the container vertically\n circlesContainer.appendChild(startCircle);\n circlesContainer.appendChild(smallCircle1);\n circlesContainer.appendChild(smallCircle2);\n circlesContainer.appendChild(smallCircle3);\n circlesContainer.appendChild(endCircle);\n return circlesContainer;\n }\n }, {\n key: \"_render\",\n value: function _render() {\n // this.element.innerHTML = `\n // <div class=\"directions-search-boxes\"></div>\n // <div class=\"dots\">•••</div>\n // `;\n // this.element.innerHTML = `\n // <div class=\"directions-header\">\n // <button class=\"back-button\" aria-label=\"Go back\">&#8592;</button>\n // <h2 class=\"directions-heading\">Directions</h2>\n // </div>\n // <div class=\"directions-search-boxes\"></div>\n // <div class=\"dots\">•••</div>\n // `;\n\n // const searchBoxesContainer = this.element.querySelector(\".directions-search-boxes\");\n\n // Append both SearchBox components to the DirectionsView\n // searchBoxesContainer.appendChild(this.startSearchBox.getElement());\n // searchBoxesContainer.appendChild(this.endSearchBox.getElement());\n\n this.element.appendChild(this.directionsViewHeader);\n\n // Render the StepsView if the steps should be shown\n if (this.steps) {\n var stepsView = new _DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.steps);\n this.element.appendChild(stepsView.getElement());\n }\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n // Listen for 'input' event from both SearchBox components and handle the search input\n\n this.startSearchBox.searchBar.on('focus', this._handleStartSearchBarFocus.bind(this));\n this.startSearchBox.searchBar.on('blur', this._handleStartSearchBarBlur.bind(this));\n this.endSearchBox.searchBar.on('focus', this._handleEndSearchBarFocus.bind(this));\n this.endSearchBox.searchBar.on('blur', this._handleEndSearchBarBlur.bind(this));\n this.startSearchBox.searchBarSuggestionsView.on('selectCell', this._handleStartContentPlacementSelect.bind(this));\n this.endSearchBox.searchBarSuggestionsView.on('selectCell', this._handleEndContentPlacementSelect.bind(this));\n\n // this.startSearchBox.on('input', (data) => this._handleSearchBoxInput(\"start\", data.query));\n // this.endSearchBox.on('input', (data) => this._handleSearchBoxInput(\"end\", data.query));\n\n // document.addEventListener(\"mousedown\", this._handleClickOutside.bind(this));\n }\n }, {\n key: \"_handleStartContentPlacementSelect\",\n value: function () {\n var _handleStartContentPlacementSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var result, placementId, startContentPlacement;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n result = data.result;\n placementId = result.placement_id;\n this.startSearchBox.searchBar.setText(result.name);\n _context.next = 5;\n return this.searchApi.fetchContentPlacementDetails(placementId);\n case 5:\n startContentPlacement = _context.sent;\n // console.log(\"HERE IS START CONTENT\", startContentPlacement);\n\n this.updateView(startContentPlacement, this.endContentPlacement);\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleStartContentPlacementSelect(_x) {\n return _handleStartContentPlacementSelect2.apply(this, arguments);\n }\n return _handleStartContentPlacementSelect;\n }()\n }, {\n key: \"_handleEndContentPlacementSelect\",\n value: function () {\n var _handleEndContentPlacementSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var result, placementId, endContentPlacement;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n result = data.result;\n placementId = result.placement_id; // console.log(\"SELECTED END:\", data);\n this.endSearchBox.searchBar.setText(result.name);\n _context2.next = 5;\n return this.searchApi.fetchContentPlacementDetails(placementId);\n case 5:\n endContentPlacement = _context2.sent;\n this.updateView(this.startContentPlacement, endContentPlacement);\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleEndContentPlacementSelect(_x2) {\n return _handleEndContentPlacementSelect2.apply(this, arguments);\n }\n return _handleEndContentPlacementSelect;\n }()\n }, {\n key: \"_handleStartSearchBarFocus\",\n value: function _handleStartSearchBarFocus() {\n this.startSearchBox.searchBar.updateRightButtonIcon('search');\n }\n }, {\n key: \"_handleEndSearchBarFocus\",\n value: function _handleEndSearchBarFocus() {\n this.endSearchBox.searchBar.updateRightButtonIcon('search');\n }\n }, {\n key: \"_handleStartSearchBarBlur\",\n value: function _handleStartSearchBarBlur() {\n this.startSearchBox.searchBar.updateRightButtonIcon('none');\n }\n }, {\n key: \"_handleEndSearchBarBlur\",\n value: function _handleEndSearchBarBlur() {\n this.endSearchBox.searchBar.updateRightButtonIcon('none');\n }\n }, {\n key: \"updateView\",\n value: function updateView(startContentPlacement, endContentPlacement) {\n this.startContentPlacement = startContentPlacement;\n this.endContentPlacement = endContentPlacement;\n if (startContentPlacement && endContentPlacement) {\n console.log(\"BOTH ARE THERE, LETS FIRE PATH\");\n this.fire('initiate:findPath', {\n startContentPlacementId: startContentPlacement.placement_id,\n endContentPlacementId: endContentPlacement.placement_id\n });\n } else if (startContentPlacement) {\n var data = startContentPlacement.content.data;\n var titleKey = startContentPlacement.content.title_key;\n var title = data[titleKey];\n this.startSearchBox.searchBar.setText(title);\n this.endSearchBox.searchBar.setText('');\n this.endSearchBox.searchBar.input.focus();\n this.clearSteps();\n } else if (endContentPlacement) {\n var _data = endContentPlacement.content.data;\n var _titleKey = endContentPlacement.content.title_key;\n var _title = _data[_titleKey];\n this.endSearchBox.searchBar.setText(_title);\n this.startSearchBox.searchBar.setText('');\n this.startSearchBox.searchBar.input.focus();\n this.clearSteps();\n }\n }\n }, {\n key: \"setSteps\",\n value: function setSteps(steps) {\n this.steps = steps;\n this._render();\n }\n }, {\n key: \"clearSteps\",\n value: function clearSteps() {\n var stepsViewElement = this.element.querySelector('.steps-view'); // Assuming .steps-view is a class in StepsView\n if (stepsViewElement) {\n stepsViewElement.remove(); // Remove the StepsView element if it exists\n }\n }\n\n // _clearViews() {\n // while (this.container.firstChild) {\n // this.container.removeChild(this.container.firstChild);\n // }\n // }\n\n // setStartContentPlacement(startContentPlacement) {\n // this.startContentPlacement = startContentPlacement;\n\n // if (!this.startContentPlacement) return;\n // else if (this.startContentPlacement && this.endContentPlacement) {\n // console.log(\"BOTH ARE THERE, LETS FIRE PATH\");\n // } else if (this.endContentPlacement) {\n // const data = endContentPlacement.content.data;\n // const titleKey = endContentPlacement.content.title_key;\n // const title = data[titleKey];\n // this.directionsView.endSearchBox.searchBar.setText(title);\n // this.directionsView.startSearchBox.searchBar.input.focus();\n // }\n // }\n\n // setEndContentPlacement(endContentPlacement) {\n // this.endContentPlacement = endContentPlacement;\n\n // if (!this.endContentPlacement) return;\n // else if (this.startContentPlacement && this.endContentPlacement) {\n // console.log(\"BOTH ARE THERE, LETS FIRE PATH\");\n // } else if (this.startContentPlacement) {\n // const data = startContentPlacement.content.data;\n // const titleKey = startContentPlacement.content.title_key;\n // const title = data[titleKey];\n // this.directionsView.startSearchBox.searchBar.setText(title);\n // this.directionsView.endSearchBox.searchBar.input.focus();\n // }\n // }\n\n // Handle input without re-rendering the entire view\n // _handleSearchBoxInput(searchBox, query) {\n // if (searchBox === \"start\") {\n // this.startLocation = query;\n // } else if (searchBox === \"end\") {\n // this.endLocation = query;\n // }\n // // Trigger the suggestions to appear in the respective search box\n // this._showSuggestions(searchBox, query);\n // }\n\n // _showSuggestions(searchBox, query) {\n // // Simulate search results or suggestions\n // const results = [\"Location A\", \"Location B\", \"Location C\"]; // Example static results\n\n // if (searchBox === \"start\") {\n // this.startSearchBox.searchBarSuggestionsView.updateResults(results);\n // this.startSearchBox.openSuggestionsView();\n // } else if (searchBox === \"end\") {\n // this.endSearchBox.searchBarSuggestionsView.updateResults(results);\n // this.endSearchBox.openSuggestionsView();\n // }\n // }\n\n // _handleClickOutside(event) {\n // if (!this.element.contains(event.target)) {\n // this.startSearchBox.closeSuggestionsView();\n // this.endSearchBox.closeSuggestionsView();\n // this.selectedSearchBox = null;\n // }\n // }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]); // Add DirectionsView to the waygomaps global namespace\n// window.waygomaps = window.waygomaps || {};\n// window.waygomaps.DirectionsView = DirectionsView;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/DirectionsView/DirectionsView.js?");
749
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../SearchBox/SearchBox */ \"./src/components/SearchBox/SearchBox.js\");\n/* harmony import */ var _DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../DirectionsView/StepsView */ \"./src/components/DirectionsView/StepsView.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _assets_pinOutlineIcon_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../assets/pinOutlineIcon.svg */ \"./src/assets/pinOutlineIcon.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\nvar DirectionsView = /*#__PURE__*/function (_Component) {\n function DirectionsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, DirectionsView);\n _this = _callSuper(this, DirectionsView, [options]);\n _this.startSearchBox = new _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"](); // Create a SearchBox for the start location\n _this.endSearchBox = new _SearchBox_SearchBox__WEBPACK_IMPORTED_MODULE_1__[\"default\"](); // Create a SearchBox for the end location\n\n _this.startContentPlacement = null;\n _this.endContentPlacement = null;\n _this.steps = null;\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_3__[\"default\"].getSearchApi();\n _this._initialize();\n return _this;\n }\n _inherits(DirectionsView, _Component);\n return _createClass(DirectionsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement(\"div\");\n this.element.className = \"directions-view\";\n this.directionsViewHeader = document.createElement(\"div\");\n this.directionsViewHeader.className = \"directions-view-header\";\n this.searchBoxesContainer = document.createElement('div');\n this.searchBoxesContainer.className = \"directions-search-boxes-container\";\n this.circlesAndSearchWrapper = document.createElement('div');\n this.circlesAndSearchWrapper.className = 'directions-circles-search-wrapper';\n var circlesContainer = this._createCirclesContainer();\n this.circlesAndSearchWrapper.appendChild(circlesContainer);\n this.startSearchBox.searchBar.updateLeftButtonIcon('none');\n this.startSearchBox.searchBar.updateRightButtonIcon('none');\n this.endSearchBox.searchBar.updateLeftButtonIcon('none');\n this.endSearchBox.searchBar.updateRightButtonIcon('none');\n this.startSearchBox.searchBar.setPlaceholderText('Choose starting point');\n this.endSearchBox.searchBar.setPlaceholderText('Choose destination');\n this.searchBoxesContainer.appendChild(this.startSearchBox.getElement());\n this.searchBoxesContainer.appendChild(this.endSearchBox.getElement());\n this.circlesAndSearchWrapper.appendChild(this.searchBoxesContainer);\n this.directionsViewHeader.appendChild(this.circlesAndSearchWrapper);\n this._render();\n this._setupEventListeners();\n }\n }, {\n key: \"_createCirclesContainer\",\n value: function _createCirclesContainer() {\n var circlesContainer = document.createElement('div');\n circlesContainer.className = \"directions-circles-container\";\n var startCircle = document.createElement('div');\n startCircle.className = \"large-circle\";\n var endCircle = document.createElement('div');\n endCircle.className = \"end-circle\";\n var smallCircle1 = document.createElement('div');\n smallCircle1.className = \"small-circle\";\n var smallCircle2 = document.createElement('div');\n smallCircle2.className = \"small-circle\";\n var smallCircle3 = document.createElement('div');\n smallCircle3.className = \"small-circle\";\n circlesContainer.appendChild(startCircle);\n circlesContainer.appendChild(smallCircle1);\n circlesContainer.appendChild(smallCircle2);\n circlesContainer.appendChild(smallCircle3);\n circlesContainer.appendChild(endCircle);\n return circlesContainer;\n }\n }, {\n key: \"_render\",\n value: function _render() {\n this.element.appendChild(this.directionsViewHeader);\n if (this.steps) {\n var stepsView = new _DirectionsView_StepsView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.steps);\n this.element.appendChild(stepsView.getElement());\n }\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n this.startSearchBox.searchBar.on('focus', this._handleStartSearchBarFocus.bind(this));\n this.startSearchBox.searchBar.on('blur', this._handleStartSearchBarBlur.bind(this));\n this.endSearchBox.searchBar.on('focus', this._handleEndSearchBarFocus.bind(this));\n this.endSearchBox.searchBar.on('blur', this._handleEndSearchBarBlur.bind(this));\n this.startSearchBox.searchBarSuggestionsView.on('selectCell', this._handleStartContentPlacementSelect.bind(this));\n this.endSearchBox.searchBarSuggestionsView.on('selectCell', this._handleEndContentPlacementSelect.bind(this));\n }\n }, {\n key: \"_handleStartContentPlacementSelect\",\n value: function () {\n var _handleStartContentPlacementSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {\n var result, placementId, startContentPlacement;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n result = data.result;\n placementId = result.placement_id;\n this.startSearchBox.searchBar.setText(result.name);\n _context.next = 5;\n return this.searchApi.fetchContentPlacementDetails(placementId);\n case 5:\n startContentPlacement = _context.sent;\n this.updateView(startContentPlacement, this.endContentPlacement);\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleStartContentPlacementSelect(_x) {\n return _handleStartContentPlacementSelect2.apply(this, arguments);\n }\n return _handleStartContentPlacementSelect;\n }()\n }, {\n key: \"_handleEndContentPlacementSelect\",\n value: function () {\n var _handleEndContentPlacementSelect2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var result, placementId, endContentPlacement;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n result = data.result;\n placementId = result.placement_id;\n this.endSearchBox.searchBar.setText(result.name);\n _context2.next = 5;\n return this.searchApi.fetchContentPlacementDetails(placementId);\n case 5:\n endContentPlacement = _context2.sent;\n this.updateView(this.startContentPlacement, endContentPlacement);\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleEndContentPlacementSelect(_x2) {\n return _handleEndContentPlacementSelect2.apply(this, arguments);\n }\n return _handleEndContentPlacementSelect;\n }()\n }, {\n key: \"_handleStartSearchBarFocus\",\n value: function _handleStartSearchBarFocus() {\n this.startSearchBox.searchBar.updateRightButtonIcon('search');\n }\n }, {\n key: \"_handleEndSearchBarFocus\",\n value: function _handleEndSearchBarFocus() {\n this.endSearchBox.searchBar.updateRightButtonIcon('search');\n }\n }, {\n key: \"_handleStartSearchBarBlur\",\n value: function _handleStartSearchBarBlur() {\n this.startSearchBox.searchBar.updateRightButtonIcon('none');\n }\n }, {\n key: \"_handleEndSearchBarBlur\",\n value: function _handleEndSearchBarBlur() {\n this.endSearchBox.searchBar.updateRightButtonIcon('none');\n }\n }, {\n key: \"updateView\",\n value: function updateView(startContentPlacement, endContentPlacement) {\n this.startContentPlacement = startContentPlacement;\n this.endContentPlacement = endContentPlacement;\n if (startContentPlacement && endContentPlacement) {\n this.fire('initiate:findPath', {\n startContentPlacementId: startContentPlacement.placement_id,\n endContentPlacementId: endContentPlacement.placement_id\n });\n } else if (startContentPlacement) {\n var data = startContentPlacement.content.data;\n var titleKey = startContentPlacement.content.title_key;\n var title = data[titleKey];\n this.startSearchBox.searchBar.setText(title);\n this.endSearchBox.searchBar.setText('');\n this.endSearchBox.searchBar.input.focus();\n this.clearSteps();\n } else if (endContentPlacement) {\n var _data = endContentPlacement.content.data;\n var _titleKey = endContentPlacement.content.title_key;\n var _title = _data[_titleKey];\n this.endSearchBox.searchBar.setText(_title);\n this.startSearchBox.searchBar.setText('');\n this.startSearchBox.searchBar.input.focus();\n this.clearSteps();\n }\n }\n }, {\n key: \"setSteps\",\n value: function setSteps(steps) {\n this.steps = steps;\n this._render();\n }\n }, {\n key: \"clearSteps\",\n value: function clearSteps() {\n var stepsViewElement = this.element.querySelector('.steps-view'); // Assuming .steps-view is a class in StepsView\n if (stepsViewElement) {\n stepsViewElement.remove(); // Remove the StepsView element if it exists\n }\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DirectionsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/DirectionsView/DirectionsView.js?");
761
750
 
762
751
  /***/ }),
763
752
 
@@ -768,7 +757,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
768
757
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
769
758
 
770
759
  "use strict";
771
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\nvar StepsView = /*#__PURE__*/function (_Component) {\n function StepsView(steps) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, StepsView);\n _this = _callSuper(this, StepsView, [options]);\n _this.steps = steps;\n _this._initialize();\n return _this;\n }\n _inherits(StepsView, _Component);\n return _createClass(StepsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement(\"div\");\n this.element.className = \"steps-view\";\n this._render(this.steps);\n }\n }, {\n key: \"_render\",\n value: function _render(steps) {\n console.log(\"HERE ARE STEPSSS\", steps);\n var heading = document.createElement(\"h2\");\n heading.textContent = \"Steps\";\n this.element.appendChild(heading);\n var list = document.createElement(\"ul\");\n steps.forEach(function (step) {\n var listItem = document.createElement(\"li\");\n listItem.textContent = step;\n list.appendChild(listItem);\n });\n this.element.appendChild(list);\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StepsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/DirectionsView/StepsView.js?");
760
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\nvar StepsView = /*#__PURE__*/function (_Component) {\n function StepsView(steps) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, StepsView);\n _this = _callSuper(this, StepsView, [options]);\n _this.steps = steps;\n _this._initialize();\n return _this;\n }\n _inherits(StepsView, _Component);\n return _createClass(StepsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement(\"div\");\n this.element.className = \"steps-view\";\n this._render(this.steps);\n }\n }, {\n key: \"_render\",\n value: function _render(steps) {\n var heading = document.createElement(\"h2\");\n heading.textContent = \"Steps\";\n this.element.appendChild(heading);\n var list = document.createElement(\"ul\");\n steps.forEach(function (step) {\n var listItem = document.createElement(\"li\");\n listItem.textContent = step;\n list.appendChild(listItem);\n });\n this.element.appendChild(list);\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StepsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/DirectionsView/StepsView.js?");
772
761
 
773
762
  /***/ }),
774
763
 
@@ -779,7 +768,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
779
768
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
780
769
 
781
770
  "use strict";
782
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MapView: () => (/* binding */ MapView)\n/* harmony export */ });\n/* harmony import */ var _utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/resourceLoader */ \"./src/utils/resourceLoader.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _api_MapApi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../api/MapApi */ \"./src/api/MapApi.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _core_Events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../core/Events */ \"./src/core/Events.js\");\n/* harmony import */ var _StateCoordinator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./StateCoordinator */ \"./src/components/MapView/StateCoordinator.js\");\n/* harmony import */ var _Controls_SearchResultsControl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../Controls/SearchResultsControl */ \"./src/Controls/SearchResultsControl.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction 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; }\nfunction _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) { _defineProperty(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; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\n\n\n\nvar mapboxCSS = 'https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.css';\nvar mapboxJS = 'https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.js';\nvar accessToken = 'pk.eyJ1Ijoid2F5Z28tbWFwcyIsImEiOiJjbGtxYzZ1N3QxdG43M210bXFuYmJ4a3gxIn0.tlbznj_fRJ8La6s2UUMO6A';\nvar mock = {\n 'c66d7e2c3ebd4a8fa60efa5bf3b5b301:2d4911eda2ef4950b307e51cd0ccf35e': {\n 'steps': ['Leave Roundtable and make a left', 'Turn right after walking 177 feet', 'Turn left after walking 203 feet', 'Turn right after walking 100 feet', 'Continue straight in 242 feet', 'Arrive at Stage 4, on your left'],\n 'path': [[-81.557308010743881, -195.68687504906683], [-66.793528483184829, -195.68687504906688], [-66.793528483184829, -136.30367294932935], [-6.7541584044446665, -136.30367294932955], [-6.7541584044446195, -106.92078820451393], [81.828518760909716, -106.92078820451393], [81.828518760909716, -47.209502115275079], [140.88363687114594, -47.209502115275079]]\n }\n};\nvar mockData = {\n 'b1800bf6e3ed480cae21526e42464676:a7fa2fb07ae04049b9026c296d015d66': {\n 'steps': ['Leave Roundtable and make a left', 'Turn right after walking 177 feet', 'Turn left after walking 203 feet', 'Turn right after walking 100 feet', 'Continue straight in 242 feet', 'Arrive at Stage 4, on your left'],\n 'path': [[95.645948774511609, -118.96329432647396], [41.840174496296385, -118.96329432647379], [41.840174496296484, -56.955420310725756], [10.344111504170499, -56.955420310725756], [10.34411150417062, 18.175813285074767], [0.17350782962993705, 18.175813285074767], [0.17350782962999536, 54.265052130219125], [-25.417043351472369, 54.26505213021921]]\n },\n // ROUNDTABLE TO STAGE 4\n '529803fcdd7e4d5db5ed71b9ff1ef0e2:899969e0115b4d8da8fb51bedf7caff2': {\n 'steps': [\"Leave Startups Info Point and make a left\", \"Turn right in 12 feet\", \"Turn left in 37 feet\", \"Continue straight for 182 feet\", \"Turn right in 36 feet\", \"Turn left after 29 feet\", \"Turn right after 57 feet\", \"Turn left after walking 42 feet\", \"Arrive at Alpha 1, on your right\"],\n 'path': [[284.28160504078147, -119.85123601826949], [258.75367051155007, -119.8512360182694], [258.75367051155007, -57.515278013020058], [-40.902596633706594, -57.515278013019092], [-40.902596633706445, 19.584459519789313], [-169.83960450772221, 19.584459519789728], [-169.83960450772213, 78.311493640524645], [-215.11519505890323, 78.311493640524787]]\n },\n 'd1910e5724844b40bf8e2a721fba172a:3673b48d96b04d7aa65937dec3276d3c': {\n 'steps': [\"Leave startup lounge and make a right\", \"Continue straight for 22 feet, then turn left\", \"Turn right in 37 feet\", \"Continue straight for 143 feet, then turn left\", \"Turn right in 32 feet\", \"Continue straight for 210 feet\", \"Turn right, and continue for 5 feet\", \"Arrive at The Black Innovation Zone, on your right\"],\n 'path': [[417.35544488563073, 75.74517709550193], [356.33182283838664, 75.745177095502129], [356.33182283838653, 17.674310953769847], [121.7517703449482, 17.674310953770604], [121.75177034494808, -56.800754663027305], [-207.21694798680142, -56.80075466302624], [-207.21694798680144, -78.116837633560053]]\n }\n};\nvar defaultMapOptions = {\n container: 'map',\n // Default container ID\n sourceId: 'collision-conference.2024.2xw_YUXYS8GoDTB2AQgN3A',\n center: [0, 0],\n // Default map center [longitude, latitude]\n zoom: 12,\n // Default zoom level\n bearing: 0,\n pitch: 0,\n minPitch: 0,\n maxPitch: 75,\n minZoom: 0,\n maxZoom: 22,\n bounds: null,\n // The bounds of the map, would override center and zoom options.\n doubleClickZoom: true,\n dragPan: true,\n dragRotate: true,\n scrollZoom: true,\n touchPitch: true,\n touchZoomRotate: true,\n interactive: true,\n trackResize: true,\n keyboard: true\n};\nvar MapView = /*#__PURE__*/function (_Component) {\n function MapView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, MapView);\n _this = _callSuper(this, MapView, [_objectSpread(_objectSpread({}, defaultMapOptions), options)]);\n _this.mapViewApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMapViewApi();\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSearchApi();\n _this.mapContainer = document.createElement('div');\n _this.mapContainer.className = 'inner-map-container';\n _this.ready = _this._initialize(options);\n\n // this._hiddenSymbolLayers = [];\n _this.mapData = null;\n _this._stateCoordinator = new _StateCoordinator__WEBPACK_IMPORTED_MODULE_5__[\"default\"](_this);\n return _this;\n }\n _inherits(MapView, _Component);\n return _createClass(MapView, [{\n key: \"_initialize\",\n value: function () {\n var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this2 = this;\n var styleId;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n console.log('Initializing map view component..');\n _context.prev = 1;\n _context.next = 4;\n return this._loadMapLibraries();\n case 4:\n this.render();\n // const mapData = await this._initializeMapData();\n _context.next = 7;\n return this._initializeMapData();\n case 7:\n console.log(\"LOADED MAP DATA\", this.mapData);\n // const style = await this._fetchMapStyle();\n if (this.mapData) {\n _context.next = 11;\n break;\n }\n console.error(\"Error initializing map data.\");\n return _context.abrupt(\"return\");\n case 11:\n styleId = this.mapData.style_id;\n if (typeof mapboxgl !== 'undefined' && styleId) {\n mapboxgl.accessToken = accessToken;\n this.map = new mapboxgl.Map({\n container: this.mapContainer,\n style: \"mapbox://styles/waygo-maps/\".concat(styleId),\n center: this.options.center,\n zoom: this.options.zoom,\n bearing: this.options.bearing,\n pitch: this.options.pitch,\n minPitch: this.options.minPitch,\n maxPitch: this.options.maxPitch,\n minZoom: this.options.minZoom,\n maxZoom: this.options.maxZoom,\n bounds: this.options.bounds,\n doubleClickZoom: this.options.doubleClickZoom,\n dragPan: this.options.dragPan,\n dragRotate: this.options.dragRotate,\n scrollZoom: this.options.scrollZoom,\n touchPitch: this.options.touchPitch,\n touchZoomRotate: this.options.touchZoomRotate,\n interactive: this.options.interactive,\n trackResize: this.options.trackResize,\n keyboard: this.options.keyboard\n });\n this.map.on('load', function () {\n return _this2.fire('load');\n });\n this._initializeEventListeners();\n } else {\n console.error('Mapbox GL JS is not loaded.');\n }\n _context.next = 18;\n break;\n case 15:\n _context.prev = 15;\n _context.t0 = _context[\"catch\"](1);\n console.error('Failed to initialize the map:', _context.t0);\n case 18:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[1, 15]]);\n }));\n function _initialize() {\n return _initialize2.apply(this, arguments);\n }\n return _initialize;\n }()\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n var _this3 = this;\n this.mapContainer.addEventListener('mousedown', function (event) {\n return _this3.fire('mousedown', {\n originalEvent: event\n });\n });\n // preclick\n this.mapContainer.addEventListener('click', function (event) {\n return _this3.fire('click', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mouseover', function (event) {\n return _this3.fire('mouseover', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mousemove', function (event) {\n return _this3.fire('mousemove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('dblclick', function (event) {\n return _this3.fire('dblclick', {\n originalEvent: event\n });\n });\n // mouseenter\n // mouseleave\n this.mapContainer.addEventListener('mouseout', function (event) {\n return _this3.fire('mouseout', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('contextmenu', function (event) {\n return _this3.fire('contextmenu', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('wheel', function (event) {\n return _this3.fire('wheel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchstart', function (event) {\n return _this3.fire('touchstart', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchend', function (event) {\n return _this3.fire('touchend', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchmove', function (event) {\n return _this3.fire('touchmove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchcancel', function (event) {\n return _this3.fire('touchcancel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('move', function (event) {\n return _this3.fire('move', {\n originalEvent: event\n });\n });\n var movementEvents = ['movestart', 'move', 'moveend', 'dragstart', 'drag', 'dragend', 'zoomstart', 'zoom', 'zoomend', 'rotatestart', 'rotate', 'rotateend', 'pitchstart', 'pitch', 'pitchend', 'boxzoomstart', 'boxzoomend', 'boxzoomcancel'];\n movementEvents.forEach(function (eventName) {\n _this3.map.on(eventName, function (event) {\n _this3.fire(eventName, {\n originalEvent: event\n });\n });\n });\n }\n }, {\n key: \"_initializeMapData\",\n value: function () {\n var _initializeMapData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var parts, accountId, mapId, mapViewId, data;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n parts = this.options.sourceId.split('.');\n if (!(parts.length !== 3)) {\n _context2.next = 4;\n break;\n }\n console.error('The mapViewId format is incorrect. It should be in the format \"businessId.mapId.mapViewId\".');\n return _context2.abrupt(\"return\");\n case 4:\n accountId = parts[0] || '';\n mapId = parts[1] || '';\n mapViewId = parts[2] || ''; // Set account id in WaygoMaps\n _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setAccountId(accountId);\n _context2.prev = 8;\n _context2.next = 11;\n return this.mapViewApi.loadMapView(mapId, mapViewId);\n case 11:\n data = _context2.sent;\n this.mapData = data;\n _context2.next = 18;\n break;\n case 15:\n _context2.prev = 15;\n _context2.t0 = _context2[\"catch\"](8);\n console.error('Error fetching map style:', _context2.t0);\n case 18:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[8, 15]]);\n }));\n function _initializeMapData() {\n return _initializeMapData2.apply(this, arguments);\n }\n return _initializeMapData;\n }() // async _fetchMapStyle() {\n // let parts = this.options.sourceId.split('.');\n // if (parts.length !== 3) {\n // console.error('The mapViewId format is incorrect. It should be in the format \"businessId.mapId.mapViewId\".');\n // return;\n // }\n // let businessId = parts[0] || '';\n // let mapId = parts[1] || '';\n // let mapViewId = parts[2] || '';\n // try {\n // const data = await this.mapViewApi.fetchMapStyle(businessId, mapId, mapViewId);\n // console.log('Fetched map style:', data.style_id);\n // return data.style_id\n // } catch (err) {\n // console.error('Error fetching map style:', err);\n // }\n // }\n }, {\n key: \"_loadMapLibraries\",\n value: function () {\n var _loadMapLibraries2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n console.log('Loading map libraries');\n _context3.next = 3;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadCSS)(mapboxCSS);\n case 3:\n _context3.next = 5;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadScript)(mapboxJS);\n case 5:\n console.log('Map libraries loaded');\n case 6:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function _loadMapLibraries() {\n return _loadMapLibraries2.apply(this, arguments);\n }\n return _loadMapLibraries;\n }()\n }, {\n key: \"render\",\n value: function render() {\n var targetContainer = document.getElementById(this.options.container);\n if (targetContainer) {\n targetContainer.appendChild(this.mapContainer);\n this.mapContainer.style.width = '100%';\n this.mapContainer.style.height = '100%';\n this.mapContainer.style.position = 'relative';\n } else {\n console.error(\"Container element with id \\\"\".concat(this.containerId, \"\\\" not found.\"));\n }\n }\n\n // MARK: Controls\n }, {\n key: \"addControl\",\n value: function addControl(control) {\n var container = control.onAdd(this);\n this.mapContainer.appendChild(container);\n }\n }, {\n key: \"removeControl\",\n value: function removeControl(control) {\n this.map.removeControl(control);\n }\n\n // MARK: Map states\n }, {\n key: \"getCurrentState\",\n value: function getCurrentState() {\n return this._stateCoordinator.state;\n }\n }, {\n key: \"setToDefaultState\",\n value: function setToDefaultState() {\n this._stateCoordinator.transitionTo('default');\n }\n }, {\n key: \"setToSearchState\",\n value: function () {\n var _setToSearchState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query) {\n var results;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return this.search(query);\n case 2:\n results = _context4.sent;\n this._stateCoordinator.transitionTo('search', {\n query: query,\n results: results\n });\n case 4:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function setToSearchState(_x) {\n return _setToSearchState.apply(this, arguments);\n }\n return setToSearchState;\n }()\n }, {\n key: \"setToSelectedContentState\",\n value: function () {\n var _setToSelectedContentState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(contentPlacementIds) {\n var lastContentPlacementId, selectedContentPlacement;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n console.log(\"2. SSSSSSSS INITIALIZING SELECTED CONTENT STATE\", contentPlacementIds);\n lastContentPlacementId = contentPlacementIds[contentPlacementIds.length - 1];\n _context5.next = 4;\n return this.getContentPlacementDetails(lastContentPlacementId);\n case 4:\n selectedContentPlacement = _context5.sent;\n this._stateCoordinator.transitionTo('selectedContent', {\n contentPlacementIds: contentPlacementIds,\n selectedContentPlacement: selectedContentPlacement\n });\n case 6:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function setToSelectedContentState(_x2) {\n return _setToSelectedContentState.apply(this, arguments);\n }\n return setToSelectedContentState;\n }()\n }, {\n key: \"setToDirectionsState\",\n value: function () {\n var _setToDirectionsState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n var startContentPlacementId,\n endContentPlacementId,\n startContentPlacement,\n endContentPlacement,\n _args6 = arguments;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n startContentPlacementId = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : null;\n endContentPlacementId = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : null;\n startContentPlacement = null;\n if (!startContentPlacementId) {\n _context6.next = 7;\n break;\n }\n _context6.next = 6;\n return this.getContentPlacementDetails(startContentPlacementId);\n case 6:\n startContentPlacement = _context6.sent;\n case 7:\n endContentPlacement = null;\n if (!endContentPlacementId) {\n _context6.next = 12;\n break;\n }\n _context6.next = 11;\n return this.getContentPlacementDetails(endContentPlacementId);\n case 11:\n endContentPlacement = _context6.sent;\n case 12:\n this._stateCoordinator.transitionTo('directions', {\n startContentPlacement: startContentPlacement,\n endContentPlacement: endContentPlacement\n });\n case 13:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function setToDirectionsState() {\n return _setToDirectionsState.apply(this, arguments);\n }\n return setToDirectionsState;\n }()\n }, {\n key: \"initiateBack\",\n value: function initiateBack() {\n this.fire('initiate:back');\n }\n }, {\n key: \"initiateSetToSearchState\",\n value: function initiateSetToSearchState() {\n this.fire('initiate:search');\n }\n }, {\n key: \"findPath\",\n value: function findPath(startContentPlacementId, endContentPlacementId) {\n console.log(\"finding path\", startContentPlacementId, endContentPlacementId);\n var data = mock[\"\".concat(startContentPlacementId, \":\").concat(endContentPlacementId)];\n console.log(\"DATA\", data);\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_7__.convertVerticesToCoordinates)(data.path, null, 10.0);\n console.log(\"COORDINATES:\", coordinates);\n return {\n coordinates: coordinates,\n steps: data.steps\n };\n }\n\n // MARK: Map methods\n }, {\n key: \"_findFeatureByPlacementId\",\n value: function _findFeatureByPlacementId(placementId) {\n // Query all rendered features and filter by the desired property (placementId)\n var features = this.map.queryRenderedFeatures({\n // Use a filter to find the feature with the matching placementId\n filter: ['==', ['get', 'placement_id'], placementId]\n });\n\n // Return the first feature that matches the placementId\n return features.length > 0 ? features[0] : null;\n }\n }, {\n key: \"getCenter\",\n value: function getCenter() {\n // Update to convert from lat, lon, to x, y in meters\n if (this.map) {\n return this.map.getCenter();\n } else {\n console.error('Map is not initialized.');\n }\n }\n }, {\n key: \"setCenter\",\n value: function setCenter(lngLat) {\n // Update to convert from lat, lon, to x, y in meters\n if (this.map) {\n this.map.setCenter(lngLat);\n } else {\n console.error('Map is not initialized.');\n }\n }\n }, {\n key: \"search\",\n value: function () {\n var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(query) {\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n if (!(query === '')) {\n _context7.next = 2;\n break;\n }\n return _context7.abrupt(\"return\");\n case 2:\n if (this.mapData) {\n _context7.next = 4;\n break;\n }\n return _context7.abrupt(\"return\");\n case 4:\n _context7.prev = 4;\n _context7.next = 7;\n return this.searchApi.search(this.mapData.map_id, this.mapData.map_view_id, query);\n case 7:\n return _context7.abrupt(\"return\", _context7.sent);\n case 10:\n _context7.prev = 10;\n _context7.t0 = _context7[\"catch\"](4);\n if (axios.isCancel(_context7.t0)) {\n console.log('Request canceled:', _context7.t0.message);\n } else {\n console.error('Search error:', _context7.t0);\n }\n case 13:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this, [[4, 10]]);\n }));\n function search(_x3) {\n return _search.apply(this, arguments);\n }\n return search;\n }()\n }, {\n key: \"getContentPlacementDetails\",\n value: function () {\n var _getContentPlacementDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(contentPlacementId) {\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.prev = 0;\n _context8.next = 3;\n return this.searchApi.fetchContentPlacementDetails(contentPlacementId);\n case 3:\n return _context8.abrupt(\"return\", _context8.sent);\n case 6:\n _context8.prev = 6;\n _context8.t0 = _context8[\"catch\"](0);\n if (axios.isCancel(_context8.t0)) {\n console.log('Request canceled:', _context8.t0.message);\n } else {\n console.error('Fetching content placement details error:', _context8.t0);\n }\n case 9:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8, this, [[0, 6]]);\n }));\n function getContentPlacementDetails(_x4) {\n return _getContentPlacementDetails.apply(this, arguments);\n }\n return getContentPlacementDetails;\n }()\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n//# sourceURL=webpack://waygomaps/./src/components/MapView/MapView.js?");
771
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MapView: () => (/* binding */ MapView)\n/* harmony export */ });\n/* harmony import */ var _utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/resourceLoader */ \"./src/utils/resourceLoader.js\");\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _StateCoordinator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./StateCoordinator */ \"./src/components/MapView/StateCoordinator.js\");\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../index */ \"./src/index.js\");\n/* harmony import */ var _utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/coordinateSystems */ \"./src/utils/coordinateSystems.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction 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; }\nfunction _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) { _defineProperty(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; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n// import getMapStyle from \"../../api/MapApi\";\n\n// import Events from \"../../core/Events\";\n\n// import SearchResultsControl from \"../../Controls/SearchResultsControl\";\n\n\nvar mapboxCSS = 'https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.css';\nvar mapboxJS = 'https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.js';\nvar accessToken = 'pk.eyJ1Ijoid2F5Z28tbWFwcyIsImEiOiJjbGtxYzZ1N3QxdG43M210bXFuYmJ4a3gxIn0.tlbznj_fRJ8La6s2UUMO6A';\nvar mock = {\n 'c66d7e2c3ebd4a8fa60efa5bf3b5b301:2d4911eda2ef4950b307e51cd0ccf35e': {\n 'steps': ['Leave Roundtable and make a left', 'Turn right after walking 177 feet', 'Turn left after walking 203 feet', 'Turn right after walking 100 feet', 'Continue straight in 242 feet', 'Arrive at Stage 4, on your left'],\n 'path': [[-81.557308010743881, -195.68687504906683], [-66.793528483184829, -195.68687504906688], [-66.793528483184829, -136.30367294932935], [-6.7541584044446665, -136.30367294932955], [-6.7541584044446195, -106.92078820451393], [81.828518760909716, -106.92078820451393], [81.828518760909716, -47.209502115275079], [140.88363687114594, -47.209502115275079]]\n }\n};\nvar mockData = {\n 'b1800bf6e3ed480cae21526e42464676:a7fa2fb07ae04049b9026c296d015d66': {\n 'steps': ['Leave Roundtable and make a left', 'Turn right after walking 177 feet', 'Turn left after walking 203 feet', 'Turn right after walking 100 feet', 'Continue straight in 242 feet', 'Arrive at Stage 4, on your left'],\n 'path': [[95.645948774511609, -118.96329432647396], [41.840174496296385, -118.96329432647379], [41.840174496296484, -56.955420310725756], [10.344111504170499, -56.955420310725756], [10.34411150417062, 18.175813285074767], [0.17350782962993705, 18.175813285074767], [0.17350782962999536, 54.265052130219125], [-25.417043351472369, 54.26505213021921]]\n },\n // ROUNDTABLE TO STAGE 4\n '529803fcdd7e4d5db5ed71b9ff1ef0e2:899969e0115b4d8da8fb51bedf7caff2': {\n 'steps': [\"Leave Startups Info Point and make a left\", \"Turn right in 12 feet\", \"Turn left in 37 feet\", \"Continue straight for 182 feet\", \"Turn right in 36 feet\", \"Turn left after 29 feet\", \"Turn right after 57 feet\", \"Turn left after walking 42 feet\", \"Arrive at Alpha 1, on your right\"],\n 'path': [[284.28160504078147, -119.85123601826949], [258.75367051155007, -119.8512360182694], [258.75367051155007, -57.515278013020058], [-40.902596633706594, -57.515278013019092], [-40.902596633706445, 19.584459519789313], [-169.83960450772221, 19.584459519789728], [-169.83960450772213, 78.311493640524645], [-215.11519505890323, 78.311493640524787]]\n },\n 'd1910e5724844b40bf8e2a721fba172a:3673b48d96b04d7aa65937dec3276d3c': {\n 'steps': [\"Leave startup lounge and make a right\", \"Continue straight for 22 feet, then turn left\", \"Turn right in 37 feet\", \"Continue straight for 143 feet, then turn left\", \"Turn right in 32 feet\", \"Continue straight for 210 feet\", \"Turn right, and continue for 5 feet\", \"Arrive at The Black Innovation Zone, on your right\"],\n 'path': [[417.35544488563073, 75.74517709550193], [356.33182283838664, 75.745177095502129], [356.33182283838653, 17.674310953769847], [121.7517703449482, 17.674310953770604], [121.75177034494808, -56.800754663027305], [-207.21694798680142, -56.80075466302624], [-207.21694798680144, -78.116837633560053]]\n }\n};\nvar defaultMapOptions = {\n container: 'map',\n // Default container ID\n sourceId: 'collision-conference.2024.2xw_YUXYS8GoDTB2AQgN3A',\n center: [0, 0],\n // Default map center [longitude, latitude]\n zoom: 12,\n // Default zoom level\n bearing: 0,\n pitch: 0,\n minPitch: 0,\n maxPitch: 75,\n minZoom: 0,\n maxZoom: 22,\n bounds: null,\n // The bounds of the map, would override center and zoom options.\n doubleClickZoom: true,\n dragPan: true,\n dragRotate: true,\n scrollZoom: true,\n touchPitch: true,\n touchZoomRotate: true,\n interactive: true,\n trackResize: true,\n keyboard: true\n};\nvar MapView = /*#__PURE__*/function (_Component) {\n function MapView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, MapView);\n _this = _callSuper(this, MapView, [_objectSpread(_objectSpread({}, defaultMapOptions), options)]);\n _this.mapViewApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getMapViewApi();\n _this.searchApi = _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getSearchApi();\n _this.mapContainer = document.createElement('div');\n _this.mapContainer.className = 'inner-map-container';\n _this.ready = _this._initialize(options);\n\n // this._hiddenSymbolLayers = [];\n _this.mapData = null;\n _this._stateCoordinator = new _StateCoordinator__WEBPACK_IMPORTED_MODULE_3__[\"default\"](_this);\n _this.defaultControls = options.defaultControls || false;\n return _this;\n }\n _inherits(MapView, _Component);\n return _createClass(MapView, [{\n key: \"_initialize\",\n value: function () {\n var _initialize2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var _this2 = this;\n var styleId;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return this._loadMapLibraries();\n case 3:\n this.render();\n _context.next = 6;\n return this._initializeMapData();\n case 6:\n if (this.mapData) {\n _context.next = 9;\n break;\n }\n console.error(\"Error initializing map data.\");\n return _context.abrupt(\"return\");\n case 9:\n styleId = this.mapData.style_id;\n if (typeof mapboxgl !== 'undefined' && styleId) {\n mapboxgl.accessToken = accessToken;\n this.map = new mapboxgl.Map({\n container: this.mapContainer,\n style: \"mapbox://styles/waygo-maps/\".concat(styleId),\n center: this.options.center,\n zoom: this.options.zoom,\n bearing: this.options.bearing,\n pitch: this.options.pitch,\n minPitch: this.options.minPitch,\n maxPitch: this.options.maxPitch,\n minZoom: this.options.minZoom,\n maxZoom: this.options.maxZoom,\n bounds: this.options.bounds,\n doubleClickZoom: this.options.doubleClickZoom,\n dragPan: this.options.dragPan,\n dragRotate: this.options.dragRotate,\n scrollZoom: this.options.scrollZoom,\n touchPitch: this.options.touchPitch,\n touchZoomRotate: this.options.touchZoomRotate,\n interactive: this.options.interactive,\n trackResize: this.options.trackResize,\n keyboard: this.options.keyboard\n });\n this.map.on('load', function () {\n if (_this2.defaultControls) {\n _this2._addDefaultControls();\n }\n _this2.fire('load', {\n mapData: _this2.mapData\n });\n });\n this._initializeEventListeners();\n } else {\n console.error('Mapbox GL JS is not loaded.');\n }\n _context.next = 16;\n break;\n case 13:\n _context.prev = 13;\n _context.t0 = _context[\"catch\"](0);\n console.error('Failed to initialize the map:', _context.t0);\n case 16:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this, [[0, 13]]);\n }));\n function _initialize() {\n return _initialize2.apply(this, arguments);\n }\n return _initialize;\n }()\n }, {\n key: \"_addDefaultControls\",\n value: function _addDefaultControls() {\n var _this3 = this;\n var controls = [new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SearchBoxControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CategoryBarControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SearchResultsControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ContentPlacementControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].DirectionsControl(), new _index__WEBPACK_IMPORTED_MODULE_4__[\"default\"].InteractionControl()];\n controls.forEach(function (control) {\n return _this3.addControl(control);\n });\n }\n }, {\n key: \"_initializeEventListeners\",\n value: function _initializeEventListeners() {\n var _this4 = this;\n this.mapContainer.addEventListener('mousedown', function (event) {\n return _this4.fire('mousedown', {\n originalEvent: event\n });\n });\n // preclick\n this.mapContainer.addEventListener('click', function (event) {\n return _this4.fire('click', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mouseover', function (event) {\n return _this4.fire('mouseover', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('mousemove', function (event) {\n return _this4.fire('mousemove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('dblclick', function (event) {\n return _this4.fire('dblclick', {\n originalEvent: event\n });\n });\n // mouseenter\n // mouseleave\n this.mapContainer.addEventListener('mouseout', function (event) {\n return _this4.fire('mouseout', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('contextmenu', function (event) {\n return _this4.fire('contextmenu', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('wheel', function (event) {\n return _this4.fire('wheel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchstart', function (event) {\n return _this4.fire('touchstart', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchend', function (event) {\n return _this4.fire('touchend', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchmove', function (event) {\n return _this4.fire('touchmove', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('touchcancel', function (event) {\n return _this4.fire('touchcancel', {\n originalEvent: event\n });\n });\n this.mapContainer.addEventListener('move', function (event) {\n return _this4.fire('move', {\n originalEvent: event\n });\n });\n var movementEvents = ['movestart', 'move', 'moveend', 'dragstart', 'drag', 'dragend', 'zoomstart', 'zoom', 'zoomend', 'rotatestart', 'rotate', 'rotateend', 'pitchstart', 'pitch', 'pitchend', 'boxzoomstart', 'boxzoomend', 'boxzoomcancel'];\n movementEvents.forEach(function (eventName) {\n _this4.map.on(eventName, function (event) {\n _this4.fire(eventName, {\n originalEvent: event\n });\n });\n });\n }\n }, {\n key: \"_initializeMapData\",\n value: function () {\n var _initializeMapData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var parts, accountId, mapId, mapViewId, data;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n parts = this.options.sourceId.split('.');\n if (!(parts.length !== 3)) {\n _context2.next = 4;\n break;\n }\n console.error('The mapViewId format is incorrect. It should be in the format \"businessId.mapId.mapViewId\".');\n return _context2.abrupt(\"return\");\n case 4:\n accountId = parts[0] || '';\n mapId = parts[1] || '';\n mapViewId = parts[2] || ''; // Set account id in WaygoMaps\n _WaygoMaps__WEBPACK_IMPORTED_MODULE_1__[\"default\"].setAccountId(accountId);\n _context2.prev = 8;\n _context2.next = 11;\n return this.mapViewApi.loadMapView(mapId, mapViewId);\n case 11:\n data = _context2.sent;\n this.mapData = data;\n _context2.next = 18;\n break;\n case 15:\n _context2.prev = 15;\n _context2.t0 = _context2[\"catch\"](8);\n console.error('Error fetching map style:', _context2.t0);\n case 18:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this, [[8, 15]]);\n }));\n function _initializeMapData() {\n return _initializeMapData2.apply(this, arguments);\n }\n return _initializeMapData;\n }()\n }, {\n key: \"_loadMapLibraries\",\n value: function () {\n var _loadMapLibraries2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadCSS)(mapboxCSS);\n case 2:\n _context3.next = 4;\n return (0,_utils_resourceLoader__WEBPACK_IMPORTED_MODULE_0__.loadScript)(mapboxJS);\n case 4:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n function _loadMapLibraries() {\n return _loadMapLibraries2.apply(this, arguments);\n }\n return _loadMapLibraries;\n }()\n }, {\n key: \"render\",\n value: function render() {\n var targetContainer = document.getElementById(this.options.container);\n if (targetContainer) {\n targetContainer.appendChild(this.mapContainer);\n this.mapContainer.style.width = '100%';\n this.mapContainer.style.height = '100%';\n this.mapContainer.style.position = 'relative';\n } else {\n console.error(\"Container element with id \\\"\".concat(this.containerId, \"\\\" not found.\"));\n }\n }\n\n // MARK: Controls\n }, {\n key: \"addControl\",\n value: function addControl(control) {\n var container = control.onAdd(this);\n this.mapContainer.appendChild(container);\n }\n }, {\n key: \"removeControl\",\n value: function removeControl(control) {\n this.map.removeControl(control);\n }\n\n // MARK: Map states\n }, {\n key: \"getCurrentState\",\n value: function getCurrentState() {\n return this._stateCoordinator.state;\n }\n }, {\n key: \"setToDefaultState\",\n value: function setToDefaultState() {\n this._stateCoordinator.transitionTo('default');\n }\n }, {\n key: \"setToSearchState\",\n value: function () {\n var _setToSearchState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(query) {\n var results;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return this.search(query);\n case 2:\n results = _context4.sent;\n this._stateCoordinator.transitionTo('search', {\n query: query,\n results: results\n });\n case 4:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4, this);\n }));\n function setToSearchState(_x) {\n return _setToSearchState.apply(this, arguments);\n }\n return setToSearchState;\n }()\n }, {\n key: \"setToSelectedContentState\",\n value: function () {\n var _setToSelectedContentState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(contentPlacementIds) {\n var lastContentPlacementId, selectedContentPlacement;\n return _regeneratorRuntime().wrap(function _callee5$(_context5) {\n while (1) switch (_context5.prev = _context5.next) {\n case 0:\n lastContentPlacementId = contentPlacementIds[contentPlacementIds.length - 1];\n _context5.next = 3;\n return this.getContentPlacementDetails(lastContentPlacementId);\n case 3:\n selectedContentPlacement = _context5.sent;\n this._stateCoordinator.transitionTo('selectedContent', {\n contentPlacementIds: contentPlacementIds,\n selectedContentPlacement: selectedContentPlacement\n });\n case 5:\n case \"end\":\n return _context5.stop();\n }\n }, _callee5, this);\n }));\n function setToSelectedContentState(_x2) {\n return _setToSelectedContentState.apply(this, arguments);\n }\n return setToSelectedContentState;\n }()\n }, {\n key: \"setToDirectionsState\",\n value: function () {\n var _setToDirectionsState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {\n var startContentPlacementId,\n endContentPlacementId,\n startContentPlacement,\n endContentPlacement,\n _args6 = arguments;\n return _regeneratorRuntime().wrap(function _callee6$(_context6) {\n while (1) switch (_context6.prev = _context6.next) {\n case 0:\n startContentPlacementId = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : null;\n endContentPlacementId = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : null;\n startContentPlacement = null;\n if (!startContentPlacementId) {\n _context6.next = 7;\n break;\n }\n _context6.next = 6;\n return this.getContentPlacementDetails(startContentPlacementId);\n case 6:\n startContentPlacement = _context6.sent;\n case 7:\n endContentPlacement = null;\n if (!endContentPlacementId) {\n _context6.next = 12;\n break;\n }\n _context6.next = 11;\n return this.getContentPlacementDetails(endContentPlacementId);\n case 11:\n endContentPlacement = _context6.sent;\n case 12:\n this._stateCoordinator.transitionTo('directions', {\n startContentPlacement: startContentPlacement,\n endContentPlacement: endContentPlacement\n });\n case 13:\n case \"end\":\n return _context6.stop();\n }\n }, _callee6, this);\n }));\n function setToDirectionsState() {\n return _setToDirectionsState.apply(this, arguments);\n }\n return setToDirectionsState;\n }()\n }, {\n key: \"initiateBack\",\n value: function initiateBack() {\n this.fire('initiate:back');\n }\n }, {\n key: \"initiateSetToSearchState\",\n value: function initiateSetToSearchState() {\n this.fire('initiate:search');\n }\n }, {\n key: \"findPath\",\n value: function findPath(startContentPlacementId, endContentPlacementId) {\n var data = mock[\"\".concat(startContentPlacementId, \":\").concat(endContentPlacementId)];\n var coordinates = (0,_utils_coordinateSystems__WEBPACK_IMPORTED_MODULE_5__.convertVerticesToCoordinates)(data.path, null, 10.0);\n return {\n coordinates: coordinates,\n steps: data.steps\n };\n }\n\n // MARK: Map methods\n }, {\n key: \"_findFeatureByPlacementId\",\n value: function _findFeatureByPlacementId(placementId) {\n var features = this.map.queryRenderedFeatures({\n filter: ['==', ['get', 'placement_id'], placementId]\n });\n\n // Return the first feature that matches the placementId\n return features.length > 0 ? features[0] : null;\n }\n }, {\n key: \"getCenter\",\n value: function getCenter() {\n // Update to convert from lat, lon, to x, y in meters\n if (this.map) {\n return this.map.getCenter();\n } else {\n console.error('Map is not initialized.');\n }\n }\n }, {\n key: \"setCenter\",\n value: function setCenter(lngLat) {\n // Update to convert from lat, lon, to x, y in meters\n if (this.map) {\n this.map.setCenter(lngLat);\n } else {\n console.error('Map is not initialized.');\n }\n }\n }, {\n key: \"search\",\n value: function () {\n var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(query) {\n return _regeneratorRuntime().wrap(function _callee7$(_context7) {\n while (1) switch (_context7.prev = _context7.next) {\n case 0:\n if (!(query === '')) {\n _context7.next = 2;\n break;\n }\n return _context7.abrupt(\"return\");\n case 2:\n if (this.mapData) {\n _context7.next = 4;\n break;\n }\n return _context7.abrupt(\"return\");\n case 4:\n _context7.prev = 4;\n _context7.next = 7;\n return this.searchApi.search(this.mapData.map_id, this.mapData.map_view_id, query);\n case 7:\n return _context7.abrupt(\"return\", _context7.sent);\n case 10:\n _context7.prev = 10;\n _context7.t0 = _context7[\"catch\"](4);\n if (axios.isCancel(_context7.t0)) {\n console.error('Request canceled:', _context7.t0.message);\n } else {\n console.error('Search error:', _context7.t0);\n }\n case 13:\n case \"end\":\n return _context7.stop();\n }\n }, _callee7, this, [[4, 10]]);\n }));\n function search(_x3) {\n return _search.apply(this, arguments);\n }\n return search;\n }()\n }, {\n key: \"getContentPlacementDetails\",\n value: function () {\n var _getContentPlacementDetails = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(contentPlacementId) {\n return _regeneratorRuntime().wrap(function _callee8$(_context8) {\n while (1) switch (_context8.prev = _context8.next) {\n case 0:\n _context8.prev = 0;\n _context8.next = 3;\n return this.searchApi.fetchContentPlacementDetails(contentPlacementId);\n case 3:\n return _context8.abrupt(\"return\", _context8.sent);\n case 6:\n _context8.prev = 6;\n _context8.t0 = _context8[\"catch\"](0);\n if (axios.isCancel(_context8.t0)) {\n console.error('Request canceled:', _context8.t0.message);\n } else {\n console.error('Fetching content placement details error:', _context8.t0);\n }\n case 9:\n case \"end\":\n return _context8.stop();\n }\n }, _callee8, this, [[0, 6]]);\n }));\n function getContentPlacementDetails(_x4) {\n return _getContentPlacementDetails.apply(this, arguments);\n }\n return getContentPlacementDetails;\n }()\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n//# sourceURL=webpack://waygomaps/./src/components/MapView/MapView.js?");
783
772
 
784
773
  /***/ }),
785
774
 
@@ -790,7 +779,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
790
779
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
791
780
 
792
781
  "use strict";
793
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar StateCoordinator = /*#__PURE__*/function () {\n function StateCoordinator(mapView) {\n _classCallCheck(this, StateCoordinator);\n this.mapView = mapView;\n this.state = 'default';\n this.stateHistory = ['default'];\n }\n return _createClass(StateCoordinator, [{\n key: \"transitionTo\",\n value: function transitionTo(newState) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.state = newState;\n var lastState = this.stateHistory[this.stateHistory.length - 1];\n if (newState == 'default') {\n this.stateHistory = ['default'];\n } else if (newState !== lastState) {\n this.stateHistory.push(newState);\n }\n console.log(\"STATE LENGTH PROPER\", this.stateHistory.length, this.stateHistory);\n this.mapView.fire(\"state:\".concat(newState), data);\n }\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StateCoordinator);\n\n//# sourceURL=webpack://waygomaps/./src/components/MapView/StateCoordinator.js?");
782
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar StateCoordinator = /*#__PURE__*/function () {\n function StateCoordinator(mapView) {\n _classCallCheck(this, StateCoordinator);\n this.mapView = mapView;\n this.state = 'default';\n this.stateHistory = ['default'];\n }\n return _createClass(StateCoordinator, [{\n key: \"transitionTo\",\n value: function transitionTo(newState) {\n var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.state = newState;\n var lastState = this.stateHistory[this.stateHistory.length - 1];\n if (newState == 'default') {\n this.stateHistory = ['default'];\n } else if (newState !== lastState) {\n this.stateHistory.push(newState);\n }\n this.mapView.fire(\"state:\".concat(newState), data);\n }\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StateCoordinator);\n\n//# sourceURL=webpack://waygomaps/./src/components/MapView/StateCoordinator.js?");
794
783
 
795
784
  /***/ }),
796
785
 
@@ -801,7 +790,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
801
790
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
802
791
 
803
792
  "use strict";
804
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _assets_magnify_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../assets/magnify.svg */ \"./src/assets/magnify.svg\");\n/* harmony import */ var _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../assets/cancel.svg */ \"./src/assets/cancel.svg\");\n/* harmony import */ var _assets_arrows_backArrow_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../assets/arrows/backArrow.svg */ \"./src/assets/arrows/backArrow.svg\");\n/* harmony import */ var _assets_WaygoIcon_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../assets/WaygoIcon.svg */ \"./src/assets/WaygoIcon.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\nvar SearchBar = /*#__PURE__*/function (_Component) {\n function SearchBar() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBar);\n _this = _callSuper(this, SearchBar, [options]);\n _this._initialize();\n return _this;\n }\n _inherits(SearchBar, _Component);\n return _createClass(SearchBar, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('div');\n this.element.className = 'search-bar-container';\n this.input = document.createElement('input');\n this.input.type = 'text';\n this.input.placeholder = 'Search MOVE America 2024';\n this.input.className = 'search-bar';\n this.rightButton = document.createElement('button');\n this.rightButton.className = 'search-bar-button-right';\n this.updateRightButtonIcon('search');\n this.leftButton = document.createElement('button');\n this.leftButton.className = 'search-bar-button-left';\n // this.updateLeftButtonIcon('logo');\n console.log(\"-------> SETTING LEFT ICON: none\");\n this.updateLeftButtonIcon('none');\n this.element.appendChild(this.leftButton);\n this.element.appendChild(this.input);\n this.element.appendChild(this.rightButton);\n this._setupEventListeners();\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.input.addEventListener('input', function (e) {\n return _this2._handleInput(e);\n });\n this.input.addEventListener('focus', this._handleFocus.bind(this));\n this.input.addEventListener('blur', this._handleBlur.bind(this));\n this.input.addEventListener('keydown', function (e) {\n if (e.key === 'Enter') {\n _this2._handleEnterSelect(e);\n }\n });\n this.rightButton.addEventListener('click', function (e) {\n return _this2._handleRightButtonSelect(e);\n });\n this.leftButton.addEventListener('click', function (e) {\n return _this2._handleLeftButtonSelect(e);\n });\n }\n }, {\n key: \"_handleInput\",\n value: function _handleInput(e) {\n // this.updateRightButtonIcon('cancel');\n this.fire('input', {\n event: e,\n query: this.getText()\n });\n }\n }, {\n key: \"_handleFocus\",\n value: function _handleFocus() {\n // this.input.classList.add('with-results');\n console.log(\"FOCUS\");\n this.fire('focus');\n }\n }, {\n key: \"_handleBlur\",\n value: function _handleBlur() {\n var _this3 = this;\n setTimeout(function () {\n var elem = document.activeElement;\n if (elem === _this3.rightButton) {\n _this3.updateStyleWithoutSuggestions();\n // this.input.classList.remove('with-results');\n _this3.fire('blur');\n } else if (elem === _this3.input) {} else {\n _this3.updateStyleWithoutSuggestions();\n // this.input.classList.remove('with-results');\n _this3.fire('blur');\n }\n }, 150); // Timeout to allow clicks on results before hiding\n }\n }, {\n key: \"_handleEnterSelect\",\n value: function _handleEnterSelect(e) {\n var query = this.getText();\n if (query.length > 0) {\n this.fire('search', {\n query: query,\n event: e\n });\n this.input.blur();\n }\n }\n }, {\n key: \"_handleRightButtonSelect\",\n value: function _handleRightButtonSelect(e) {\n if (this.rightButtonState === 'search') {\n var query = this.getText();\n if (query.length > 0) {\n this.fire('search', {\n query: query,\n event: e\n });\n this.input.blur();\n }\n } else if (this.rightButtonState === 'cancel') {\n // || this.rightButtonState === 'selectedContent') {\n this.fire('cancel', {\n event: e\n });\n }\n }\n }, {\n key: \"_handleLeftButtonSelect\",\n value: function _handleLeftButtonSelect(e) {\n if (this.leftButtonState === 'logo') {\n this.input.focus();\n } else if (this.leftButtonState === 'back') {\n // || this.rightButtonState === 'selectedContent') {\n this.fire('back');\n }\n }\n }, {\n key: \"updateStyleWithSuggestions\",\n value: function updateStyleWithSuggestions() {\n this.element.classList.add('with-results');\n }\n }, {\n key: \"updateStyleWithoutSuggestions\",\n value: function updateStyleWithoutSuggestions() {\n this.element.classList.remove('with-results');\n }\n }, {\n key: \"updateRightButtonIcon\",\n value: function updateRightButtonIcon(state) {\n this.rightButtonState = state;\n // if (state === 'default') {\n if (state === 'search') {\n this.rightButton.innerHTML = \"<img src=\\\"\".concat(_assets_magnify_svg__WEBPACK_IMPORTED_MODULE_1__[\"default\"], \"\\\" alt=\\\"Search\\\" />\");\n this.rightButton.style.display = 'flex';\n // this.input.style.paddingLeft = '100px';\n } else if (state === 'cancel') {\n this.rightButton.innerHTML = \"<img src=\\\"\".concat(_assets_cancel_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"], \"\\\" alt=\\\"Cancel\\\" />\");\n this.rightButton.style.display = 'flex';\n // this.input.style.paddingLeft = '100px';\n } else if (state === 'none') {\n this.rightButton.style.display = 'none';\n // this.input.style.paddingLeft = '24px';\n }\n }\n }, {\n key: \"updateLeftButtonIcon\",\n value: function updateLeftButtonIcon(state) {\n console.log(\"UPDATING LEFT BAR BUTTON TO STATE:\", state);\n this.leftButtonState = state;\n if (state === 'logo') {\n this.leftButton.innerHTML = \"<img src=\\\"\".concat(_assets_WaygoIcon_svg__WEBPACK_IMPORTED_MODULE_4__[\"default\"], \"\\\" alt=\\\"\").concat(state, \"\\\" />\");\n var imgElement = this.leftButton.querySelector('img');\n imgElement.style.width = '16px';\n imgElement.style.height = '16px';\n this.leftButton.style.display = 'flex';\n\n // this.input.style.paddingLeft = '50px';\n } else if (state === 'back') {\n this.leftButton.innerHTML = \"<img src=\\\"\".concat(_assets_arrows_backArrow_svg__WEBPACK_IMPORTED_MODULE_3__[\"default\"], \"\\\" alt=\\\"\").concat(state, \"\\\" />\");\n var _imgElement = this.leftButton.querySelector('img');\n _imgElement.style.width = '20px';\n _imgElement.style.height = '20px';\n // this.input.style.paddingLeft = '50px';\n this.leftButton.style.display = 'flex';\n } else if (state === 'none') {\n this.leftButton.style.display = 'none';\n // this.input.style.paddingLeft = '24px';\n }\n }\n }, {\n key: \"getText\",\n value: function getText() {\n return this.input.value;\n }\n }, {\n key: \"setText\",\n value: function setText(query) {\n this.input.value = query;\n }\n }, {\n key: \"setPlaceholderText\",\n value: function setPlaceholderText(placeholderText) {\n this.input.placeholder = placeholderText;\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n this.element.classList.remove('mobile-view');\n this.input.classList.remove('mobile-view');\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n this.element.classList.add('mobile-view');\n this.input.classList.add('mobile-view');\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBar);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBar.js?");
793
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _assets_magnify_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../assets/magnify.svg */ \"./src/assets/magnify.svg\");\n/* harmony import */ var _assets_cancel_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../assets/cancel.svg */ \"./src/assets/cancel.svg\");\n/* harmony import */ var _assets_arrows_backArrow_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../assets/arrows/backArrow.svg */ \"./src/assets/arrows/backArrow.svg\");\n/* harmony import */ var _assets_WaygoIcon_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../assets/WaygoIcon.svg */ \"./src/assets/WaygoIcon.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n\nvar SearchBar = /*#__PURE__*/function (_Component) {\n function SearchBar() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBar);\n _this = _callSuper(this, SearchBar, [options]);\n _this._initialize();\n return _this;\n }\n _inherits(SearchBar, _Component);\n return _createClass(SearchBar, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('div');\n this.element.className = 'search-bar-container';\n this.input = document.createElement('input');\n this.input.type = 'text';\n this.input.placeholder = '';\n this.input.className = 'search-bar';\n this.rightButton = document.createElement('button');\n this.rightButton.className = 'search-bar-button-right';\n this.updateRightButtonIcon('search');\n this.leftButton = document.createElement('button');\n this.leftButton.className = 'search-bar-button-left';\n this.updateLeftButtonIcon('none');\n this.element.appendChild(this.leftButton);\n this.element.appendChild(this.input);\n this.element.appendChild(this.rightButton);\n this._setupEventListeners();\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.input.addEventListener('input', function (e) {\n return _this2._handleInput(e);\n });\n this.input.addEventListener('focus', this._handleFocus.bind(this));\n this.input.addEventListener('blur', this._handleBlur.bind(this));\n this.input.addEventListener('keydown', function (e) {\n if (e.key === 'Enter') {\n _this2._handleEnterSelect(e);\n }\n });\n this.rightButton.addEventListener('click', function (e) {\n return _this2._handleRightButtonSelect(e);\n });\n this.leftButton.addEventListener('click', function (e) {\n return _this2._handleLeftButtonSelect(e);\n });\n }\n }, {\n key: \"_handleInput\",\n value: function _handleInput(e) {\n this.fire('input', {\n event: e,\n query: this.getText()\n });\n }\n }, {\n key: \"_handleFocus\",\n value: function _handleFocus() {\n this.fire('focus');\n }\n }, {\n key: \"_handleBlur\",\n value: function _handleBlur() {\n var _this3 = this;\n setTimeout(function () {\n var elem = document.activeElement;\n if (elem === _this3.rightButton) {\n _this3.updateStyleWithoutSuggestions();\n _this3.fire('blur');\n } else if (elem === _this3.input) {} else {\n _this3.updateStyleWithoutSuggestions();\n _this3.fire('blur');\n }\n }, 150);\n }\n }, {\n key: \"_handleEnterSelect\",\n value: function _handleEnterSelect(e) {\n var query = this.getText();\n if (query.length > 0) {\n this.fire('search', {\n query: query,\n event: e\n });\n this.input.blur();\n }\n }\n }, {\n key: \"_handleRightButtonSelect\",\n value: function _handleRightButtonSelect(e) {\n if (this.rightButtonState === 'search') {\n var query = this.getText();\n if (query.length > 0) {\n this.fire('search', {\n query: query,\n event: e\n });\n this.input.blur();\n }\n } else if (this.rightButtonState === 'cancel') {\n this.fire('cancel', {\n event: e\n });\n }\n }\n }, {\n key: \"_handleLeftButtonSelect\",\n value: function _handleLeftButtonSelect(e) {\n if (this.leftButtonState === 'logo') {\n this.input.focus();\n } else if (this.leftButtonState === 'back') {\n this.fire('back');\n }\n }\n }, {\n key: \"updateStyleWithSuggestions\",\n value: function updateStyleWithSuggestions() {\n this.element.classList.add('with-results');\n }\n }, {\n key: \"updateStyleWithoutSuggestions\",\n value: function updateStyleWithoutSuggestions() {\n this.element.classList.remove('with-results');\n }\n }, {\n key: \"updateRightButtonIcon\",\n value: function updateRightButtonIcon(state) {\n this.rightButtonState = state;\n if (state === 'search') {\n this.rightButton.innerHTML = \"<img src=\\\"\".concat(_assets_magnify_svg__WEBPACK_IMPORTED_MODULE_1__[\"default\"], \"\\\" alt=\\\"Search\\\" />\");\n this.rightButton.style.display = 'flex';\n } else if (state === 'cancel') {\n this.rightButton.innerHTML = \"<img src=\\\"\".concat(_assets_cancel_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"], \"\\\" alt=\\\"Cancel\\\" />\");\n this.rightButton.style.display = 'flex';\n } else if (state === 'none') {\n this.rightButton.style.display = 'none';\n }\n }\n }, {\n key: \"updateLeftButtonIcon\",\n value: function updateLeftButtonIcon(state) {\n this.leftButtonState = state;\n if (state === 'logo') {\n this.leftButton.innerHTML = \"<img src=\\\"\".concat(_assets_WaygoIcon_svg__WEBPACK_IMPORTED_MODULE_4__[\"default\"], \"\\\" alt=\\\"\").concat(state, \"\\\" />\");\n var imgElement = this.leftButton.querySelector('img');\n imgElement.style.width = '16px';\n imgElement.style.height = '16px';\n this.leftButton.style.display = 'flex';\n } else if (state === 'back') {\n this.leftButton.innerHTML = \"<img src=\\\"\".concat(_assets_arrows_backArrow_svg__WEBPACK_IMPORTED_MODULE_3__[\"default\"], \"\\\" alt=\\\"\").concat(state, \"\\\" />\");\n var _imgElement = this.leftButton.querySelector('img');\n _imgElement.style.width = '20px';\n _imgElement.style.height = '20px';\n this.leftButton.style.display = 'flex';\n } else if (state === 'none') {\n this.leftButton.style.display = 'none';\n }\n }\n }, {\n key: \"setPlaceholderText\",\n value: function setPlaceholderText(placeholderText) {\n this.input.placeholder = placeholderText;\n }\n }, {\n key: \"getText\",\n value: function getText() {\n return this.input.value;\n }\n }, {\n key: \"setText\",\n value: function setText(query) {\n this.input.value = query;\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n this.element.classList.remove('mobile-view');\n this.input.classList.remove('mobile-view');\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n this.element.classList.add('mobile-view');\n this.input.classList.add('mobile-view');\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBar);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBar.js?");
805
794
 
806
795
  /***/ }),
807
796
 
@@ -812,7 +801,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
812
801
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
813
802
 
814
803
  "use strict";
815
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _SearchBarSuggestionsViewCell__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SearchBarSuggestionsViewCell */ \"./src/components/SearchBox/SearchBarSuggestionsViewCell.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar SearchBarSuggestionsView = /*#__PURE__*/function (_Component) {\n function SearchBarSuggestionsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBarSuggestionsView);\n _this = _callSuper(this, SearchBarSuggestionsView, [options]);\n _this._initialize();\n return _this;\n }\n _inherits(SearchBarSuggestionsView, _Component);\n return _createClass(SearchBarSuggestionsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.results = [];\n this.element = document.createElement('div');\n this.element.className = 'search-bar-suggestions-view';\n }\n }, {\n key: \"updateResults\",\n value: function updateResults(results) {\n this.results = results;\n this.render();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n this.element.innerHTML = ''; // Clear previous results\n\n this.results.forEach(function (r) {\n var cell = new _SearchBarSuggestionsViewCell__WEBPACK_IMPORTED_MODULE_0__[\"default\"](r);\n cell.on('click', function () {\n return _this2.fire('selectCell', {\n result: r\n });\n });\n _this2.element.appendChild(cell.getElement());\n });\n }\n }, {\n key: \"clearResults\",\n value: function clearResults() {\n this.updateResults([]);\n }\n }, {\n key: \"show\",\n value: function show() {\n this.element.classList.add('visible');\n }\n }, {\n key: \"hide\",\n value: function hide() {\n this.element.classList.remove('visible');\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n console.log(\"HERE\");\n return;\n // this.element.classList.remove('mobile-view');\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n console.log(\"HERE\");\n return;\n // this.element.classList.remove('mobile-view');\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBarSuggestionsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBarSuggestionsView.js?");
804
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _SearchBarSuggestionsViewCell__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SearchBarSuggestionsViewCell */ \"./src/components/SearchBox/SearchBarSuggestionsViewCell.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\nvar SearchBarSuggestionsView = /*#__PURE__*/function (_Component) {\n function SearchBarSuggestionsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBarSuggestionsView);\n _this = _callSuper(this, SearchBarSuggestionsView, [options]);\n _this._initialize();\n return _this;\n }\n _inherits(SearchBarSuggestionsView, _Component);\n return _createClass(SearchBarSuggestionsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.results = [];\n this.element = document.createElement('div');\n this.element.className = 'search-bar-suggestions-view';\n }\n }, {\n key: \"updateResults\",\n value: function updateResults(results) {\n this.results = results;\n this.render();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n this.element.innerHTML = ''; // Clear previous results\n\n this.results.forEach(function (r) {\n var cell = new _SearchBarSuggestionsViewCell__WEBPACK_IMPORTED_MODULE_0__[\"default\"](r);\n cell.on('click', function () {\n return _this2.fire('selectCell', {\n result: r\n });\n });\n _this2.element.appendChild(cell.getElement());\n });\n }\n }, {\n key: \"clearResults\",\n value: function clearResults() {\n this.updateResults([]);\n }\n }, {\n key: \"show\",\n value: function show() {\n this.element.classList.add('visible');\n }\n }, {\n key: \"hide\",\n value: function hide() {\n this.element.classList.remove('visible');\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n return;\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n return;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBarSuggestionsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBarSuggestionsView.js?");
816
805
 
817
806
  /***/ }),
818
807
 
@@ -834,7 +823,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
834
823
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
835
824
 
836
825
  "use strict";
837
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _SearchBar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SearchBar */ \"./src/components/SearchBox/SearchBar.js\");\n/* harmony import */ var _SearchBarSuggestionsView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SearchBarSuggestionsView */ \"./src/components/SearchBox/SearchBarSuggestionsView.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n// import axios from \"axios\";\nvar SearchBox = /*#__PURE__*/function (_Component) {\n function SearchBox() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBox);\n _this = _callSuper(this, SearchBox, [options]);\n // this.searchApi = waygoMaps.getSearchApi();\n\n _this.element = document.createElement('div');\n _this.element.className = 'search-box';\n _this.searchBar = new _SearchBar__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n _this.searchBarSuggestionsView = new _SearchBarSuggestionsView__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n _this.searchCount = 0; // Allows us to invalidate outdated searches\n\n _this.initializeHandlers();\n _this._render();\n return _this;\n }\n _inherits(SearchBox, _Component);\n return _createClass(SearchBox, [{\n key: \"initializeHandlers\",\n value: function initializeHandlers() {\n this.searchBar.on('input', this._handleSearchBarInput.bind(this));\n this.searchBar.on('focus', this._handleSearchBarFocus.bind(this));\n this.searchBar.on('blur', this._handleSearchBarBlur.bind(this));\n this.searchBar.on('search', this._handleSearchBarSearch.bind(this));\n this.searchBar.on('back', this._handleSearchBarBack.bind(this));\n this.searchBarSuggestionsView.on('selectCell', this._handleSearchResultSelect.bind(this));\n }\n }, {\n key: \"_handleSearchBarBack\",\n value: function _handleSearchBarBack() {\n this.fire('selectBack');\n }\n }, {\n key: \"_handleSearchBarSearch\",\n value: function _handleSearchBarSearch(data) {\n var query = data.query,\n event = data.event;\n console.log(\"Handling search\", query);\n this.fire('search', {\n query: query\n });\n }\n }, {\n key: \"_handleSearchResultSelect\",\n value: function _handleSearchResultSelect(data) {\n var result = data.result;\n }\n }, {\n key: \"_handleSearchBarFocus\",\n value: function () {\n var _handleSearchBarFocus2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var query;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n // this.searchBar.input.focus();\n query = this.searchBar.getText(); // console.log(\"query\", query);\n if (!(query.length > 0)) {\n _context.next = 5;\n break;\n }\n _context.next = 4;\n return this.getSearchBarSuggestions(query);\n case 4:\n this.openSuggestionsView();\n case 5:\n this.searchBar.input.focus();\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleSearchBarFocus() {\n return _handleSearchBarFocus2.apply(this, arguments);\n }\n return _handleSearchBarFocus;\n }()\n }, {\n key: \"_handleSearchBarBlur\",\n value: function _handleSearchBarBlur() {\n this.searchBarSuggestionsView.hide();\n }\n }, {\n key: \"_handleSearchBarInput\",\n value: function () {\n var _handleSearchBarInput2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var query;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n query = data.query;\n this.openSuggestionsView();\n _context2.next = 4;\n return this.getSearchBarSuggestions(query);\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleSearchBarInput(_x) {\n return _handleSearchBarInput2.apply(this, arguments);\n }\n return _handleSearchBarInput;\n }()\n }, {\n key: \"_render\",\n value: function _render() {\n this.element.appendChild(this.searchBar.getElement());\n this.element.appendChild(this.searchBarSuggestionsView.getElement());\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n console.log(\"Setting view for desktop\");\n this.searchBar.setViewForDesktop();\n this.searchBarSuggestionsView.setViewForDesktop();\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n console.log(\"Setting view for mobile\");\n this.searchBar.setViewForMobile();\n this.searchBarSuggestionsView.setViewForMobile();\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"openSuggestionsView\",\n value: function openSuggestionsView() {\n this.searchBarSuggestionsView.show();\n this.searchBar.updateStyleWithSuggestions();\n }\n }, {\n key: \"closeSuggestionsView\",\n value: function closeSuggestionsView() {\n this.searchBarSuggestionsView.hide();\n this.searchBar.updateStyleWithoutSuggestions();\n }\n }, {\n key: \"getSearchBarSuggestions\",\n value: function () {\n var _getSearchBarSuggestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n this.fire('getSearchBarSuggestions', {\n query: query\n });\n // const currentSearch = ++this.searchCount;\n // if (query === '') {\n // this.searchBarSuggestionsView.updateResults([]);\n // this.closeSuggestionsView();\n // return;\n // }\n // try {\n // const results = await this.searchApi.search(\n // 'e9df990cbd084934973a87fc2f3b0e74',\n // 'move-america-2024',\n // 'FTdsy9btTs6qumoZ6E8Z2Q',\n // query\n // );\n // if (currentSearch === this.searchCount) {\n // this.searchBarSuggestionsView.updateResults(results);\n // }\n // } catch (error) {\n // if (axios.isCancel(error)) {\n // console.log('Request canceled:', error.message);\n // } else {\n // console.error('Search error:', error);\n // }\n // }\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function getSearchBarSuggestions(_x2) {\n return _getSearchBarSuggestions.apply(this, arguments);\n }\n return getSearchBarSuggestions;\n }()\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBox);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBox.js?");
826
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _WaygoMaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../WaygoMaps */ \"./src/WaygoMaps.js\");\n/* harmony import */ var _SearchBar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SearchBar */ \"./src/components/SearchBox/SearchBar.js\");\n/* harmony import */ var _SearchBarSuggestionsView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SearchBarSuggestionsView */ \"./src/components/SearchBox/SearchBarSuggestionsView.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\n\n// import axios from \"axios\";\nvar SearchBox = /*#__PURE__*/function (_Component) {\n function SearchBox() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchBox);\n _this = _callSuper(this, SearchBox, [options]);\n // this.searchApi = waygoMaps.getSearchApi();\n\n _this.element = document.createElement('div');\n _this.element.className = 'search-box';\n _this.searchBar = new _SearchBar__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n _this.searchBarSuggestionsView = new _SearchBarSuggestionsView__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n _this.searchCount = 0; // Allows us to invalidate outdated searches\n\n _this.initializeHandlers();\n _this._render();\n return _this;\n }\n _inherits(SearchBox, _Component);\n return _createClass(SearchBox, [{\n key: \"initializeHandlers\",\n value: function initializeHandlers() {\n this.searchBar.on('input', this._handleSearchBarInput.bind(this));\n this.searchBar.on('focus', this._handleSearchBarFocus.bind(this));\n this.searchBar.on('blur', this._handleSearchBarBlur.bind(this));\n this.searchBar.on('search', this._handleSearchBarSearch.bind(this));\n this.searchBar.on('back', this._handleSearchBarBack.bind(this));\n this.searchBarSuggestionsView.on('selectCell', this._handleSearchResultSelect.bind(this));\n }\n }, {\n key: \"_handleSearchBarBack\",\n value: function _handleSearchBarBack() {\n this.fire('selectBack');\n }\n }, {\n key: \"_handleSearchBarSearch\",\n value: function _handleSearchBarSearch(data) {\n var query = data.query,\n event = data.event;\n this.fire('search', {\n query: query\n });\n }\n }, {\n key: \"_handleSearchResultSelect\",\n value: function _handleSearchResultSelect(data) {\n var result = data.result;\n }\n }, {\n key: \"_handleSearchBarFocus\",\n value: function () {\n var _handleSearchBarFocus2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var query;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n query = this.searchBar.getText();\n if (!(query.length > 0)) {\n _context.next = 5;\n break;\n }\n _context.next = 4;\n return this.getSearchBarSuggestions(query);\n case 4:\n this.openSuggestionsView();\n case 5:\n this.searchBar.input.focus();\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function _handleSearchBarFocus() {\n return _handleSearchBarFocus2.apply(this, arguments);\n }\n return _handleSearchBarFocus;\n }()\n }, {\n key: \"_handleSearchBarBlur\",\n value: function _handleSearchBarBlur() {\n this.searchBarSuggestionsView.hide();\n }\n }, {\n key: \"_handleSearchBarInput\",\n value: function () {\n var _handleSearchBarInput2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {\n var query;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n query = data.query;\n this.openSuggestionsView();\n _context2.next = 4;\n return this.getSearchBarSuggestions(query);\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function _handleSearchBarInput(_x) {\n return _handleSearchBarInput2.apply(this, arguments);\n }\n return _handleSearchBarInput;\n }()\n }, {\n key: \"_render\",\n value: function _render() {\n this.element.appendChild(this.searchBar.getElement());\n this.element.appendChild(this.searchBarSuggestionsView.getElement());\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n this.searchBar.setViewForDesktop();\n this.searchBarSuggestionsView.setViewForDesktop();\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n this.searchBar.setViewForMobile();\n this.searchBarSuggestionsView.setViewForMobile();\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"openSuggestionsView\",\n value: function openSuggestionsView() {\n this.searchBarSuggestionsView.show();\n this.searchBar.updateStyleWithSuggestions();\n }\n }, {\n key: \"closeSuggestionsView\",\n value: function closeSuggestionsView() {\n this.searchBarSuggestionsView.hide();\n this.searchBar.updateStyleWithoutSuggestions();\n }\n }, {\n key: \"getSearchBarSuggestions\",\n value: function () {\n var _getSearchBarSuggestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(query) {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n this.fire('getSearchBarSuggestions', {\n query: query\n });\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function getSearchBarSuggestions(_x2) {\n return _getSearchBarSuggestions.apply(this, arguments);\n }\n return getSearchBarSuggestions;\n }()\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchBox);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchBox/SearchBox.js?");
838
827
 
839
828
  /***/ }),
840
829
 
@@ -856,7 +845,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
856
845
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
857
846
 
858
847
  "use strict";
859
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _SearchResultsViewCell__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SearchResultsViewCell */ \"./src/components/SearchResultsView/SearchResultsViewCell.js\");\n/* harmony import */ var _LoadingCell__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LoadingCell */ \"./src/components/SearchResultsView/LoadingCell.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\nvar SearchResultsView = /*#__PURE__*/function (_Component) {\n function SearchResultsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchResultsView);\n _this = _callSuper(this, SearchResultsView, [options]);\n _this._initialize();\n return _this;\n }\n _inherits(SearchResultsView, _Component);\n return _createClass(SearchResultsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.results = [];\n this.loading = false;\n this.element = document.createElement('div');\n this.element.className = 'search-results-view';\n this.titleElement = document.createElement('h3');\n this.titleElement.className = 'search-results-title';\n this.element.appendChild(this.titleElement);\n\n // this.element.addEventListener('scroll', this.handleScroll.bind(this));\n }\n }, {\n key: \"showLoadingCell\",\n value: function showLoadingCell() {\n if (!this.loading) {\n var loadingCell = new _LoadingCell__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.loading = true;\n this.element.appendChild(loadingCell.getElement());\n }\n }\n }, {\n key: \"hideLoadingCell\",\n value: function hideLoadingCell() {\n var loadingCell = this.element.querySelector('.loading-cell');\n if (loadingCell) {\n this.element.removeChild(loadingCell);\n }\n this.loading = false;\n }\n\n // handleScroll() {\n // const { scrollTop, scrollHeight, clientHeight } = this.element;\n\n // const threshold = 0;\n // const step1 = scrollHeight - scrollTop - clientHeight + threshold;\n // // const step2 = clientHeight + threshold;\n\n // console.log(\"LOGGING SCROLL\", scrollTop, scrollHeight, clientHeight);\n // console.log(\"Info:\", step1);\n // }\n }, {\n key: \"updateView\",\n value: function updateView(results, query) {\n this.results = results;\n\n // if (results.length > 0) {\n // this.setTitle(`${results.length} results found for '${query}'`);\n // }\n // if (results.length === 1) {\n // this.setTitle(`${results.length} result found for '${query}'`);\n // }\n // if (results.length === 0) {\n // this.setTitle(`No matching results for '${query}'`);\n // }\n\n if (results.length > 0) {\n this.setTitle(\"Results for '\".concat(query, \"'\"));\n }\n if (results.length === 0) {\n this.setTitle(\"No matching results for '\".concat(query, \"'\"));\n }\n this.scrollToTop();\n this.render();\n }\n }, {\n key: \"scrollToTop\",\n value: function scrollToTop() {\n var scrollableElement = this.getElement();\n scrollableElement.style.display = 'none';\n scrollableElement.offsetHeight; // Force reflow\n scrollableElement.style.display = ''; // Show again\n scrollableElement.scrollTop = 0;\n }\n }, {\n key: \"updateResults\",\n value: function updateResults(results) {\n this.results = results;\n this.render();\n }\n }, {\n key: \"extendResults\",\n value: function extendResults(newResults) {\n var _this$results;\n (_this$results = this.results).push.apply(_this$results, _toConsumableArray(newResults));\n this.render();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n while (this.element.children.length > 1) {\n this.element.removeChild(this.element.lastChild);\n }\n this.results.forEach(function (r) {\n var cell = new _SearchResultsViewCell__WEBPACK_IMPORTED_MODULE_0__[\"default\"](r);\n cell.on('click', function () {\n return _this2.fire('selectCell', {\n result: r\n });\n });\n cell.on('hover', function () {\n return _this2.fire('hoverCell', {\n result: r\n });\n });\n cell.on('hoverOut', function () {\n return _this2.fire('hoverOutCell', {\n result: r\n });\n });\n _this2.element.appendChild(cell.getElement());\n });\n\n // if (this.results.length === 20) {\n // this.showLoadingCell();\n // }\n }\n }, {\n key: \"setTitle\",\n value: function setTitle(title) {\n this.titleElement.innerText = title;\n }\n }, {\n key: \"show\",\n value: function show() {\n this.element.classList.add('visible');\n }\n }, {\n key: \"hide\",\n value: function hide() {\n this.element.classList.remove('visible');\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchResultsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchResultsView/SearchResultsView.js?");
848
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _SearchResultsViewCell__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SearchResultsViewCell */ \"./src/components/SearchResultsView/SearchResultsViewCell.js\");\n/* harmony import */ var _LoadingCell__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LoadingCell */ \"./src/components/SearchResultsView/LoadingCell.js\");\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\n\n\nvar SearchResultsView = /*#__PURE__*/function (_Component) {\n function SearchResultsView() {\n var _this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, SearchResultsView);\n _this = _callSuper(this, SearchResultsView, [options]);\n _this._initialize();\n return _this;\n }\n _inherits(SearchResultsView, _Component);\n return _createClass(SearchResultsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.results = [];\n this.loading = false;\n this.element = document.createElement('div');\n this.element.className = 'search-results-view';\n this.titleElement = document.createElement('h3');\n this.titleElement.className = 'search-results-title';\n this.element.appendChild(this.titleElement);\n }\n\n // ADD THIS BELOW:\n // setViewForDesktop() {\n // this.element.classList.remove('mobile-view');\n // this.input.classList.remove('mobile-view');\n // }\n\n // setViewForMobile() {\n // this.element.classList.add('mobile-view');\n // this.input.classList.add('mobile-view');\n // }\n }, {\n key: \"showLoadingCell\",\n value: function showLoadingCell() {\n if (!this.loading) {\n var loadingCell = new _LoadingCell__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.loading = true;\n this.element.appendChild(loadingCell.getElement());\n }\n }\n }, {\n key: \"hideLoadingCell\",\n value: function hideLoadingCell() {\n var loadingCell = this.element.querySelector('.loading-cell');\n if (loadingCell) {\n this.element.removeChild(loadingCell);\n }\n this.loading = false;\n }\n }, {\n key: \"updateView\",\n value: function updateView(results, query) {\n this.results = results;\n if (results.length > 0) {\n this.setTitle(\"Results for '\".concat(query, \"'\"));\n }\n if (results.length === 0) {\n this.setTitle(\"No matching results for '\".concat(query, \"'\"));\n }\n this.scrollToTop();\n this.render();\n }\n }, {\n key: \"scrollToTop\",\n value: function scrollToTop() {\n var scrollableElement = this.getElement();\n scrollableElement.style.display = 'none';\n scrollableElement.offsetHeight;\n scrollableElement.style.display = '';\n scrollableElement.scrollTop = 0;\n }\n }, {\n key: \"updateResults\",\n value: function updateResults(results) {\n this.results = results;\n this.render();\n }\n }, {\n key: \"extendResults\",\n value: function extendResults(newResults) {\n var _this$results;\n (_this$results = this.results).push.apply(_this$results, _toConsumableArray(newResults));\n this.render();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n while (this.element.children.length > 1) {\n this.element.removeChild(this.element.lastChild);\n }\n this.results.forEach(function (r) {\n var cell = new _SearchResultsViewCell__WEBPACK_IMPORTED_MODULE_0__[\"default\"](r);\n cell.on('click', function () {\n return _this2.fire('selectCell', {\n result: r\n });\n });\n cell.on('hover', function () {\n return _this2.fire('hoverCell', {\n result: r\n });\n });\n cell.on('hoverOut', function () {\n return _this2.fire('hoverOutCell', {\n result: r\n });\n });\n _this2.element.appendChild(cell.getElement());\n });\n }\n }, {\n key: \"setTitle\",\n value: function setTitle(title) {\n this.titleElement.innerText = title;\n }\n }, {\n key: \"show\",\n value: function show() {\n this.element.classList.add('visible');\n }\n }, {\n key: \"hide\",\n value: function hide() {\n this.element.classList.remove('visible');\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchResultsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchResultsView/SearchResultsView.js?");
860
849
 
861
850
  /***/ }),
862
851
 
@@ -867,7 +856,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
867
856
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
868
857
 
869
858
  "use strict";
870
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\nvar SearchResultViewCell = /*#__PURE__*/function (_Component) {\n function SearchResultViewCell(result) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, SearchResultViewCell);\n _this = _callSuper(this, SearchResultViewCell, [options]);\n _this.result = result;\n _this._initialize();\n return _this;\n }\n _inherits(SearchResultViewCell, _Component);\n return _createClass(SearchResultViewCell, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('div');\n this.element.className = 'search-results-view-cell';\n this.render();\n this._setupEventListeners();\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.element.addEventListener('click', function () {\n return _this2.fire('click', {\n result: _this2.result\n });\n });\n this.element.addEventListener('mouseover', function () {\n return _this2.fire('hover', {\n result: _this2.result\n });\n });\n this.element.addEventListener('mouseout', function () {\n return _this2.fire('hoverOut', {\n result: _this2.result\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n this.element.innerHTML = \"\\n <div class=\\\"result-title\\\">\".concat(this.result.name, \"</div>\\n <div class=\\\"result-subtitle\\\">\").concat(this.result.contextual_location, \"</div>\\n \");\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchResultViewCell);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchResultsView/SearchResultsViewCell.js?");
859
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/Component */ \"./src/core/Component.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n\nvar SearchResultViewCell = /*#__PURE__*/function (_Component) {\n function SearchResultViewCell(result) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, SearchResultViewCell);\n _this = _callSuper(this, SearchResultViewCell, [options]);\n _this.result = result;\n _this._initialize();\n return _this;\n }\n _inherits(SearchResultViewCell, _Component);\n return _createClass(SearchResultViewCell, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('div');\n this.element.className = 'search-results-view-cell';\n this.render();\n this._setupEventListeners();\n console.log(\"RESULT:\", this.result);\n }\n }, {\n key: \"_setupEventListeners\",\n value: function _setupEventListeners() {\n var _this2 = this;\n this.element.addEventListener('click', function () {\n return _this2.fire('click', {\n result: _this2.result\n });\n });\n this.element.addEventListener('mouseover', function () {\n return _this2.fire('hover', {\n result: _this2.result\n });\n });\n this.element.addEventListener('mouseout', function () {\n return _this2.fire('hoverOut', {\n result: _this2.result\n });\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n this.element.innerHTML = \"\\n <div class=\\\"result-title\\\">\".concat(this.result.name, \"</div>\\n <div class=\\\"result-subtitle\\\">\").concat(this.result.catalog_name, \" \\xB7 \").concat(this.result.contextual_location, \"</div>\\n \");\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchResultViewCell);\n\n//# sourceURL=webpack://waygomaps/./src/components/SearchResultsView/SearchResultsViewCell.js?");
871
860
 
872
861
  /***/ }),
873
862
 
@@ -878,7 +867,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
878
867
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
879
868
 
880
869
  "use strict";
881
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _assets_arrows_leftArrow_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../assets/arrows/leftArrow.svg */ \"./src/assets/arrows/leftArrow.svg\");\n/* harmony import */ var _assets_arrows_rightArrow_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assets/arrows/rightArrow.svg */ \"./src/assets/arrows/rightArrow.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n// import leftArrowIcon from '../../assets/arrows/leftArrow.svg';\n\n\n\nvar SliderBar = /*#__PURE__*/function (_Component) {\n function SliderBar() {\n var _this;\n var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, SliderBar);\n _this = _callSuper(this, SliderBar, [options]);\n _this.items = items;\n _this.containerClass = options.container;\n _this.element = document.createElement('div');\n _this.element.className = \"slider-bar-container \".concat(_this.containerClass); //this.containerClass; // 'slider-bar-container';\n\n _this.sliderBar = document.createElement('div');\n _this.sliderBar.className = \"slider-bar \".concat(_this.containerClass, \"-bar\");\n _this.leftButton = document.createElement('button');\n _this.leftButton.className = \"scroll-button left \".concat(_this.containerClass, \"-scroll-button\");\n _this.leftButton.style.backgroundImage = \"url(\".concat(_assets_arrows_leftArrow_svg__WEBPACK_IMPORTED_MODULE_1__[\"default\"], \")\");\n _this.leftButton.addEventListener('click', function () {\n return _this._scrollSliderBar('left');\n });\n _this.rightButton = document.createElement('button');\n _this.rightButton.className = \"scroll-button right \".concat(_this.containerClass, \"-scroll-button\");\n _this.rightButton.style.backgroundImage = \"url(\".concat(_assets_arrows_rightArrow_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"], \")\");\n _this.rightButton.addEventListener('click', function () {\n return _this._scrollSliderBar('right');\n });\n _this.buttonElements = [];\n _this._render();\n _this.sliderBar.addEventListener('scroll', function () {\n return _this._updateScrollButtons();\n });\n\n // Initial check\n setTimeout(function () {\n return _this._updateScrollButtons();\n }, 0.8);\n return _this;\n }\n _inherits(SliderBar, _Component);\n return _createClass(SliderBar, [{\n key: \"_render\",\n value: function _render() {\n var _this2 = this;\n this.items.forEach(function (_ref) {\n var title = _ref.title,\n imageUrl = _ref.imageUrl;\n var button = document.createElement('button');\n button.addEventListener('click', _this2._handleSliderButtonSelect.bind(_this2));\n button.className = \"slider-bar-button \".concat(_this2.containerClass, \"-button\");\n if (imageUrl) {\n var img = document.createElement('img');\n img.src = imageUrl;\n img.alt = title;\n img.className = \"slider-bar-button-image \".concat(_this2.containerClass, \"-button-image\");\n button.appendChild(img);\n } else {\n console.log(\"No image found for slider bar button.\");\n }\n var titleSpan = document.createElement('span');\n titleSpan.textContent = title;\n button.appendChild(titleSpan);\n _this2.buttonElements.push(button);\n _this2.sliderBar.appendChild(button);\n });\n this.element.appendChild(this.leftButton);\n this.element.appendChild(this.sliderBar);\n this.element.appendChild(this.rightButton);\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n // console.log(\"SLIDER DESKTOP\");\n this.buttonElements.forEach(function (button) {\n if (button) {\n // console.log(\"BUTTON\", button);\n button.classList.remove('mobile-view');\n }\n });\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n // console.log(\"SLIDER MOBILE\", this.buttonElements);\n this.buttonElements.forEach(function (button) {\n // console.log(\"FOUND BUTTON\", button);\n if (button) {\n // console.log(\"BUTTON\", button);\n button.classList.add('mobile-view');\n }\n });\n }\n }, {\n key: \"_handleSliderButtonSelect\",\n value: function _handleSliderButtonSelect(event) {\n var button = event.currentTarget;\n // const query = button.textContent;\n var query = button.querySelector('span').textContent;\n if (button.classList.contains('selected')) {\n button.classList.remove('selected');\n this.fire('deselect');\n } else {\n var currentlySelected = document.querySelector('.slider-bar-button.selected');\n if (currentlySelected) {\n currentlySelected.classList.remove('selected');\n }\n button.classList.add('selected');\n this.fire('selectNew', {\n query: query\n });\n }\n }\n }, {\n key: \"_scrollSliderBar\",\n value: function _scrollSliderBar(direction) {\n var scrollAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 275;\n var maxScrollLeft = this.sliderBar.scrollWidth - this.sliderBar.clientWidth;\n var currentScrollLeft = this.sliderBar.scrollLeft;\n var finalScrollAmount = scrollAmount;\n if (direction === 'right') {\n var remainingScroll = maxScrollLeft - currentScrollLeft;\n if (remainingScroll < scrollAmount) {\n finalScrollAmount = remainingScroll; // Adjust to scroll exactly to the end\n }\n }\n if (direction === 'left') {\n this.sliderBar.scrollBy({\n left: -scrollAmount,\n behavior: 'smooth'\n });\n } else if (direction === 'right') {\n this.sliderBar.scrollBy({\n left: finalScrollAmount,\n behavior: 'smooth'\n });\n }\n }\n }, {\n key: \"_updateScrollButtons\",\n value: function _updateScrollButtons() {\n var scrollLeft = this.sliderBar.scrollLeft;\n var maxScrollLeft = this.sliderBar.scrollWidth - this.sliderBar.clientWidth;\n if (scrollLeft <= 0) {\n this.leftButton.style.display = 'none';\n } else {\n this.leftButton.style.display = 'block';\n }\n var diff = Math.abs(maxScrollLeft - scrollLeft);\n if (diff <= 1) {\n this.rightButton.style.display = 'none';\n } else {\n this.rightButton.style.display = 'block';\n }\n }\n }, {\n key: \"deselectAll\",\n value: function deselectAll() {\n // const selectedButtons = this.sliderBar.querySelectorAll(`.slider-bar-button ${this.containerClass}.selected`);\n var selectedButtons = this.sliderBar.querySelectorAll('.slider-bar-button.selected');\n selectedButtons.forEach(function (button) {\n return button.classList.remove('selected');\n });\n }\n }, {\n key: \"deselectAllNotMatchingQuery\",\n value: function deselectAllNotMatchingQuery(query) {\n // const selectedButtons = this.sliderBar.querySelectorAll(`.slider-bar-button ${this.containerClass}.selected`);\n var selectedButtons = this.sliderBar.querySelectorAll('.slider-bar-button.selected');\n selectedButtons.forEach(function (button) {\n if (button.textContent !== query) {\n button.classList.remove('selected');\n }\n });\n }\n }, {\n key: \"invertButtonAtIndex\",\n value: function invertButtonAtIndex(index) {\n var button = this.buttonElements[index];\n if (button) {\n button.classList.toggle('inverted');\n } else {\n console.error(\"Button at index \".concat(index, \" does not exist.\"));\n }\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"show\",\n value: function show() {\n this.element.classList.add('visible');\n }\n }, {\n key: \"hide\",\n value: function hide() {\n this.element.classList.remove('visible');\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SliderBar);\n\n//# sourceURL=webpack://waygomaps/./src/components/SliderBar.js?");
870
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _core_Component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/Component */ \"./src/core/Component.js\");\n/* harmony import */ var _assets_arrows_leftArrow_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../assets/arrows/leftArrow.svg */ \"./src/assets/arrows/leftArrow.svg\");\n/* harmony import */ var _assets_arrows_rightArrow_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../assets/arrows/rightArrow.svg */ \"./src/assets/arrows/rightArrow.svg\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }\nfunction _possibleConstructorReturn(t, e) { if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e; if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\"); return _assertThisInitialized(t); }\nfunction _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); return e; }\nfunction _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }\nfunction _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }\nfunction _inherits(t, e) { if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, \"prototype\", { writable: !1 }), e && _setPrototypeOf(t, e); }\nfunction _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }\n// import leftArrowIcon from '../../assets/arrows/leftArrow.svg';\n\n\n\nvar SliderBar = /*#__PURE__*/function (_Component) {\n function SliderBar() {\n var _this;\n var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, SliderBar);\n _this = _callSuper(this, SliderBar, [options]);\n _this.items = items;\n _this.containerClass = options.container;\n _this.element = document.createElement('div');\n _this.element.className = \"slider-bar-container \".concat(_this.containerClass); //this.containerClass; // 'slider-bar-container';\n\n _this.sliderBar = document.createElement('div');\n _this.sliderBar.className = \"slider-bar \".concat(_this.containerClass, \"-bar\");\n _this.leftButton = document.createElement('button');\n _this.leftButton.className = \"scroll-button left \".concat(_this.containerClass, \"-scroll-button\");\n _this.leftButton.style.backgroundImage = \"url(\".concat(_assets_arrows_leftArrow_svg__WEBPACK_IMPORTED_MODULE_1__[\"default\"], \")\");\n _this.leftButton.addEventListener('click', function () {\n return _this._scrollSliderBar('left');\n });\n _this.rightButton = document.createElement('button');\n _this.rightButton.className = \"scroll-button right \".concat(_this.containerClass, \"-scroll-button\");\n _this.rightButton.style.backgroundImage = \"url(\".concat(_assets_arrows_rightArrow_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"], \")\");\n _this.rightButton.addEventListener('click', function () {\n return _this._scrollSliderBar('right');\n });\n _this.buttonElements = [];\n _this._render();\n _this.sliderBar.addEventListener('scroll', function () {\n return _this._updateScrollButtons();\n });\n\n // Initial check\n setTimeout(function () {\n return _this._updateScrollButtons();\n }, 0.8);\n return _this;\n }\n _inherits(SliderBar, _Component);\n return _createClass(SliderBar, [{\n key: \"updateItems\",\n value: function updateItems(newItems) {\n this.items = newItems;\n\n // Clear existing buttons\n this.sliderBar.innerHTML = '';\n this.buttonElements = [];\n\n // Re-render with new items\n this._render();\n this._updateScrollButtons(); // Re-evaluate scroll buttons\n }\n }, {\n key: \"_render\",\n value: function _render() {\n var _this2 = this;\n this.items.forEach(function (title) {\n // this.items.forEach(({ title, imageUrl }) => {\n var button = document.createElement('button');\n button.addEventListener('click', _this2._handleSliderButtonSelect.bind(_this2));\n button.className = \"slider-bar-button \".concat(_this2.containerClass, \"-button\");\n var titleSpan = document.createElement('span');\n titleSpan.textContent = title;\n button.appendChild(titleSpan);\n _this2.buttonElements.push(button);\n _this2.sliderBar.appendChild(button);\n });\n this.element.appendChild(this.leftButton);\n this.element.appendChild(this.sliderBar);\n this.element.appendChild(this.rightButton);\n }\n }, {\n key: \"setViewForDesktop\",\n value: function setViewForDesktop() {\n this.buttonElements.forEach(function (button) {\n if (button) {\n button.classList.remove('mobile-view');\n }\n });\n }\n }, {\n key: \"setViewForMobile\",\n value: function setViewForMobile() {\n this.buttonElements.forEach(function (button) {\n if (button) {\n button.classList.add('mobile-view');\n }\n });\n }\n }, {\n key: \"_handleSliderButtonSelect\",\n value: function _handleSliderButtonSelect(event) {\n var button = event.currentTarget;\n var query = button.querySelector('span').textContent;\n if (button.classList.contains('selected')) {\n button.classList.remove('selected');\n this.fire('deselect');\n } else {\n var currentlySelected = document.querySelector('.slider-bar-button.selected');\n if (currentlySelected) {\n currentlySelected.classList.remove('selected');\n }\n button.classList.add('selected');\n this.fire('selectNew', {\n query: query\n });\n }\n }\n }, {\n key: \"_scrollSliderBar\",\n value: function _scrollSliderBar(direction) {\n var scrollAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 275;\n var maxScrollLeft = this.sliderBar.scrollWidth - this.sliderBar.clientWidth;\n var currentScrollLeft = this.sliderBar.scrollLeft;\n var finalScrollAmount = scrollAmount;\n if (direction === 'right') {\n var remainingScroll = maxScrollLeft - currentScrollLeft;\n if (remainingScroll < scrollAmount) {\n finalScrollAmount = remainingScroll; // Adjust to scroll exactly to the end\n }\n }\n if (direction === 'left') {\n this.sliderBar.scrollBy({\n left: -scrollAmount,\n behavior: 'smooth'\n });\n } else if (direction === 'right') {\n this.sliderBar.scrollBy({\n left: finalScrollAmount,\n behavior: 'smooth'\n });\n }\n }\n }, {\n key: \"_updateScrollButtons\",\n value: function _updateScrollButtons() {\n var scrollLeft = this.sliderBar.scrollLeft;\n var maxScrollLeft = this.sliderBar.scrollWidth - this.sliderBar.clientWidth;\n if (scrollLeft <= 0) {\n this.leftButton.style.display = 'none';\n } else {\n this.leftButton.style.display = 'block';\n }\n var diff = Math.abs(maxScrollLeft - scrollLeft);\n if (diff <= 1) {\n this.rightButton.style.display = 'none';\n } else {\n this.rightButton.style.display = 'block';\n }\n }\n }, {\n key: \"deselectAll\",\n value: function deselectAll() {\n var selectedButtons = this.sliderBar.querySelectorAll('.slider-bar-button.selected');\n selectedButtons.forEach(function (button) {\n return button.classList.remove('selected');\n });\n }\n }, {\n key: \"deselectAllNotMatchingQuery\",\n value: function deselectAllNotMatchingQuery(query) {\n var selectedButtons = this.sliderBar.querySelectorAll('.slider-bar-button.selected');\n selectedButtons.forEach(function (button) {\n if (button.textContent !== query) {\n button.classList.remove('selected');\n }\n });\n }\n }, {\n key: \"invertButtonAtIndex\",\n value: function invertButtonAtIndex(index) {\n var button = this.buttonElements[index];\n if (button) {\n button.classList.toggle('inverted');\n } else {\n console.error(\"Button at index \".concat(index, \" does not exist.\"));\n }\n }\n }, {\n key: \"getElement\",\n value: function getElement() {\n return this.element;\n }\n }, {\n key: \"show\",\n value: function show() {\n this.element.classList.add('visible');\n }\n }, {\n key: \"hide\",\n value: function hide() {\n this.element.classList.remove('visible');\n }\n }]);\n}(_core_Component__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SliderBar);\n\n//# sourceURL=webpack://waygomaps/./src/components/SliderBar.js?");
882
871
 
883
872
  /***/ }),
884
873
 
@@ -900,7 +889,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
900
889
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
901
890
 
902
891
  "use strict";
903
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _EventBus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EventBus */ \"./src/core/EventBus.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\nvar Control = /*#__PURE__*/function () {\n function Control() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Control);\n this.options = options;\n this.map = null;\n this.currentViewType = null; // null, 'desktop' or 'mobile'\n }\n\n // To be overwritten\n return _createClass(Control, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n if (!this.container) {\n return;\n }\n this.container.parentNode.removeChild(this.container);\n this.map = undefined;\n }\n }, {\n key: \"_attachResizeListener\",\n value: function _attachResizeListener() {\n var _this = this;\n // console.log(\"\")\n window.addEventListener('resize', function () {\n var newWidth = _this.map.mapContainer.offsetWidth;\n // console.log(\"NEW MAP WIDTH\", newWidth, this.map.map.getContainer().offsetWidth);\n // console.log(\"WIDTH\", newWidth);\n _this._configureView(newWidth); // Reconfigure based on new width of mapView container\n });\n }\n }, {\n key: \"_initialize\",\n value: function _initialize() {\n // console.log(\"check1\");\n if (!this.map) {\n return;\n }\n // console.log(\"check2\");\n var containerWidth = this.map.mapContainer.offsetWidth;\n this._configureView(containerWidth);\n }\n }, {\n key: \"_configureView\",\n value: function _configureView(width) {\n // console.log(\"CHECK\", width, this.map.map.getContainer().offsetWidth);\n if (width > 767) {\n this._setViewForDesktop();\n } else {\n this._setViewForMobile();\n }\n }\n }, {\n key: \"_setViewForDesktop\",\n value: function _setViewForDesktop() {\n // console.log(\"SET CONTROL TO DESKTOP\");\n this.currentViewType = 'desktop';\n this._updateContentView();\n }\n }, {\n key: \"_setViewForMobile\",\n value: function _setViewForMobile() {\n // console.log(\"SET CONTROL TO MOBILE\");\n this.currentViewType = 'mobile';\n this._updateContentView();\n }\n }, {\n key: \"_updateContentView\",\n value: function _updateContentView() {\n this._clearViews();\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n }\n }, {\n key: \"_clearViews\",\n value: function _clearViews() {\n while (this.container.firstChild) {\n this.container.removeChild(this.container.firstChild);\n this.container.classList.remove('mobile-view');\n this.container.classList.remove('desktop-view');\n }\n }\n }, {\n key: \"show\",\n value: function show() {\n if (!this.container) {\n return;\n }\n // this.container.classList.remove('hidden');\n this.container.style.display = 'block';\n }\n }, {\n key: \"hide\",\n value: function hide() {\n if (!this.container) {\n return;\n }\n // console.log(\"HID\");\n // this.container.classList.add('hidden');\n this.container.style.display = 'none';\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n // TO BE OVERWRITTEN BY THE CLASS INSTANCE\n console.log(\"main control\");\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n // TO BE OVERWRITTEN BY THE CLASS INSTANCE\n }\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Control);\n\n//# sourceURL=webpack://waygomaps/./src/core/Control.js?");
892
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _EventBus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EventBus */ \"./src/core/EventBus.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\nvar Control = /*#__PURE__*/function () {\n function Control() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _classCallCheck(this, Control);\n this.options = options;\n this.map = null;\n this.currentViewType = null; // null, 'desktop' or 'mobile'\n }\n\n // To be overwritten\n return _createClass(Control, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this.map = map;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n if (!this.container) {\n return;\n }\n this.container.parentNode.removeChild(this.container);\n this.map = undefined;\n }\n }, {\n key: \"_attachResizeListener\",\n value: function _attachResizeListener() {\n var _this = this;\n window.addEventListener('resize', function () {\n var newWidth = _this.map.mapContainer.offsetWidth;\n _this._configureView(newWidth);\n });\n }\n }, {\n key: \"_initialize\",\n value: function _initialize() {\n if (!this.map) {\n return;\n }\n var containerWidth = this.map.mapContainer.offsetWidth;\n this._configureView(containerWidth);\n }\n }, {\n key: \"_configureView\",\n value: function _configureView(width) {\n if (width > 767) {\n this._setViewForDesktop();\n } else {\n this._setViewForMobile();\n }\n }\n }, {\n key: \"_setViewForDesktop\",\n value: function _setViewForDesktop() {\n this.currentViewType = 'desktop';\n this._updateContentView();\n }\n }, {\n key: \"_setViewForMobile\",\n value: function _setViewForMobile() {\n this.currentViewType = 'mobile';\n this._updateContentView();\n }\n }, {\n key: \"_updateContentView\",\n value: function _updateContentView() {\n this._clearViews();\n if (this.currentViewType === 'desktop') {\n this._renderDesktopView();\n } else {\n this._renderMobileView();\n }\n }\n }, {\n key: \"_clearViews\",\n value: function _clearViews() {\n while (this.container.firstChild) {\n this.container.removeChild(this.container.firstChild);\n this.container.classList.remove('mobile-view');\n this.container.classList.remove('desktop-view');\n }\n }\n }, {\n key: \"show\",\n value: function show() {\n if (!this.container) {\n return;\n }\n this.container.style.display = 'block';\n }\n }, {\n key: \"hide\",\n value: function hide() {\n if (!this.container) {\n return;\n }\n this.container.style.display = 'none';\n }\n }, {\n key: \"_renderDesktopView\",\n value: function _renderDesktopView() {\n return;\n }\n }, {\n key: \"_renderMobileView\",\n value: function _renderMobileView() {\n return;\n }\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Control);\n\n//# sourceURL=webpack://waygomaps/./src/core/Control.js?");
904
893
 
905
894
  /***/ }),
906
895
 
@@ -944,18 +933,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
944
933
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
945
934
 
946
935
  "use strict";
947
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ convertVerticesToCoordinates: () => (/* binding */ convertVerticesToCoordinates)\n/* harmony export */ });\nfunction findLatLonConversionsForLatitude(latitude) {\n // console.log(\"CHECK3\");\n var lat = latitude * Math.PI / 180;\n var r_a = 6378137.0;\n var r_b = 6356752.314;\n\n // console.log(\"CHECK4\", lat, r_a, r_b);\n\n var e = (Math.pow(r_a, 0.5) - Math.pow(r_b, 0.5)) / Math.pow(r_a, 0.5);\n\n // console.log(\"CHECK5\",e);\n\n var latConv = 1 / (111132.954 - 559.822 * Math.cos(2 * lat) + 1.175 * Math.cos(4 * lat));\n // console.log(\"CHECK6\",latConv);\n\n var lonConv = 1 / (Math.PI * r_a * Math.cos(lat) / (180 * Math.pow(1 - Math.pow(e, 2) * Math.pow(Math.sin(lat), 2), 0.5)));\n\n // console.log(\"CHECK7\",lonConv);\n\n return {\n meterToLat: latConv,\n meterToLon: lonConv\n };\n}\nfunction convertVertexToCoordinate(vertex, refCoordinate, meterToLat, meterToLon) {\n var scalingFactor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1.0;\n var x = vertex[0];\n var y = vertex[1];\n var refLon = refCoordinate[0];\n var refLat = refCoordinate[1];\n var lat = refLat + y * scalingFactor * meterToLat;\n var lon = refLon + x * scalingFactor * meterToLon;\n return {\n lat: lat,\n lon: lon\n };\n}\nfunction convertVerticesToCoordinates(vertices) {\n var refCoordinate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var scalingFactor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1.0;\n if (refCoordinate === null) {\n refCoordinate = [0.0, 0.0];\n }\n // console.log(\"CHECK1\", refCoordinate);\n var coordinates = [];\n var _findLatLonConversion = findLatLonConversionsForLatitude(refCoordinate[1]),\n meterToLat = _findLatLonConversion.meterToLat,\n meterToLon = _findLatLonConversion.meterToLon;\n\n // console.log(\"CHECK2\", meterToLat, meterToLon);\n vertices.forEach(function (vertex) {\n var _convertVertexToCoord = convertVertexToCoordinate(vertex, refCoordinate, meterToLat, meterToLon, scalingFactor),\n lat = _convertVertexToCoord.lat,\n lon = _convertVertexToCoord.lon;\n coordinates.push([lon, lat]);\n });\n return coordinates;\n}\n\n//# sourceURL=webpack://waygomaps/./src/utils/coordinateSystems.js?");
948
-
949
- /***/ }),
950
-
951
- /***/ "./src/utils/mapPathFinder.js":
952
- /*!************************************!*\
953
- !*** ./src/utils/mapPathFinder.js ***!
954
- \************************************/
955
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
956
-
957
- "use strict";
958
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getWaygoPathForMapState: () => (/* binding */ getWaygoPathForMapState)\n/* harmony export */ });\nfunction getWaygoPathForMapState(mapView) {\n console.log(\"HERE:\", mapView.getCurrentState());\n}\n\n//# sourceURL=webpack://waygomaps/./src/utils/mapPathFinder.js?");
936
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ convertVerticesToCoordinates: () => (/* binding */ convertVerticesToCoordinates)\n/* harmony export */ });\nfunction findLatLonConversionsForLatitude(latitude) {\n var lat = latitude * Math.PI / 180;\n var r_a = 6378137.0;\n var r_b = 6356752.314;\n var e = (Math.pow(r_a, 0.5) - Math.pow(r_b, 0.5)) / Math.pow(r_a, 0.5);\n var latConv = 1 / (111132.954 - 559.822 * Math.cos(2 * lat) + 1.175 * Math.cos(4 * lat));\n var lonConv = 1 / (Math.PI * r_a * Math.cos(lat) / (180 * Math.pow(1 - Math.pow(e, 2) * Math.pow(Math.sin(lat), 2), 0.5)));\n return {\n meterToLat: latConv,\n meterToLon: lonConv\n };\n}\nfunction convertVertexToCoordinate(vertex, refCoordinate, meterToLat, meterToLon) {\n var scalingFactor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1.0;\n var x = vertex[0];\n var y = vertex[1];\n var refLon = refCoordinate[0];\n var refLat = refCoordinate[1];\n var lat = refLat + y * scalingFactor * meterToLat;\n var lon = refLon + x * scalingFactor * meterToLon;\n return {\n lat: lat,\n lon: lon\n };\n}\nfunction convertVerticesToCoordinates(vertices) {\n var refCoordinate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var scalingFactor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1.0;\n if (refCoordinate === null) {\n refCoordinate = [0.0, 0.0];\n }\n var coordinates = [];\n var _findLatLonConversion = findLatLonConversionsForLatitude(refCoordinate[1]),\n meterToLat = _findLatLonConversion.meterToLat,\n meterToLon = _findLatLonConversion.meterToLon;\n vertices.forEach(function (vertex) {\n var _convertVertexToCoord = convertVertexToCoordinate(vertex, refCoordinate, meterToLat, meterToLon, scalingFactor),\n lat = _convertVertexToCoord.lat,\n lon = _convertVertexToCoord.lon;\n coordinates.push([lon, lat]);\n });\n return coordinates;\n}\n\n//# sourceURL=webpack://waygomaps/./src/utils/coordinateSystems.js?");
959
937
 
960
938
  /***/ }),
961
939