UNPKG

kepler.gl

Version:

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

435 lines (432 loc) 74.5 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _typeof = require("@babel/runtime/helpers/typeof"); Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = ModalContainerFactory; 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 _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); 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 _styledComponents = require("styled-components"); var _lodash = _interopRequireDefault(require("lodash.get")); var _document = _interopRequireDefault(require("global/document")); var _constants = require("@kepler.gl/constants"); var _reducers = require("@kepler.gl/reducers"); var _utils = require("@kepler.gl/utils"); var _modalDialog = _interopRequireDefault(require("./modals/modal-dialog")); var _deleteDataModal = _interopRequireDefault(require("./modals/delete-data-modal")); var _overwriteMapModal = _interopRequireDefault(require("./modals/overwrite-map-modal")); var _dataTableModal = _interopRequireDefault(require("./modals/data-table-modal")); var _loadDataModal = _interopRequireDefault(require("./modals/load-data-modal")); var _exportImageModal = _interopRequireDefault(require("./modals/export-image-modal")); var _exportDataModal = _interopRequireDefault(require("./modals/export-data-modal")); var _exportMapModal = _interopRequireDefault(require("./modals/export-map-modal/export-map-modal")); var _addMapStyleModal = _interopRequireDefault(require("./modals/add-map-style-modal")); var _saveMapModal = _interopRequireDefault(require("./modals/save-map-modal")); var _shareMapModal = _interopRequireDefault(require("./modals/share-map-modal")); var _styles = require("@kepler.gl/styles"); var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8; // SPDX-License-Identifier: MIT // Copyright contributors to the kepler.gl project // modals // Breakpoints // Template function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } var DataTableModalStyle = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n top: 70px;\n padding: 0;\n width: 90vw;\n max-width: 90vw;\n\n ", " ", ";\n"])), _styles.media.portable(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0;\n "]))), _styles.media.palm(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0;\n margin: 0 auto;\n "])))); var smallModalCss = (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: 40%;\n padding: 40px 40px 32px 40px;\n"]))); var LoadDataModalStyle = (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n top: 60px;\n"]))); var DefaultStyle = (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n max-width: 960px;\n"]))); ModalContainerFactory.deps = [_deleteDataModal["default"], _overwriteMapModal["default"], _dataTableModal["default"], _loadDataModal["default"], _exportImageModal["default"], _exportDataModal["default"], _exportMapModal["default"], _addMapStyleModal["default"], _modalDialog["default"], _saveMapModal["default"], _shareMapModal["default"]]; function ModalContainerFactory(DeleteDatasetModal, OverWriteMapModal, DataTableModal, LoadDataModal, ExportImageModal, ExportDataModal, ExportMapModal, AddMapStyleModal, ModalDialog, SaveMapModal, ShareMapModal) { /** @augments React.Component<ModalContainerProps> */ var ModalContainer = /*#__PURE__*/function (_Component) { function ModalContainer() { var _this; (0, _classCallCheck2["default"])(this, ModalContainer); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _callSuper(this, ModalContainer, [].concat(args)); // TODO - remove when prop types are fully exported (0, _defineProperty2["default"])(_this, "componentDidMount", function () { _document["default"].addEventListener('keyup', _this._onKeyUp); }); (0, _defineProperty2["default"])(_this, "_onKeyUp", function (event) { var keyCode = event.keyCode; if (keyCode === _constants.KeyEvent.DOM_VK_ESCAPE) { _this._closeModal(); } }); (0, _defineProperty2["default"])(_this, "_closeModal", function () { _this.props.uiStateActions.toggleModal(null); }); (0, _defineProperty2["default"])(_this, "_deleteDataset", function (key) { _this.props.visStateActions.removeDataset(key); _this._closeModal(); }); (0, _defineProperty2["default"])(_this, "_onAddCustomMapStyle", function () { _this.props.mapStyleActions.addCustomMapStyle(); _this._closeModal(); }); (0, _defineProperty2["default"])(_this, "_onFileUpload", function (fileList) { _this.props.visStateActions.loadFiles(fileList); }); (0, _defineProperty2["default"])(_this, "_onTilesetAdded", function (tileset, processedMetadata) { _this.props.visStateActions.updateVisData({ info: { label: tileset.name, type: tileset.type, format: 'rows' }, data: { fields: (processedMetadata === null || processedMetadata === void 0 ? void 0 : processedMetadata.fields) || [], rows: [] }, metadata: _objectSpread(_objectSpread({}, processedMetadata), tileset.metadata), // vector tile layer only supports gpu filtering for now supportedFilterTypes: [_constants.ALL_FIELD_TYPES.real, _constants.ALL_FIELD_TYPES.integer], disableDataOperation: true }, { autoCreateLayers: true, centerMap: true }); _this._closeModal(); }); (0, _defineProperty2["default"])(_this, "_onExportImage", function () { if (!_this.props.uiState.exportImage.processing) { (0, _utils.exportImage)(_this.props.uiState.exportImage, "".concat(_this.props.appName, ".png")); _this.props.uiStateActions.cleanupExportImage(); _this._closeModal(); } }); (0, _defineProperty2["default"])(_this, "_onExportData", function () { (0, _reducers.exportData)(_this.props, _this.props.uiState.exportData); _this._closeModal(); }); (0, _defineProperty2["default"])(_this, "_onExportMap", function () { var uiState = _this.props.uiState; var format = uiState.exportMap.format; (format === _constants.EXPORT_MAP_FORMATS.HTML ? _utils.exportHtml : _utils.exportJson)(_this.props, _this.props.uiState.exportMap[format] || {}); _this._closeModal(); }); (0, _defineProperty2["default"])(_this, "_exportFileToCloud", function (_ref) { var provider = _ref.provider, isPublic = _ref.isPublic, overwrite = _ref.overwrite, closeModal = _ref.closeModal; var toSave = (0, _utils.exportMap)(_this.props); _this.props.providerActions.exportFileToCloud({ mapData: toSave, provider: provider, options: { isPublic: isPublic, overwrite: overwrite, mapIdToOverwrite: _this.props.providerState.savedMapId }, closeModal: closeModal, onSuccess: _this.props.onExportToCloudSuccess, onError: _this.props.onExportToCloudError }); }); (0, _defineProperty2["default"])(_this, "_onSaveMap", function (provider) { var overwrite = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; _this._exportFileToCloud({ provider: provider, isPublic: false, overwrite: overwrite, closeModal: true }); }); (0, _defineProperty2["default"])(_this, "_onOverwriteMap", function (provider) { _this._onSaveMap(provider, true); }); (0, _defineProperty2["default"])(_this, "_onShareMapUrl", function (provider) { _this._exportFileToCloud({ provider: provider, isPublic: true, overwrite: false, closeModal: false }); }); (0, _defineProperty2["default"])(_this, "_onCloseSaveMap", function () { _this.props.providerActions.resetProviderStatus(); _this._closeModal(); }); (0, _defineProperty2["default"])(_this, "_onLoadCloudMap", function (payload) { _this.props.providerActions.loadCloudMap(_objectSpread(_objectSpread({}, payload), {}, { onSuccess: _this.props.onLoadCloudMapSuccess, onError: _this.props.onLoadCloudMapError })); }); return _this; } (0, _inherits2["default"])(ModalContainer, _Component); return (0, _createClass2["default"])(ModalContainer, [{ key: "componentWillUnmount", value: function componentWillUnmount() { _document["default"].removeEventListener('keyup', this._onKeyUp); } }, { key: "render", value: /* eslint-disable complexity */ function render() { var _this2 = this; var _this$props = this.props, containerW = _this$props.containerW, containerH = _this$props.containerH, mapStyle = _this$props.mapStyle, mapState = _this$props.mapState, uiState = _this$props.uiState, visState = _this$props.visState, rootNode = _this$props.rootNode, visStateActions = _this$props.visStateActions, uiStateActions = _this$props.uiStateActions, providerState = _this$props.providerState; var currentModal = uiState.currentModal, datasetKeyToRemove = uiState.datasetKeyToRemove; var datasets = visState.datasets, layers = visState.layers, editingDataset = visState.editingDataset; var template = null; var modalProps = {}; // TODO - currentModal is a string // @ts-ignore if (currentModal && currentModal.id && currentModal.template) { // if currentMdoal template is already provided // TODO: need to check whether template is valid // @ts-ignore template = /*#__PURE__*/_react["default"].createElement(currentModal.template, null); // @ts-ignore modalProps = currentModal.modalProps; } else { switch (currentModal) { case _constants.DATA_TABLE_ID: { var width = containerW * 0.9; template = /*#__PURE__*/_react["default"].createElement(DataTableModal, { datasets: datasets, dataId: editingDataset, showDatasetTable: visStateActions.showDatasetTable, sortTableColumn: visStateActions.sortTableColumn, pinTableColumn: visStateActions.pinTableColumn, copyTableColumn: visStateActions.copyTableColumn, setColumnDisplayFormat: visStateActions.setColumnDisplayFormat, uiStateActions: uiStateActions, uiState: uiState }); // TODO: we need to make this width consistent with the css rule defined modal.js:32 max-width: 70vw // @ts-ignore // TODO fix this after add types to Theme modalProps.cssStyle = (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n ", ";\n "])), DataTableModalStyle, _styles.media.palm(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", "px;\n "])), width)); break; } case _constants.DELETE_DATA_ID: { // validate options if (datasetKeyToRemove && datasets && datasets[datasetKeyToRemove]) { template = /*#__PURE__*/_react["default"].createElement(DeleteDatasetModal, { dataset: datasets[datasetKeyToRemove], layers: layers }); modalProps = { title: 'modal.title.deleteDataset', cssStyle: smallModalCss, footer: true, onConfirm: function onConfirm() { return _this2._deleteDataset(datasetKeyToRemove); }, onCancel: this._closeModal, confirmButton: { negative: true, large: true, children: 'modal.button.delete' } }; } break; // in case we add a new case after this one } case _constants.ADD_DATA_ID: template = /*#__PURE__*/_react["default"].createElement(LoadDataModal, (0, _extends2["default"])({}, providerState, { onClose: this._closeModal, onFileUpload: this._onFileUpload, onTilesetAdded: this._onTilesetAdded, onLoadCloudMap: this._onLoadCloudMap, loadFiles: uiState.loadFiles, fileLoading: visState.fileLoading, fileLoadingProgress: visState.fileLoadingProgress, fileFormatNames: (0, _reducers.getFileFormatNames)(this.props.visState), fileExtensions: (0, _reducers.getFileExtensions)(this.props.visState) })); modalProps = { title: 'modal.title.addDataToMap', cssStyle: LoadDataModalStyle, footer: false, onConfirm: this._closeModal }; break; case _constants.EXPORT_IMAGE_ID: template = /*#__PURE__*/_react["default"].createElement(ExportImageModal, { exportImage: uiState.exportImage, mapW: containerW, mapH: containerH, onUpdateImageSetting: uiStateActions.setExportImageSetting, cleanupExportImage: uiStateActions.cleanupExportImage }); modalProps = { title: 'modal.title.exportImage', cssStyle: '', footer: true, onCancel: this._closeModal, onConfirm: this._onExportImage, confirmButton: { large: true, disabled: uiState.exportImage.processing, children: 'modal.button.download' } }; break; case _constants.EXPORT_DATA_ID: template = /*#__PURE__*/_react["default"].createElement(ExportDataModal, (0, _extends2["default"])({}, uiState.exportData, { supportedDataTypes: _constants.EXPORT_DATA_TYPE_OPTIONS, datasets: datasets, applyCPUFilter: this.props.visStateActions.applyCPUFilter, onChangeExportDataType: uiStateActions.setExportDataType, onChangeExportSelectedDataset: uiStateActions.setExportSelectedDataset, onChangeExportFiltered: uiStateActions.setExportFiltered })); modalProps = { title: 'modal.title.exportData', cssStyle: '', footer: true, onCancel: this._closeModal, onConfirm: this._onExportData, confirmButton: { large: true, children: 'modal.button.export' } }; break; case _constants.EXPORT_MAP_ID: { var keplerGlConfig = visState.schema.getConfigToSave({ mapStyle: mapStyle, visState: visState, mapState: mapState, uiState: uiState }); template = /*#__PURE__*/_react["default"].createElement(ExportMapModal, { config: keplerGlConfig, options: uiState.exportMap, onChangeExportMapFormat: uiStateActions.setExportMapFormat, onEditUserMapboxAccessToken: uiStateActions.setUserMapboxAccessToken, onChangeExportMapHTMLMode: uiStateActions.setExportHTMLMapMode }); modalProps = { title: 'modal.title.exportMap', cssStyle: '', footer: true, onCancel: this._closeModal, onConfirm: this._onExportMap, confirmButton: { large: true, children: 'modal.button.export' } }; break; } case _constants.ADD_MAP_STYLE_ID: template = /*#__PURE__*/_react["default"].createElement(AddMapStyleModal, { mapboxApiAccessToken: this.props.mapboxApiAccessToken, mapboxApiUrl: this.props.mapboxApiUrl, mapState: this.props.mapState, inputStyle: mapStyle.inputStyle, inputMapStyle: this.props.mapStyleActions.inputMapStyle, loadCustomMapStyle: this.props.mapStyleActions.loadCustomMapStyle }); modalProps = { title: 'modal.title.addCustomMapboxStyle', cssStyle: '', footer: true, onCancel: this._closeModal, onConfirm: this._onAddCustomMapStyle, confirmButton: { large: true, disabled: mapStyle.inputStyle.error || !mapStyle.inputStyle.url || !mapStyle.inputStyle.label, children: 'modal.button.addStyle' } }; break; case _constants.SAVE_MAP_ID: template = /*#__PURE__*/_react["default"].createElement(SaveMapModal, (0, _extends2["default"])({}, providerState, { exportImage: uiState.exportImage, mapInfo: visState.mapInfo, onSetMapInfo: visStateActions.setMapInfo, cleanupExportImage: uiStateActions.cleanupExportImage, onUpdateImageSetting: uiStateActions.setExportImageSetting, onCancel: this._closeModal, onConfirm: function onConfirm(provider) { return _this2._onSaveMap(provider, false); } })); modalProps = { title: 'modal.title.saveMap', cssStyle: '', footer: false }; break; case _constants.OVERWRITE_MAP_ID: template = /*#__PURE__*/_react["default"].createElement(OverWriteMapModal, (0, _extends2["default"])({}, providerState, { title: (0, _lodash["default"])(visState, ['mapInfo', 'title']), onUpdateImageSetting: uiStateActions.setExportImageSetting, cleanupExportImage: uiStateActions.cleanupExportImage, onConfirm: this._onOverwriteMap, onCancel: this._closeModal })); modalProps = { title: 'Overwrite Existing File?', cssStyle: smallModalCss, footer: false }; break; case _constants.SHARE_MAP_ID: template = /*#__PURE__*/_react["default"].createElement(ShareMapModal, (0, _extends2["default"])({}, providerState, { onExport: this._onShareMapUrl, cleanupExportImage: uiStateActions.cleanupExportImage, onUpdateImageSetting: uiStateActions.setExportImageSetting })); modalProps = { title: 'modal.title.shareURL', cssStyle: '', onCancel: this._onCloseSaveMap }; break; default: break; } } return rootNode ? /*#__PURE__*/_react["default"].createElement(ModalDialog, (0, _extends2["default"])({ parentSelector: function parentSelector() { return rootNode; }, isOpen: Boolean(currentModal), onCancel: this._closeModal }, modalProps, { cssStyle: DefaultStyle.concat(modalProps.cssStyle) }), template) : null; } /* eslint-enable complexity */ }]); }(_react.Component); return ModalContainer; } //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfcmVhY3QiLCJfaW50ZXJvcFJlcXVpcmVXaWxkY2FyZCIsInJlcXVpcmUiLCJfc3R5bGVkQ29tcG9uZW50cyIsIl9sb2Rhc2giLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwiX2RvY3VtZW50IiwiX2NvbnN0YW50cyIsIl9yZWR1Y2VycyIsIl91dGlscyIsIl9tb2RhbERpYWxvZyIsIl9kZWxldGVEYXRhTW9kYWwiLCJfb3ZlcndyaXRlTWFwTW9kYWwiLCJfZGF0YVRhYmxlTW9kYWwiLCJfbG9hZERhdGFNb2RhbCIsIl9leHBvcnRJbWFnZU1vZGFsIiwiX2V4cG9ydERhdGFNb2RhbCIsIl9leHBvcnRNYXBNb2RhbCIsIl9hZGRNYXBTdHlsZU1vZGFsIiwiX3NhdmVNYXBNb2RhbCIsIl9zaGFyZU1hcE1vZGFsIiwiX3N0eWxlcyIsIl90ZW1wbGF0ZU9iamVjdCIsIl90ZW1wbGF0ZU9iamVjdDIiLCJfdGVtcGxhdGVPYmplY3QzIiwiX3RlbXBsYXRlT2JqZWN0NCIsIl90ZW1wbGF0ZU9iamVjdDUiLCJfdGVtcGxhdGVPYmplY3Q2IiwiX3RlbXBsYXRlT2JqZWN0NyIsIl90ZW1wbGF0ZU9iamVjdDgiLCJfZ2V0UmVxdWlyZVdpbGRjYXJkQ2FjaGUiLCJlIiwiV2Vha01hcCIsInIiLCJ0IiwiX19lc01vZHVsZSIsIl90eXBlb2YiLCJoYXMiLCJnZXQiLCJuIiwiX19wcm90b19fIiwiYSIsIk9iamVjdCIsImRlZmluZVByb3BlcnR5IiwiZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yIi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gICAgICAgICAgIC8vIEB0cy1pZ25vcmUgLy8gVE9ETyBmaXggdGhpcyBhZnRlciBhZGQgdHlwZXMgdG8gVGhlbWVcbiAgICAgICAgICAgIG1vZGFsUHJvcHMuY3NzU3R5bGUgPSBjc3NgXG4gICAgICAgICAgICAgICR7RGF0YVRhYmxlTW9kYWxTdHlsZX07XG4gICAgICAgICAgICAgICR7bWVkaWEucGFsbWBcbiAgICAgICAgICAgICAgICB3aWR0aDogJHt3aWR0aH1weDtcbiAgICAgICAgICAgICAgYH07XG4gICAgICAgICAgICBgO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIGNhc2UgREVMRVRFX0RBVEFfSUQ6IHtcbiAgICAgICAgICAgIC8vIHZhbGlkYXRlIG9wdGlvbnNcbiAgICAgICAgICAgIGlmIChkYXRhc2V0S2V5VG9SZW1vdmUgJiYgZGF0YXNldHMgJiYgZGF0YXNldHNbZGF0YXNldEtleVRvUmVtb3ZlXSkge1xuICAgICAgICAgICAgICB0ZW1wbGF0ZSA9IChcbiAgICAgICAgICAgICAgICA8RGVsZXRlRGF0YXNldE1vZGFsIGRhdGFzZXQ9e2RhdGFzZXRzW2RhdGFzZXRLZXlUb1JlbW92ZV19IGxheWVycz17bGF5ZXJzfSAvPlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICBtb2RhbFByb3BzID0ge1xuICAgICAgICAgICAgICAgIHRpdGxlOiAnbW9kYWwudGl0bGUuZGVsZXRlRGF0YXNldCcsXG4gICAgICAgICAgICAgICAgY3NzU3R5bGU6IHNtYWxsTW9kYWxDc3MsXG4gICAgICAgICAgICAgICAgZm9vdGVyOiB0cnVlLFxuICAgICAgICAgICAgICAgIG9uQ29uZmlybTogKCkgPT4gdGhpcy5fZGVsZXRlRGF0YXNldChkYXRhc2V0S2V5VG9SZW1vdmUpLFxuICAgICAgICAgICAgICAgIG9uQ2FuY2VsOiB0aGlzLl9jbG9zZU1vZGFsLFxuICAgICAgICAgICAgICAgIGNvbmZpcm1CdXR0b246IHtcbiAgICAgICAgICAgICAgICAgIG5lZ2F0aXZlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgbGFyZ2U6IHRydWUsXG4gICAgICAgICAgICAgICAgICBjaGlsZHJlbjogJ21vZGFsLmJ1dHRvbi5kZWxldGUnXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7IC8vIGluIGNhc2Ugd2UgYWRkIGEgbmV3IGNhc2UgYWZ0ZXIgdGhpcyBvbmVcbiAgICAgICAgICB9XG4gICAgICAgICAgY2FzZSBBRERfREFUQV9JRDpcbiAgICAgICAgICAgIHRlbXBsYXRlID0gKFxuICAgICAgICAgICAgICA8TG9hZERhdGFNb2RhbFxuICAgICAgICAgICAgICAgIHsuLi5wcm92aWRlclN0YXRlfVxuICAgICAgICAgICAgICAgIG9uQ2xvc2U9e3RoaXMuX2Nsb3NlTW9kYWx9XG4gICAgICAgICAgICAgICAgb25GaWxlVXBsb2FkPXt0aGlzLl9vbkZpbGVVcGxvYWR9XG4gICAgICAgICAgICAgICAgb25UaWxlc2V0QWRkZWQ9e3RoaXMuX29uVGlsZXNldEFkZGVkfVxuICAgICAgICAgICAgICAgIG9uTG9hZENsb3VkTWFwPXt0aGlzLl9vbkxvYWRDbG91ZE1hcH1cbiAgICAgICAgICAgICAgICBsb2FkRmlsZXM9e3VpU3RhdGUubG9hZEZpbGVzfVxuICAgICAgICAgICAgICAgIGZpbGVMb2FkaW5nPXt2aXNTdGF0ZS5maWxlTG9hZGluZ31cbiAgICAgICAgICAgICAgICBmaWxlTG9hZGluZ1Byb2dyZXNzPXt2aXNTdGF0ZS5maWxlTG9hZGluZ1Byb2dyZXNzfVxuICAgICAgICAgICAgICAgIGZpbGVGb3JtYXROYW1lcz17Z2V0RmlsZUZvcm1hdE5hbWVzKHRoaXMucHJvcHMudmlzU3RhdGUpfVxuICAgICAgICAgICAgICAgIGZpbGVFeHRlbnNpb25zPXtnZXRGaWxlRXh0ZW5zaW9ucyh0aGlzLnByb3BzLnZpc1N0YXRlKX1cbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBtb2RhbFByb3BzID0ge1xuICAgICAgICAgICAgICB0aXRsZTogJ21vZGFsLnRpdGxlLmFkZERhdGFUb01hcCcsXG4gICAgICAgICAgICAgIGNzc1N0eWxlOiBMb2FkRGF0YU1vZGFsU3R5bGUsXG4gICAgICAgICAgICAgIGZvb3RlcjogZmFsc2UsXG4gICAgICAgICAgICAgIG9uQ29uZmlybTogdGhpcy5fY2xvc2VNb2RhbFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgRVhQT1JUX0lNQUdFX0lEOlxuICAgICAgICAgICAgdGVtcGxhdGUgPSAoXG4gICAgICAgICAgICAgIDxFeHBvcnRJbWFnZU1vZGFsXG4gICAgICAgICAgICAgICAgZXhwb3J0SW1hZ2U9e3VpU3RhdGUuZXhwb3J0SW1hZ2V9XG4gICAgICAgICAgICAgICAgbWFwVz17Y29udGFpbmVyV31cbiAgICAgICAgICAgICAgICBtYXBIPXtjb250YWluZXJIfVxuICAgICAgICAgICAgICAgIG9uVXBkYXRlSW1hZ2VTZXR0aW5nPXt1aVN0YXRlQWN0aW9ucy5zZXRFeHBvcnRJbWFnZVNldHRpbmd9XG4gICAgICAgICAgICAgICAgY2xlYW51cEV4cG9ydEltYWdlPXt1aVN0YXRlQWN0aW9ucy5jbGVhbnVwRXhwb3J0SW1hZ2V9XG4gICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgbW9kYWxQcm9wcyA9IHtcbiAgICAgICAgICAgICAgdGl0bGU6ICdtb2RhbC50aXRsZS5leHBvcnRJbWFnZScsXG4gICAgICAgICAgICAgIGNzc1N0eWxlOiAnJyxcbiAgICAgICAgICAgICAgZm9vdGVyOiB0cn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25zLnNldEV4cG9ydEZpbHRlcmVkfVxuICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIG1vZGFsUHJvcHMgPSB7XG4gICAgICAgICAgICAgIHRpdGxlOiAnbW9kYWwudGl0bGUuZXhwb3J0RGF0YScsXG4gICAgICAgICAgICAgIGNzc1N0eWxlOiAnJyxcbiAgICAgICAgICAgICAgZm9vdGVyOiB0cnVlLFxuICAgICAgICAgICAgICBvbkNhbmNlbDogdGhpcy5fY2xvc2VNb2RhbCxcbiAgICAgICAgICAgICAgb25Db25maXJtOiB0aGlzLl9vbkV4cG9ydERhdGEsXG4gICAgICAgICAgICAgIGNvbmZpcm1CdXR0b246IHtcbiAgICAgICAgICAgICAgICBsYXJnZTogdHJ1ZSxcbiAgICAgICAgICAgICAgICBjaGlsZHJlbjogJ21vZGFsLmJ1dHRvbi5leHBvcnQnXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlIEVYUE9SVF9NQVBfSUQ6IHtcbiAgICAgICAgICAgIGNvbnN0IGtlcGxlckdsQ29uZmlnID0gdmlzU3RhdGUuc2NoZW1hLmdldENvbmZpZ1RvU2F2ZSh7XG4gICAgICAgICAgICAgIG1hcFN0eWxlLFxuICAgICAgICAgICAgICB2aXNTdGF0ZSxcbiAgICAgICAgICAgICAgbWFwU3RhdGUsXG4gICAgICAgICAgICAgIHVpU3RhdGVcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgdGVtcGxhdGUgPSAoXG4gICAgICAgICAgICAgIDxFeHBvcnRNYXBNb2RhbFxuICAgICAgICAgICAgICAgIGNvbmZpZz17a2VwbGVyR2xDb25maWd9XG4gICAgICAgICAgICAgICAgb3B0aW9ucz17dWlTdGF0ZS5leHBvcnRNYXB9XG4gICAgICAgICAgICAgICAgb25DaGFuZ2VFeHBvcnRNYXBGb3JtYXQ9e3VpU3RhdGVBY3Rpb25zLnNldEV4cG9ydE1hcEZvcm1hdH1cbiAgICAgICAgICAgICAgICBvbkVkaXRVc2VyTWFwYm94QWNjZXNzVG9rZW49e3VpU3RhdGVBY3Rpb25zLnNldFVzZXJNYXBib3hBY2Nlc3NUb2tlbn1cbiAgICAgICAgICAgICAgICBvbkNoYW5nZUV4cG9ydE1hcEhUTUxNb2RlPXt1aVN0YXRlQWN0aW9ucy5zZXRFeHBvcnRIVE1MTWFwTW9kZX1cbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBtb2RhbFByb3BzID0ge1xuICAgICAgICAgICAgICB0aXRsZTogJ21vZGFsLnRpdGxlLmV4cG9ydE1hcCcsXG4gICAgICAgICAgICAgIGNzc1N0eWxlOiAnJyxcbiAgICAgICAgICAgICAgZm9vdGVyOiB0cnVlLFxuICAgICAgICAgICAgICBvbkNhbmNlbDogdGhpcy5fY2xvc2VNb2RhbCxcbiAgICAgICAgICAgICAgb25Db25maXJtOiB0aGlzLl9vbkV4cG9ydE1hcCxcbiAgICAgICAgICAgICAgY29uZmlybUJ1dHRvbjoge1xuICAgICAgICAgICAgICAgIGxhcmdlOiB0cnVlLFxuICAgICAgICAgICAgICAgIGNoaWxkcmVuOiAnbW9kYWwuYnV0dG9uLmV4cG9ydCdcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjYXNlIEFERF9NQVBfU1RZTEVfSUQ6XG4gICAgICAgICAgICB0ZW1wbGF0ZSA9IChcbiAgICAgICAgICAgICAgPEFkZE1hcFN0eWxlTW9kYWxcbiAgICAgICAgICAgICAgICBtYXBib3hBcGlBY2Nlc3NUb2tlbj17dGhpcy5wcm9wcy5tYXBib3hBcGlBY2Nlc3NUb2tlbn1cbiAgICAgICAgICAgICAgICBtYXBib3hBcGlVcmw9e3RoaXMucHJvcHMubWFwYm94QXBpVXJsfVxuICAgICAgICAgICAgICAgIG1hcFN0YXRlPXt0aGlzLnByb3BzLm1hcFN0YXRlfVxuICAgICAgICAgICAgICAgIGlucHV0U3R5bGU9e21hcFN0eWxlLmlucHV0U3R5bGV9XG4gICAgICAgICAgICAgICAgaW5wdXRNYXBTdHlsZT17dGhpcy5wcm9wcy5tYXBTdHlsZUFjdGlvbnMuaW5wdXRNYXBTdHlsZX1cbiAgICAgICAgICAgICAgICBsb2FkQ3VzdG9tTWFwU3R5bGU9e3RoaXMucHJvcHMubWFwU3R5bGVBY3Rpb25zLmxvYWRDdXN0b21NYXBTdHlsZX1cbiAgICAgICAgICAgIC