-
Notifications
You must be signed in to change notification settings - Fork 61
/
view-model.js
375 lines (353 loc) · 48.3 KB
/
view-model.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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ViewModel = undefined;
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; }; }();
var _lodash = require('lodash');
var _omnisharpClient = require('omnisharp-client');
var _path = require('path');
var _rxjs = require('rxjs');
var _tsDisposables = require('ts-disposables');
var _outputMessageElement = require('../views/output-message-element');
var _projectViewModel = require('./project-view-model');
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ViewModel = exports.ViewModel = function () {
function ViewModel(_solution) {
var _this = this;
_classCallCheck(this, ViewModel);
this._solution = _solution;
this.disposable = new _tsDisposables.CompositeDisposable();
this.output = [];
this.outputElement = document.createElement('div');
this.diagnosticsByFile = new Map();
this.diagnosticCounts = { error: 0, warning: 0, hidden: 0 };
this.errors = 0;
this.warnings = 0;
this.hidden = 0;
this.packageSources = [];
this.projects = [];
this._projectAddedStream = new _rxjs.Subject();
this._projectRemovedStream = new _rxjs.Subject();
this._projectChangedStream = new _rxjs.Subject();
this._stateStream = new _rxjs.ReplaySubject(1);
this._uniqueId = _solution.uniqueId;
this._updateState(_solution.currentState);
this.outputElement.classList.add('messages-container');
this.disposable.add(_solution.logs.subscribe(function (event) {
_this.output.push(event);
if (_this.output.length > 1000) {
_this.output.shift();
}
}), _solution.logs.subscribe(function (item) {
if (_this.outputElement.children.length === 1000) {
_this.outputElement.children[0].remove();
}
_this.outputElement.appendChild(_outputMessageElement.OutputMessageElement.create(item));
}), _solution.state.filter(function (z) {
return z === _omnisharpClient.DriverState.Disconnected;
}).subscribe(function () {
(0, _lodash.each)(_this.projects.slice(), function (project) {
return _this._projectRemovedStream.next(project);
});
_this.projects = [];
_this.diagnosticsByFile.clear();
}));
var _setupCodecheck2 = this._setupCodecheck(_solution),
diagnostics = _setupCodecheck2.diagnostics,
diagnosticsByFile = _setupCodecheck2.diagnosticsByFile,
diagnosticsCounts = _setupCodecheck2.diagnosticsCounts;
var status = this._setupStatus(_solution);
var output = this.output;
var _projectAddedStream = this._projectAddedStream.share();
var _projectRemovedStream = this._projectRemovedStream.share();
var _projectChangedStream = this._projectChangedStream.share();
var projects = _rxjs.Observable.merge(_projectAddedStream, _projectRemovedStream, _projectChangedStream).startWith([]).debounceTime(200).map(function (z) {
return _this.projects;
}).publishReplay(1).refCount();
var outputObservable = _solution.logs.auditTime(100).map(function () {
return output;
});
var state = this._stateStream;
this.observe = {
get diagnostics() {
return diagnostics;
},
get diagnosticsCounts() {
return diagnosticsCounts;
},
get diagnosticsByFile() {
return diagnosticsByFile;
},
get output() {
return outputObservable;
},
get status() {
return status;
},
get state() {
return state;
},
get projects() {
return projects;
},
get projectAdded() {
return _projectAddedStream;
},
get projectRemoved() {
return _projectRemovedStream;
},
get projectChanged() {
return _projectChangedStream;
}
};
this.disposable.add(_solution.state.subscribe((0, _lodash.bind)(this._updateState, this)));
(window["clients"] || (window["clients"] = [])).push(this);
this.disposable.add(_solution.state.filter(function (z) {
return z === _omnisharpClient.DriverState.Connected;
}).subscribe(function () {
_solution.projects({ ExcludeSourceFiles: false });
_solution.packagesource({ ProjectPath: _solution.path }).subscribe(function (response) {
_this.packageSources = response.Sources;
});
}));
this.disposable.add(_solution.state.filter(function (z) {
return z === _omnisharpClient.DriverState.Disconnected;
}).subscribe(function () {
(0, _lodash.each)(_this.projects.slice(), function (project) {
return _this._projectRemovedStream.next(project);
});
}));
this.disposable.add(_solution.observe.projectAdded.subscribe(function (projectInformation) {
(0, _lodash.each)((0, _projectViewModel.projectViewModelFactory)(projectInformation, _solution.projectPath), function (project) {
if (!(0, _lodash.some)(_this.projects, { path: project.path })) {
_this.projects.push(project);
_this._projectAddedStream.next(project);
}
});
}));
this.disposable.add(_solution.observe.projectRemoved.subscribe(function (projectInformation) {
(0, _lodash.each)((0, _projectViewModel.projectViewModelFactory)(projectInformation, _solution.projectPath), function (project) {
var found = (0, _lodash.find)(_this.projects, { path: project.path });
if (found) {
(0, _lodash.pull)(_this.projects, found);
_this._projectRemovedStream.next(project);
}
});
}));
this.disposable.add(_solution.observe.projectChanged.subscribe(function (projectInformation) {
(0, _lodash.each)((0, _projectViewModel.projectViewModelFactory)(projectInformation, _solution.projectPath), function (project) {
var found = (0, _lodash.find)(_this.projects, { path: project.path });
if (found) {
found.update(project);
_this._projectChangedStream.next(project);
}
});
}));
this.disposable.add(_solution.observe.projects.subscribe(function (context) {
(0, _lodash.each)((0, _projectViewModel.workspaceViewModelFactory)(context.response, _solution.projectPath), function (project) {
var found = (0, _lodash.find)(_this.projects, { path: project.path });
if (found) {
found.update(project);
_this._projectChangedStream.next(project);
} else {
_this.projects.push(project);
_this._projectAddedStream.next(project);
}
});
}));
this.disposable.add(this._projectAddedStream);
this.disposable.add(this._projectChangedStream);
this.disposable.add(this._projectRemovedStream);
this.disposable.add(_tsDisposables.Disposable.create(function () {
(0, _lodash.each)(_this.projects, function (x) {
return x.dispose();
});
}));
}
_createClass(ViewModel, [{
key: 'dispose',
value: function dispose() {
this.disposable.dispose();
}
}, {
key: 'getProjectForEditor',
value: function getProjectForEditor(editor) {
return this.getProjectForPath(editor.getPath()).filter(function () {
return !editor.isDestroyed();
});
}
}, {
key: 'getProjectForPath',
value: function getProjectForPath(path) {
if (this.isOn && this.projects.length) {
var project = (0, _lodash.find)(this.projects, function (x) {
return x.filesSet.has(path);
});
if (project) {
return _rxjs.Observable.of(project);
}
}
return this.observe.projectAdded.filter(function (x) {
return (0, _lodash.startsWith)(path, x.path);
}).take(1);
}
}, {
key: 'getProjectContainingEditor',
value: function getProjectContainingEditor(editor) {
return this.getProjectContainingFile(editor.getPath());
}
}, {
key: 'getProjectContainingFile',
value: function getProjectContainingFile(path) {
if (this.isOn && this.projects.length) {
var project = (0, _lodash.find)(this.projects, function (x) {
return (0, _lodash.includes)(x.sourceFiles, (0, _path.normalize)(path));
});
if (project) {
return _rxjs.Observable.of(project);
}
return _rxjs.Observable.of(null);
} else {
return this.observe.projectAdded.filter(function (x) {
return (0, _lodash.includes)(x.sourceFiles, (0, _path.normalize)(path));
}).take(1).defaultIfEmpty(null);
}
}
}, {
key: '_updateState',
value: function _updateState(state) {
this.isOn = state === _omnisharpClient.DriverState.Connecting || state === _omnisharpClient.DriverState.Connected;
this.isOff = state === _omnisharpClient.DriverState.Disconnected;
this.isConnecting = state === _omnisharpClient.DriverState.Connecting;
this.isReady = state === _omnisharpClient.DriverState.Connected;
this.isError = state === _omnisharpClient.DriverState.Error;
this._stateStream.next(this);
}
}, {
key: '_setupCodecheck',
value: function _setupCodecheck(_solution) {
var _this2 = this;
var baseCodecheck = _solution.observe.diagnostic.map(function (data) {
var files = [];
var counts = _this2.diagnosticCounts;
(0, _lodash.each)(data.Results, function (result) {
files.push(result.FileName);
if (_this2.diagnosticsByFile.has(result.FileName)) {
var old = _this2.diagnosticsByFile.get(result.FileName);
_this2.diagnosticsByFile.delete(result.FileName);
var _grouped = (0, _lodash.groupBy)(old, function (x) {
return x.LogLevel.toLowerCase();
});
(0, _lodash.each)(_grouped, function (items, key) {
if (!(0, _lodash.isNumber)(counts[key])) {
counts[key] = 0;
}
counts[key] -= items.length;
if (counts[key] < 0) counts[key] = 0;
});
}
_this2.diagnosticsByFile.set(result.FileName, (0, _lodash.sortBy)(result.QuickFixes, function (x) {
return x.Line;
}, function (quickFix) {
return quickFix.LogLevel;
}, function (x) {
return x.Text;
}));
var grouped = (0, _lodash.groupBy)(result.QuickFixes, function (x) {
return x.LogLevel.toLowerCase();
});
(0, _lodash.each)(grouped, function (items, key) {
if (!(0, _lodash.isNumber)(counts[key])) {
counts[key] = 0;
}
counts[key] += items.length;
});
});
return files;
}).share();
var diagnostics = baseCodecheck.map(function (x) {
return _this2.diagnostics;
}).publishReplay(1).refCount();
var diagnosticsByFile = baseCodecheck.map(function (files) {
var map = new Map();
(0, _lodash.each)(files, function (file) {
map.set(file, _this2.diagnosticsByFile.get(file));
});
return map;
}).publishReplay(1).refCount();
var diagnosticsCounts = baseCodecheck.map(function (x) {
return _this2.diagnosticCounts;
}).publishReplay(1).refCount();
this.disposable.add(baseCodecheck.subscribe());
return { diagnostics: diagnostics, diagnosticsByFile: diagnosticsByFile, diagnosticsCounts: diagnosticsCounts };
}
}, {
key: '_setupStatus',
value: function _setupStatus(_solution) {
var status = _solution.status.startWith({}).share();
return status;
}
}, {
key: 'uniqueId',
get: function get() {
return this._solution.uniqueId;
}
}, {
key: 'index',
get: function get() {
return this._solution.index;
}
}, {
key: 'path',
get: function get() {
return this._solution.path;
}
}, {
key: 'diagnostics',
get: function get() {
var results = [];
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = this.diagnosticsByFile.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var result = _step.value;
results.push.apply(results, _toConsumableArray(result));
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
return (0, _lodash.sortBy)(results, function (x) {
return x.LogLevel;
}, function (x) {
return x.FileName;
}, function (x) {
return x.Line;
}, function (x) {
return x.Column;
}, function (x) {
return x.Text;
});
}
}, {
key: 'state',
get: function get() {
return this._solution.currentState;
}
}]);
return ViewModel;
}();
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi9zZXJ2ZXIvdmlldy1tb2RlbC50cyJdLCJuYW1lcyI6WyJWaWV3TW9kZWwiLCJfc29sdXRpb24iLCJkaXNwb3NhYmxlIiwib3V0cHV0Iiwib3V0cHV0RWxlbWVudCIsImRvY3VtZW50IiwiY3JlYXRlRWxlbWVudCIsImRpYWdub3N0aWNzQnlGaWxlIiwiTWFwIiwiZGlhZ25vc3RpY0NvdW50cyIsImVycm9yIiwid2FybmluZyI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Bfc29sdXRpb24udW5pcXVlSWQ7XHJcbiAgICAgICAgdGhpcy5fdXBkYXRlU3RhdGUoX3NvbHV0aW9uLmN1cnJlbnRTdGF0ZSk7XHJcblxyXG4gICAgICAgIHRoaXMub3V0cHV0RWxlbWVudC5jbGFzc0xpc3QuYWRkKCdtZXNzYWdlcy1jb250YWluZXInKTtcclxuXHJcbiAgICAgICAgLy8gTWFuYWdlIG91ciBidWlsZCBsb2cgZm9yIGRpc3BsYXlcclxuICAgICAgICB0aGlzLmRpc3Bvc2FibGUuYWRkKF9zb2x1dGlvbi5sb2dzXHJcbiAgICAgICAgICAgIC5zdWJzY3JpYmUoZXZlbnQgPT4ge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5vdXRwdXQucHVzaChldmVudCk7XHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMub3V0cHV0Lmxlbmd0aCA+IDEwMDApIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm91dHB1dC5zaGlmdCgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KSxcclxuICAgICAgICAgICAgX3NvbHV0aW9uLmxvZ3NcclxuICAgICAgICAgICAgICAgIC5zdWJzY3JpYmUoaXRlbSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMub3V0cHV0RWxlbWVudC5jaGlsZHJlbi5sZW5ndGggPT09IDEwMDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vdXRwdXRFbGVtZW50LmNoaWxkcmVuWzBdLnJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vdXRwdXRFbGVtZW50LmFwcGVuZENoaWxkKE91dHB1dE1lc3NhZ2VFbGVtZW50LmNyZWF0ZShpdGVtKSk7XHJcbiAgICAgICAgICAgICAgICB9KSxcclxuICAgICAgICAgICAgX3NvbHV0aW9uLnN0YXRlLmZpbHRlc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tLCBfcHJvamVjdENoYW5nZWRTdHJlYW0pXHJcbiAgICAgICAgICAgIC5zdGFydFdpdGgoPGFueT5bXSlcclxuICAgICAgICAgICAgLmRlYm91bmNlVGltZSgyMDApXHJcbiAgICAgICAgICAgIC5tYXAoeiA9PiB0aGlzLnByb2plY3RzKVxyXG4gICAgICAgICAgICAucHVibGlzaFJlcGxheSgxKS5yZWZDb3VudCgpO1xyXG5cclxuICAgICAgICBjb25zdCBvdXRwdXRPYnNlcnZhYmxlID0gX3NvbHV0aW9uLmxvZ3NcclxuICAgICAgICAgICAgLmF1ZGl0VGltZSgxMDApXHJcbiAgICAgICAgICAgIC5tYXAoKCkgPT4gb3V0cHV0KTtcclxuXHJcbiAgICAgICAgY29uc3Qgc3RhdGUgPSB0aGlzLl9zdGF0ZVN0cmVhbTtcclxuXHJcbiAgICAgICAgdGhpcy5vYnNlcnZlID0ge1xyXG4gICAgICAgICAgICBnZXQgZGlhZ25vc3RpY3MoKSB7IHJldHVybiBkaWFnbm9zdGljczsgfSxcclxuICAgICAgICAgICAgZ2V0IGRpYWdub3N0aWNzQ291bnRzKCkgeyByZXR1cm4gZGlhZ25vc3RpY3NDb3VudHM7IH0sXHJcbiAgICAgICAgICAgIGdldCBkaWFnbm9zdGljc0J5RmlsZSgpIHsgcmV0dXJuIGRpYWdub3N0aWNzQnlGaWxlOyB9LFxyXG4gICAgICAgICAgICBnZXQgb3V0cHV0KCkgeyByZXR1cm4gb3V0cHV0T2JzZXJ2YWJsZTsgfSxcclxuICAgICAgICAgICAgZ2V0IHN0YXR1cygpIHsgcmV0dXJuIHN0YXR1czsgfSxcclxuICAgICAgICAgICAgZ2V0IHN0YXRlKCkgeyByZXR1cm4gPE9ic2VydmFibGU8Vmlld01vZGVsPj48YW55PnN0YXRlOyB9LFxyXG4gICAgICAgICAgICBnZXQgcHJvamVjdHMoKSB7IHJldHVybiBwcm9qZWN0czsgfSxcclxuICAgICAgICAgICAgZ2V0IHByb2plY3RBZGRlZCgpIHs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uICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfSkpO1xyXG5cclxuICAgICAgICB0aGlzLmRpc3Bvc2FibGUuYWRkKF9zb2x1dGlvbi5zdGF0ZS5maWx0ZXIoeiA9PiB6ID09PSBEcml2ZXJTdGF0ZS5EaXNjb25uZWN0ZWQpLnN1YnNjcmliZSgoKSA9PiB7XHJcbiAgICAgICAgICAgIGVhY2godGhpcy5wcm9qZWN0cy5zbGljZSgpLCBwcm9qZWN0ID0+IHRoaXMuX3Byb2plY3RSZW1vdmVkU3RyZWFtLm5leHQocHJvamVjdCkpO1xyXG4gICAgICAgIH0pKTtcclxuXHJcbiAgICAgICAgdGhpcy5kaXNwb3NhYmxlLmFkZChfc29sdXRpb24ub2JzZXJ2ZS5wcm9qZWN0QWRkZWQuc3Vic2NyaWJlKHByb2plY3RJbmZvcm1hdGlvbiA9PiB7XHJcbiAgICAgICAgICAgIGVhY2gocHJvamVjdFZpZXdNb2RlbEZhY3RvcnkocHJvamVjdEluZm9ybWF0aW9uLCBfc29sdXRpb24ucHJvamVjdFBhdGgpLCBwcm9qZWN0ID0+IHtcclxuICAgICAgICAgICAgICAgIGlmICghc29tZSh0aGlzLnByb2plY3RzLCB7IHBhdGg6IHByb2plY3QucGF0aCB9KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucHJvamVjdHMucHVzaChwcm9qZWN0KTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9wcm9qZWN0QWRkZWRTdHJlYW0ubmV4dChwcm9qZWN0KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSkpO1xyXG5cclxuICAgICAgICB0aGlzLmRpc3Bvc2FibGUuYWRkKF9zb2x1dGlvbi5vYnNlcnZlLnByb2plY3RSZW1vdmVkLnN1YnNjcmliZShwcm9qZWN0SW5mb3JtYXRpb24gPT4ge1xyXG4gICAgICAgICAgICBlYWNoKHByb2plY3RWaWV3TW9kZWxGYWN0b3J5KHByb2plY3RJbmZvcm1hdGlvbiwgX3NvbHV0aW9uLnByb2plY3RQYXRoKSwgcHJvamVjdCA9PiB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBmb3VuZDogUHJvamVjdFZpZXdNb2RlbDxhbnk+ID0gZmluZCh0aGlzLnByb2plY3RzLCB7IHBhdGg6IHByb2plY3QucGF0aCB9KTtcclxuICAgICAgICAgICAgICAgIGlmIChmb3VuZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHB1bGwodGhpcy5wcm9qZWN0cywgZm91bmQpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3Byb2plY3RSZW1vdmVkU3RyZWFtLm5leHQocHJvamVjdCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pKTtcclxuXHJcbiAgICAgICAgdGhpcy5kaXNwb3NhYmxlLmFkZChfc29sdXRpb24ub2JzZXJ2ZS5wcm9qZWN0Q2hhbmdlZC5zdWJzY3JpYmUocHJvamVjdEluZm9ybWF0aW9uID0+IHtcclxuICAgICAgICAgICAgZWFjaChwcm9qZWN0Vmlld01vZGVsRmFjdG9yeShwcm9qZWN0SW5mb3JtYXRpb24sIF9zb2x1dGlvbi5wcm9qZWN0UGF0aCksIHByb2plY3QgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZm91bmQ6IFByb2plY3RWaWV3TW9kZWw8YW55PiA9IGZpbmQodGhpcy5wcm9qZWN0cywgeyBwYXRoOiBwcm9qZWN0LnBhdGggfSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoZm91bmQpIHtcclxuICAgICAgICAgICAgICAgICAgICBmb3VuZC51cGRhdGUocHJvamVjdCk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fcHJvamVjdENoYW5nZWRTdHJlYW0ubmV4dChwcm9qZWN0KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSkpO1xyXG5cclxuICAgICAgICB0aGlzLmRpc3Bvc2FibGUuYWRkKF9zb2x1dGlvbi5vYnNlcnZlLnByb2plY3RzLnN1YnNjcmliZShjb250ZXh0ID0+IHtcclxuICAgICAgICAgICAgZWFjaCh3b3Jrc3BhY2VWaWV3TW9kZWxGYWN0b3J5KGNvbnRleHQucmVzcG9uc2UsIF9zb2x1dGlvbi5wcm9qZWN0UGF0aCksIHByb2plY3QgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZm91bmQ6IFByb2plY3RWaWV3TW9kZWw8YW55PiA9IGZpbmQodGhpcy5wcm9qZWN0cywgeyBwYXRoOiBwcm9qZWN0LnBhdGggfSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoZm91bmQpIHtcclxuICAgICAgICAgICAgICAgICAgICBmb3VuZC51cGRhdGUocHJvamVjdCk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fcHJvamVjdENoYW5nZWRTdHJlYW0ubmV4dChwcm9qZWN0KTtcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wcm9qZWN0cy5wdXNoKHByb2plY3QpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3Byb2plY3RBZGRlZFN0cmVhbS5uZXh0KHByb2plY3QpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9KSk7XHJcblxyXG4gICAgICAgIHRoaXMuZGlzcG9zYWJsZS5hZGQodGhpcy5fcHJvamVjdEFkZGVkU3RyZWFtKTtcclxuICAgICAgICB0aGlzLmRpc3Bvc2FibGUuYWRkKHRoaXMuX3Byb2plY3RDaGFuZ2VkU3RyZWFtKTtcclxuICAgICAgICB0aGlzLmRpc3Bvc2FibGUuYWRkKHRoaXMuX3Byb2plY3RSZW1vdmVkU3RyZWFtKTtcclxuXHJcbiAgICAgICAgdGhpcy5kaXNwb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0b20uVGV4dEVkaXRvcikge1xyXG4gICAgICAgIHJldHVybiB0aGlzLmdldFByb2plY3RDb250YWluaW5nRmlsZShlZGl0b3IuZ2V0UGF0aCgpKTtcclxuICAgIH1cclxuXHJcbiAgICBwdWJsaWMgZ2V0UHJvamVjdENvbnRhaW5pbmdGaWxlKHBhdGg6IHN0cmluZykge1xyXG4gICAgICAgIGlmICh0aGlzLmlzT24gJiYgdGhpcy5wcm9qZWN0cy5sZW5ndGgpIHtcclxuICAgICAgICAgICAgY29uc3QgcHJvamVjdCA9IGZpbmQodGhpcy5wcm9qZWN0cywgeCA9PiBpbmNsdWRlcyh4LnNvdXJjZUZpbGVzLCBub3JtYWxpemUocGF0aCkpKTtcclxuICAgICAgICAgICAgaWYgKHByb2plY3QpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBPYnNlcnZhYmxlLm9mKHByb2plY3QpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBPYnNlcnZhYmxlLm9mKG51bGwpO1xyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm9ic2VydmUucHJvamVjdEFkZGVkXHJcbiAgICAgICAgICAgICAgICAuZmlsdGVyKHggPT4gaW5jbHVkZXMoeC5zb3VyY2VGaWxlcywgbm9ybWFsaXplKHBhdGgpKSlcclxuICAgICAgICAgICAgICAgIC50YWtlKDEpXHJcbiAgICAgICAgICAgICAgICAuZGVmYXVsdElmRW1wdHkobnVsbCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIHByaXZhdGUgX3VwZGF0ZVN0YXRlKHN0YXRlOiBEcml2ZXJTdGF0ZSkge1xyXG4gICAgICAgIHRoaXMuaXNPbiA9IHN0YXRlID09PSBEcml2ZXJTdGF0ZS5Db25uZWN0aW5nIHx8IHN0YXRlID09PSBEcml2ZXJTdGF0ZS5Db25uZWN0ZWQ7XHJcbiAgICAgICAgdGhpcy5pc09mZiA9IHN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GVsZXRlKHJlc3VsdC5GaWxlTmFtZSk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBncm91cGVkID0gZ3JvdXBCeShvbGQsIHggPT4geC5Mb2dMZXZlbC50b0xvd2VyQ2FzZSgpKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZWFjaChncm91cGVkLCAoaXRlbXMsIGtleSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc051bWJlcihjb3VudHNba2V5XSkpIHsgY291bnRzW2tleV0gPSAwOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudHNba2V5XSAtPSBpdGVtcy5sZW5ndGg7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY291bnRzW2tleV0gPCAwKSBjb3VudHNba2V5XSA9IDA7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaWFnbm9zdGljc0J5RmlsZS5zZXQocmVzdWx0LkZpbGVOYW1lLCBzb3J0QnkocmVzdWx0LlF1aWNrRml4ZXMsIHggPT4geC5MaW5lLCBxdWlja0ZpeCA9PiBxdWlja0ZpeC5Mb2dMZXZlbCwgeCA9PiB4LlRleHQpKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBncm91cGVkID0gZ3JvdXBCeShyZXN1bHQuUXVpY2tGaXhlcywgeCA9PiB4LkxvZ0xldmVsLnRvTG93ZXJDYXNlKCkpO1xyXG4gICAgICAgICAgICAgICAgICAgIGVhY2goZ3JvdXBlZCwgKGl0ZW1zLCBrZXkpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc051bWJlcihjb3VudHNba2V5XSkpIHsgY291bnRzW2tleV0gPSAwOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50c1trZXldICs9IGl0ZW1zLmxlbmd0aDtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVzO1xyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAuc2hhcmUoKTtcclxuXHJcbiAgICAgICAgY29uc3QgZGlhZ25vc3RpY3MgPSBiYXNlQ29kZWNoZWNrXHJcbiAgICAgICAgICAgIC5tYXAoeCA9PiB0aGlzLmRpYWdub3N0aWNzKVxyXG4gICAgICAgICAgICAucHVibGlzaFJlcGxheSgxKS5yZWZDb3VudCgpO1xyXG5cclxuICAgICAgICBjb25zdCBkaWFnbm9zdGljc0J5RmlsZSA9IGJhc2VDb2RlY2hlY2tcclxuICAgICAgICAgICAgLm1hcChmaWxlcyA9PiB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBtYXAgPSBuZXcgTWFwPHN0cmluZywgTW9kZWxzLkRpYWdub3N0aWNMb2NhdGlvbltdPigpO1xyXG4gICAgICAgICAgICAgICAgZWFjaChmaWxlcywgZmlsZSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgbWFwLnNldChmaWxlLCB0aGlzLmRpYWdub3N0aWNzQnlGaWxlLmdldChmaWxlKSk7XHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIHJldHVybiBtYXA7XHJcbiAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIC5wdWJsaXNoUmVwbGF5KDEpLnJlZkNvdW50KCk7XHJcblxyXG4gICAgICAgIGNvbnN0IGRpYWdub3N0aWNzQ291bnRzID0gYmFzZUNvZGVjaGVja1xyXG4gICAgICAgICAgICAubWFwKHggPT4gdGhpcy5kaWFnbm9zdGljQ291bnRzKVxyXG4gICAgICAgICAgICAucHVibGlzaFJlcGxheSgxKS5yZWZDb3VudCgpO1xyXG5cclxuICAgICAgICB0aGlzLmRpc3Bvc2FibGUuYWRkKGJhc2VDb2RlY2hlY2suc3Vic2NyaWJlKCkpO1xyXG4gICAgICAgIHJldHVybiB7IGRpYWdub3N0aWNzLCBkaWFnbm9zdGljc0J5RmlsZSwgZGlhZ25vc3RpY3NDb3VudHMgfTtcclxuICAgIH1cclxuXHJcbiAgICBwcml2YXRlIF9zZXR1cFN0YXR1cyhfc29sdXRpb246IFNvbHV0aW9uKSB7XHJcbiAgICAgICAgY29uc3Qgc3RhdHVzID0gX3NvbHV0aW9uLnN0YXR1c1xyXG4gICAgICAgICAgICAuc3RhcnRXaXRoKDxhbnk+e30pXHJcbiAgICAgICAgICAgIC5zaGFyZSgpO1xyXG5cclxuICAgICAgICByZXR1cm4gc3RhdHVzO1xyXG4gICAgfVxyXG59XHJcbiJdfQ==