waygo-maps 1.1.48 → 1.1.49
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 +16 -15
- package/dist/style.css +11 -4
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -713,7 +713,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
713
713
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
714
714
|
|
|
715
715
|
"use strict";
|
|
716
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentChildButton: () => (/* binding */ ContentChildButton),\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 _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\nvar ContentChildButton = /*#__PURE__*/function (_Component) {\n function ContentChildButton(childPlacement) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, ContentChildButton);\n _this = _callSuper(this, ContentChildButton, [options]);\n _this.childPlacement = childPlacement;\n _this.maxValueLength = 50;\n _this.maxEntriesToShow = 3;\n _this._initialize();\n return _this;\n }\n _inherits(ContentChildButton, _Component);\n return _createClass(ContentChildButton, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('button');\n this.element.className = 'content-details-child-view';\n this.titleElement = document.createElement('div');\n this.titleElement.className = 'content-details-child-view-title';\n var titleKey = this.childPlacement.catalog.content_title_key;\n this.titleElement.textContent = \"\".concat(
|
|
716
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentChildButton: () => (/* binding */ ContentChildButton),\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 _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\nvar ContentChildButton = /*#__PURE__*/function (_Component) {\n function ContentChildButton(childPlacement) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, ContentChildButton);\n _this = _callSuper(this, ContentChildButton, [options]);\n _this.childPlacement = childPlacement;\n _this.maxValueLength = 50;\n _this.maxEntriesToShow = 3;\n _this._initialize();\n return _this;\n }\n _inherits(ContentChildButton, _Component);\n return _createClass(ContentChildButton, [{\n key: \"_initialize\",\n value: function _initialize() {\n this.element = document.createElement('button');\n this.element.className = 'content-details-child-view';\n this.titleElement = document.createElement('div');\n this.titleElement.className = 'content-details-child-view-title';\n var titleKey = this.childPlacement.catalog.content_title_key;\n var titleValue = this.childPlacement.content.data[titleKey];\n console.log(\"[ContentChildButton] Child title value:\", {\n key: titleKey,\n value: JSON.stringify(titleValue),\n hasNewlines: titleValue && titleValue.includes('\\n'),\n hasTabs: titleValue && titleValue.includes('\\t'),\n length: titleValue ? titleValue.length : 0\n });\n this.titleElement.textContent = \"\".concat(titleValue);\n this._render();\n }\n }, {\n key: \"_truncateText\",\n value: function _truncateText(text, maxLength) {\n if (text.length > maxLength) {\n return text.slice(0, maxLength - 3) + '...'; // Truncate and append \"...\"\n }\n return text;\n }\n }, {\n key: \"findViableData\",\n value: function findViableData(contentPlacement) {\n var data = contentPlacement.content.data;\n var keys = Object.keys(data);\n var titleKey = contentPlacement.catalog.content_title_key;\n var excludedKeys = contentPlacement.excluded_child_fields || [];\n var viableData = {};\n keys.forEach(function (key) {\n var value = data[key];\n if (key !== titleKey &&\n // key !== 'Type' &&\n !key.toLowerCase().includes('description') && !excludedKeys.includes(key) && contentPlacement.catalog.data_schema[key] !== 'image' && contentPlacement.catalog.data_schema[key] !== 'url' && value !== null && value !== undefined && value !== \"\") {\n viableData[key] = value;\n }\n });\n return viableData;\n }\n }, {\n key: \"_render\",\n value: function _render() {\n var _this2 = this;\n this.element.appendChild(this.titleElement);\n var dataDict = this.findViableData(this.childPlacement);\n var entries = Object.entries(dataDict);\n if (Object.keys(dataDict).length === 0) {\n this.titleElement.style.marginBottom = \"0px\";\n }\n entries.slice(0, this.maxEntriesToShow).forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n // for (const [key, value] of ) {\n var dataRow = document.createElement('div');\n dataRow.className = 'content-details-child-view-data-row';\n var keyElement = document.createElement('div');\n keyElement.className = 'content-details-child-view-data-key';\n keyElement.textContent = key.toUpperCase(); // `${key}: `;\n\n var valueElement = document.createElement('div');\n valueElement.className = 'content-details-child-view-data-value';\n valueElement.textContent = _this2._truncateText(value.toString(), _this2.maxValueLength); // value;\n\n dataRow.appendChild(keyElement);\n dataRow.appendChild(valueElement);\n _this2.element.appendChild(dataRow);\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__ = (ContentChildButton);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/ContentChildButton.js?");
|
|
717
717
|
|
|
718
718
|
/***/ }),
|
|
719
719
|
|
|
@@ -735,7 +735,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
735
735
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
736
736
|
|
|
737
737
|
"use strict";
|
|
738
|
-
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 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 _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.websiteButtons = [];\n _this.detailsView = null;\n _this.childrenComponents = [];\n _this.imageContainer = null;\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\n // if (this.websiteButton) {\n // this.actionsView.appendChild(this.websiteButton.getElement());\n // }\n\n this.websiteButtons.forEach(function (websiteButton) {\n _this3.actionsView.appendChild(websiteButton.getElement());\n });\n\n // Add image container if there are images\n if (this.imageContainer) {\n this.actionsView.appendChild(this.imageContainer);\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 schema = contentPlacement.catalog.data_schema;\n var titleKey = contentPlacement.catalog.content_title_key;\n var excludedKeys = contentPlacement.excluded_child_fields || [];\n var viableData = {};\n for (var _i = 0, _Object$entries = Object.entries(schema); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n key = _Object$entries$_i[0],\n value = _Object$entries$_i[1];\n if (value !== 'image' && value !== 'url' && key !== titleKey && !excludedKeys.includes(key)) {\n var dataValue = contentPlacement.content.data[key];\n if (dataValue && dataValue.trim() !== '') {\n var cleanDataValue = dataValue.trim().replace(/\\s+/g, ' ');\n viableData[key] = cleanDataValue;\n }\n }\n }\n return viableData;\n }\n }, {\n key: \"updateView\",\n value: function updateView(contentPlacement) {\n var _this4 = this;\n this.contentPlacement = contentPlacement;\n\n // Update the header\n this.contentPlacementHeader = new _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__[\"default\"](contentPlacement);\n var schema = contentPlacement.catalog.data_schema;\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 // const websiteUrl = contentPlacement.content.data['URL'] || contentPlacement.content.data['Website'] || contentPlacement.content.data['LinkedIn'] || contentPlacement.content.data['Website URL'] || contentPlacement.content.data['SNS'];\n var urlFields = ['URL', 'Website', 'LinkedIn', 'Website URL', 'SNS', 'Networking Link'];\n for (var _i2 = 0, _Object$entries2 = Object.entries(schema); _i2 < _Object$entries2.length; _i2++) {\n var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),\n key = _Object$entries2$_i[0],\n value = _Object$entries2$_i[1];\n if (value === 'url') {\n var url = contentPlacement.content.data[key];\n if (url && url.trim() !== '') {\n this.websiteButtons.push(new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_website_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"], url, url));\n }\n }\n }\n\n // Make a copy of content data\n var contentDataCopy = _objectSpread({}, contentPlacement.content.data);\n\n // Collect image keys and remove them from copy\n var images = [];\n var displayImgKey = contentPlacement.catalog.content_display_img_key;\n for (var _i3 = 0, _Object$entries3 = Object.entries(schema); _i3 < _Object$entries3.length; _i3++) {\n var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),\n _key = _Object$entries3$_i[0],\n _value = _Object$entries3$_i[1];\n if (_value === 'image' && _key !== displayImgKey) {\n var imageUrl = contentPlacement.content.data[_key];\n if (imageUrl) {\n images.push(imageUrl);\n }\n delete contentDataCopy[_key];\n }\n }\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 _i4 = 0, _Object$entries4 = Object.entries(contentPlacement.children); _i4 < _Object$entries4.length; _i4++) {\n var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),\n title = _Object$entries4$_i[0],\n children = _Object$entries4$_i[1];\n var childrenComponent = new _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__[\"default\"](title, children);\n this.childrenComponents.push(childrenComponent);\n }\n\n // Handle images\n if (images.length > 0) {\n this.imageContainer = document.createElement('div');\n this.imageContainer.className = 'content-details-image-container';\n var firstImage = document.createElement('img');\n firstImage.src = images[0];\n firstImage.className = 'content-details-preview-image';\n var hoverPopup = document.createElement('div');\n hoverPopup.className = 'image-hover-popup';\n hoverPopup.textContent = 'See photos';\n this.imageContainer.appendChild(firstImage);\n this.imageContainer.appendChild(hoverPopup);\n this.imageContainer.addEventListener('click', function () {\n _this4.fire('selectPhotos', {\n placementId: _this4.contentPlacement.placement_id,\n images: images\n });\n });\n } else {\n this.imageContainer = null;\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?");
|
|
738
|
+
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 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 _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.websiteButtons = [];\n _this.detailsView = null;\n _this.childrenComponents = [];\n _this.imageContainer = null;\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\n // if (this.websiteButton) {\n // this.actionsView.appendChild(this.websiteButton.getElement());\n // }\n\n this.websiteButtons.forEach(function (websiteButton) {\n _this3.actionsView.appendChild(websiteButton.getElement());\n });\n\n // Add image container if there are images\n if (this.imageContainer) {\n this.actionsView.appendChild(this.imageContainer);\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 // const schema = contentPlacement.catalog.data_schema;\n // const titleKey = contentPlacement.catalog.content_title_key;\n // const excludedKeys = contentPlacement.excluded_child_fields || [];\n // var viableData = {};\n\n // for (const [key, value] of Object.entries(schema)) {\n // if (value !== 'image' && value !== 'url' && key !== titleKey && !excludedKeys.includes(key)) {\n // const dataValue = contentPlacement.content.data[key];\n // if (dataValue && dataValue.trim() !== '') {\n // const cleanDataValue = dataValue.trim().replace(/\\s+/g, ' ');\n // viableData[key] = cleanDataValue;\n // }\n // }\n // }\n // return viableData;\n\n var schema = contentPlacement.catalog.data_schema;\n var titleKey = contentPlacement.catalog.content_title_key;\n var excludedKeys = contentPlacement.excluded_child_fields || [];\n var viableData = {};\n for (var _i = 0, _Object$entries = Object.entries(schema); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n key = _Object$entries$_i[0],\n value = _Object$entries$_i[1];\n if (value !== 'image' && value !== 'url' && key !== titleKey && !excludedKeys.includes(key)) {\n var dataValue = contentPlacement.content.data[key];\n if (dataValue && dataValue.trim() !== '') {\n // Only trim leading/trailing whitespace, preserve newlines and other content\n var cleanDataValue = dataValue.trim();\n console.log(\"[ContentDetails] Processing field \\\"\".concat(key, \"\\\":\"), {\n original: JSON.stringify(dataValue),\n cleaned: JSON.stringify(cleanDataValue),\n hasNewlines: dataValue.includes('\\n'),\n hasTabs: dataValue.includes('\\t'),\n length: dataValue.length\n });\n viableData[key] = cleanDataValue;\n }\n }\n }\n return viableData;\n }\n }, {\n key: \"updateView\",\n value: function updateView(contentPlacement) {\n var _this4 = this;\n this.contentPlacement = contentPlacement;\n\n // Update the header\n this.contentPlacementHeader = new _ContentPlacementHeader__WEBPACK_IMPORTED_MODULE_1__[\"default\"](contentPlacement);\n var schema = contentPlacement.catalog.data_schema;\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 // const websiteUrl = contentPlacement.content.data['URL'] || contentPlacement.content.data['Website'] || contentPlacement.content.data['LinkedIn'] || contentPlacement.content.data['Website URL'] || contentPlacement.content.data['SNS'];\n var urlFields = ['URL', 'Website', 'LinkedIn', 'Website URL', 'SNS', 'Networking Link'];\n for (var _i2 = 0, _Object$entries2 = Object.entries(schema); _i2 < _Object$entries2.length; _i2++) {\n var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),\n key = _Object$entries2$_i[0],\n value = _Object$entries2$_i[1];\n if (value === 'url') {\n var url = contentPlacement.content.data[key];\n if (url && url.trim() !== '') {\n this.websiteButtons.push(new _ContextualLocationView__WEBPACK_IMPORTED_MODULE_2__[\"default\"](_assets_website_svg__WEBPACK_IMPORTED_MODULE_6__[\"default\"], url, url));\n }\n }\n }\n\n // Make a copy of content data\n var contentDataCopy = _objectSpread({}, contentPlacement.content.data);\n\n // Collect image keys and remove them from copy\n var images = [];\n var displayImgKey = contentPlacement.catalog.content_display_img_key;\n for (var _i3 = 0, _Object$entries3 = Object.entries(schema); _i3 < _Object$entries3.length; _i3++) {\n var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),\n _key = _Object$entries3$_i[0],\n _value = _Object$entries3$_i[1];\n if (_value === 'image' && _key !== displayImgKey) {\n var imageUrl = contentPlacement.content.data[_key];\n if (imageUrl) {\n images.push(imageUrl);\n }\n delete contentDataCopy[_key];\n }\n }\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 _i4 = 0, _Object$entries4 = Object.entries(contentPlacement.children); _i4 < _Object$entries4.length; _i4++) {\n var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i4], 2),\n title = _Object$entries4$_i[0],\n children = _Object$entries4$_i[1];\n var childrenComponent = new _ContentChildrenView__WEBPACK_IMPORTED_MODULE_4__[\"default\"](title, children);\n this.childrenComponents.push(childrenComponent);\n }\n\n // Handle images\n if (images.length > 0) {\n this.imageContainer = document.createElement('div');\n this.imageContainer.className = 'content-details-image-container';\n var firstImage = document.createElement('img');\n firstImage.src = images[0];\n firstImage.className = 'content-details-preview-image';\n var hoverPopup = document.createElement('div');\n hoverPopup.className = 'image-hover-popup';\n hoverPopup.textContent = 'See photos';\n this.imageContainer.appendChild(firstImage);\n this.imageContainer.appendChild(hoverPopup);\n this.imageContainer.addEventListener('click', function () {\n _this4.fire('selectPhotos', {\n placementId: _this4.contentPlacement.placement_id,\n images: images\n });\n });\n } else {\n this.imageContainer = null;\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?");
|
|
739
739
|
|
|
740
740
|
/***/ }),
|
|
741
741
|
|
|
@@ -746,7 +746,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
746
746
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
747
747
|
|
|
748
748
|
"use strict";
|
|
749
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentPlacementHeader: () => (/* binding */ ContentPlacementHeader),\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_volks_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../assets/volks.svg */ \"./src/assets/volks.svg\");\n/* harmony import */ var _assets_location_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../assets/location.svg */ \"./src/assets/location.svg\");\n/* harmony import */ var _assets_defaultIconImage_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../assets/defaultIconImage.svg */ \"./src/assets/defaultIconImage.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\nvar ContentPlacementHeader = /*#__PURE__*/function (_Component) {\n function ContentPlacementHeader(contentPlacement) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, ContentPlacementHeader);\n _this = _callSuper(this, ContentPlacementHeader, [options]);\n _this.contentPlacement = contentPlacement;\n _this._initialize();\n return _this;\n }\n _inherits(ContentPlacementHeader, _Component);\n return _createClass(ContentPlacementHeader, [{\n key: \"_initialize\",\n value: function _initialize() {\n var content = this.contentPlacement.content;\n this.element = document.createElement('div');\n this.element.className = 'content-placement-header';\n this.textContainer = document.createElement('div');\n this.textContainer.className = 'header-text-container';\n this.textContainer.style.paddingLeft = '10px';\n this.nameElement = document.createElement('div');\n this.nameElement.className = 'header-content-name';\n var title_key = this.contentPlacement.catalog.content_title_key;\n
|
|
749
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContentPlacementHeader: () => (/* binding */ ContentPlacementHeader),\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_volks_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../assets/volks.svg */ \"./src/assets/volks.svg\");\n/* harmony import */ var _assets_location_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../assets/location.svg */ \"./src/assets/location.svg\");\n/* harmony import */ var _assets_defaultIconImage_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../assets/defaultIconImage.svg */ \"./src/assets/defaultIconImage.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\nvar ContentPlacementHeader = /*#__PURE__*/function (_Component) {\n function ContentPlacementHeader(contentPlacement) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, ContentPlacementHeader);\n _this = _callSuper(this, ContentPlacementHeader, [options]);\n _this.contentPlacement = contentPlacement;\n _this._initialize();\n return _this;\n }\n _inherits(ContentPlacementHeader, _Component);\n return _createClass(ContentPlacementHeader, [{\n key: \"_initialize\",\n value: function _initialize() {\n var content = this.contentPlacement.content;\n this.element = document.createElement('div');\n this.element.className = 'content-placement-header';\n this.textContainer = document.createElement('div');\n this.textContainer.className = 'header-text-container';\n this.textContainer.style.paddingLeft = '10px';\n this.nameElement = document.createElement('div');\n this.nameElement.className = 'header-content-name';\n var title_key = this.contentPlacement.catalog.content_title_key;\n var titleValue = content.data[title_key];\n console.log(\"[ContentPlacementHeader] Title value:\", {\n key: title_key,\n value: JSON.stringify(titleValue),\n hasNewlines: titleValue && titleValue.includes('\\n'),\n hasTabs: titleValue && titleValue.includes('\\t'),\n length: titleValue ? titleValue.length : 0\n });\n this.nameElement.textContent = titleValue;\n this.catalogNameElement = document.createElement('div');\n this.catalogNameElement.className = 'header-catalog-name';\n this.catalogNameElement.textContent = this.contentPlacement.catalog.title;\n this.textContainer.appendChild(this.nameElement);\n this.textContainer.appendChild(this.catalogNameElement);\n var displayImgKey = this.contentPlacement.catalog.content_display_img_key;\n var displayImgUrl = content.data[displayImgKey];\n if (displayImgUrl) {\n this.imageViewElement = document.createElement('div');\n this.imageViewElement.className = 'header-image-view';\n var imageElement = document.createElement('img');\n imageElement.className = 'header-image';\n imageElement.src = displayImgUrl;\n imageElement.style.width = '100%';\n imageElement.style.height = '100%';\n // imageElement.style.objectFit = 'cover';\n imageElement.style.objectFit = 'contain';\n imageElement.style.background = 'white';\n this.imageViewElement.appendChild(imageElement);\n this.element.appendChild(this.imageViewElement);\n }\n\n // const imageElement = document.createElement('img');\n // imageElement.className = 'header-image';\n // imageElement.src = defaultIconImage;\n // this.imageViewElement.appendChild(imageElement);\n\n // this.element.appendChild(this.imageViewElement);\n this.element.appendChild(this.textContainer);\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__ = (ContentPlacementHeader);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/ContentPlacementHeader.js?");
|
|
750
750
|
|
|
751
751
|
/***/ }),
|
|
752
752
|
|
|
@@ -768,7 +768,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
768
768
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
769
769
|
|
|
770
770
|
"use strict";
|
|
771
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DetailsView: () => (/* binding */ DetailsView),\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 DetailsView = /*#__PURE__*/function (_Component) {\n function DetailsView(data) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, DetailsView);\n _this = _callSuper(this, DetailsView, [options]);\n _this.data = data;\n _this._initialize();\n return _this;\n }\n _inherits(DetailsView, _Component);\n return _createClass(DetailsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n var _this2 = this;\n this.element = document.createElement('div');\n this.element.className = 'content-placement-details-view';\n this.titleView = document.createElement('div');\n this.titleView.className = 'content-details-section-title';\n this.titleView.textContent = 'Additional details';\n this.element.appendChild(this.titleView);\n var dataKeys = Object.keys(this.data);\n dataKeys.forEach(function (key, index) {\n var value = _this2.data[key];\n var itemElement = document.createElement('div');\n itemElement.className = 'details-view-item';\n var keyElement = document.createElement('div');\n keyElement.className = 'details-view-key';\n keyElement.textContent = key;\n var valueElement = document.createElement('span');\n valueElement.className = 'details-view-value';\n valueElement.textContent = value;\n itemElement.appendChild(keyElement);\n itemElement.appendChild(valueElement);\n if (index < dataKeys.length - 1) {\n var lineElement = document.createElement('hr');\n lineElement.className = 'details-view-line';\n itemElement.append(lineElement);\n }\n _this2.element.appendChild(itemElement);\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__ = (DetailsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/DetailsView.js?");
|
|
771
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DetailsView: () => (/* binding */ DetailsView),\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 DetailsView = /*#__PURE__*/function (_Component) {\n function DetailsView(data) {\n var _this;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n _classCallCheck(this, DetailsView);\n _this = _callSuper(this, DetailsView, [options]);\n _this.data = data;\n _this._initialize();\n return _this;\n }\n _inherits(DetailsView, _Component);\n return _createClass(DetailsView, [{\n key: \"_initialize\",\n value: function _initialize() {\n var _this2 = this;\n this.element = document.createElement('div');\n this.element.className = 'content-placement-details-view';\n this.titleView = document.createElement('div');\n this.titleView.className = 'content-details-section-title';\n this.titleView.textContent = 'Additional details';\n this.element.appendChild(this.titleView);\n var dataKeys = Object.keys(this.data);\n dataKeys.forEach(function (key, index) {\n var value = _this2.data[key];\n console.log(\"[DetailsView] Field \\\"\".concat(key, \"\\\":\"), {\n value: JSON.stringify(value),\n hasNewlines: value && value.includes('\\n'),\n hasTabs: value && value.includes('\\t'),\n length: value ? value.length : 0\n });\n var itemElement = document.createElement('div');\n itemElement.className = 'details-view-item';\n var keyElement = document.createElement('div');\n keyElement.className = 'details-view-key';\n keyElement.textContent = key;\n var valueElement = document.createElement('span');\n valueElement.className = 'details-view-value';\n valueElement.textContent = value;\n itemElement.appendChild(keyElement);\n itemElement.appendChild(valueElement);\n if (index < dataKeys.length - 1) {\n var lineElement = document.createElement('hr');\n lineElement.className = 'details-view-line';\n itemElement.append(lineElement);\n }\n _this2.element.appendChild(itemElement);\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__ = (DetailsView);\n\n//# sourceURL=webpack://waygomaps/./src/components/ContentPlacementView/DetailsView.js?");
|
|
772
772
|
|
|
773
773
|
/***/ }),
|
|
774
774
|
|
|
@@ -2883,7 +2883,7 @@ eval("var __filename = \"/index.js\";\nvar __dirname = \"/\";\n/* module decorat
|
|
|
2883
2883
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2884
2884
|
|
|
2885
2885
|
"use strict";
|
|
2886
|
-
eval("\n\n/** @typedef {import(\"@jridgewell/trace-mapping\").SourceMapInput} SourceMapInput */\n/** @typedef {import(\"terser\").FormatOptions} TerserFormatOptions */\n/** @typedef {import(\"terser\").MinifyOptions} TerserOptions */\n/** @typedef {import(\"terser\").CompressOptions} TerserCompressOptions */\n/** @typedef {import(\"terser\").ECMA} TerserECMA */\n/** @typedef {import(\"./index.js\").ExtractCommentsOptions} ExtractCommentsOptions */\n/** @typedef {import(\"./index.js\").ExtractCommentsFunction} ExtractCommentsFunction */\n/** @typedef {import(\"./index.js\").ExtractCommentsCondition} ExtractCommentsCondition */\n/** @typedef {import(\"./index.js\").Input} Input */\n/** @typedef {import(\"./index.js\").MinimizedResult} MinimizedResult */\n/** @typedef {import(\"./index.js\").PredefinedOptions} PredefinedOptions */\n/** @typedef {import(\"./index.js\").CustomOptions} CustomOptions */\n\n/**\n * @typedef {Array<string>} ExtractedComments\n */\n\nconst notSettled = Symbol(`not-settled`);\n\n/**\n * @template T\n * @typedef {() => Promise<T>} Task\n */\n\n/**\n * Run tasks with limited concurrency.\n * @template T\n * @param {number} limit - Limit of tasks that run at once.\n * @param {Task<T>[]} tasks - List of tasks to run.\n * @returns {Promise<T[]>} A promise that fulfills to an array of the results\n */\nfunction throttleAll(limit, tasks) {\n if (!Number.isInteger(limit) || limit < 1) {\n throw new TypeError(`Expected \\`limit\\` to be a finite number > 0, got \\`${limit}\\` (${typeof limit})`);\n }\n if (!Array.isArray(tasks) || !tasks.every(task => typeof task === `function`)) {\n throw new TypeError(`Expected \\`tasks\\` to be a list of functions returning a promise`);\n }\n return new Promise((resolve, reject) => {\n const result = Array(tasks.length).fill(notSettled);\n const entries = tasks.entries();\n const next = () => {\n const {\n done,\n value\n } = entries.next();\n if (done) {\n const isLast = !result.includes(notSettled);\n if (isLast) resolve( /** @type{T[]} **/result);\n return;\n }\n const [index, task] = value;\n\n /**\n * @param {T} x\n */\n const onFulfilled = x => {\n result[index] = x;\n next();\n };\n task().then(onFulfilled, reject);\n };\n Array(limit).fill(0).forEach(next);\n });\n}\n\n/* istanbul ignore next */\n/**\n * @param {Input} input\n * @param {SourceMapInput | undefined} sourceMap\n * @param {PredefinedOptions & CustomOptions} minimizerOptions\n * @param {ExtractCommentsOptions | undefined} extractComments\n * @return {Promise<MinimizedResult>}\n */\nasync function terserMinify(input, sourceMap, minimizerOptions, extractComments) {\n /**\n * @param {any} value\n * @returns {boolean}\n */\n const isObject = value => {\n const type = typeof value;\n return value != null && (type === \"object\" || type === \"function\");\n };\n\n /**\n * @param {TerserOptions & { sourceMap: undefined } & ({ output: TerserFormatOptions & { beautify: boolean } } | { format: TerserFormatOptions & { beautify: boolean } })} terserOptions\n * @param {ExtractedComments} extractedComments\n * @returns {ExtractCommentsFunction}\n */\n const buildComments = (terserOptions, extractedComments) => {\n /** @type {{ [index: string]: ExtractCommentsCondition }} */\n const condition = {};\n let comments;\n if (terserOptions.format) {\n ({\n comments\n } = terserOptions.format);\n } else if (terserOptions.output) {\n ({\n comments\n } = terserOptions.output);\n }\n condition.preserve = typeof comments !== \"undefined\" ? comments : false;\n if (typeof extractComments === \"boolean\" && extractComments) {\n condition.extract = \"some\";\n } else if (typeof extractComments === \"string\" || extractComments instanceof RegExp) {\n condition.extract = extractComments;\n } else if (typeof extractComments === \"function\") {\n condition.extract = extractComments;\n } else if (extractComments && isObject(extractComments)) {\n condition.extract = typeof extractComments.condition === \"boolean\" && extractComments.condition ? \"some\" : typeof extractComments.condition !== \"undefined\" ? extractComments.condition : \"some\";\n } else {\n // No extract\n // Preserve using \"commentsOpts\" or \"some\"\n condition.preserve = typeof comments !== \"undefined\" ? comments : \"some\";\n condition.extract = false;\n }\n\n // Ensure that both conditions are functions\n [\"preserve\", \"extract\"].forEach(key => {\n /** @type {undefined | string} */\n let regexStr;\n /** @type {undefined | RegExp} */\n let regex;\n switch (typeof condition[key]) {\n case \"boolean\":\n condition[key] = condition[key] ? () => true : () => false;\n break;\n case \"function\":\n break;\n case \"string\":\n if (condition[key] === \"all\") {\n condition[key] = () => true;\n break;\n }\n if (condition[key] === \"some\") {\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => (comment.type === \"comment2\" || comment.type === \"comment1\") && /@preserve|@lic|@cc_on|^\\**!/i.test(comment.value);\n break;\n }\n regexStr = /** @type {string} */condition[key];\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => new RegExp( /** @type {string} */regexStr).test(comment.value);\n break;\n default:\n regex = /** @type {RegExp} */condition[key];\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => /** @type {RegExp} */regex.test(comment.value);\n }\n });\n\n // Redefine the comments function to extract and preserve\n // comments according to the two conditions\n return (astNode, comment) => {\n if ( /** @type {{ extract: ExtractCommentsFunction }} */\n condition.extract(astNode, comment)) {\n const commentText = comment.type === \"comment2\" ? `/*${comment.value}*/` : `//${comment.value}`;\n\n // Don't include duplicate comments\n if (!extractedComments.includes(commentText)) {\n extractedComments.push(commentText);\n }\n }\n return /** @type {{ preserve: ExtractCommentsFunction }} */condition.preserve(astNode, comment);\n };\n };\n\n /**\n * @param {PredefinedOptions & TerserOptions} [terserOptions={}]\n * @returns {TerserOptions & { sourceMap: undefined } & { compress: TerserCompressOptions } & ({ output: TerserFormatOptions & { beautify: boolean } } | { format: TerserFormatOptions & { beautify: boolean } })}\n */\n const buildTerserOptions = (terserOptions = {}) => {\n // Need deep copy objects to avoid https://github.com/terser/terser/issues/366\n return {\n ...terserOptions,\n compress: typeof terserOptions.compress === \"boolean\" ? terserOptions.compress ? {} : false : {\n ...terserOptions.compress\n },\n // ecma: terserOptions.ecma,\n // ie8: terserOptions.ie8,\n // keep_classnames: terserOptions.keep_classnames,\n // keep_fnames: terserOptions.keep_fnames,\n mangle: terserOptions.mangle == null ? true : typeof terserOptions.mangle === \"boolean\" ? terserOptions.mangle : {\n ...terserOptions.mangle\n },\n // module: terserOptions.module,\n // nameCache: { ...terserOptions.toplevel },\n // the `output` option is deprecated\n ...(terserOptions.format ? {\n format: {\n beautify: false,\n ...terserOptions.format\n }\n } : {\n output: {\n beautify: false,\n ...terserOptions.output\n }\n }),\n parse: {\n ...terserOptions.parse\n },\n // safari10: terserOptions.safari10,\n // Ignoring sourceMap from options\n // eslint-disable-next-line no-undefined\n sourceMap: undefined\n // toplevel: terserOptions.toplevel\n };\n };\n\n // eslint-disable-next-line global-require\n const {\n minify\n } = __webpack_require__(/*! terser */ \"./node_modules/terser/dist/bundle.min.js\");\n // Copy `terser` options\n const terserOptions = buildTerserOptions(minimizerOptions);\n\n // Let terser generate a SourceMap\n if (sourceMap) {\n // @ts-ignore\n terserOptions.sourceMap = {\n asObject: true\n };\n }\n\n /** @type {ExtractedComments} */\n const extractedComments = [];\n if (terserOptions.output) {\n terserOptions.output.comments = buildComments(terserOptions, extractedComments);\n } else if (terserOptions.format) {\n terserOptions.format.comments = buildComments(terserOptions, extractedComments);\n }\n if (terserOptions.compress) {\n // More optimizations\n if (typeof terserOptions.compress.ecma === \"undefined\") {\n terserOptions.compress.ecma = terserOptions.ecma;\n }\n\n // https://github.com/webpack/webpack/issues/16135\n if (terserOptions.ecma === 5 && typeof terserOptions.compress.arrows === \"undefined\") {\n terserOptions.compress.arrows = false;\n }\n }\n const [[filename, code]] = Object.entries(input);\n const result = await minify({\n [filename]: code\n }, terserOptions);\n return {\n code: ( /** @type {string} **/result.code),\n // @ts-ignore\n // eslint-disable-next-line no-undefined\n map: result.map ? ( /** @type {SourceMapInput} **/result.map) : undefined,\n extractedComments\n };\n}\n\n/**\n * @returns {string | undefined}\n */\nterserMinify.getMinimizerVersion = () => {\n let packageJson;\n try {\n // eslint-disable-next-line global-require\n packageJson = __webpack_require__(/*! terser/package.json */ \"./node_modules/terser/package.json\");\n } catch (error) {\n // Ignore\n }\n return packageJson && packageJson.version;\n};\n\n/* istanbul ignore next */\n/**\n * @param {Input} input\n * @param {SourceMapInput | undefined} sourceMap\n * @param {PredefinedOptions & CustomOptions} minimizerOptions\n * @param {ExtractCommentsOptions | undefined} extractComments\n * @return {Promise<MinimizedResult>}\n */\nasync function uglifyJsMinify(input, sourceMap, minimizerOptions, extractComments) {\n /**\n * @param {any} value\n * @returns {boolean}\n */\n const isObject = value => {\n const type = typeof value;\n return value != null && (type === \"object\" || type === \"function\");\n };\n\n /**\n * @param {import(\"uglify-js\").MinifyOptions & { sourceMap: undefined } & { output: import(\"uglify-js\").OutputOptions & { beautify: boolean }}} uglifyJsOptions\n * @param {ExtractedComments} extractedComments\n * @returns {ExtractCommentsFunction}\n */\n const buildComments = (uglifyJsOptions, extractedComments) => {\n /** @type {{ [index: string]: ExtractCommentsCondition }} */\n const condition = {};\n const {\n comments\n } = uglifyJsOptions.output;\n condition.preserve = typeof comments !== \"undefined\" ? comments : false;\n if (typeof extractComments === \"boolean\" && extractComments) {\n condition.extract = \"some\";\n } else if (typeof extractComments === \"string\" || extractComments instanceof RegExp) {\n condition.extract = extractComments;\n } else if (typeof extractComments === \"function\") {\n condition.extract = extractComments;\n } else if (extractComments && isObject(extractComments)) {\n condition.extract = typeof extractComments.condition === \"boolean\" && extractComments.condition ? \"some\" : typeof extractComments.condition !== \"undefined\" ? extractComments.condition : \"some\";\n } else {\n // No extract\n // Preserve using \"commentsOpts\" or \"some\"\n condition.preserve = typeof comments !== \"undefined\" ? comments : \"some\";\n condition.extract = false;\n }\n\n // Ensure that both conditions are functions\n [\"preserve\", \"extract\"].forEach(key => {\n /** @type {undefined | string} */\n let regexStr;\n /** @type {undefined | RegExp} */\n let regex;\n switch (typeof condition[key]) {\n case \"boolean\":\n condition[key] = condition[key] ? () => true : () => false;\n break;\n case \"function\":\n break;\n case \"string\":\n if (condition[key] === \"all\") {\n condition[key] = () => true;\n break;\n }\n if (condition[key] === \"some\") {\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => (comment.type === \"comment2\" || comment.type === \"comment1\") && /@preserve|@lic|@cc_on|^\\**!/i.test(comment.value);\n break;\n }\n regexStr = /** @type {string} */condition[key];\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => new RegExp( /** @type {string} */regexStr).test(comment.value);\n break;\n default:\n regex = /** @type {RegExp} */condition[key];\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => /** @type {RegExp} */regex.test(comment.value);\n }\n });\n\n // Redefine the comments function to extract and preserve\n // comments according to the two conditions\n return (astNode, comment) => {\n if ( /** @type {{ extract: ExtractCommentsFunction }} */\n condition.extract(astNode, comment)) {\n const commentText = comment.type === \"comment2\" ? `/*${comment.value}*/` : `//${comment.value}`;\n\n // Don't include duplicate comments\n if (!extractedComments.includes(commentText)) {\n extractedComments.push(commentText);\n }\n }\n return /** @type {{ preserve: ExtractCommentsFunction }} */condition.preserve(astNode, comment);\n };\n };\n\n /**\n * @param {PredefinedOptions & import(\"uglify-js\").MinifyOptions} [uglifyJsOptions={}]\n * @returns {import(\"uglify-js\").MinifyOptions & { sourceMap: undefined } & { output: import(\"uglify-js\").OutputOptions & { beautify: boolean }}}\n */\n const buildUglifyJsOptions = (uglifyJsOptions = {}) => {\n // eslint-disable-next-line no-param-reassign\n delete minimizerOptions.ecma;\n // eslint-disable-next-line no-param-reassign\n delete minimizerOptions.module;\n\n // Need deep copy objects to avoid https://github.com/terser/terser/issues/366\n return {\n ...uglifyJsOptions,\n // warnings: uglifyJsOptions.warnings,\n parse: {\n ...uglifyJsOptions.parse\n },\n compress: typeof uglifyJsOptions.compress === \"boolean\" ? uglifyJsOptions.compress : {\n ...uglifyJsOptions.compress\n },\n mangle: uglifyJsOptions.mangle == null ? true : typeof uglifyJsOptions.mangle === \"boolean\" ? uglifyJsOptions.mangle : {\n ...uglifyJsOptions.mangle\n },\n output: {\n beautify: false,\n ...uglifyJsOptions.output\n },\n // Ignoring sourceMap from options\n // eslint-disable-next-line no-undefined\n sourceMap: undefined\n // toplevel: uglifyJsOptions.toplevel\n // nameCache: { ...uglifyJsOptions.toplevel },\n // ie8: uglifyJsOptions.ie8,\n // keep_fnames: uglifyJsOptions.keep_fnames,\n };\n };\n\n // eslint-disable-next-line global-require, import/no-extraneous-dependencies\n const {\n minify\n } = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module 'uglify-js'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n\n // Copy `uglify-js` options\n const uglifyJsOptions = buildUglifyJsOptions(minimizerOptions);\n\n // Let terser generate a SourceMap\n if (sourceMap) {\n // @ts-ignore\n uglifyJsOptions.sourceMap = true;\n }\n\n /** @type {ExtractedComments} */\n const extractedComments = [];\n\n // @ts-ignore\n uglifyJsOptions.output.comments = buildComments(uglifyJsOptions, extractedComments);\n const [[filename, code]] = Object.entries(input);\n const result = await minify({\n [filename]: code\n }, uglifyJsOptions);\n return {\n code: result.code,\n // eslint-disable-next-line no-undefined\n map: result.map ? JSON.parse(result.map) : undefined,\n errors: result.error ? [result.error] : [],\n warnings: result.warnings || [],\n extractedComments\n };\n}\n\n/**\n * @returns {string | undefined}\n */\nuglifyJsMinify.getMinimizerVersion = () => {\n let packageJson;\n try {\n // eslint-disable-next-line global-require, import/no-extraneous-dependencies\n packageJson = __webpack_require__(/*! uglify-js/package.json */ \"?4edc\");\n } catch (error) {\n // Ignore\n }\n return packageJson && packageJson.version;\n};\n\n/* istanbul ignore next */\n/**\n * @param {Input} input\n * @param {SourceMapInput | undefined} sourceMap\n * @param {PredefinedOptions & CustomOptions} minimizerOptions\n * @return {Promise<MinimizedResult>}\n */\nasync function swcMinify(input, sourceMap, minimizerOptions) {\n /**\n * @param {PredefinedOptions & import(\"@swc/core\").JsMinifyOptions} [swcOptions={}]\n * @returns {import(\"@swc/core\").JsMinifyOptions & { sourceMap: undefined } & { compress: import(\"@swc/core\").TerserCompressOptions }}\n */\n const buildSwcOptions = (swcOptions = {}) => {\n // Need deep copy objects to avoid https://github.com/terser/terser/issues/366\n return {\n ...swcOptions,\n compress: typeof swcOptions.compress === \"boolean\" ? swcOptions.compress ? {} : false : {\n ...swcOptions.compress\n },\n mangle: swcOptions.mangle == null ? true : typeof swcOptions.mangle === \"boolean\" ? swcOptions.mangle : {\n ...swcOptions.mangle\n },\n // ecma: swcOptions.ecma,\n // keep_classnames: swcOptions.keep_classnames,\n // keep_fnames: swcOptions.keep_fnames,\n // module: swcOptions.module,\n // safari10: swcOptions.safari10,\n // toplevel: swcOptions.toplevel\n // eslint-disable-next-line no-undefined\n sourceMap: undefined\n };\n };\n\n // eslint-disable-next-line import/no-extraneous-dependencies, global-require\n const swc = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module '@swc/core'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n // Copy `swc` options\n const swcOptions = buildSwcOptions(minimizerOptions);\n\n // Let `swc` generate a SourceMap\n if (sourceMap) {\n // @ts-ignore\n swcOptions.sourceMap = true;\n }\n if (swcOptions.compress) {\n // More optimizations\n if (typeof swcOptions.compress.ecma === \"undefined\") {\n swcOptions.compress.ecma = swcOptions.ecma;\n }\n\n // https://github.com/webpack/webpack/issues/16135\n if (swcOptions.ecma === 5 && typeof swcOptions.compress.arrows === \"undefined\") {\n swcOptions.compress.arrows = false;\n }\n }\n const [[filename, code]] = Object.entries(input);\n const result = await swc.minify(code, swcOptions);\n let map;\n if (result.map) {\n map = JSON.parse(result.map);\n\n // TODO workaround for swc because `filename` is not preset as in `swc` signature as for `terser`\n map.sources = [filename];\n delete map.sourcesContent;\n }\n return {\n code: result.code,\n map\n };\n}\n\n/**\n * @returns {string | undefined}\n */\nswcMinify.getMinimizerVersion = () => {\n let packageJson;\n try {\n // eslint-disable-next-line global-require, import/no-extraneous-dependencies\n packageJson = __webpack_require__(/*! @swc/core/package.json */ \"./node_modules/@swc/core/package.json\");\n } catch (error) {\n // Ignore\n }\n return packageJson && packageJson.version;\n};\n\n/* istanbul ignore next */\n/**\n * @param {Input} input\n * @param {SourceMapInput | undefined} sourceMap\n * @param {PredefinedOptions & CustomOptions} minimizerOptions\n * @return {Promise<MinimizedResult>}\n */\nasync function esbuildMinify(input, sourceMap, minimizerOptions) {\n /**\n * @param {PredefinedOptions & import(\"esbuild\").TransformOptions} [esbuildOptions={}]\n * @returns {import(\"esbuild\").TransformOptions}\n */\n const buildEsbuildOptions = (esbuildOptions = {}) => {\n // eslint-disable-next-line no-param-reassign\n delete esbuildOptions.ecma;\n if (esbuildOptions.module) {\n // eslint-disable-next-line no-param-reassign\n esbuildOptions.format = \"esm\";\n }\n\n // eslint-disable-next-line no-param-reassign\n delete esbuildOptions.module;\n\n // Need deep copy objects to avoid https://github.com/terser/terser/issues/366\n return {\n minify: true,\n legalComments: \"inline\",\n ...esbuildOptions,\n sourcemap: false\n };\n };\n\n // eslint-disable-next-line import/no-extraneous-dependencies, global-require\n const esbuild = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module 'esbuild'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n\n // Copy `esbuild` options\n const esbuildOptions = buildEsbuildOptions(minimizerOptions);\n\n // Let `esbuild` generate a SourceMap\n if (sourceMap) {\n esbuildOptions.sourcemap = true;\n esbuildOptions.sourcesContent = false;\n }\n const [[filename, code]] = Object.entries(input);\n esbuildOptions.sourcefile = filename;\n const result = await esbuild.transform(code, esbuildOptions);\n return {\n code: result.code,\n // eslint-disable-next-line no-undefined\n map: result.map ? JSON.parse(result.map) : undefined,\n warnings: result.warnings.length > 0 ? result.warnings.map(item => {\n const plugin = item.pluginName ? `\\nPlugin Name: ${item.pluginName}` : \"\";\n const location = item.location ? `\\n\\n${item.location.file}:${item.location.line}:${item.location.column}:\\n ${item.location.line} | ${item.location.lineText}\\n\\nSuggestion: ${item.location.suggestion}` : \"\";\n const notes = item.notes.length > 0 ? `\\n\\nNotes:\\n${item.notes.map(note => `${note.location ? `[${note.location.file}:${note.location.line}:${note.location.column}] ` : \"\"}${note.text}${note.location ? `\\nSuggestion: ${note.location.suggestion}` : \"\"}${note.location ? `\\nLine text:\\n${note.location.lineText}\\n` : \"\"}`).join(\"\\n\")}` : \"\";\n return `${item.text} [${item.id}]${plugin}${location}${item.detail ? `\\nDetails:\\n${item.detail}` : \"\"}${notes}`;\n }) : []\n };\n}\n\n/**\n * @returns {string | undefined}\n */\nesbuildMinify.getMinimizerVersion = () => {\n let packageJson;\n try {\n // eslint-disable-next-line global-require, import/no-extraneous-dependencies\n packageJson = __webpack_require__(/*! esbuild/package.json */ \"?38be\");\n } catch (error) {\n // Ignore\n }\n return packageJson && packageJson.version;\n};\n\n/**\n * @template T\n * @param fn {(function(): any) | undefined}\n * @returns {function(): T}\n */\nfunction memoize(fn) {\n let cache = false;\n /** @type {T} */\n let result;\n return () => {\n if (cache) {\n return result;\n }\n result = /** @type {function(): any} */fn();\n cache = true;\n // Allow to clean up memory for fn\n // and all dependent resources\n // eslint-disable-next-line no-undefined, no-param-reassign\n fn = undefined;\n return result;\n };\n}\nmodule.exports = {\n throttleAll,\n memoize,\n terserMinify,\n uglifyJsMinify,\n swcMinify,\n esbuildMinify\n};\n\n//# sourceURL=webpack://waygomaps/./node_modules/terser-webpack-plugin/dist/utils.js?");
|
|
2886
|
+
eval("\n\n/** @typedef {import(\"@jridgewell/trace-mapping\").SourceMapInput} SourceMapInput */\n/** @typedef {import(\"terser\").FormatOptions} TerserFormatOptions */\n/** @typedef {import(\"terser\").MinifyOptions} TerserOptions */\n/** @typedef {import(\"terser\").CompressOptions} TerserCompressOptions */\n/** @typedef {import(\"terser\").ECMA} TerserECMA */\n/** @typedef {import(\"./index.js\").ExtractCommentsOptions} ExtractCommentsOptions */\n/** @typedef {import(\"./index.js\").ExtractCommentsFunction} ExtractCommentsFunction */\n/** @typedef {import(\"./index.js\").ExtractCommentsCondition} ExtractCommentsCondition */\n/** @typedef {import(\"./index.js\").Input} Input */\n/** @typedef {import(\"./index.js\").MinimizedResult} MinimizedResult */\n/** @typedef {import(\"./index.js\").PredefinedOptions} PredefinedOptions */\n/** @typedef {import(\"./index.js\").CustomOptions} CustomOptions */\n\n/**\n * @typedef {Array<string>} ExtractedComments\n */\n\nconst notSettled = Symbol(`not-settled`);\n\n/**\n * @template T\n * @typedef {() => Promise<T>} Task\n */\n\n/**\n * Run tasks with limited concurrency.\n * @template T\n * @param {number} limit - Limit of tasks that run at once.\n * @param {Task<T>[]} tasks - List of tasks to run.\n * @returns {Promise<T[]>} A promise that fulfills to an array of the results\n */\nfunction throttleAll(limit, tasks) {\n if (!Number.isInteger(limit) || limit < 1) {\n throw new TypeError(`Expected \\`limit\\` to be a finite number > 0, got \\`${limit}\\` (${typeof limit})`);\n }\n if (!Array.isArray(tasks) || !tasks.every(task => typeof task === `function`)) {\n throw new TypeError(`Expected \\`tasks\\` to be a list of functions returning a promise`);\n }\n return new Promise((resolve, reject) => {\n const result = Array(tasks.length).fill(notSettled);\n const entries = tasks.entries();\n const next = () => {\n const {\n done,\n value\n } = entries.next();\n if (done) {\n const isLast = !result.includes(notSettled);\n if (isLast) resolve( /** @type{T[]} **/result);\n return;\n }\n const [index, task] = value;\n\n /**\n * @param {T} x\n */\n const onFulfilled = x => {\n result[index] = x;\n next();\n };\n task().then(onFulfilled, reject);\n };\n Array(limit).fill(0).forEach(next);\n });\n}\n\n/* istanbul ignore next */\n/**\n * @param {Input} input\n * @param {SourceMapInput | undefined} sourceMap\n * @param {PredefinedOptions & CustomOptions} minimizerOptions\n * @param {ExtractCommentsOptions | undefined} extractComments\n * @return {Promise<MinimizedResult>}\n */\nasync function terserMinify(input, sourceMap, minimizerOptions, extractComments) {\n /**\n * @param {any} value\n * @returns {boolean}\n */\n const isObject = value => {\n const type = typeof value;\n return value != null && (type === \"object\" || type === \"function\");\n };\n\n /**\n * @param {TerserOptions & { sourceMap: undefined } & ({ output: TerserFormatOptions & { beautify: boolean } } | { format: TerserFormatOptions & { beautify: boolean } })} terserOptions\n * @param {ExtractedComments} extractedComments\n * @returns {ExtractCommentsFunction}\n */\n const buildComments = (terserOptions, extractedComments) => {\n /** @type {{ [index: string]: ExtractCommentsCondition }} */\n const condition = {};\n let comments;\n if (terserOptions.format) {\n ({\n comments\n } = terserOptions.format);\n } else if (terserOptions.output) {\n ({\n comments\n } = terserOptions.output);\n }\n condition.preserve = typeof comments !== \"undefined\" ? comments : false;\n if (typeof extractComments === \"boolean\" && extractComments) {\n condition.extract = \"some\";\n } else if (typeof extractComments === \"string\" || extractComments instanceof RegExp) {\n condition.extract = extractComments;\n } else if (typeof extractComments === \"function\") {\n condition.extract = extractComments;\n } else if (extractComments && isObject(extractComments)) {\n condition.extract = typeof extractComments.condition === \"boolean\" && extractComments.condition ? \"some\" : typeof extractComments.condition !== \"undefined\" ? extractComments.condition : \"some\";\n } else {\n // No extract\n // Preserve using \"commentsOpts\" or \"some\"\n condition.preserve = typeof comments !== \"undefined\" ? comments : \"some\";\n condition.extract = false;\n }\n\n // Ensure that both conditions are functions\n [\"preserve\", \"extract\"].forEach(key => {\n /** @type {undefined | string} */\n let regexStr;\n /** @type {undefined | RegExp} */\n let regex;\n switch (typeof condition[key]) {\n case \"boolean\":\n condition[key] = condition[key] ? () => true : () => false;\n break;\n case \"function\":\n break;\n case \"string\":\n if (condition[key] === \"all\") {\n condition[key] = () => true;\n break;\n }\n if (condition[key] === \"some\") {\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => (comment.type === \"comment2\" || comment.type === \"comment1\") && /@preserve|@lic|@cc_on|^\\**!/i.test(comment.value);\n break;\n }\n regexStr = /** @type {string} */condition[key];\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => new RegExp( /** @type {string} */regexStr).test(comment.value);\n break;\n default:\n regex = /** @type {RegExp} */condition[key];\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => /** @type {RegExp} */regex.test(comment.value);\n }\n });\n\n // Redefine the comments function to extract and preserve\n // comments according to the two conditions\n return (astNode, comment) => {\n if ( /** @type {{ extract: ExtractCommentsFunction }} */\n condition.extract(astNode, comment)) {\n const commentText = comment.type === \"comment2\" ? `/*${comment.value}*/` : `//${comment.value}`;\n\n // Don't include duplicate comments\n if (!extractedComments.includes(commentText)) {\n extractedComments.push(commentText);\n }\n }\n return /** @type {{ preserve: ExtractCommentsFunction }} */condition.preserve(astNode, comment);\n };\n };\n\n /**\n * @param {PredefinedOptions & TerserOptions} [terserOptions={}]\n * @returns {TerserOptions & { sourceMap: undefined } & { compress: TerserCompressOptions } & ({ output: TerserFormatOptions & { beautify: boolean } } | { format: TerserFormatOptions & { beautify: boolean } })}\n */\n const buildTerserOptions = (terserOptions = {}) => {\n // Need deep copy objects to avoid https://github.com/terser/terser/issues/366\n return {\n ...terserOptions,\n compress: typeof terserOptions.compress === \"boolean\" ? terserOptions.compress ? {} : false : {\n ...terserOptions.compress\n },\n // ecma: terserOptions.ecma,\n // ie8: terserOptions.ie8,\n // keep_classnames: terserOptions.keep_classnames,\n // keep_fnames: terserOptions.keep_fnames,\n mangle: terserOptions.mangle == null ? true : typeof terserOptions.mangle === \"boolean\" ? terserOptions.mangle : {\n ...terserOptions.mangle\n },\n // module: terserOptions.module,\n // nameCache: { ...terserOptions.toplevel },\n // the `output` option is deprecated\n ...(terserOptions.format ? {\n format: {\n beautify: false,\n ...terserOptions.format\n }\n } : {\n output: {\n beautify: false,\n ...terserOptions.output\n }\n }),\n parse: {\n ...terserOptions.parse\n },\n // safari10: terserOptions.safari10,\n // Ignoring sourceMap from options\n // eslint-disable-next-line no-undefined\n sourceMap: undefined\n // toplevel: terserOptions.toplevel\n };\n };\n\n // eslint-disable-next-line global-require\n const {\n minify\n } = __webpack_require__(/*! terser */ \"./node_modules/terser/dist/bundle.min.js\");\n // Copy `terser` options\n const terserOptions = buildTerserOptions(minimizerOptions);\n\n // Let terser generate a SourceMap\n if (sourceMap) {\n // @ts-ignore\n terserOptions.sourceMap = {\n asObject: true\n };\n }\n\n /** @type {ExtractedComments} */\n const extractedComments = [];\n if (terserOptions.output) {\n terserOptions.output.comments = buildComments(terserOptions, extractedComments);\n } else if (terserOptions.format) {\n terserOptions.format.comments = buildComments(terserOptions, extractedComments);\n }\n if (terserOptions.compress) {\n // More optimizations\n if (typeof terserOptions.compress.ecma === \"undefined\") {\n terserOptions.compress.ecma = terserOptions.ecma;\n }\n\n // https://github.com/webpack/webpack/issues/16135\n if (terserOptions.ecma === 5 && typeof terserOptions.compress.arrows === \"undefined\") {\n terserOptions.compress.arrows = false;\n }\n }\n const [[filename, code]] = Object.entries(input);\n const result = await minify({\n [filename]: code\n }, terserOptions);\n return {\n code: ( /** @type {string} **/result.code),\n // @ts-ignore\n // eslint-disable-next-line no-undefined\n map: result.map ? ( /** @type {SourceMapInput} **/result.map) : undefined,\n extractedComments\n };\n}\n\n/**\n * @returns {string | undefined}\n */\nterserMinify.getMinimizerVersion = () => {\n let packageJson;\n try {\n // eslint-disable-next-line global-require\n packageJson = __webpack_require__(/*! terser/package.json */ \"./node_modules/terser/package.json\");\n } catch (error) {\n // Ignore\n }\n return packageJson && packageJson.version;\n};\n\n/* istanbul ignore next */\n/**\n * @param {Input} input\n * @param {SourceMapInput | undefined} sourceMap\n * @param {PredefinedOptions & CustomOptions} minimizerOptions\n * @param {ExtractCommentsOptions | undefined} extractComments\n * @return {Promise<MinimizedResult>}\n */\nasync function uglifyJsMinify(input, sourceMap, minimizerOptions, extractComments) {\n /**\n * @param {any} value\n * @returns {boolean}\n */\n const isObject = value => {\n const type = typeof value;\n return value != null && (type === \"object\" || type === \"function\");\n };\n\n /**\n * @param {import(\"uglify-js\").MinifyOptions & { sourceMap: undefined } & { output: import(\"uglify-js\").OutputOptions & { beautify: boolean }}} uglifyJsOptions\n * @param {ExtractedComments} extractedComments\n * @returns {ExtractCommentsFunction}\n */\n const buildComments = (uglifyJsOptions, extractedComments) => {\n /** @type {{ [index: string]: ExtractCommentsCondition }} */\n const condition = {};\n const {\n comments\n } = uglifyJsOptions.output;\n condition.preserve = typeof comments !== \"undefined\" ? comments : false;\n if (typeof extractComments === \"boolean\" && extractComments) {\n condition.extract = \"some\";\n } else if (typeof extractComments === \"string\" || extractComments instanceof RegExp) {\n condition.extract = extractComments;\n } else if (typeof extractComments === \"function\") {\n condition.extract = extractComments;\n } else if (extractComments && isObject(extractComments)) {\n condition.extract = typeof extractComments.condition === \"boolean\" && extractComments.condition ? \"some\" : typeof extractComments.condition !== \"undefined\" ? extractComments.condition : \"some\";\n } else {\n // No extract\n // Preserve using \"commentsOpts\" or \"some\"\n condition.preserve = typeof comments !== \"undefined\" ? comments : \"some\";\n condition.extract = false;\n }\n\n // Ensure that both conditions are functions\n [\"preserve\", \"extract\"].forEach(key => {\n /** @type {undefined | string} */\n let regexStr;\n /** @type {undefined | RegExp} */\n let regex;\n switch (typeof condition[key]) {\n case \"boolean\":\n condition[key] = condition[key] ? () => true : () => false;\n break;\n case \"function\":\n break;\n case \"string\":\n if (condition[key] === \"all\") {\n condition[key] = () => true;\n break;\n }\n if (condition[key] === \"some\") {\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => (comment.type === \"comment2\" || comment.type === \"comment1\") && /@preserve|@lic|@cc_on|^\\**!/i.test(comment.value);\n break;\n }\n regexStr = /** @type {string} */condition[key];\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => new RegExp( /** @type {string} */regexStr).test(comment.value);\n break;\n default:\n regex = /** @type {RegExp} */condition[key];\n condition[key] = /** @type {ExtractCommentsFunction} */\n (astNode, comment) => /** @type {RegExp} */regex.test(comment.value);\n }\n });\n\n // Redefine the comments function to extract and preserve\n // comments according to the two conditions\n return (astNode, comment) => {\n if ( /** @type {{ extract: ExtractCommentsFunction }} */\n condition.extract(astNode, comment)) {\n const commentText = comment.type === \"comment2\" ? `/*${comment.value}*/` : `//${comment.value}`;\n\n // Don't include duplicate comments\n if (!extractedComments.includes(commentText)) {\n extractedComments.push(commentText);\n }\n }\n return /** @type {{ preserve: ExtractCommentsFunction }} */condition.preserve(astNode, comment);\n };\n };\n\n /**\n * @param {PredefinedOptions & import(\"uglify-js\").MinifyOptions} [uglifyJsOptions={}]\n * @returns {import(\"uglify-js\").MinifyOptions & { sourceMap: undefined } & { output: import(\"uglify-js\").OutputOptions & { beautify: boolean }}}\n */\n const buildUglifyJsOptions = (uglifyJsOptions = {}) => {\n // eslint-disable-next-line no-param-reassign\n delete minimizerOptions.ecma;\n // eslint-disable-next-line no-param-reassign\n delete minimizerOptions.module;\n\n // Need deep copy objects to avoid https://github.com/terser/terser/issues/366\n return {\n ...uglifyJsOptions,\n // warnings: uglifyJsOptions.warnings,\n parse: {\n ...uglifyJsOptions.parse\n },\n compress: typeof uglifyJsOptions.compress === \"boolean\" ? uglifyJsOptions.compress : {\n ...uglifyJsOptions.compress\n },\n mangle: uglifyJsOptions.mangle == null ? true : typeof uglifyJsOptions.mangle === \"boolean\" ? uglifyJsOptions.mangle : {\n ...uglifyJsOptions.mangle\n },\n output: {\n beautify: false,\n ...uglifyJsOptions.output\n },\n // Ignoring sourceMap from options\n // eslint-disable-next-line no-undefined\n sourceMap: undefined\n // toplevel: uglifyJsOptions.toplevel\n // nameCache: { ...uglifyJsOptions.toplevel },\n // ie8: uglifyJsOptions.ie8,\n // keep_fnames: uglifyJsOptions.keep_fnames,\n };\n };\n\n // eslint-disable-next-line global-require, import/no-extraneous-dependencies\n const {\n minify\n } = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module 'uglify-js'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n\n // Copy `uglify-js` options\n const uglifyJsOptions = buildUglifyJsOptions(minimizerOptions);\n\n // Let terser generate a SourceMap\n if (sourceMap) {\n // @ts-ignore\n uglifyJsOptions.sourceMap = true;\n }\n\n /** @type {ExtractedComments} */\n const extractedComments = [];\n\n // @ts-ignore\n uglifyJsOptions.output.comments = buildComments(uglifyJsOptions, extractedComments);\n const [[filename, code]] = Object.entries(input);\n const result = await minify({\n [filename]: code\n }, uglifyJsOptions);\n return {\n code: result.code,\n // eslint-disable-next-line no-undefined\n map: result.map ? JSON.parse(result.map) : undefined,\n errors: result.error ? [result.error] : [],\n warnings: result.warnings || [],\n extractedComments\n };\n}\n\n/**\n * @returns {string | undefined}\n */\nuglifyJsMinify.getMinimizerVersion = () => {\n let packageJson;\n try {\n // eslint-disable-next-line global-require, import/no-extraneous-dependencies\n packageJson = __webpack_require__(/*! uglify-js/package.json */ \"?4edc\");\n } catch (error) {\n // Ignore\n }\n return packageJson && packageJson.version;\n};\n\n/* istanbul ignore next */\n/**\n * @param {Input} input\n * @param {SourceMapInput | undefined} sourceMap\n * @param {PredefinedOptions & CustomOptions} minimizerOptions\n * @return {Promise<MinimizedResult>}\n */\nasync function swcMinify(input, sourceMap, minimizerOptions) {\n /**\n * @param {PredefinedOptions & import(\"@swc/core\").JsMinifyOptions} [swcOptions={}]\n * @returns {import(\"@swc/core\").JsMinifyOptions & { sourceMap: undefined } & { compress: import(\"@swc/core\").TerserCompressOptions }}\n */\n const buildSwcOptions = (swcOptions = {}) => {\n // Need deep copy objects to avoid https://github.com/terser/terser/issues/366\n return {\n ...swcOptions,\n compress: typeof swcOptions.compress === \"boolean\" ? swcOptions.compress ? {} : false : {\n ...swcOptions.compress\n },\n mangle: swcOptions.mangle == null ? true : typeof swcOptions.mangle === \"boolean\" ? swcOptions.mangle : {\n ...swcOptions.mangle\n },\n // ecma: swcOptions.ecma,\n // keep_classnames: swcOptions.keep_classnames,\n // keep_fnames: swcOptions.keep_fnames,\n // module: swcOptions.module,\n // safari10: swcOptions.safari10,\n // toplevel: swcOptions.toplevel\n // eslint-disable-next-line no-undefined\n sourceMap: undefined\n };\n };\n\n // eslint-disable-next-line import/no-extraneous-dependencies, global-require\n const swc = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module '@swc/core'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n // Copy `swc` options\n const swcOptions = buildSwcOptions(minimizerOptions);\n\n // Let `swc` generate a SourceMap\n if (sourceMap) {\n // @ts-ignore\n swcOptions.sourceMap = true;\n }\n if (swcOptions.compress) {\n // More optimizations\n if (typeof swcOptions.compress.ecma === \"undefined\") {\n swcOptions.compress.ecma = swcOptions.ecma;\n }\n\n // https://github.com/webpack/webpack/issues/16135\n if (swcOptions.ecma === 5 && typeof swcOptions.compress.arrows === \"undefined\") {\n swcOptions.compress.arrows = false;\n }\n }\n const [[filename, code]] = Object.entries(input);\n const result = await swc.minify(code, swcOptions);\n let map;\n if (result.map) {\n map = JSON.parse(result.map);\n\n // TODO workaround for swc because `filename` is not preset as in `swc` signature as for `terser`\n map.sources = [filename];\n delete map.sourcesContent;\n }\n return {\n code: result.code,\n map\n };\n}\n\n/**\n * @returns {string | undefined}\n */\nswcMinify.getMinimizerVersion = () => {\n let packageJson;\n try {\n // eslint-disable-next-line global-require, import/no-extraneous-dependencies\n packageJson = __webpack_require__(/*! @swc/core/package.json */ \"./node_modules/@swc/core/package.json\");\n } catch (error) {\n // Ignore\n }\n return packageJson && packageJson.version;\n};\n\n/* istanbul ignore next */\n/**\n * @param {Input} input\n * @param {SourceMapInput | undefined} sourceMap\n * @param {PredefinedOptions & CustomOptions} minimizerOptions\n * @return {Promise<MinimizedResult>}\n */\nasync function esbuildMinify(input, sourceMap, minimizerOptions) {\n /**\n * @param {PredefinedOptions & import(\"esbuild\").TransformOptions} [esbuildOptions={}]\n * @returns {import(\"esbuild\").TransformOptions}\n */\n const buildEsbuildOptions = (esbuildOptions = {}) => {\n // eslint-disable-next-line no-param-reassign\n delete esbuildOptions.ecma;\n if (esbuildOptions.module) {\n // eslint-disable-next-line no-param-reassign\n esbuildOptions.format = \"esm\";\n }\n\n // eslint-disable-next-line no-param-reassign\n delete esbuildOptions.module;\n\n // Need deep copy objects to avoid https://github.com/terser/terser/issues/366\n return {\n minify: true,\n legalComments: \"inline\",\n ...esbuildOptions,\n sourcemap: false\n };\n };\n\n // eslint-disable-next-line import/no-extraneous-dependencies, global-require\n const esbuild = __webpack_require__(Object(function webpackMissingModule() { var e = new Error(\"Cannot find module 'esbuild'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n\n // Copy `esbuild` options\n const esbuildOptions = buildEsbuildOptions(minimizerOptions);\n\n // Let `esbuild` generate a SourceMap\n if (sourceMap) {\n esbuildOptions.sourcemap = true;\n esbuildOptions.sourcesContent = false;\n }\n const [[filename, code]] = Object.entries(input);\n esbuildOptions.sourcefile = filename;\n const result = await esbuild.transform(code, esbuildOptions);\n return {\n code: result.code,\n // eslint-disable-next-line no-undefined\n map: result.map ? JSON.parse(result.map) : undefined,\n warnings: result.warnings.length > 0 ? result.warnings.map(item => {\n const plugin = item.pluginName ? `\\nPlugin Name: ${item.pluginName}` : \"\";\n const location = item.location ? `\\n\\n${item.location.file}:${item.location.line}:${item.location.column}:\\n ${item.location.line} | ${item.location.lineText}\\n\\nSuggestion: ${item.location.suggestion}` : \"\";\n const notes = item.notes.length > 0 ? `\\n\\nNotes:\\n${item.notes.map(note => `${note.location ? `[${note.location.file}:${note.location.line}:${note.location.column}] ` : \"\"}${note.text}${note.location ? `\\nSuggestion: ${note.location.suggestion}` : \"\"}${note.location ? `\\nLine text:\\n${note.location.lineText}\\n` : \"\"}`).join(\"\\n\")}` : \"\";\n return `${item.text} [${item.id}]${plugin}${location}${item.detail ? `\\nDetails:\\n${item.detail}` : \"\"}${notes}`;\n }) : []\n };\n}\n\n/**\n * @returns {string | undefined}\n */\nesbuildMinify.getMinimizerVersion = () => {\n let packageJson;\n try {\n // eslint-disable-next-line global-require, import/no-extraneous-dependencies\n packageJson = __webpack_require__(/*! esbuild/package.json */ \"../../../node_modules/esbuild/package.json\");\n } catch (error) {\n // Ignore\n }\n return packageJson && packageJson.version;\n};\n\n/**\n * @template T\n * @param fn {(function(): any) | undefined}\n * @returns {function(): T}\n */\nfunction memoize(fn) {\n let cache = false;\n /** @type {T} */\n let result;\n return () => {\n if (cache) {\n return result;\n }\n result = /** @type {function(): any} */fn();\n cache = true;\n // Allow to clean up memory for fn\n // and all dependent resources\n // eslint-disable-next-line no-undefined, no-param-reassign\n fn = undefined;\n return result;\n };\n}\nmodule.exports = {\n throttleAll,\n memoize,\n terserMinify,\n uglifyJsMinify,\n swcMinify,\n esbuildMinify\n};\n\n//# sourceURL=webpack://waygomaps/./node_modules/terser-webpack-plugin/dist/utils.js?");
|
|
2887
2887
|
|
|
2888
2888
|
/***/ }),
|
|
2889
2889
|
|
|
@@ -11631,16 +11631,6 @@ eval("/* (ignored) */\n\n//# sourceURL=webpack://waygomaps/./util.inspect_(ignor
|
|
|
11631
11631
|
|
|
11632
11632
|
/***/ }),
|
|
11633
11633
|
|
|
11634
|
-
/***/ "?38be":
|
|
11635
|
-
/*!**************************************!*\
|
|
11636
|
-
!*** esbuild/package.json (ignored) ***!
|
|
11637
|
-
\**************************************/
|
|
11638
|
-
/***/ (() => {
|
|
11639
|
-
|
|
11640
|
-
eval("/* (ignored) */\n\n//# sourceURL=webpack://waygomaps/esbuild/package.json_(ignored)?");
|
|
11641
|
-
|
|
11642
|
-
/***/ }),
|
|
11643
|
-
|
|
11644
11634
|
/***/ "?fc3b":
|
|
11645
11635
|
/*!********************!*\
|
|
11646
11636
|
!*** os (ignored) ***!
|
|
@@ -12837,6 +12827,17 @@ eval("module.exports = /*#__PURE__*/JSON.parse('{\"definitions\":{\"Consumes\":{
|
|
|
12837
12827
|
"use strict";
|
|
12838
12828
|
eval("module.exports = /*#__PURE__*/JSON.parse('{\"definitions\":{\"Provides\":{\"description\":\"Modules that should be provided as shared modules to the share scope. When provided, property name is used to match modules, otherwise this is automatically inferred from share key.\",\"anyOf\":[{\"type\":\"array\",\"items\":{\"description\":\"Modules that should be provided as shared modules to the share scope.\",\"anyOf\":[{\"$ref\":\"#/definitions/ProvidesItem\"},{\"$ref\":\"#/definitions/ProvidesObject\"}]}},{\"$ref\":\"#/definitions/ProvidesObject\"}]},\"ProvidesConfig\":{\"description\":\"Advanced configuration for modules that should be provided as shared modules to the share scope.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"eager\":{\"description\":\"Include the provided module directly instead behind an async request. This allows to use this shared module in initial load too. All possible shared modules need to be eager too.\",\"type\":\"boolean\"},\"shareKey\":{\"description\":\"Key in the share scope under which the shared modules should be stored.\",\"type\":\"string\",\"minLength\":1},\"shareScope\":{\"description\":\"Share scope name.\",\"type\":\"string\",\"minLength\":1},\"version\":{\"description\":\"Version of the provided module. Will replace lower matching versions, but not higher.\",\"anyOf\":[{\"description\":\"Don\\'t provide a version.\",\"enum\":[false]},{\"description\":\"Version as string. Each part of the version should be separated by a dot \\'.\\'.\",\"type\":\"string\"}]}}},\"ProvidesItem\":{\"description\":\"Request to a module that should be provided as shared module to the share scope (will be resolved when relative).\",\"type\":\"string\",\"minLength\":1},\"ProvidesObject\":{\"description\":\"Modules that should be provided as shared modules to the share scope. Property names are used as share keys.\",\"type\":\"object\",\"additionalProperties\":{\"description\":\"Modules that should be provided as shared modules to the share scope.\",\"anyOf\":[{\"$ref\":\"#/definitions/ProvidesConfig\"},{\"$ref\":\"#/definitions/ProvidesItem\"}]}}},\"title\":\"ProvideSharedPluginOptions\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"provides\":{\"$ref\":\"#/definitions/Provides\"},\"shareScope\":{\"description\":\"Share scope name used for all provided modules (defaults to \\'default\\').\",\"type\":\"string\",\"minLength\":1}},\"required\":[\"provides\"]}');\n\n//# sourceURL=webpack://waygomaps/./node_modules/webpack/schemas/plugins/sharing/ProvideSharedPlugin.json?");
|
|
12839
12829
|
|
|
12830
|
+
/***/ }),
|
|
12831
|
+
|
|
12832
|
+
/***/ "../../../node_modules/esbuild/package.json":
|
|
12833
|
+
/*!**************************************************!*\
|
|
12834
|
+
!*** ../../../node_modules/esbuild/package.json ***!
|
|
12835
|
+
\**************************************************/
|
|
12836
|
+
/***/ ((module) => {
|
|
12837
|
+
|
|
12838
|
+
"use strict";
|
|
12839
|
+
eval("module.exports = /*#__PURE__*/JSON.parse('{\"name\":\"esbuild\",\"version\":\"0.25.5\",\"description\":\"An extremely fast JavaScript and CSS bundler and minifier.\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/evanw/esbuild.git\"},\"scripts\":{\"postinstall\":\"node install.js\"},\"main\":\"lib/main.js\",\"types\":\"lib/main.d.ts\",\"engines\":{\"node\":\">=18\"},\"bin\":{\"esbuild\":\"bin/esbuild\"},\"optionalDependencies\":{\"@esbuild/aix-ppc64\":\"0.25.5\",\"@esbuild/android-arm\":\"0.25.5\",\"@esbuild/android-arm64\":\"0.25.5\",\"@esbuild/android-x64\":\"0.25.5\",\"@esbuild/darwin-arm64\":\"0.25.5\",\"@esbuild/darwin-x64\":\"0.25.5\",\"@esbuild/freebsd-arm64\":\"0.25.5\",\"@esbuild/freebsd-x64\":\"0.25.5\",\"@esbuild/linux-arm\":\"0.25.5\",\"@esbuild/linux-arm64\":\"0.25.5\",\"@esbuild/linux-ia32\":\"0.25.5\",\"@esbuild/linux-loong64\":\"0.25.5\",\"@esbuild/linux-mips64el\":\"0.25.5\",\"@esbuild/linux-ppc64\":\"0.25.5\",\"@esbuild/linux-riscv64\":\"0.25.5\",\"@esbuild/linux-s390x\":\"0.25.5\",\"@esbuild/linux-x64\":\"0.25.5\",\"@esbuild/netbsd-arm64\":\"0.25.5\",\"@esbuild/netbsd-x64\":\"0.25.5\",\"@esbuild/openbsd-arm64\":\"0.25.5\",\"@esbuild/openbsd-x64\":\"0.25.5\",\"@esbuild/sunos-x64\":\"0.25.5\",\"@esbuild/win32-arm64\":\"0.25.5\",\"@esbuild/win32-ia32\":\"0.25.5\",\"@esbuild/win32-x64\":\"0.25.5\"},\"license\":\"MIT\"}');\n\n//# sourceURL=webpack://waygomaps/../../../node_modules/esbuild/package.json?");
|
|
12840
|
+
|
|
12840
12841
|
/***/ })
|
|
12841
12842
|
|
|
12842
12843
|
/******/ });
|
package/dist/style.css
CHANGED
|
@@ -1473,6 +1473,8 @@
|
|
|
1473
1473
|
font-weight: 600;
|
|
1474
1474
|
font-family: "Inter", "sans-serif";
|
|
1475
1475
|
color: #1e1e1e;
|
|
1476
|
+
white-space: pre-wrap; /* Add this to preserve newlines */
|
|
1477
|
+
word-wrap: break-word; /* Allow long words to break */
|
|
1476
1478
|
}
|
|
1477
1479
|
|
|
1478
1480
|
.header-image-view {
|
|
@@ -1594,6 +1596,8 @@
|
|
|
1594
1596
|
overflow: hidden;
|
|
1595
1597
|
height: fit-content;
|
|
1596
1598
|
color: #1e1e1e;
|
|
1599
|
+
white-space: pre-wrap; /* Add this to preserve newlines */
|
|
1600
|
+
word-wrap: break-word; /* Allow long words to break */
|
|
1597
1601
|
/* margin: 0 0 5px 0; */
|
|
1598
1602
|
}
|
|
1599
1603
|
|
|
@@ -1694,6 +1698,8 @@
|
|
|
1694
1698
|
margin-top: 2px;
|
|
1695
1699
|
margin-bottom: 16px;
|
|
1696
1700
|
font-weight: 500;
|
|
1701
|
+
white-space: pre-wrap; /* Add this to preserve newlines */
|
|
1702
|
+
word-wrap: break-word; /* Allow long words to break */
|
|
1697
1703
|
}
|
|
1698
1704
|
|
|
1699
1705
|
/* .content-details-child-view-subtitle {
|
|
@@ -1716,17 +1722,18 @@
|
|
|
1716
1722
|
/* Spacing between key and value */
|
|
1717
1723
|
}
|
|
1718
1724
|
|
|
1725
|
+
/* Fix the child view data value to preserve newlines */
|
|
1719
1726
|
.content-details-child-view-data-value {
|
|
1720
1727
|
font-size: 13px;
|
|
1721
1728
|
/* color: #525252; */
|
|
1722
1729
|
color: #595C60;
|
|
1723
|
-
white-space: nowrap
|
|
1730
|
+
white-space: pre-wrap; /* Changed from nowrap to pre-wrap to preserve newlines */
|
|
1724
1731
|
overflow: hidden;
|
|
1725
1732
|
font-weight: 400;
|
|
1726
|
-
text-overflow: ellipsis
|
|
1727
|
-
/* Adds "..." if the value is too long */
|
|
1728
|
-
/* max-width: 100%; Adjust as necessary */
|
|
1733
|
+
/* Remove text-overflow: ellipsis since we want to show full content with newlines */
|
|
1729
1734
|
display: block;
|
|
1735
|
+
word-wrap: break-word; /* Allow long words to break */
|
|
1736
|
+
max-width: 100%;
|
|
1730
1737
|
}
|
|
1731
1738
|
|
|
1732
1739
|
|