-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaccount~dashboard~dashboard-accounts.e4e21bac7c7dceb7e267.js
346 lines (294 loc) · 28.6 KB
/
account~dashboard~dashboard-accounts.e4e21bac7c7dceb7e267.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
(this["webpackJsonp"] = this["webpackJsonp"] || []).push([[28],{
/***/ 2910:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return Tabs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tab", function() { return Tab; });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(395);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(824);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(732);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var alt_react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1854);
/* harmony import */ var actions_SettingsActions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(718);
/* harmony import */ var stores_SettingsStore__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(717);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(578);
/* harmony import */ var counterpart__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(counterpart__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1836);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
/**
* Renders a tab layout, handling switching and optionally persists the currently open tab using the SettingsStore
*
* props:
* setting: unique name to be used to remember the active tab of this tabs layout,
* tabsClass: optional classes for the tabs container div
* contentClass: optional classes for the content container div
*
* Usage:
*
* <Tabs setting="mySetting">
* <Tab title="locale.string.title1">Tab 1 content</Tab>
* <Tab title="locale.string.title2">Tab 2 content</Tab>
* </Tabs>
*
*/
var Tab = function (_React$Component) {
_inherits(Tab, _React$Component);
function Tab() {
_classCallCheck(this, Tab);
return _possibleConstructorReturn(this, (Tab.__proto__ || Object.getPrototypeOf(Tab)).apply(this, arguments));
}
_createClass(Tab, [{
key: "render",
value: function render() {
var _props = this.props,
isActive = _props.isActive,
index = _props.index,
changeTab = _props.changeTab,
title = _props.title,
className = _props.className,
updatedTab = _props.updatedTab,
disabled = _props.disabled,
subText = _props.subText;
var c = classnames__WEBPACK_IMPORTED_MODULE_2___default()({ "is-active": isActive }, className);
if (typeof title === "string" && title.indexOf(".") > 0) {
title = counterpart__WEBPACK_IMPORTED_MODULE_6___default.a.translate(title);
}
// dont string concetenate subText directly within the rendering, subText can be an object without toString
// implementation, but valid DOM (meaning, don't do subText + "someString"
if (this.props.collapsed) {
// if subText is empty, dont render it, we dont want empty brackets added
if (typeof subText === "string") {
subText = subText.trim();
}
if (title.type === "span") {
title = title.props.children[2];
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"option",
{ value: index, "data-is-link-to": this.props.isLinkTo },
title,
updatedTab ? "*" : "",
subText && " (",
subText && subText,
subText && ")"
);
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"li",
{
className: c,
onClick: !disabled ? changeTab.bind(this, index, this.props.isLinkTo) : null
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"a",
null,
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"span",
{ className: "tab-title" },
title,
updatedTab ? "*" : ""
),
subText && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "tab-subtext" },
subText
)
)
);
}
}]);
return Tab;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
Tab.propTypes = {
changeTab: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.func,
isActive: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool.isRequired,
index: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number.isRequired,
className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
isLinkTo: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
subText: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string])
};
Tab.defaultProps = {
isActive: false,
index: 0,
className: "",
isLinkTo: "",
subText: null
};
var Tabs = function (_React$Component2) {
_inherits(Tabs, _React$Component2);
function Tabs(props) {
_classCallCheck(this, Tabs);
var _this2 = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this));
_this2.state = {
activeTab: props.setting ? props.viewSettings.get(props.setting, props.defaultActiveTab) : props.defaultActiveTab,
width: window.innerWidth
};
_this2._setDimensions = _this2._setDimensions.bind(_this2);
return _this2;
}
_createClass(Tabs, [{
key: "componentDidMount",
value: function componentDidMount() {
this._setDimensions();
window.addEventListener("resize", this._setDimensions, {
capture: false,
passive: true
});
}
}, {
key: "componentWillReceiveProps",
value: function componentWillReceiveProps(nextProps) {
var nextSetting = nextProps.viewSettings.get(nextProps.setting);
if (nextSetting !== this.props.viewSettings.get(this.props.setting)) {
this.setState({
activeTab: nextSetting
});
}
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
window.removeEventListener("resize", this._setDimensions);
}
}, {
key: "_setDimensions",
value: function _setDimensions() {
var width = window.innerWidth;
if (width !== this.state.width) {
this.setState({ width: width });
}
}
}, {
key: "_changeTab",
value: function _changeTab(value, isLinkTo) {
if (value === this.state.activeTab) return;
// Persist current tab if desired
if (isLinkTo !== "") {
this.props.history.push(isLinkTo);
}
if (this.props.setting) {
actions_SettingsActions__WEBPACK_IMPORTED_MODULE_4__["default"].changeViewSetting(_defineProperty({}, this.props.setting, value));
}
this.setState({ activeTab: value });
if (this.props.onChangeTab) this.props.onChangeTab(value);
}
}, {
key: "render",
value: function render() {
var _this3 = this;
var _props2 = this.props,
children = _props2.children,
contentClass = _props2.contentClass,
tabsClass = _props2.tabsClass,
style = _props2.style,
segmented = _props2.segmented;
var collapseTabs = this.state.width < 900 && react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.count(children) > 2;
var activeContent = null;
var tabs = react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.map(children, function (child, index) {
if (!child) {
return null;
}
if (collapseTabs && child.props.disabled) return null;
var isActive = index === _this3.state.activeTab;
if (isActive) {
activeContent = child.props.children;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.cloneElement(child, {
collapsed: collapseTabs,
isActive: isActive,
changeTab: _this3._changeTab.bind(_this3),
index: index
});
}).filter(function (a) {
return a !== null;
});
if (!activeContent) {
activeContent = tabs[0].props.children;
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(!!this.props.actionButtons ? "with-buttons" : "", this.props.className)
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "service-selector" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"ul",
{
style: style,
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("button-group no-margin", tabsClass, {
segmented: segmented
})
},
collapseTabs ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"li",
{
style: {
paddingLeft: 10,
paddingRight: 10,
minWidth: "15rem"
}
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"select",
{
value: this.state.activeTab,
style: { marginTop: 10, marginBottom: 10 },
className: "bts-select",
onChange: function onChange(e) {
var ind = parseInt(e.target.value, 10);
_this3._changeTab(ind, e.target[ind].attributes["data-is-link-to"].value);
}
},
tabs
)
) : tabs,
this.props.actionButtons ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"li",
{ className: "tabs-action-buttons" },
this.props.actionButtons
) : null
)
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("tab-content", contentClass) },
activeContent
)
);
}
}]);
return Tabs;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
Tabs.propTypes = {
setting: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string,
defaultActiveTab: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.number,
segmented: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.bool
};
Tabs.defaultProps = {
active: 0,
defaultActiveTab: 0,
segmented: true,
contentClass: "",
style: {}
};
Tabs = Object(alt_react__WEBPACK_IMPORTED_MODULE_3__["connect"])(Tabs, {
listenTo: function listenTo() {
return [stores_SettingsStore__WEBPACK_IMPORTED_MODULE_5__["default"]];
},
getProps: function getProps() {
return { viewSettings: stores_SettingsStore__WEBPACK_IMPORTED_MODULE_5__["default"].getState().viewSettings };
}
});
Tabs = Object(react_router_dom__WEBPACK_IMPORTED_MODULE_7__["withRouter"])(Tabs);
/***/ })
}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIj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AgICAgICBpbmRleCxcbiAgICAgICAgICAgIGNoYW5nZVRhYixcbiAgICAgICAgICAgIHRpdGxlLFxuICAgICAgICAgICAgY2xhc3NOYW1lLFxuICAgICAgICAgICAgdXBkYXRlZFRhYixcbiAgICAgICAgICAgIGRpc2FibGVkLFxuICAgICAgICAgICAgc3ViVGV4dFxuICAgICAgICB9ID0gdGhpcy5wcm9wcztcbiAgICAgICAgbGV0IGMgPSBjbmFtZXMoe1wiaXMtYWN0aXZlXCI6IGlzQWN0aXZlfSwgY2xhc3NOYW1lKTtcblxuICAgICAgICBpZiAodHlwZW9mIHRpdGxlID09PSBcInN0cmluZ1wiICYmIHRpdGxlLmluZGV4T2YoXCIuXCIpID4gMCkge1xuICAgICAgICAgICAgdGl0bGUgPSBjb3VudGVycGFydC50cmFuc2xhdGUodGl0bGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gZG9udCBzdHJpbmcgY29uY2V0ZW5hdGUgc3ViVGV4dCBkaXJlY3RseSB3aXRoaW4gdGhlIHJlbmRlcmluZywgc3ViVGV4dCBjYW4gYmUgYW4gb2JqZWN0IHdpdGhvdXQgdG9TdHJpbmdcbiAgICAgICAgLy8gaW1wbGVtZW50YXRpb24sIGJ1dCB2YWxpZCBET00gKG1lYW5pbmcsIGRvbid0IGRvIHN1YlRleHQgKyBcInNvbWVTdHJpbmdcIlxuXG4gICAgICAgIGlmICh0aGlzLnByb3BzLmNvbGxhcHNlZCkge1xuICAgICAgICAgICAgLy8gaWYgc3ViVGV4dCBpcyBlbXB0eSwgZG9udCByZW5kZXIgaXQsIHdlIGRvbnQgd2FudCBlbXB0eSBicmFja2V0cyBhZGRlZFxuICAgICAgICAgICAgaWYgKHR5cGVvZiBzdWJUZXh0ID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgc3ViVGV4dCA9IHN1YlRleHQudHJpbSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRpdGxlLnR5cGUgPT09IFwic3BhblwiKSB7XG4gICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5wcm9wcy5jaGlsZHJlblsyXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgPG9wdGlvbiB2YWx1ZT17aW5kZXh9IGRhdGEtaXMtbGluay10bz17dGhpcy5wcm9wcy5pc0xpbmtUb30+XG4gICAgICAgICAgICAgICAgICAgIHt0aXRsZX1cbiAgICAgICAgICAgICAgICAgICAge3VwZGF0ZWRUYWIgPyBcIipcIiA6IFwiXCJ9XG4gICAgICAgICAgICAgICAgICAgIHtzdWJUZXh0ICYmIFwiIChcIn1cbiAgICAgICAgICAgICAgICAgICAge3N1YlRleHQgJiYgc3ViVGV4dH1cbiAgICAgICAgICAgICAgICAgICAge3N1YlRleHQgJiYgXCIpXCJ9XG4gICAgICAgICAgICAgICAgPC9vcHRpb24+XG4gICAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8bGlcbiAgICAgICAgICAgICAgICBjbGFzc05hbWU9e2N9XG4gICAgICAgICAgICAgICAgb25DbGljaz17XG4gICAgICAgICAgICAgICAgICAgICFkaXNhYmxlZFxuICAgICAgICAgICAgICAgICAgICAgICAgPyBjaGFuZ2VUYWIuYmluZCh0aGlzLCBpbmRleCwgdGhpcy5wcm9wcy5pc0xpbmtUbylcbiAgICAgICAgICAgICAgICAgICAgICAgIDogbnVsbFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICA8YT5cbiAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3NOYW1lPVwidGFiLXRpdGxlXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICB7dGl0bGV9XG4gICAgICAgICAgICAgICAgICAgICAgICB7dXBkYXRlZFRhYiA/IFwiKlwiIDogXCJcIn1cbiAgICAgICAgICAgICAgICAgICAgPC9zcGFuPlxuICAgICAgICAgIC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AgICB9XG5cbiAgICBjb21wb25lbnREaWRNb3VudCgpIHtcbiAgICAgICAgdGhpcy5fc2V0RGltZW5zaW9ucygpO1xuICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcihcInJlc2l6ZVwiLCB0aGlzLl9zZXREaW1lbnNpb25zLCB7XG4gICAgICAgICAgICBjYXB0dXJlOiBmYWxzZSxcbiAgICAgICAgICAgIHBhc3NpdmU6IHRydWVcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tcG9uZW50V2lsbFJlY2VpdmVQcm9wcyhuZXh0UHJvcHMpIHtcbiAgICAgICAgbGV0IG5leHRTZXR0aW5nID0gbmV4dFByb3BzLnZpZXdTZXR0aW5ncy5nZXQobmV4dFByb3BzLnNldHRpbmcpO1xuICAgICAgICBpZiAobmV4dFNldHRpbmcgIT09IHRoaXMucHJvcHMudmlld1NldHRpbmdzLmdldCh0aGlzLnByb3BzLnNldHRpbmcpKSB7XG4gICAgICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICBhY3RpdmVUYWI6IG5leHRTZXR0aW5nXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGNvbXBvbmVudFdpbGxVbm1vdW50KCkge1xuICAgICAgICB3aW5kb3cucmVtb3ZlRXZlbnRMaXN0ZW5lcihcInJlc2l6ZVwiLCB0aGlzLl9zZXREaW1lbnNpb25zKTtcbiAgICB9XG5cbiAgICBfc2V0RGltZW5zaW9ucygpIHtcbiAgICAgICAgbGV0IHdpZHRoID0gd2luZG93LmlubmVyV2lkdGg7XG5cbiAgICAgICAgaWYgKHdpZHRoICE9PSB0aGlzLnN0YXRlLndpZHRoKSB7XG4gICAgICAgICAgICB0aGlzLnNldFN0YXRlKHt3aWR0aH0pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgX2NoYW5nZVRhYih2YWx1ZSwgaXNMaW5rVG8pIHtcbiAgICAgICAgaWYgKHZhbHVlID09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gICAgIGlmIChjb2xsYXBzZVRhYnMgJiYgY2hpbGQucHJvcHMuZGlzYWJsZWQpIHJldHVybiBudWxsO1xuICAgICAgICAgICAgbGV0IGlzQWN0aXZlID0gaW5kZXggPT09IHRoaXMuc3RhdGUuYWN0aXZlVGFiO1xuICAgICAgICAgICAgaWYgKGlzQWN0aXZlKSB7XG4gICAgICAgICAgICAgICAgYWN0aXZlQ29udGVudCA9IGNoaWxkLnByb3BzLmNoaWxkcmVuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gUmVhY3QuY2xvbmVFbGVtZW50KGNoaWxkLCB7XG4gICAgICAgICAgICAgICAgY29sbGFwc2VkOiBjb2xsYXBzZVRhYnMsXG4gICAgICAgICAgICAgICAgaXNBY3RpdmUsXG4gICAgICAgICAgICAgICAgY2hhbmdlVGFiOiB0aGlzLl9jaGFuZ2VUYWIuYmluZCh0aGlzKSxcbiAgICAgICAgICAgICAgICBpbmRleDogaW5kZXhcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9KS5maWx0ZXIoYSA9PiBhICE9PSBudWxsKTtcblxuICAgICAgICBpZiAoIWFjdGl2ZUNvbnRlbnQpIHtcbiAgICAgICAgICAgIGFjdGl2ZUNvbnRlbnQgPSB0YWJzWzBdLnByb3BzLmNoaWxkcmVuO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgICAgICBjbGFzc05hbWU9e2NuYW1lcyhcbiAgICAgICAgICAgICAgICAgICAgISF0aGlzLnByb3BzLmFjdGlvbkJ1dHRvbnMgPyBcIndpdGgtYnV0dG9uc1wiIDogXCJcIixcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wcm9wcy5jbGFzc05hbWVcbiAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwic2VydmljZS1zZWxlY3RvclwiPlxuICAgICAgICAgICAgICAgICAgICA8dWxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlPXtzdHlsZX1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT17Y25hbWVzKFwiYnV0dG9uLWdyb3VwIG5vLW1hcmdpblwiLCB0YWJzQ2xhc3MsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWdtZW50ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICB7Y29sbGFwc2VUYWJzID8gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxsaVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZT17e1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZ0xlZnQ6IDEwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZ1JpZ2h0OiAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbldpZHRoOiBcIjE1cmVtXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzZWxlY3RcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlPXt0aGlzLnN0YXRlLmFjdGl2ZVRhYn1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlPXt7bWFyZ2luVG9wOiAxMCwgbWFyZ2luQm90dG9tOiAxMH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJidHMtc2VsZWN0XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlPXtlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5kID0gcGFyc2VJbnQoZS50YXJnZXQudmFsdWUsIDEwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jaGFuZ2VUYWIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS50YXJnZXRbaW5kXS5hdHRyaWJ1dGVzW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJkYXRhLWlzLWxpbmstdG9cIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLnZhbHVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt0YWJzfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NlbGVjdD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2xpPlxuICAgICAgICAgICAgICAgICAgICAgICAgKSA6IChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWJzXG4gICAgICAgICAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICAgICAgICAgICAge3RoaXMucHJvcHMuYWN0aW9uQnV0dG9ucyA/IChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8bGkgY2xhc3NOYW1lPVwidGFicy1hY3Rpb24tYnV0dG9uc1wiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7dGhpcy5wcm9wcy5hY3Rpb25CdXR0b25zfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvbGk+XG4gICAgICAgICAgICAgICAgICAgICAgICApIDogbnVs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