UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

325 lines (266 loc) 35.4 kB
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); var _getPrototypeOf3 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); var _react = _interopRequireWildcard(require("react")); var _reactLifecyclesCompat = require("react-lifecycles-compat"); var _propTypes = _interopRequireDefault(require("prop-types")); var _classnames = _interopRequireDefault(require("classnames")); var _styledComponents = _interopRequireDefault(require("styled-components")); var _reactMapGl = _interopRequireDefault(require("react-map-gl")); var _styledComponents2 = require("../common/styled-components"); var _mediaBreakpoints = require("../../styles/media-breakpoints"); var _mapboxUtils = require("../../utils/map-style-utils/mapbox-utils"); var _reactIntl = require("react-intl"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _templateObject5() { var data = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: 500;\n\n :hover {\n cursor: pointer;\n }\n"]); _templateObject5 = function _templateObject5() { return data; }; return data; } function _templateObject4() { var data = (0, _taggedTemplateLiteral2["default"])(["\n background: ", ";\n border-radius: 4px;\n box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.18);\n width: ", "px;\n height: ", "px;\n position: relative;\n\n .preview-image-placeholder {\n position: absolute;\n top: 0;\n left: 0;\n }\n\n .preview-image-spinner {\n position: absolute;\n left: calc(50% - 25px);\n top: calc(50% - 25px);\n }\n"]); _templateObject4 = function _templateObject4() { return data; }; return data; } function _templateObject3() { var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: unset;\n .preview-title {\n margin-top: 0px;\n }\n "]); _templateObject3 = function _templateObject3() { return data; }; return data; } function _templateObject2() { var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 32px;\n "]); _templateObject2 = function _templateObject2() { return data; }; return data; } function _templateObject() { var data = (0, _taggedTemplateLiteral2["default"])(["\n align-items: center;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: 116px;\n flex-shrink: 0;\n\n .preview-title {\n font-weight: 500;\n font-size: 10px;\n padding: 8px 0px;\n }\n\n .preview-title.error {\n color: ", ";\n }\n\n ", ";\n\n ", ";\n"]); _templateObject = function _templateObject() { return data; }; return data; } var MapH = 190; var MapW = 264; var ErrorMsg = { styleError: 'Failed to load map style, make sure it is published. For private style, paste in your access token.' }; var PreviewMap = _styledComponents["default"].div(_templateObject(), function (props) { return props.theme.errorColor; }, _mediaBreakpoints.media.portable(_templateObject2()), _mediaBreakpoints.media.palm(_templateObject3())); var StyledPreviewImage = _styledComponents["default"].div(_templateObject4(), function (props) { return props.theme.modalImagePlaceHolder; }, MapW, MapH); var InlineLink = _styledComponents["default"].a(_templateObject5()); function AddMapStyleModalFactory() { var AddMapStyleModal = /*#__PURE__*/ function (_Component) { (0, _inherits2["default"])(AddMapStyleModal, _Component); function AddMapStyleModal() { var _getPrototypeOf2; var _this; (0, _classCallCheck2["default"])(this, AddMapStyleModal); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = (0, _possibleConstructorReturn2["default"])(this, (_getPrototypeOf2 = (0, _getPrototypeOf3["default"])(AddMapStyleModal)).call.apply(_getPrototypeOf2, [this].concat(args))); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "state", { reRenderKey: 0, previousToken: null }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "loadMapStyleJson", function (style) { _this.props.loadCustomMapStyle({ style: style, error: false }); }); (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "loadMapStyleError", function () { _this.props.loadCustomMapStyle({ error: true }); }); return _this; } (0, _createClass2["default"])(AddMapStyleModal, [{ key: "componentDidUpdate", value: function componentDidUpdate() { var _this2 = this; var map = this.mapRef && this.mapRef.getMap(); if (map && this._map !== map) { this._map = map; map.on('style.load', function () { var style = map.getStyle(); _this2.loadMapStyleJson(style); }); map.on('error', function () { _this2.loadMaoStyleError(); }); } } }, { key: "render", value: function render() { var _this3 = this; var _this$props = this.props, inputStyle = _this$props.inputStyle, mapState = _this$props.mapState, mapboxApiUrl = _this$props.mapboxApiUrl, intl = _this$props.intl; var mapboxApiAccessToken = inputStyle.accessToken || this.props.mapboxApiAccessToken; var mapProps = _objectSpread({}, mapState, { mapboxApiUrl: mapboxApiUrl, mapboxApiAccessToken: mapboxApiAccessToken, preserveDrawingBuffer: true, transformRequest: _mapboxUtils.transformRequest }); return _react["default"].createElement("div", { className: "add-map-style-modal" }, _react["default"].createElement(_styledComponents2.StyledModalContent, null, _react["default"].createElement(_styledComponents2.StyledModalVerticalPanel, null, _react["default"].createElement(_styledComponents2.StyledModalSection, null, _react["default"].createElement("div", { className: "modal-section-title" }, _react["default"].createElement(_reactIntl.FormattedMessage, { id: 'modal.addStyle.publishTitle' })), _react["default"].createElement("div", { className: "modal-section-subtitle" }, intl.formatMessage({ id: 'modal.addStyle.publishSubtitle1' }), _react["default"].createElement(InlineLink, { target: "_blank", href: "https://www.mapbox.com/studio/styles/" }, ' ', "mapbox"), ' ', intl.formatMessage({ id: 'modal.addStyle.publishSubtitle2' }), _react["default"].createElement(InlineLink, { target: "_blank", href: "https://www.mapbox.com/help/studio-manual-publish/" }, ' ', intl.formatMessage({ id: 'modal.addStyle.publishSubtitle3' })), ' ', intl.formatMessage({ id: 'modal.addStyle.publishSubtitle4' })), _react["default"].createElement("div", { className: "modal-section-subtitle" }, intl.formatMessage({ id: 'modal.addStyle.publishSubtitle5' }), _react["default"].createElement(InlineLink, { target: "_blank", href: "https://www.mapbox.com/help/how-access-tokens-work/" }, ' ', intl.formatMessage({ id: 'modal.addStyle.publishSubtitle6' })), ' ', intl.formatMessage({ id: 'modal.addStyle.publishSubtitle7' })), _react["default"].createElement(_styledComponents2.InputLight, { type: "text", value: inputStyle.accessToken || '', onChange: function onChange(_ref) { var value = _ref.target.value; return _this3.props.inputMapStyle({ accessToken: value }); }, placeholder: intl.formatMessage({ id: 'modal.addStyle.exampleToken' }) })), _react["default"].createElement(_styledComponents2.StyledModalSection, null, _react["default"].createElement("div", { className: "modal-section-title" }, _react["default"].createElement(_reactIntl.FormattedMessage, { id: 'modal.addStyle.pasteTitle' })), _react["default"].createElement("div", { className: "modal-section-subtitle" }, intl.formatMessage({ id: 'modal.addStyle.pasteSubtitle1' }), _react["default"].createElement(InlineLink, { target: "_blank", href: "https://www.mapbox.com/help/studio-manual-publish/#style-url" }, ' ', intl.formatMessage({ id: 'modal.addStyle.pasteSubtitle2' }))), _react["default"].createElement(_styledComponents2.InputLight, { type: "text", value: inputStyle.url || '', onChange: function onChange(_ref2) { var value = _ref2.target.value; return _this3.props.inputMapStyle({ url: value }); }, placeholder: "e.g. mapbox://styles/uberdataviz/abcdefghijklmnopq" })), _react["default"].createElement(_styledComponents2.StyledModalSection, null, _react["default"].createElement("div", { className: "modal-section-title" }, _react["default"].createElement(_reactIntl.FormattedMessage, { id: 'modal.addStyle.namingTitle' })), _react["default"].createElement(_styledComponents2.InputLight, { type: "text", value: inputStyle.label || '', onChange: function onChange(_ref3) { var value = _ref3.target.value; return _this3.props.inputMapStyle({ label: value }); } }))), _react["default"].createElement(PreviewMap, null, _react["default"].createElement("div", { className: (0, _classnames["default"])('preview-title', { error: inputStyle.error }) }, inputStyle.error ? ErrorMsg.styleError : inputStyle.style && inputStyle.style.name || ''), _react["default"].createElement(StyledPreviewImage, { className: "preview-image" }, !inputStyle.isValid ? _react["default"].createElement("div", { className: "preview-image-spinner" }) : _react["default"].createElement(_styledComponents2.StyledMapContainer, null, _react["default"].createElement(_reactMapGl["default"], (0, _extends2["default"])({}, mapProps, { ref: function ref(el) { _this3.mapRef = el; }, key: this.state.reRenderKey, width: MapW, height: MapH, mapStyle: inputStyle.url }))))))); } }], [{ key: "getDerivedStateFromProps", value: function getDerivedStateFromProps(props, state) { if (props.inputStyle && props.inputStyle.accessToken && props.inputStyle.accessToken !== state.previousToken) { // toke has changed // ReactMapGl doesn't re-create map when token has changed // here we force the map to update return { reRenderKey: state.reRenderKey + 1, previousToken: props.inputStyle.accessToken }; } return null; } }]); return AddMapStyleModal; }(_react.Component); (0, _defineProperty2["default"])(AddMapStyleModal, "propTypes", { inputMapStyle: _propTypes["default"].func.isRequired, inputStyle: _propTypes["default"].object.isRequired, loadCustomMapStyle: _propTypes["default"].func.isRequired, mapboxApiAccessToken: _propTypes["default"].string.isRequired, mapboxApiUrl: _propTypes["default"].string.isRequired, mapState: _propTypes["default"].object.isRequired }); return (0, _reactIntl.injectIntl)((0, _reactLifecyclesCompat.polyfill)(AddMapStyleModal)); } var _default = AddMapStyleModalFactory; exports["default"] = _default; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL21vZGFscy9hZGQtbWFwLXN0eWxlLW1vZGFsLmpzIl0sIm5hbWVzIjpbIk1hcEgiLCJNYXBXIiwiRXJyb3JNc2ciLCJzdHlsZUVycm9yIiwiUHJldmlld01hcCIsInN0eWxlZCIsImRpdiIsInByb3BzIiwidGhlbWUiLCJlcnJvckNvbG9yIiwibWVkaWEiLCJwb3J0YWJsZSIsInBhbG0iLCJTdHlsZWRQcmV2aWV3SW1hZ2UiLCJtb2RhbEltYWdlUGxhY2VIb2xkZXIiLCJJbmxpbmVMaW5rIiwiYSIsIkFkZE1hcFN0eWxlTW9kYWxGYWN0b3J5IiwiQWRkTWFwU3R5bGVNb2RhbCIsInJlUmVuZGVyS2V5IiwicHJldmlvdXNUb2tlbiIsInN0eWxlIiwibG9hZEN1c3RvbU1hcFN0eWxlIiwiZXJyb3IiLCJtYXAiLCJtYXBSZWYiLCJnZXRNYXAiLCJfbWFwIiwib24iLCJnZXRTdHlsZSIsImxvYWRNYXBTdHlsZUpzb24iLCJsb2FkTWFvU3R5bGVFcnJvciIsImlucHV0U3R5bGUiLCJtYXBTdGF0ZSIsIm1hcGJveEFwaVVybCIsImludGwiLCJtYXBib3hBcGlBY2Nlc3NUb2tlbiIsImFjY2Vzc1Rva2VuIiwibWFwUHJvcHMiLCJwcmVzZXJ2ZURyYXdpbmdCdWZmZXIiLCJ0cmFuc2Zvcm1SZXF1ZXN0IiwiZm9ybWF0TWVzc2FnZSIsImlkIiwidmFsdWUiLCJ0YXJnZXQiLCJpbnB1dE1hcFN0eWxlIiwidXJsIiwibGFiZWwiLCJuYW1lIiwiaXNWYWxpZCIsImVsIiwic3RhdGUiLCJDb21wb25lbnQiLCJQcm9wVHlwZXMiLCJmdW5jIiwia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JodHRwczovL3d3dy5tYXBib3guY29tL3N0dWRpby9zdHlsZXMvXCI+XG4gICAgICAgICAgICAgICAgICAgIHsnICd9XG4gICAgICAgICAgICAgICAgICAgIG1hcGJveFxuICAgICAgICAgICAgICAgICAgPC9JbmxpbmVMaW5rPnsnICd9XG4gICAgICAgICAgICAgICAgICB7aW50bC5mb3JtYXRNZXNzYWdlKHtpZDogJ21vZGFsLmFkZFN0eWxlLnB1Ymxpc2hTdWJ0aXRsZTInfSl9XG4gICAgICAgICAgICAgICAgICA8SW5saW5lTGlua1xuICAgICAgICAgICAgICAgICAgICB0YXJnZXQ9XCJfYmxhbmtcIlxuICAgICAgICAgICAgICAgICAgICBocmVmPVwiaHR0cHM6Ly93d3cubWFwYm94LmNvbS9oZWxwL3N0dWRpby1tYW51YWwtcHVibGlzaC9cIlxuICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICB7JyAnfVxuICAgICAgICAgICAgICAgICAgICB7aW50bC5mb3JtYXRNZXNzYWdlKHtpZDogJ21vZGFsLmFkZFN0eWxlLnB1Ymxpc2hTdWJ0aXRsZTMnfSl9XG4gICAgICAgICAgICAgICAgICA8L0lubGluZUxpbms+eycgJ31cbiAgICAgICAgICAgICAgICAgIHtpbnRsLmZvcm1hdE1lc3NhZ2Uoe2lkOiAnbW9kYWwuYWRkU3R5bGUucHVibGlzaFN1YnRpdGxlNCd9KX1cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cIm1vZGFsLXNlY3Rpb24tc3VidGl0bGVcIj5cbiAgICAgICAgICAgICAgICAgIHtpbnRsLmZvcm1hdE1lc3NhZ2Uoe2lkOiAnbW9kYWwuYWRkU3R5bGUucHVibGlzaFN1YnRpdGxlNSd9KX1cbiAgICAgICAgICAgICAgICAgIDxJbmxpbmVMaW5rXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldD1cIl9ibGFua1wiXG4gICAgICAgICAgICAgICAgICAgIGhyZWY9XCJodHRwczovL3d3dy5tYXBib3guY29tL2hlbHAvaG93LWFjY2Vzcy10b2tlbnMtd29yay9cIlxuICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICB7JyAnfVxuICAgICAgICAgICAgICAgICAgICB7aW50bC5mb3JtYXRNZXNzYWdlKHtpZDogJ21vZGFsLmFkZFN0eWxlLnB1Ymxpc2hTdWJ0aXRsZTYnfSl9XG4gICAgICAgICAgICAgICAgICA8L0lubGluZUxpbms+eycgJ31cbiAgICAgICAgICAgICAgICAgIHtpbnRsLmZvcm1hdE1lc3NhZ2Uoe2lkOiAnbW9kYWwuYWRkU3R5bGUucHVibGlzaFN1YnRpdGxlNyd9KX1cbiAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICA8SW5wdXRMaWdodFxuICAgICAgICAgICAgICAgICAgdHlwZT1cInRleHRcIlxuICAgICAgICAgICAgICAgICAgdmFsdWU9e2lucHV0U3R5bGUuYWNjZXNzVG9rZW4gfHwgJyd9XG4gICAgICAgICAgICAgICAgICBvbkNoYW5nZT17KHt0YXJnZXQ6IHt2YWx1ZX19KSA9PiB0aGlzLnByb3BzLmlucHV0TWFwU3R5bGUoe2FjY2Vzc1Rva2VuOiB2YWx1ZX0pfVxuICAgICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI9e2ludGwuZm9ybWF0TWVzc2FnZSh7aWQ6ICdtb2RhbC5hZGRTdHlsZS5leGFtcGxlVG9rZW4nfSl9XG4gICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgPC9TdHlsZWRNb2RhbFNlY3Rpb24+XG4gICAgICAgICAgICAgIDxTdHlsZWRNb2RhbFNlY3Rpb24+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJtb2RhbC1zZWN0aW9uLXRpdGxlXCI+XG4gICAgICAgICAgICAgICAgICA8Rm9ybWF0dGVkTWVzc2FnZSBpZD17J21vZGFsLmFkZFN0eWxlLnBhc3RlVGl0bGUnfSAvPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwibW9kYWwtc2VjdGlvbi1zdWJ0aXRsZVwiPlxuICAgICAgICAgICAgICAgICAge2ludGwuZm9ybWF0TWVzc2FnZSh7aWQ6ICdtb2RhbC5hZGRTdHlsZS5wYXN0ZVN1YnRpdGxlMSd9KX1cbiAgICAgICAgICAgICAgICAgIDxJbmxpbmVMaW5rXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldD1cIl9ibGFua1wiXG4gICAgICAgICAgICAgICAgICAgIGhyZWY9XCJodHRwczovL3d3dy5tYXBib3guY29tL2hlbHAvc3R1ZGlvLW1hbnVhbC1wdWJsaXNoLyNzdHlsZS11cmxcIlxuICAgICAgICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgICAgICB7JyAnfVxuICAgICAgICAgICAgICAgICAgICB7aW50bC5mb3JtYXRNZXNzYWdlKHtpZDogJ21vZGFsLmFkZFN0eWxlLnBhc3RlU3VidGl0bGUyJ30pfVxuICAgICAgICAgICAgICAgICAgPC9JbmxpbmVMaW5rPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDxJbnB1dExpZ2h0XG4gICAgICAgICAgICAgICAgICB0eXBlPVwidGV4dFwiXG4gICAgICAgICAgICAgICAgICB2YWx1ZT17aW5wdXRTdHlsZS51cmwgfHwgJyd9XG4gICAgICAgICAgICAgICAgICBvbkNoYW5nZT17KHt0YXJnZXQ6IHt2YWx1ZX19KSA9PiB0aGlzLnByb3BzLmlucHV0TWFwU3R5bGUoe3VybDogdmFsdWV9KX1cbiAgICAgICAgICAgICAgICAgIHBsYWNlaG9sZGVyPVwiZS5nLiBtYXBib3g6Ly9zdHlsZXMvdWJlcmRhdGF2aXovYWJjZGVmZ2hpamtsbW5vcHFcIlxuICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgIDwvU3R5bGVkTW9kYWxTZWN0aW9uPlxuICAgICAgICAgICAgICA8U3R5bGVkTW9kYWxTZWN0aW9uPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwibW9kYWwtc2VjdGlvbi10aXRsZVwiPlxuICAgICAgICAgICAgICAgICAgPEZvcm1hdHRlZE1lc3NhZ2UgaWQ9eydtb2RhbC5hZGRTdHlsZS5uYW1pbmdUaXRsZSd9IC8+XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgPElucHV0TGlnaHRcbiAgICAgICAgICAgICAgICAgIHR5cGU9XCJ0ZXh0XCJcbiAgICAgICAgICAgICAgICAgIHZhbHVlPXtpbnB1dFN0eWxlLmxhYmVsIHx8ICcnfVxuICAgICAgICAgICAgICAgICAgb25DaGFuZ2U9eyh7dGFyZ2V0OiB7dmFsdWV9fSkgPT4gdGhpcy5wcm9wcy5pbnB1dE1hcFN0eWxlKHtsYWJlbDogdmFsdWV9KX1cbiAgICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgICA8L1N0eWxlZE1vZGFsU2VjdGlvbj5cbiAgICAgICAgICAgIDwvU3R5bGVkTW9kYWxWZXJ0aWNhbFBhbmVsPlxuICAgICAgICAgICAgPFByZXZpZXdNYXA+XG4gICAgICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgICAgICBjbGFzc05hbWU9e2NsYXNzbmFtZXMoJ3ByZXZpZXctdGl0bGUnLCB7XG4gICAgICAgICAgICAgICAgICBlcnJvcjogaW5wdXRTdHlsZS5lcnJvclxuICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAge2lucHV0U3R5bGUuZXJyb3JcbiAgICAgICAgICAgICAgICAgID8gRXJyb3JNc2cuc3R5bGVFcnJvclxuICAgICAgICAgICAgICAgICAgOiAoaW5wdXRTdHlsZS5zdHlsZSAmJiBpbnB1dFN0eWxlLnN0eWxlLm5hbWUpIHx8ICcnfVxuICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgPFN0eWxlZFByZXZpZXdJbWFnZSBjbGFzc05hbWU9XCJwcmV2aWV3LWltYWdlXCI+XG4gICAgICAgICAgICAgICAgeyFpbnB1dFN0eWxlLmlzVmFsaWQgPyAoXG4gICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cInByZXZpZXctaW1hZ2Utc3Bpbm5lclwiIC8+XG4gICAgICAgICAgICAgICAgKSA6IChcbiAgICAgICAgICAgICAgICAgIDxTdHlsZWRNYXBDb250YWluZXI+XG4gICAgICAgICAgICAgICAgICAgIDxNYXBib3hHTE1hcFxuICAgICAgICAgICAgICAgICAgICAgIHsuLi5tYXBQcm9wc31cbiAgICAgICAgICAgICAgICAgICAgICByZWY9e2VsID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubWFwUmVmID0gZWw7XG4gICAgICAgICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgICAgICAgICBrZXk9e3RoaXMuc3RhdGUucmVSZW5kZXJLZXl9XG4gICAgICAgICAgICAgICAgICAgICAgd2lkdGg9e01hcFd9XG4gICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0PXtNYXBIfVxuICAgICAgICAgICAgICAgICAgICAgIG1hcFN0eWxlPXtpbnB1dFN0eWxlLnVybH1cbiAgICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICAgIDwvU3R5bGVkTWFwQ29udGFpbmVyPlxuICAgICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgIDwvU3R5bGVkUHJldmlld0ltYWdlPlxuICAgICAgICAgICAgPC9QcmV2aWV3TWFwPlxuICAgICAgICAgIDwvU3R5bGVkTW9kYWxDb250ZW50PlxuICAgICAgICA8L2Rpdj5cbiAgICAgICk7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIGluamVjdEludGwocG9seWZpbGwoQWRkTWFwU3R5bGVNb2RhbCkpO1xufVxuXG5leHBvcnQgZGVmYXVsdCBBZGRNYXBTdHlsZU1vZGFsRmFjdG9yeTtcbiJdfQ==