diff --git a/.jshintignore b/.jshintignore
index bb4654421..8f9a6096e 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -1,4 +1,4 @@
-td/public/libs/
-td/public/app/threatdragon.js
-td/public/app/*.min.js
+td.site/libs/
+td.site/app/threatdragon.js
+td.site/app/*.min.js
td.tests/
\ No newline at end of file
diff --git a/karma.conf.js b/karma.conf.js
index b53428e0a..fc2e700e0 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -14,9 +14,9 @@ module.exports = function (config) {
// list of files / patterns to load in the browser
files: [
- 'td/public/app/app.js',
+ 'td.site/app/app.js',
'td.tests/clientspec/**/*.js',
- 'td/public/app/**/*.html'
+ 'td.site/app/**/*.html'
],
// list of files to exclude
@@ -26,8 +26,8 @@ module.exports = function (config) {
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
- 'td/public/app/**/*.html': ['ng-html2js'],
- 'td/public/app/app.js': ['browserify'],
+ 'td.site/app/**/*.html': ['ng-html2js'],
+ 'td.site/app/app.js': ['browserify'],
'td.tests/clientspec/test.js': ['browserify']
},
diff --git a/package.json b/package.json
index 34bd0dbec..ed6687c1d 100644
--- a/package.json
+++ b/package.json
@@ -4,21 +4,21 @@
"private": false,
"scripts": {
"build": "npm run-script bundle && npm run-script bundle-minify && npm run-script bundle-css && npm run-script bundle-minify-css && npm run-script copy-fonts",
- "build-templates": "browserify -t [browserify-ng-html2js --module templates] ./td/public/app/templates.build.js -o ./td/public/app/templates.js",
- "copy-fonts": "./node_modules/.bin/copyfiles -f ./node_modules/font-awesome/fonts/*.* ./node_modules/bootstrap/dist/fonts/*.* ./td/public/fonts",
- "bundle-css": "./node_modules/.bin/rework-npm ./td/public/content/app.css -o ./td/public/content/threatdragon.css",
- "minify-css": "./node_modules/.bin/uglifycss ./td/public/content/threatdragon.css > ./td/public/content/threatdragon.min.css",
+ "build-templates": "browserify -t [browserify-ng-html2js --module templates] ./td.site/app/templates.build.js -o ./td.site/app/templates.js",
+ "copy-fonts": "./node_modules/.bin/copyfiles -f ./node_modules/font-awesome/fonts/*.* ./node_modules/bootstrap/dist/fonts/*.* ./td.site/fonts",
+ "bundle-css": "./node_modules/.bin/rework-npm ./td.site/content/app.css -o ./td.site/content/threatdragon.css",
+ "minify-css": "./node_modules/.bin/uglifycss ./td.site/content/threatdragon.css > ./td.site/content/threatdragon.min.css",
"bundle-minify-css": "npm run-script bundle-css && npm run-script minify-css",
- "bundle": "browserify --debug ./td/public/app/app.js -o ./td/public/app/threatdragon.js",
- "bundle-minify": "browserify ./td/public/app/app.js -d -p [minifyify --map ./td/public/app/threatdragon.js.map --output ./td/public/app/threatdragon.js.map ] > ./td/public/app/threatdragon.min.js",
+ "bundle": "browserify --debug ./td.site/app/app.js -o ./td.site/app/threatdragon.js",
+ "bundle-minify": "browserify ./td.site/app/app.js -d -p [minifyify --map ./td.site/app/threatdragon.js.map --output ./td.site/app/threatdragon.js.map ] > ./td.site/app/threatdragon.min.js",
"start": "node server.js",
- "pretest": "node ./node_modules/jshint/bin/jshint --verbose --show-non-errors td",
+ "pretest": "node ./node_modules/jshint/bin/jshint --verbose --show-non-errors td.server td.site",
"test": "npm run-script test-client-firefox && npm run-script test-server",
"test-client-phantomjs": "./node_modules/.bin/karma start --single-run --browsers PhantomJS",
"test-client-firefox": "./node_modules/.bin/karma start --single-run --browsers Firefox",
"test-client-chrome": "./node_modules/.bin/karma start --single-run --browsers Chrome",
"test-client-ie": "./node_modules/.bin/karma start --single-run --browsers IE",
- "test-server": "istanbul cover --include-all-sources -x public/** --root ./td/ --dir ./coverage/Server/ ./td.tests/serverspec/support/jasmine-runner.js",
+ "test-server": "istanbul cover --include-all-sources -x ./td.site --root ./td.server/ --dir ./coverage/Server/ ./td.tests/serverspec/support/jasmine-runner.js",
"test-local": "npm run-script pretest && npm run-script test-client-chrome && npm run-script test-client-ie && npm run-script test-client-phantomjs && npm run-script test-client-firefox && npm run-script test-server",
"citest": "./node_modules/.bin/karma start --single-run false --browsers Firefox",
"codecov": "./node_modules/.bin/codecov"
diff --git a/server.js b/server.js
index 26067b4c0..21545007c 100644
--- a/server.js
+++ b/server.js
@@ -1,5 +1,5 @@
var debug = require('debug')('OWASP Threat Dragon');
-var app = require('./td/app');
+var app = require('./td.server/app');
app.set('port', process.env.PORT || 3000);
diff --git a/td/app.js b/td.server/app.js
similarity index 80%
rename from td/app.js
rename to td.server/app.js
index 76c928b0f..5004ef1bf 100644
--- a/td/app.js
+++ b/td.server/app.js
@@ -3,17 +3,19 @@ var path = require('path');
var favicon = require('serve-favicon');
var bunyan = require('bunyan');
+var upDir = '..' + path.sep;
+
try {
var app = express();
app.set('trust proxy', true);
- app.set('views', './td/views');
+ app.set('views', path.join(__dirname, upDir, 'td.site', 'views'));
app.set('view engine', 'pug');
// environment configuration
require('./config/env.config').tryLoadDotEnv();
//static content
- app.use('/public', express.static(path.join(__dirname, 'public')));
+ app.use('/public', express.static(path.join(__dirname, upDir, 'td.site')));
//security headers
require('./config/securityheaders.config')(app);
@@ -25,7 +27,7 @@ try {
require('./config/passport.config')(app);
//favicon
- app.use(favicon(__dirname + '/public/favicon.ico'));
+ app.use(favicon(path.join(__dirname, upDir, 'td.site', 'favicon.ico')));
//logging
require('./config/loggers.config').config(app);
diff --git a/td/config/env.config.js b/td.server/config/env.config.js
similarity index 100%
rename from td/config/env.config.js
rename to td.server/config/env.config.js
diff --git a/td/config/loggers.config.js b/td.server/config/loggers.config.js
similarity index 100%
rename from td/config/loggers.config.js
rename to td.server/config/loggers.config.js
diff --git a/td/config/parsers.config.js b/td.server/config/parsers.config.js
similarity index 100%
rename from td/config/parsers.config.js
rename to td.server/config/parsers.config.js
diff --git a/td/config/passport.config.js b/td.server/config/passport.config.js
similarity index 100%
rename from td/config/passport.config.js
rename to td.server/config/passport.config.js
diff --git a/td/config/routes.config.js b/td.server/config/routes.config.js
similarity index 100%
rename from td/config/routes.config.js
rename to td.server/config/routes.config.js
diff --git a/td/config/securityheaders.config.js b/td.server/config/securityheaders.config.js
similarity index 100%
rename from td/config/securityheaders.config.js
rename to td.server/config/securityheaders.config.js
diff --git a/td/config/session.config.js b/td.server/config/session.config.js
similarity index 100%
rename from td/config/session.config.js
rename to td.server/config/session.config.js
diff --git a/td/controllers/githublogincontroller.js b/td.server/controllers/githublogincontroller.js
similarity index 100%
rename from td/controllers/githublogincontroller.js
rename to td.server/controllers/githublogincontroller.js
diff --git a/td/controllers/homecontroller.js b/td.server/controllers/homecontroller.js
similarity index 93%
rename from td/controllers/homecontroller.js
rename to td.server/controllers/homecontroller.js
index 591385c3e..e96bb63e7 100644
--- a/td/controllers/homecontroller.js
+++ b/td.server/controllers/homecontroller.js
@@ -14,7 +14,7 @@ homeController.index = function (req, res) {
}
res.cookie('XSRF-TOKEN', req.csrfToken(), cookieOptions);
- res.sendFile(path.join(__dirname, '../', 'index.html'));
+ res.sendFile(path.join(__dirname, '..' + path.sep, '..' + path.sep, 'td.site', 'index.html'));
};
homeController.login = function (req, res) {
diff --git a/td/controllers/threatmodelcontroller.js b/td.server/controllers/threatmodelcontroller.js
similarity index 100%
rename from td/controllers/threatmodelcontroller.js
rename to td.server/controllers/threatmodelcontroller.js
diff --git a/td/helpers/encryption.helper.js b/td.server/helpers/encryption.helper.js
similarity index 100%
rename from td/helpers/encryption.helper.js
rename to td.server/helpers/encryption.helper.js
diff --git a/td/repositories/threatmodelrepository.js b/td.server/repositories/threatmodelrepository.js
similarity index 100%
rename from td/repositories/threatmodelrepository.js
rename to td.server/repositories/threatmodelrepository.js
diff --git a/td/public/app/.jshintrc b/td.site/app/.jshintrc
similarity index 100%
rename from td/public/app/.jshintrc
rename to td.site/app/.jshintrc
diff --git a/td/public/app/app.js b/td.site/app/app.js
similarity index 100%
rename from td/public/app/app.js
rename to td.site/app/app.js
diff --git a/td/public/app/config.exceptionHandler.js b/td.site/app/config.exceptionHandler.js
similarity index 100%
rename from td/public/app/config.exceptionHandler.js
rename to td.site/app/config.exceptionHandler.js
diff --git a/td/public/app/config.route.js b/td.site/app/config.route.js
similarity index 100%
rename from td/public/app/config.route.js
rename to td.site/app/config.route.js
diff --git a/td/public/app/layout/index.js b/td.site/app/layout/index.js
similarity index 100%
rename from td/public/app/layout/index.js
rename to td.site/app/layout/index.js
diff --git a/td/public/app/layout/shell.html b/td.site/app/layout/shell.html
similarity index 100%
rename from td/public/app/layout/shell.html
rename to td.site/app/layout/shell.html
diff --git a/td/public/app/layout/shell.js b/td.site/app/layout/shell.js
similarity index 100%
rename from td/public/app/layout/shell.js
rename to td.site/app/layout/shell.js
diff --git a/td/public/app/layout/topnav.html b/td.site/app/layout/topnav.html
similarity index 100%
rename from td/public/app/layout/topnav.html
rename to td.site/app/layout/topnav.html
diff --git a/td/public/app/services/datacontext.js b/td.site/app/services/datacontext.js
similarity index 100%
rename from td/public/app/services/datacontext.js
rename to td.site/app/services/datacontext.js
diff --git a/td/public/app/services/index.js b/td.site/app/services/index.js
similarity index 100%
rename from td/public/app/services/index.js
rename to td.site/app/services/index.js
diff --git a/td/public/app/services/threatmodellocator.js b/td.site/app/services/threatmodellocator.js
similarity index 100%
rename from td/public/app/services/threatmodellocator.js
rename to td.site/app/services/threatmodellocator.js
diff --git a/td/public/app/threatdragon.js b/td.site/app/threatdragon.js
similarity index 71%
rename from td/public/app/threatdragon.js
rename to td.site/app/threatdragon.js
index ae945a06b..4774de917 100644
--- a/td/public/app/threatdragon.js
+++ b/td.site/app/threatdragon.js
@@ -1,7 +1,7 @@
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i
- * It is not possible to whitelist specific URLs/paths. The `path`, `query` and `fragment` parts
+ * It is not possible to trust specific URLs/paths. The `path`, `query` and `fragment` parts
* of a URL will be ignored. For example, `https://foo.com/path/bar?query=baz#fragment` will be
* treated as `https://foo.com`, meaning that **all** requests to URLs starting with
* `https://foo.com/` will include the XSRF token.
@@ -28575,9 +28617,9 @@ function $HttpProvider() {
* ```js
* // App served from `https://example.com/`.
* angular.
- * module('xsrfWhitelistedOriginsExample', []).
+ * module('xsrfTrustedOriginsExample', []).
* config(['$httpProvider', function($httpProvider) {
- * $httpProvider.xsrfWhitelistedOrigins.push('https://api.example.com');
+ * $httpProvider.xsrfTrustedOrigins.push('https://api.example.com');
* }]).
* run(['$http', function($http) {
* // The XSRF token will be sent.
@@ -28588,7 +28630,27 @@ function $HttpProvider() {
* }]);
* ```
*/
- var xsrfWhitelistedOrigins = this.xsrfWhitelistedOrigins = [];
+ var xsrfTrustedOrigins = this.xsrfTrustedOrigins = [];
+
+ /**
+ * @ngdoc property
+ * @name $httpProvider#xsrfWhitelistedOrigins
+ * @description
+ *
+ * @deprecated
+ * sinceVersion="1.8.1"
+ *
+ * This property is deprecated. Use {@link $httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins}
+ * instead.
+ */
+ Object.defineProperty(this, 'xsrfWhitelistedOrigins', {
+ get: function() {
+ return this.xsrfTrustedOrigins;
+ },
+ set: function(origins) {
+ this.xsrfTrustedOrigins = origins;
+ }
+ });
this.$get = ['$browser', '$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector', '$sce',
function($browser, $httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector, $sce) {
@@ -28616,7 +28678,7 @@ function $HttpProvider() {
/**
* A function to check request URLs against a list of allowed origins.
*/
- var urlIsAllowedOrigin = urlIsAllowedOriginFactory(xsrfWhitelistedOrigins);
+ var urlIsAllowedOrigin = urlIsAllowedOriginFactory(xsrfTrustedOrigins);
/**
* @ngdoc service
@@ -28990,16 +29052,16 @@ function $HttpProvider() {
* The header will — by default — **not** be set for cross-domain requests. This
* prevents unauthorized servers (e.g. malicious or compromised 3rd-party APIs) from gaining
* access to your users' XSRF tokens and exposing them to Cross Site Request Forgery. If you
- * want to, you can whitelist additional origins to also receive the XSRF token, by adding them
- * to {@link ng.$httpProvider#xsrfWhitelistedOrigins xsrfWhitelistedOrigins}. This might be
+ * want to, you can trust additional origins to also receive the XSRF token, by adding them
+ * to {@link ng.$httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins}. This might be
* useful, for example, if your application, served from `example.com`, needs to access your API
* at `api.example.com`.
- * See {@link ng.$httpProvider#xsrfWhitelistedOrigins $httpProvider.xsrfWhitelistedOrigins} for
+ * See {@link ng.$httpProvider#xsrfTrustedOrigins $httpProvider.xsrfTrustedOrigins} for
* more details.
*
*
* **Warning**
- * Only whitelist origins that you have control over and make sure you understand the
+ * Only trusted origins that you have control over and make sure you understand the
* implications of doing so.
*
*
@@ -29126,8 +29188,8 @@ function $HttpProvider() {
angular.module('httpExample', [])
.config(['$sceDelegateProvider', function($sceDelegateProvider) {
- // We must whitelist the JSONP endpoint that we are using to show that we trust it
- $sceDelegateProvider.resourceUrlWhitelist([
+ // We must add the JSONP endpoint that we are using to the trusted list to show that we trust it
+ $sceDelegateProvider.trustedResourceUrlList([
'self',
'https://angularjs.org/**'
]);
@@ -29384,8 +29446,8 @@ function $HttpProvider() {
*
* Note that, since JSONP requests are sensitive because the response is given full access to the browser,
* the url must be declared, via {@link $sce} as a trusted resource URL.
- * You can trust a URL by adding it to the whitelist via
- * {@link $sceDelegateProvider#resourceUrlWhitelist `$sceDelegateProvider.resourceUrlWhitelist`} or
+ * You can trust a URL by adding it to the trusted resource URL list via
+ * {@link $sceDelegateProvider#trustedResourceUrlList `$sceDelegateProvider.trustedResourceUrlList`} or
* by explicitly trusting the URL via {@link $sce#trustAsResourceUrl `$sce.trustAsResourceUrl(url)`}.
*
* You should avoid generating the URL for the JSONP request from user provided data.
@@ -36121,12 +36183,12 @@ function $RootScopeProvider() {
*/
function $$SanitizeUriProvider() {
- var aHrefSanitizationWhitelist = /^\s*(https?|s?ftp|mailto|tel|file):/,
- imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/;
+ var aHrefSanitizationTrustedUrlList = /^\s*(https?|s?ftp|mailto|tel|file):/,
+ imgSrcSanitizationTrustedUrlList = /^\s*((https?|ftp|file|blob):|data:image\/)/;
/**
* @description
- * Retrieves or overrides the default regular expression that is used for whitelisting of safe
+ * Retrieves or overrides the default regular expression that is used for determining trusted safe
* urls during a[href] sanitization.
*
* The sanitization is a security measure aimed at prevent XSS attacks via HTML anchor links.
@@ -36135,27 +36197,27 @@ function $$SanitizeUriProvider() {
* the $sce.URL security context. When interpolation occurs a call is made to `$sce.trustAsUrl(url)`
* which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize the potentially malicious URL.
*
- * If the URL matches the `aHrefSanitizationWhitelist` regular expression, it is returned unchanged.
+ * If the URL matches the `aHrefSanitizationTrustedUrlList` regular expression, it is returned unchanged.
*
* If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written
* to the DOM it is inactive and potentially malicious code will not be executed.
*
- * @param {RegExp=} regexp New regexp to whitelist urls with.
+ * @param {RegExp=} regexp New regexp to trust urls with.
* @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
* chaining otherwise.
*/
- this.aHrefSanitizationWhitelist = function(regexp) {
+ this.aHrefSanitizationTrustedUrlList = function(regexp) {
if (isDefined(regexp)) {
- aHrefSanitizationWhitelist = regexp;
+ aHrefSanitizationTrustedUrlList = regexp;
return this;
}
- return aHrefSanitizationWhitelist;
+ return aHrefSanitizationTrustedUrlList;
};
/**
* @description
- * Retrieves or overrides the default regular expression that is used for whitelisting of safe
+ * Retrieves or overrides the default regular expression that is used for determining trusted safe
* urls during img[src] sanitization.
*
* The sanitization is a security measure aimed at prevent XSS attacks via HTML image src links.
@@ -36165,27 +36227,28 @@ function $$SanitizeUriProvider() {
* `$sce.trustAsMediaUrl(url)` which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize
* the potentially malicious URL.
*
- * If the URL matches the `aImgSanitizationWhitelist` regular expression, it is returned unchanged.
+ * If the URL matches the `imgSrcSanitizationTrustedUrlList` regular expression, it is returned
+ * unchanged.
*
* If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written
* to the DOM it is inactive and potentially malicious code will not be executed.
*
- * @param {RegExp=} regexp New regexp to whitelist urls with.
+ * @param {RegExp=} regexp New regexp to trust urls with.
* @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
* chaining otherwise.
*/
- this.imgSrcSanitizationWhitelist = function(regexp) {
+ this.imgSrcSanitizationTrustedUrlList = function(regexp) {
if (isDefined(regexp)) {
- imgSrcSanitizationWhitelist = regexp;
+ imgSrcSanitizationTrustedUrlList = regexp;
return this;
}
- return imgSrcSanitizationWhitelist;
+ return imgSrcSanitizationTrustedUrlList;
};
this.$get = function() {
return function sanitizeUri(uri, isMediaUrl) {
// if (!uri) return uri;
- var regex = isMediaUrl ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;
+ var regex = isMediaUrl ? imgSrcSanitizationTrustedUrlList : aHrefSanitizationTrustedUrlList;
var normalizedVal = urlResolve(uri && uri.trim()).href;
if (normalizedVal !== '' && !normalizedVal.match(regex)) {
return 'unsafe:' + normalizedVal;
@@ -36313,10 +36376,10 @@ function adjustMatchers(matchers) {
* The default instance of `$sceDelegate` should work out of the box with little pain. While you
* can override it completely to change the behavior of `$sce`, the common case would
* involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting
- * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as
- * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist
- * $sceDelegateProvider.resourceUrlWhitelist} and {@link
- * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}
+ * your own trusted and banned resource lists for trusting URLs used for loading AngularJS resources
+ * such as templates. Refer {@link ng.$sceDelegateProvider#trustedResourceUrlList
+ * $sceDelegateProvider.trustedResourceUrlList} and {@link
+ * ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList}
*/
/**
@@ -36329,12 +36392,12 @@ function adjustMatchers(matchers) {
* The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate
* $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}.
*
- * The `$sceDelegateProvider` allows one to get/set the whitelists and blacklists used to ensure
- * that the URLs used for sourcing AngularJS templates and other script-running URLs are safe (all
- * places that use the `$sce.RESOURCE_URL` context). See
- * {@link ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist}
- * and
- * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist},
+ * The `$sceDelegateProvider` allows one to get/set the `trustedResourceUrlList` and
+ * `bannedResourceUrlList` used to ensure that the URLs used for sourcing AngularJS templates and
+ * other script-running URLs are safe (all places that use the `$sce.RESOURCE_URL` context). See
+ * {@link ng.$sceDelegateProvider#trustedResourceUrlList
+ * $sceDelegateProvider.trustedResourceUrlList} and
+ * {@link ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList},
*
* For the general details about this service in AngularJS, read the main page for {@link ng.$sce
* Strict Contextual Escaping (SCE)}.
@@ -36350,98 +36413,139 @@ function adjustMatchers(matchers) {
*
* ```
* angular.module('myApp', []).config(function($sceDelegateProvider) {
- * $sceDelegateProvider.resourceUrlWhitelist([
+ * $sceDelegateProvider.trustedResourceUrlList([
* // Allow same origin resource loads.
* 'self',
* // Allow loading from our assets domain. Notice the difference between * and **.
* 'http://srv*.assets.example.com/**'
* ]);
*
- * // The blacklist overrides the whitelist so the open redirect here is blocked.
- * $sceDelegateProvider.resourceUrlBlacklist([
+ * // The banned resource URL list overrides the trusted resource URL list so the open redirect
+ * // here is blocked.
+ * $sceDelegateProvider.bannedResourceUrlList([
* 'http://myapp.example.com/clickThru**'
* ]);
* });
* ```
- * Note that an empty whitelist will block every resource URL from being loaded, and will require
+ * Note that an empty trusted resource URL list will block every resource URL from being loaded, and will require
* you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates
* requested by {@link ng.$templateRequest $templateRequest} that are present in
* {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism
* to populate your templates in that cache at config time, then it is a good idea to remove 'self'
- * from that whitelist. This helps to mitigate the security impact of certain types of issues, like
- * for instance attacker-controlled `ng-includes`.
+ * from the trusted resource URL lsit. This helps to mitigate the security impact of certain types
+ * of issues, like for instance attacker-controlled `ng-includes`.
*/
function $SceDelegateProvider() {
this.SCE_CONTEXTS = SCE_CONTEXTS;
// Resource URLs can also be trusted by policy.
- var resourceUrlWhitelist = ['self'],
- resourceUrlBlacklist = [];
+ var trustedResourceUrlList = ['self'],
+ bannedResourceUrlList = [];
/**
* @ngdoc method
- * @name $sceDelegateProvider#resourceUrlWhitelist
+ * @name $sceDelegateProvider#trustedResourceUrlList
* @kind function
*
- * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value
- * provided. This must be an array or null. A snapshot of this array is used so further
- * changes to the array are ignored.
+ * @param {Array=} trustedResourceUrlList When provided, replaces the trustedResourceUrlList with
+ * the value provided. This must be an array or null. A snapshot of this array is used so
+ * further changes to the array are ignored.
* Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
* allowed in this array.
*
- * @return {Array} The currently set whitelist array.
+ * @return {Array} The currently set trusted resource URL array.
*
* @description
- * Sets/Gets the whitelist of trusted resource URLs.
+ * Sets/Gets the list trusted of resource URLs.
*
- * The **default value** when no whitelist has been explicitly set is `['self']` allowing only
- * same origin resource requests.
+ * The **default value** when no `trustedResourceUrlList` has been explicitly set is `['self']`
+ * allowing only same origin resource requests.
*
*
- * **Note:** the default whitelist of 'self' is not recommended if your app shares its origin
- * with other apps! It is a good idea to limit it to only your application's directory.
+ * **Note:** the default `trustedResourceUrlList` of 'self' is not recommended if your app shares
+ * its origin with other apps! It is a good idea to limit it to only your application's directory.
*
*/
- this.resourceUrlWhitelist = function(value) {
+ this.trustedResourceUrlList = function(value) {
if (arguments.length) {
- resourceUrlWhitelist = adjustMatchers(value);
+ trustedResourceUrlList = adjustMatchers(value);
}
- return resourceUrlWhitelist;
+ return trustedResourceUrlList;
};
/**
* @ngdoc method
- * @name $sceDelegateProvider#resourceUrlBlacklist
+ * @name $sceDelegateProvider#resourceUrlWhitelist
* @kind function
*
- * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value
- * provided. This must be an array or null. A snapshot of this array is used so further
- * changes to the array are ignored.
+ * @deprecated
+ * sinceVersion="1.8.1"
+ *
+ * This method is deprecated. Use {@link $sceDelegateProvider#trustedResourceUrlList
+ * trustedResourceUrlList} instead.
+ */
+ Object.defineProperty(this, 'resourceUrlWhitelist', {
+ get: function() {
+ return this.trustedResourceUrlList;
+ },
+ set: function(value) {
+ this.trustedResourceUrlList = value;
+ }
+ });
+
+ /**
+ * @ngdoc method
+ * @name $sceDelegateProvider#bannedResourceUrlList
+ * @kind function
+ *
+ * @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with
+ * the value provided. This must be an array or null. A snapshot of this array is used so
+ * further changes to the array are ignored.
* Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
* allowed in this array.
- * The typical usage for the blacklist is to **block
+ * The typical usage for the `bannedResourceUrlList` is to **block
* [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as
* these would otherwise be trusted but actually return content from the redirected domain.
*
- * Finally, **the blacklist overrides the whitelist** and has the final say.
+ * Finally, **the banned resource URL list overrides the trusted resource URL list** and has
+ * the final say.
*
- * @return {Array} The currently set blacklist array.
+ * @return {Array} The currently set `bannedResourceUrlList` array.
*
* @description
- * Sets/Gets the blacklist of trusted resource URLs.
+ * Sets/Gets the `bannedResourceUrlList` of trusted resource URLs.
*
- * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there
- * is no blacklist.)
+ * The **default value** when no trusted resource URL list has been explicitly set is the empty
+ * array (i.e. there is no `bannedResourceUrlList`.)
*/
-
- this.resourceUrlBlacklist = function(value) {
+ this.bannedResourceUrlList = function(value) {
if (arguments.length) {
- resourceUrlBlacklist = adjustMatchers(value);
+ bannedResourceUrlList = adjustMatchers(value);
}
- return resourceUrlBlacklist;
+ return bannedResourceUrlList;
};
+ /**
+ * @ngdoc method
+ * @name $sceDelegateProvider#resourceUrlBlacklist
+ * @kind function
+ *
+ * @deprecated
+ * sinceVersion="1.8.1"
+ *
+ * This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList
+ * bannedResourceUrlList} instead.
+ */
+ Object.defineProperty(this, 'resourceUrlBlacklist', {
+ get: function() {
+ return this.bannedResourceUrlList;
+ },
+ set: function(value) {
+ this.bannedResourceUrlList = value;
+ }
+ });
+
this.$get = ['$injector', '$$sanitizeUri', function($injector, $$sanitizeUri) {
var htmlSanitizer = function htmlSanitizer(html) {
@@ -36465,17 +36569,17 @@ function $SceDelegateProvider() {
function isResourceUrlAllowedByPolicy(url) {
var parsedUrl = urlResolve(url.toString());
var i, n, allowed = false;
- // Ensure that at least one item from the whitelist allows this url.
- for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {
- if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {
+ // Ensure that at least one item from the trusted resource URL list allows this url.
+ for (i = 0, n = trustedResourceUrlList.length; i < n; i++) {
+ if (matchUrl(trustedResourceUrlList[i], parsedUrl)) {
allowed = true;
break;
}
}
if (allowed) {
- // Ensure that no item from the blacklist blocked this url.
- for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {
- if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {
+ // Ensure that no item from the banned resource URL list has blocked this url.
+ for (i = 0, n = bannedResourceUrlList.length; i < n; i++) {
+ if (matchUrl(bannedResourceUrlList[i], parsedUrl)) {
allowed = false;
break;
}
@@ -36596,9 +36700,9 @@ function $SceDelegateProvider() {
* The contexts that can be sanitized are $sce.MEDIA_URL, $sce.URL and $sce.HTML. The first two are available
* by default, and the third one relies on the `$sanitize` service (which may be loaded through
* the `ngSanitize` module). Furthermore, for $sce.RESOURCE_URL context, a plain string may be
- * accepted if the resource url policy defined by {@link ng.$sceDelegateProvider#resourceUrlWhitelist
- * `$sceDelegateProvider.resourceUrlWhitelist`} and {@link ng.$sceDelegateProvider#resourceUrlBlacklist
- * `$sceDelegateProvider.resourceUrlBlacklist`} accepts that resource.
+ * accepted if the resource url policy defined by {@link ng.$sceDelegateProvider#trustedResourceUrlList
+ * `$sceDelegateProvider.trustedResourceUrlList`} and {@link ng.$sceDelegateProvider#bannedResourceUrlList
+ * `$sceDelegateProvider.bannedResourceUrlList`} accepts that resource.
*
* This function will throw if the safe type isn't appropriate for this context, or if the
* value given cannot be accepted in the context (which might be caused by sanitization not
@@ -36692,9 +36796,9 @@ function $SceDelegateProvider() {
*
* To systematically block XSS security bugs, AngularJS treats all values as untrusted by default in
* HTML or sensitive URL bindings. When binding untrusted values, AngularJS will automatically
- * run security checks on them (sanitizations, whitelists, depending on context), or throw when it
- * cannot guarantee the security of the result. That behavior depends strongly on contexts: HTML
- * can be sanitized, but template URLs cannot, for instance.
+ * run security checks on them (sanitizations, trusted URL resource, depending on context), or throw
+ * when it cannot guarantee the security of the result. That behavior depends strongly on contexts:
+ * HTML can be sanitized, but template URLs cannot, for instance.
*
* To illustrate this, consider the `ng-bind-html` directive. It renders its value directly as HTML:
* we call that the *context*. When given an untrusted input, AngularJS will attempt to sanitize it
@@ -36773,8 +36877,8 @@ function $SceDelegateProvider() {
* By default, AngularJS only loads templates from the same domain and protocol as the application
* document. This is done by calling {@link ng.$sce#getTrustedResourceUrl
* $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or
- * protocols, you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist
- * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value.
+ * protocols, you may either add them to the {@link ng.$sceDelegateProvider#trustedResourceUrlList
+ * trustedResourceUrlList} or {@link ng.$sce#trustAsResourceUrl wrap them} into trusted values.
*
* *Please note*:
* The browser's
@@ -36802,8 +36906,8 @@ function $SceDelegateProvider() {
* templates in `ng-include` from your application's domain without having to even know about SCE.
* It blocks loading templates from other domains or loading templates over http from an https
* served document. You can change these by setting your own custom {@link
- * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link
- * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs.
+ * ng.$sceDelegateProvider#trustedResourceUrlList trusted resource URL list} and {@link
+ * ng.$sceDelegateProvider#bannedResourceUrlList banned resource URL list} for matching such URLs.
*
* This significantly reduces the overhead. It is far easier to pay the small overhead and have an
* application that's secure and can be audited to verify that with much more ease than bolting
@@ -36818,7 +36922,7 @@ function $SceDelegateProvider() {
* | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |
* | `$sce.MEDIA_URL` | For URLs that are safe to render as media. Is automatically converted from string by sanitizing when needed. |
* | `$sce.URL` | For URLs that are safe to follow as links. Is automatically converted from string by sanitizing when needed. Note that `$sce.URL` makes a stronger statement about the URL than `$sce.MEDIA_URL` does and therefore contexts requiring values trusted for `$sce.URL` can be used anywhere that values trusted for `$sce.MEDIA_URL` are required.|
- * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.) Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` or `$sce.MEDIA_URL` do and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` or `$sce.MEDIA_URL` are required. The {@link $sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider#resourceUrlWhitelist()} and {@link $sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider#resourceUrlBlacklist()} can be used to restrict trusted origins for `RESOURCE_URL` |
+ * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.) Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` or `$sce.MEDIA_URL` do and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` or `$sce.MEDIA_URL` are required. The {@link $sceDelegateProvider#trustedResourceUrlList $sceDelegateProvider#trustedResourceUrlList()} and {@link $sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider#bannedResourceUrlList()} can be used to restrict trusted origins for `RESOURCE_URL` |
* | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. |
*
*
@@ -36836,7 +36940,7 @@ function $SceDelegateProvider() {
* There are no CSS or JS context bindings in AngularJS currently, so their corresponding `$sce.trustAs`
* functions aren't useful yet. This might evolve.
*
- * ### Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist}
+ * ### Format of items in {@link ng.$sceDelegateProvider#trustedResourceUrlList trustedResourceUrlList}/{@link ng.$sceDelegateProvider#bannedResourceUrlList bannedResourceUrlList}
*
* Each element in these arrays must be one of the following:
*
@@ -36850,7 +36954,7 @@ function $SceDelegateProvider() {
* match themselves.
* - `*`: matches zero or more occurrences of any character other than one of the following 6
* characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use
- * in a whitelist.
+ * for matching resource URL lists.
* - `**`: matches zero or more occurrences of *any* character. As such, it's not
* appropriate for use in a scheme, domain, etc. as it would match too much. (e.g.
* http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might
@@ -37654,10 +37758,10 @@ function $TemplateRequestProvider() {
handleRequestFn.totalPendingRequests++;
// We consider the template cache holds only trusted templates, so
- // there's no need to go through whitelisting again for keys that already
- // are included in there. This also makes AngularJS accept any script
- // directive, no matter its name. However, we still need to unwrap trusted
- // types.
+ // there's no need to go through adding the template again to the trusted
+ // resources for keys that already are included in there. This also makes
+ // AngularJS accept any script directive, no matter its name. However, we
+ // still need to unwrap trusted types.
if (!isString(tpl) || isUndefined($templateCache.get(tpl))) {
tpl = $sce.getTrustedResourceUrl(tpl);
}
@@ -38062,20 +38166,20 @@ function urlIsSameOriginAsBaseUrl(requestUrl) {
}
/**
- * Create a function that can check a URL's origin against a list of allowed/whitelisted origins.
+ * Create a function that can check a URL's origin against a list of allowed/trusted origins.
* The current location's origin is implicitly trusted.
*
- * @param {string[]} whitelistedOriginUrls - A list of URLs (strings), whose origins are trusted.
+ * @param {string[]} trustedOriginUrls - A list of URLs (strings), whose origins are trusted.
*
* @returns {Function} - A function that receives a URL (string or parsed URL object) and returns
* whether it is of an allowed origin.
*/
-function urlIsAllowedOriginFactory(whitelistedOriginUrls) {
- var parsedAllowedOriginUrls = [originUrl].concat(whitelistedOriginUrls.map(urlResolve));
+function urlIsAllowedOriginFactory(trustedOriginUrls) {
+ var parsedAllowedOriginUrls = [originUrl].concat(trustedOriginUrls.map(urlResolve));
/**
* Check whether the specified URL (string or parsed URL object) has an origin that is allowed
- * based on a list of whitelisted-origin URLs. The current location's origin is implicitly
+ * based on a list of trusted-origin URLs. The current location's origin is implicitly
* trusted.
*
* @param {string|Object} requestUrl - The URL to be checked (provided as a string that will be
@@ -45822,9 +45926,9 @@ var ngIfDirective = ['$animate', '$compile', function($animate, $compile) {
* By default, the template URL is restricted to the same domain and protocol as the
* application document. This is done by calling {@link $sce#getTrustedResourceUrl
* $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols
- * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or
- * {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to AngularJS's {@link
- * ng.$sce Strict Contextual Escaping}.
+ * you may either add them to your {@link ng.$sceDelegateProvider#trustedResourceUrlList trusted
+ * resource URL list} or {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to
+ * AngularJS's {@link ng.$sce Strict Contextual Escaping}.
*
* In addition, the browser's
* [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
@@ -54774,9 +54878,7 @@ function fromByteArray (uint8) {
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(
- uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
- ))
+ parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
}
// pad the end with zeros, but make sure to not forget the extra bytes
@@ -59215,531 +59317,6 @@ function numberIsNaN (obj) {
}).call(this)}).call(this,require("buffer").Buffer)
},{"base64-js":12,"buffer":27,"ieee754":90}],28:[function(require,module,exports){
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-var objectCreate = Object.create || objectCreatePolyfill
-var objectKeys = Object.keys || objectKeysPolyfill
-var bind = Function.prototype.bind || functionBindPolyfill
-
-function EventEmitter() {
- if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) {
- this._events = objectCreate(null);
- this._eventsCount = 0;
- }
-
- this._maxListeners = this._maxListeners || undefined;
-}
-module.exports = EventEmitter;
-
-// Backwards-compat with node 0.10.x
-EventEmitter.EventEmitter = EventEmitter;
-
-EventEmitter.prototype._events = undefined;
-EventEmitter.prototype._maxListeners = undefined;
-
-// By default EventEmitters will print a warning if more than 10 listeners are
-// added to it. This is a useful default which helps finding memory leaks.
-var defaultMaxListeners = 10;
-
-var hasDefineProperty;
-try {
- var o = {};
- if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 });
- hasDefineProperty = o.x === 0;
-} catch (err) { hasDefineProperty = false }
-if (hasDefineProperty) {
- Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
- enumerable: true,
- get: function() {
- return defaultMaxListeners;
- },
- set: function(arg) {
- // check whether the input is a positive number (whose value is zero or
- // greater and not a NaN).
- if (typeof arg !== 'number' || arg < 0 || arg !== arg)
- throw new TypeError('"defaultMaxListeners" must be a positive number');
- defaultMaxListeners = arg;
- }
- });
-} else {
- EventEmitter.defaultMaxListeners = defaultMaxListeners;
-}
-
-// Obviously not all Emitters should be limited to 10. This function allows
-// that to be increased. Set to zero for unlimited.
-EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
- if (typeof n !== 'number' || n < 0 || isNaN(n))
- throw new TypeError('"n" argument must be a positive number');
- this._maxListeners = n;
- return this;
-};
-
-function $getMaxListeners(that) {
- if (that._maxListeners === undefined)
- return EventEmitter.defaultMaxListeners;
- return that._maxListeners;
-}
-
-EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
- return $getMaxListeners(this);
-};
-
-// These standalone emit* functions are used to optimize calling of event
-// handlers for fast cases because emit() itself often has a variable number of
-// arguments and can be deoptimized because of that. These functions always have
-// the same number of arguments and thus do not get deoptimized, so the code
-// inside them can execute faster.
-function emitNone(handler, isFn, self) {
- if (isFn)
- handler.call(self);
- else {
- var len = handler.length;
- var listeners = arrayClone(handler, len);
- for (var i = 0; i < len; ++i)
- listeners[i].call(self);
- }
-}
-function emitOne(handler, isFn, self, arg1) {
- if (isFn)
- handler.call(self, arg1);
- else {
- var len = handler.length;
- var listeners = arrayClone(handler, len);
- for (var i = 0; i < len; ++i)
- listeners[i].call(self, arg1);
- }
-}
-function emitTwo(handler, isFn, self, arg1, arg2) {
- if (isFn)
- handler.call(self, arg1, arg2);
- else {
- var len = handler.length;
- var listeners = arrayClone(handler, len);
- for (var i = 0; i < len; ++i)
- listeners[i].call(self, arg1, arg2);
- }
-}
-function emitThree(handler, isFn, self, arg1, arg2, arg3) {
- if (isFn)
- handler.call(self, arg1, arg2, arg3);
- else {
- var len = handler.length;
- var listeners = arrayClone(handler, len);
- for (var i = 0; i < len; ++i)
- listeners[i].call(self, arg1, arg2, arg3);
- }
-}
-
-function emitMany(handler, isFn, self, args) {
- if (isFn)
- handler.apply(self, args);
- else {
- var len = handler.length;
- var listeners = arrayClone(handler, len);
- for (var i = 0; i < len; ++i)
- listeners[i].apply(self, args);
- }
-}
-
-EventEmitter.prototype.emit = function emit(type) {
- var er, handler, len, args, i, events;
- var doError = (type === 'error');
-
- events = this._events;
- if (events)
- doError = (doError && events.error == null);
- else if (!doError)
- return false;
-
- // If there is no 'error' event listener then throw.
- if (doError) {
- if (arguments.length > 1)
- er = arguments[1];
- if (er instanceof Error) {
- throw er; // Unhandled 'error' event
- } else {
- // At least give some kind of context to the user
- var err = new Error('Unhandled "error" event. (' + er + ')');
- err.context = er;
- throw err;
- }
- return false;
- }
-
- handler = events[type];
-
- if (!handler)
- return false;
-
- var isFn = typeof handler === 'function';
- len = arguments.length;
- switch (len) {
- // fast cases
- case 1:
- emitNone(handler, isFn, this);
- break;
- case 2:
- emitOne(handler, isFn, this, arguments[1]);
- break;
- case 3:
- emitTwo(handler, isFn, this, arguments[1], arguments[2]);
- break;
- case 4:
- emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);
- break;
- // slower
- default:
- args = new Array(len - 1);
- for (i = 1; i < len; i++)
- args[i - 1] = arguments[i];
- emitMany(handler, isFn, this, args);
- }
-
- return true;
-};
-
-function _addListener(target, type, listener, prepend) {
- var m;
- var events;
- var existing;
-
- if (typeof listener !== 'function')
- throw new TypeError('"listener" argument must be a function');
-
- events = target._events;
- if (!events) {
- events = target._events = objectCreate(null);
- target._eventsCount = 0;
- } else {
- // To avoid recursion in the case that type === "newListener"! Before
- // adding it to the listeners, first emit "newListener".
- if (events.newListener) {
- target.emit('newListener', type,
- listener.listener ? listener.listener : listener);
-
- // Re-assign `events` because a newListener handler could have caused the
- // this._events to be assigned to a new object
- events = target._events;
- }
- existing = events[type];
- }
-
- if (!existing) {
- // Optimize the case of one listener. Don't need the extra array object.
- existing = events[type] = listener;
- ++target._eventsCount;
- } else {
- if (typeof existing === 'function') {
- // Adding the second element, need to change to array.
- existing = events[type] =
- prepend ? [listener, existing] : [existing, listener];
- } else {
- // If we've already got an array, just append.
- if (prepend) {
- existing.unshift(listener);
- } else {
- existing.push(listener);
- }
- }
-
- // Check for listener leak
- if (!existing.warned) {
- m = $getMaxListeners(target);
- if (m && m > 0 && existing.length > m) {
- existing.warned = true;
- var w = new Error('Possible EventEmitter memory leak detected. ' +
- existing.length + ' "' + String(type) + '" listeners ' +
- 'added. Use emitter.setMaxListeners() to ' +
- 'increase limit.');
- w.name = 'MaxListenersExceededWarning';
- w.emitter = target;
- w.type = type;
- w.count = existing.length;
- if (typeof console === 'object' && console.warn) {
- console.warn('%s: %s', w.name, w.message);
- }
- }
- }
- }
-
- return target;
-}
-
-EventEmitter.prototype.addListener = function addListener(type, listener) {
- return _addListener(this, type, listener, false);
-};
-
-EventEmitter.prototype.on = EventEmitter.prototype.addListener;
-
-EventEmitter.prototype.prependListener =
- function prependListener(type, listener) {
- return _addListener(this, type, listener, true);
- };
-
-function onceWrapper() {
- if (!this.fired) {
- this.target.removeListener(this.type, this.wrapFn);
- this.fired = true;
- switch (arguments.length) {
- case 0:
- return this.listener.call(this.target);
- case 1:
- return this.listener.call(this.target, arguments[0]);
- case 2:
- return this.listener.call(this.target, arguments[0], arguments[1]);
- case 3:
- return this.listener.call(this.target, arguments[0], arguments[1],
- arguments[2]);
- default:
- var args = new Array(arguments.length);
- for (var i = 0; i < args.length; ++i)
- args[i] = arguments[i];
- this.listener.apply(this.target, args);
- }
- }
-}
-
-function _onceWrap(target, type, listener) {
- var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
- var wrapped = bind.call(onceWrapper, state);
- wrapped.listener = listener;
- state.wrapFn = wrapped;
- return wrapped;
-}
-
-EventEmitter.prototype.once = function once(type, listener) {
- if (typeof listener !== 'function')
- throw new TypeError('"listener" argument must be a function');
- this.on(type, _onceWrap(this, type, listener));
- return this;
-};
-
-EventEmitter.prototype.prependOnceListener =
- function prependOnceListener(type, listener) {
- if (typeof listener !== 'function')
- throw new TypeError('"listener" argument must be a function');
- this.prependListener(type, _onceWrap(this, type, listener));
- return this;
- };
-
-// Emits a 'removeListener' event if and only if the listener was removed.
-EventEmitter.prototype.removeListener =
- function removeListener(type, listener) {
- var list, events, position, i, originalListener;
-
- if (typeof listener !== 'function')
- throw new TypeError('"listener" argument must be a function');
-
- events = this._events;
- if (!events)
- return this;
-
- list = events[type];
- if (!list)
- return this;
-
- if (list === listener || list.listener === listener) {
- if (--this._eventsCount === 0)
- this._events = objectCreate(null);
- else {
- delete events[type];
- if (events.removeListener)
- this.emit('removeListener', type, list.listener || listener);
- }
- } else if (typeof list !== 'function') {
- position = -1;
-
- for (i = list.length - 1; i >= 0; i--) {
- if (list[i] === listener || list[i].listener === listener) {
- originalListener = list[i].listener;
- position = i;
- break;
- }
- }
-
- if (position < 0)
- return this;
-
- if (position === 0)
- list.shift();
- else
- spliceOne(list, position);
-
- if (list.length === 1)
- events[type] = list[0];
-
- if (events.removeListener)
- this.emit('removeListener', type, originalListener || listener);
- }
-
- return this;
- };
-
-EventEmitter.prototype.removeAllListeners =
- function removeAllListeners(type) {
- var listeners, events, i;
-
- events = this._events;
- if (!events)
- return this;
-
- // not listening for removeListener, no need to emit
- if (!events.removeListener) {
- if (arguments.length === 0) {
- this._events = objectCreate(null);
- this._eventsCount = 0;
- } else if (events[type]) {
- if (--this._eventsCount === 0)
- this._events = objectCreate(null);
- else
- delete events[type];
- }
- return this;
- }
-
- // emit removeListener for all listeners on all events
- if (arguments.length === 0) {
- var keys = objectKeys(events);
- var key;
- for (i = 0; i < keys.length; ++i) {
- key = keys[i];
- if (key === 'removeListener') continue;
- this.removeAllListeners(key);
- }
- this.removeAllListeners('removeListener');
- this._events = objectCreate(null);
- this._eventsCount = 0;
- return this;
- }
-
- listeners = events[type];
-
- if (typeof listeners === 'function') {
- this.removeListener(type, listeners);
- } else if (listeners) {
- // LIFO order
- for (i = listeners.length - 1; i >= 0; i--) {
- this.removeListener(type, listeners[i]);
- }
- }
-
- return this;
- };
-
-function _listeners(target, type, unwrap) {
- var events = target._events;
-
- if (!events)
- return [];
-
- var evlistener = events[type];
- if (!evlistener)
- return [];
-
- if (typeof evlistener === 'function')
- return unwrap ? [evlistener.listener || evlistener] : [evlistener];
-
- return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
-}
-
-EventEmitter.prototype.listeners = function listeners(type) {
- return _listeners(this, type, true);
-};
-
-EventEmitter.prototype.rawListeners = function rawListeners(type) {
- return _listeners(this, type, false);
-};
-
-EventEmitter.listenerCount = function(emitter, type) {
- if (typeof emitter.listenerCount === 'function') {
- return emitter.listenerCount(type);
- } else {
- return listenerCount.call(emitter, type);
- }
-};
-
-EventEmitter.prototype.listenerCount = listenerCount;
-function listenerCount(type) {
- var events = this._events;
-
- if (events) {
- var evlistener = events[type];
-
- if (typeof evlistener === 'function') {
- return 1;
- } else if (evlistener) {
- return evlistener.length;
- }
- }
-
- return 0;
-}
-
-EventEmitter.prototype.eventNames = function eventNames() {
- return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
-};
-
-// About 1.5x faster than the two-arg version of Array#splice().
-function spliceOne(list, index) {
- for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
- list[i] = list[k];
- list.pop();
-}
-
-function arrayClone(arr, n) {
- var copy = new Array(n);
- for (var i = 0; i < n; ++i)
- copy[i] = arr[i];
- return copy;
-}
-
-function unwrapListeners(arr) {
- var ret = new Array(arr.length);
- for (var i = 0; i < ret.length; ++i) {
- ret[i] = arr[i].listener || arr[i];
- }
- return ret;
-}
-
-function objectCreatePolyfill(proto) {
- var F = function() {};
- F.prototype = proto;
- return new F;
-}
-function objectKeysPolyfill(obj) {
- var keys = [];
- for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) {
- keys.push(k);
- }
- return k;
-}
-function functionBindPolyfill(context) {
- var fn = this;
- return function () {
- return fn.apply(context, arguments);
- };
-}
-
-},{}],29:[function(require,module,exports){
(function (Buffer){(function (){
var clone = (function() {
'use strict';
@@ -60001,7 +59578,7 @@ if (typeof module === 'object' && module.exports) {
}).call(this)}).call(this,require("buffer").Buffer)
-},{"buffer":27}],30:[function(require,module,exports){
+},{"buffer":27}],29:[function(require,module,exports){
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -60107,7 +59684,7 @@ if (typeof module === 'object' && module.exports) {
}));
-},{}],31:[function(require,module,exports){
+},{}],30:[function(require,module,exports){
'use strict'
/*!
@@ -60151,7 +59728,7 @@ function curry2 (fn, self) {
return out
}
-},{"fast-bind":63}],32:[function(require,module,exports){
+},{"fast-bind":63}],31:[function(require,module,exports){
/*
Copyright (c) 2012-2014 Chris Pettitt
@@ -60186,7 +59763,7 @@ module.exports = {
version: require("./lib/version")
};
-},{"./lib/debug":37,"./lib/graphlib":38,"./lib/layout":40,"./lib/util":60,"./lib/version":61}],33:[function(require,module,exports){
+},{"./lib/debug":36,"./lib/graphlib":37,"./lib/layout":39,"./lib/util":59,"./lib/version":60}],32:[function(require,module,exports){
"use strict";
var _ = require("./lodash"),
@@ -60255,7 +59832,7 @@ function undo(g) {
});
}
-},{"./greedy-fas":39,"./lodash":41}],34:[function(require,module,exports){
+},{"./greedy-fas":38,"./lodash":40}],33:[function(require,module,exports){
var _ = require("./lodash"),
util = require("./util");
@@ -60295,7 +59872,7 @@ function addBorderNode(g, prop, prefix, sg, sgNode, rank) {
}
}
-},{"./lodash":41,"./util":60}],35:[function(require,module,exports){
+},{"./lodash":40,"./util":59}],34:[function(require,module,exports){
"use strict";
var _ = require("./lodash");
@@ -60369,7 +59946,7 @@ function swapXYOne(attrs) {
attrs.y = x;
}
-},{"./lodash":41}],36:[function(require,module,exports){
+},{"./lodash":40}],35:[function(require,module,exports){
/*
* Simple doubly linked list implementation derived from Cormen, et al.,
* "Introduction to Algorithms".
@@ -60427,7 +60004,7 @@ function filterOutLinks(k, v) {
}
}
-},{}],37:[function(require,module,exports){
+},{}],36:[function(require,module,exports){
var _ = require("./lodash"),
util = require("./util"),
Graph = require("./graphlib").Graph;
@@ -60463,7 +60040,7 @@ function debugOrdering(g) {
return h;
}
-},{"./graphlib":38,"./lodash":41,"./util":60}],38:[function(require,module,exports){
+},{"./graphlib":37,"./lodash":40,"./util":59}],37:[function(require,module,exports){
/* global window */
var graphlib;
@@ -60480,7 +60057,7 @@ if (!graphlib) {
module.exports = graphlib;
-},{"graphlib":64}],39:[function(require,module,exports){
+},{"graphlib":64}],38:[function(require,module,exports){
var _ = require("./lodash"),
Graph = require("./graphlib").Graph,
List = require("./data/list");
@@ -60600,7 +60177,7 @@ function assignBucket(buckets, zeroIdx, entry) {
}
}
-},{"./data/list":36,"./graphlib":38,"./lodash":41}],40:[function(require,module,exports){
+},{"./data/list":35,"./graphlib":37,"./lodash":40}],39:[function(require,module,exports){
"use strict";
var _ = require("./lodash"),
@@ -60994,7 +60571,7 @@ function canonicalize(attrs) {
return newAttrs;
}
-},{"./acyclic":33,"./add-border-segments":34,"./coordinate-system":35,"./graphlib":38,"./lodash":41,"./nesting-graph":42,"./normalize":43,"./order":48,"./parent-dummy-chains":53,"./position":55,"./rank":57,"./util":60}],41:[function(require,module,exports){
+},{"./acyclic":32,"./add-border-segments":33,"./coordinate-system":34,"./graphlib":37,"./lodash":40,"./nesting-graph":41,"./normalize":42,"./order":47,"./parent-dummy-chains":52,"./position":54,"./rank":56,"./util":59}],40:[function(require,module,exports){
/* global window */
var lodash;
@@ -61011,7 +60588,7 @@ if (!lodash) {
module.exports = lodash;
-},{"lodash":109}],42:[function(require,module,exports){
+},{"lodash":109}],41:[function(require,module,exports){
var _ = require("./lodash"),
util = require("./util");
@@ -61145,7 +60722,7 @@ function cleanup(g) {
});
}
-},{"./lodash":41,"./util":60}],43:[function(require,module,exports){
+},{"./lodash":40,"./util":59}],42:[function(require,module,exports){
"use strict";
var _ = require("./lodash"),
@@ -61237,7 +60814,7 @@ function undo(g) {
});
}
-},{"./lodash":41,"./util":60}],44:[function(require,module,exports){
+},{"./lodash":40,"./util":59}],43:[function(require,module,exports){
var _ = require("../lodash");
module.exports = addSubgraphConstraints;
@@ -61292,7 +60869,7 @@ function addSubgraphConstraints(g, cg, vs) {
*/
}
-},{"../lodash":41}],45:[function(require,module,exports){
+},{"../lodash":40}],44:[function(require,module,exports){
var _ = require("../lodash");
module.exports = barycenter;
@@ -61322,7 +60899,7 @@ function barycenter(g, movable) {
}
-},{"../lodash":41}],46:[function(require,module,exports){
+},{"../lodash":40}],45:[function(require,module,exports){
var _ = require("../lodash"),
Graph = require("../graphlib").Graph;
@@ -61397,7 +60974,7 @@ function createRootNode(g) {
return v;
}
-},{"../graphlib":38,"../lodash":41}],47:[function(require,module,exports){
+},{"../graphlib":37,"../lodash":40}],46:[function(require,module,exports){
"use strict";
var _ = require("../lodash");
@@ -61469,7 +61046,7 @@ function twoLayerCrossCount(g, northLayer, southLayer) {
return cc;
}
-},{"../lodash":41}],48:[function(require,module,exports){
+},{"../lodash":40}],47:[function(require,module,exports){
"use strict";
var _ = require("../lodash"),
@@ -61550,7 +61127,7 @@ function assignOrder(g, layering) {
});
}
-},{"../graphlib":38,"../lodash":41,"../util":60,"./add-subgraph-constraints":44,"./build-layer-graph":46,"./cross-count":47,"./init-order":49,"./sort-subgraph":51}],49:[function(require,module,exports){
+},{"../graphlib":37,"../lodash":40,"../util":59,"./add-subgraph-constraints":43,"./build-layer-graph":45,"./cross-count":46,"./init-order":48,"./sort-subgraph":50}],48:[function(require,module,exports){
"use strict";
var _ = require("../lodash");
@@ -61590,7 +61167,7 @@ function initOrder(g) {
return layers;
}
-},{"../lodash":41}],50:[function(require,module,exports){
+},{"../lodash":40}],49:[function(require,module,exports){
"use strict";
var _ = require("../lodash");
@@ -61715,7 +61292,7 @@ function mergeEntries(target, source) {
source.merged = true;
}
-},{"../lodash":41}],51:[function(require,module,exports){
+},{"../lodash":40}],50:[function(require,module,exports){
var _ = require("../lodash"),
barycenter = require("./barycenter"),
resolveConflicts = require("./resolve-conflicts"),
@@ -61793,7 +61370,7 @@ function mergeBarycenters(target, other) {
}
}
-},{"../lodash":41,"./barycenter":45,"./resolve-conflicts":50,"./sort":52}],52:[function(require,module,exports){
+},{"../lodash":40,"./barycenter":44,"./resolve-conflicts":49,"./sort":51}],51:[function(require,module,exports){
var _ = require("../lodash"),
util = require("../util");
@@ -61852,7 +61429,7 @@ function compareWithBias(bias) {
};
}
-},{"../lodash":41,"../util":60}],53:[function(require,module,exports){
+},{"../lodash":40,"../util":59}],52:[function(require,module,exports){
var _ = require("./lodash");
module.exports = parentDummyChains;
@@ -61940,7 +61517,7 @@ function postorder(g) {
return result;
}
-},{"./lodash":41}],54:[function(require,module,exports){
+},{"./lodash":40}],53:[function(require,module,exports){
"use strict";
var _ = require("../lodash"),
@@ -62361,7 +61938,7 @@ function width(g, v) {
return g.node(v).width;
}
-},{"../graphlib":38,"../lodash":41,"../util":60}],55:[function(require,module,exports){
+},{"../graphlib":37,"../lodash":40,"../util":59}],54:[function(require,module,exports){
"use strict";
var _ = require("../lodash"),
@@ -62393,7 +61970,7 @@ function positionY(g) {
}
-},{"../lodash":41,"../util":60,"./bk":54}],56:[function(require,module,exports){
+},{"../lodash":40,"../util":59,"./bk":53}],55:[function(require,module,exports){
"use strict";
var _ = require("../lodash"),
@@ -62484,7 +62061,7 @@ function shiftRanks(t, g, delta) {
});
}
-},{"../graphlib":38,"../lodash":41,"./util":59}],57:[function(require,module,exports){
+},{"../graphlib":37,"../lodash":40,"./util":58}],56:[function(require,module,exports){
"use strict";
var rankUtil = require("./util"),
@@ -62534,7 +62111,7 @@ function networkSimplexRanker(g) {
networkSimplex(g);
}
-},{"./feasible-tree":56,"./network-simplex":58,"./util":59}],58:[function(require,module,exports){
+},{"./feasible-tree":55,"./network-simplex":57,"./util":58}],57:[function(require,module,exports){
"use strict";
var _ = require("../lodash"),
@@ -62770,7 +62347,7 @@ function isDescendant(tree, vLabel, rootLabel) {
return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;
}
-},{"../graphlib":38,"../lodash":41,"../util":60,"./feasible-tree":56,"./util":59}],59:[function(require,module,exports){
+},{"../graphlib":37,"../lodash":40,"../util":59,"./feasible-tree":55,"./util":58}],58:[function(require,module,exports){
"use strict";
var _ = require("../lodash");
@@ -62835,7 +62412,7 @@ function slack(g, e) {
return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen;
}
-},{"../lodash":41}],60:[function(require,module,exports){
+},{"../lodash":40}],59:[function(require,module,exports){
"use strict";
var _ = require("./lodash"),
@@ -63073,10 +62650,10 @@ function notime(name, fn) {
return fn();
}
-},{"./graphlib":38,"./lodash":41}],61:[function(require,module,exports){
+},{"./graphlib":37,"./lodash":40}],60:[function(require,module,exports){
module.exports = "0.8.2";
-},{}],62:[function(require,module,exports){
+},{}],61:[function(require,module,exports){
'use strict'
var toString = Object.prototype.toString
@@ -63160,6 +62737,531 @@ function todots (string) {
module.exports = dotsplit
+},{}],62:[function(require,module,exports){
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+var objectCreate = Object.create || objectCreatePolyfill
+var objectKeys = Object.keys || objectKeysPolyfill
+var bind = Function.prototype.bind || functionBindPolyfill
+
+function EventEmitter() {
+ if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) {
+ this._events = objectCreate(null);
+ this._eventsCount = 0;
+ }
+
+ this._maxListeners = this._maxListeners || undefined;
+}
+module.exports = EventEmitter;
+
+// Backwards-compat with node 0.10.x
+EventEmitter.EventEmitter = EventEmitter;
+
+EventEmitter.prototype._events = undefined;
+EventEmitter.prototype._maxListeners = undefined;
+
+// By default EventEmitters will print a warning if more than 10 listeners are
+// added to it. This is a useful default which helps finding memory leaks.
+var defaultMaxListeners = 10;
+
+var hasDefineProperty;
+try {
+ var o = {};
+ if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 });
+ hasDefineProperty = o.x === 0;
+} catch (err) { hasDefineProperty = false }
+if (hasDefineProperty) {
+ Object.defineProperty(EventEmitter, 'defaultMaxListeners', {
+ enumerable: true,
+ get: function() {
+ return defaultMaxListeners;
+ },
+ set: function(arg) {
+ // check whether the input is a positive number (whose value is zero or
+ // greater and not a NaN).
+ if (typeof arg !== 'number' || arg < 0 || arg !== arg)
+ throw new TypeError('"defaultMaxListeners" must be a positive number');
+ defaultMaxListeners = arg;
+ }
+ });
+} else {
+ EventEmitter.defaultMaxListeners = defaultMaxListeners;
+}
+
+// Obviously not all Emitters should be limited to 10. This function allows
+// that to be increased. Set to zero for unlimited.
+EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
+ if (typeof n !== 'number' || n < 0 || isNaN(n))
+ throw new TypeError('"n" argument must be a positive number');
+ this._maxListeners = n;
+ return this;
+};
+
+function $getMaxListeners(that) {
+ if (that._maxListeners === undefined)
+ return EventEmitter.defaultMaxListeners;
+ return that._maxListeners;
+}
+
+EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
+ return $getMaxListeners(this);
+};
+
+// These standalone emit* functions are used to optimize calling of event
+// handlers for fast cases because emit() itself often has a variable number of
+// arguments and can be deoptimized because of that. These functions always have
+// the same number of arguments and thus do not get deoptimized, so the code
+// inside them can execute faster.
+function emitNone(handler, isFn, self) {
+ if (isFn)
+ handler.call(self);
+ else {
+ var len = handler.length;
+ var listeners = arrayClone(handler, len);
+ for (var i = 0; i < len; ++i)
+ listeners[i].call(self);
+ }
+}
+function emitOne(handler, isFn, self, arg1) {
+ if (isFn)
+ handler.call(self, arg1);
+ else {
+ var len = handler.length;
+ var listeners = arrayClone(handler, len);
+ for (var i = 0; i < len; ++i)
+ listeners[i].call(self, arg1);
+ }
+}
+function emitTwo(handler, isFn, self, arg1, arg2) {
+ if (isFn)
+ handler.call(self, arg1, arg2);
+ else {
+ var len = handler.length;
+ var listeners = arrayClone(handler, len);
+ for (var i = 0; i < len; ++i)
+ listeners[i].call(self, arg1, arg2);
+ }
+}
+function emitThree(handler, isFn, self, arg1, arg2, arg3) {
+ if (isFn)
+ handler.call(self, arg1, arg2, arg3);
+ else {
+ var len = handler.length;
+ var listeners = arrayClone(handler, len);
+ for (var i = 0; i < len; ++i)
+ listeners[i].call(self, arg1, arg2, arg3);
+ }
+}
+
+function emitMany(handler, isFn, self, args) {
+ if (isFn)
+ handler.apply(self, args);
+ else {
+ var len = handler.length;
+ var listeners = arrayClone(handler, len);
+ for (var i = 0; i < len; ++i)
+ listeners[i].apply(self, args);
+ }
+}
+
+EventEmitter.prototype.emit = function emit(type) {
+ var er, handler, len, args, i, events;
+ var doError = (type === 'error');
+
+ events = this._events;
+ if (events)
+ doError = (doError && events.error == null);
+ else if (!doError)
+ return false;
+
+ // If there is no 'error' event listener then throw.
+ if (doError) {
+ if (arguments.length > 1)
+ er = arguments[1];
+ if (er instanceof Error) {
+ throw er; // Unhandled 'error' event
+ } else {
+ // At least give some kind of context to the user
+ var err = new Error('Unhandled "error" event. (' + er + ')');
+ err.context = er;
+ throw err;
+ }
+ return false;
+ }
+
+ handler = events[type];
+
+ if (!handler)
+ return false;
+
+ var isFn = typeof handler === 'function';
+ len = arguments.length;
+ switch (len) {
+ // fast cases
+ case 1:
+ emitNone(handler, isFn, this);
+ break;
+ case 2:
+ emitOne(handler, isFn, this, arguments[1]);
+ break;
+ case 3:
+ emitTwo(handler, isFn, this, arguments[1], arguments[2]);
+ break;
+ case 4:
+ emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);
+ break;
+ // slower
+ default:
+ args = new Array(len - 1);
+ for (i = 1; i < len; i++)
+ args[i - 1] = arguments[i];
+ emitMany(handler, isFn, this, args);
+ }
+
+ return true;
+};
+
+function _addListener(target, type, listener, prepend) {
+ var m;
+ var events;
+ var existing;
+
+ if (typeof listener !== 'function')
+ throw new TypeError('"listener" argument must be a function');
+
+ events = target._events;
+ if (!events) {
+ events = target._events = objectCreate(null);
+ target._eventsCount = 0;
+ } else {
+ // To avoid recursion in the case that type === "newListener"! Before
+ // adding it to the listeners, first emit "newListener".
+ if (events.newListener) {
+ target.emit('newListener', type,
+ listener.listener ? listener.listener : listener);
+
+ // Re-assign `events` because a newListener handler could have caused the
+ // this._events to be assigned to a new object
+ events = target._events;
+ }
+ existing = events[type];
+ }
+
+ if (!existing) {
+ // Optimize the case of one listener. Don't need the extra array object.
+ existing = events[type] = listener;
+ ++target._eventsCount;
+ } else {
+ if (typeof existing === 'function') {
+ // Adding the second element, need to change to array.
+ existing = events[type] =
+ prepend ? [listener, existing] : [existing, listener];
+ } else {
+ // If we've already got an array, just append.
+ if (prepend) {
+ existing.unshift(listener);
+ } else {
+ existing.push(listener);
+ }
+ }
+
+ // Check for listener leak
+ if (!existing.warned) {
+ m = $getMaxListeners(target);
+ if (m && m > 0 && existing.length > m) {
+ existing.warned = true;
+ var w = new Error('Possible EventEmitter memory leak detected. ' +
+ existing.length + ' "' + String(type) + '" listeners ' +
+ 'added. Use emitter.setMaxListeners() to ' +
+ 'increase limit.');
+ w.name = 'MaxListenersExceededWarning';
+ w.emitter = target;
+ w.type = type;
+ w.count = existing.length;
+ if (typeof console === 'object' && console.warn) {
+ console.warn('%s: %s', w.name, w.message);
+ }
+ }
+ }
+ }
+
+ return target;
+}
+
+EventEmitter.prototype.addListener = function addListener(type, listener) {
+ return _addListener(this, type, listener, false);
+};
+
+EventEmitter.prototype.on = EventEmitter.prototype.addListener;
+
+EventEmitter.prototype.prependListener =
+ function prependListener(type, listener) {
+ return _addListener(this, type, listener, true);
+ };
+
+function onceWrapper() {
+ if (!this.fired) {
+ this.target.removeListener(this.type, this.wrapFn);
+ this.fired = true;
+ switch (arguments.length) {
+ case 0:
+ return this.listener.call(this.target);
+ case 1:
+ return this.listener.call(this.target, arguments[0]);
+ case 2:
+ return this.listener.call(this.target, arguments[0], arguments[1]);
+ case 3:
+ return this.listener.call(this.target, arguments[0], arguments[1],
+ arguments[2]);
+ default:
+ var args = new Array(arguments.length);
+ for (var i = 0; i < args.length; ++i)
+ args[i] = arguments[i];
+ this.listener.apply(this.target, args);
+ }
+ }
+}
+
+function _onceWrap(target, type, listener) {
+ var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };
+ var wrapped = bind.call(onceWrapper, state);
+ wrapped.listener = listener;
+ state.wrapFn = wrapped;
+ return wrapped;
+}
+
+EventEmitter.prototype.once = function once(type, listener) {
+ if (typeof listener !== 'function')
+ throw new TypeError('"listener" argument must be a function');
+ this.on(type, _onceWrap(this, type, listener));
+ return this;
+};
+
+EventEmitter.prototype.prependOnceListener =
+ function prependOnceListener(type, listener) {
+ if (typeof listener !== 'function')
+ throw new TypeError('"listener" argument must be a function');
+ this.prependListener(type, _onceWrap(this, type, listener));
+ return this;
+ };
+
+// Emits a 'removeListener' event if and only if the listener was removed.
+EventEmitter.prototype.removeListener =
+ function removeListener(type, listener) {
+ var list, events, position, i, originalListener;
+
+ if (typeof listener !== 'function')
+ throw new TypeError('"listener" argument must be a function');
+
+ events = this._events;
+ if (!events)
+ return this;
+
+ list = events[type];
+ if (!list)
+ return this;
+
+ if (list === listener || list.listener === listener) {
+ if (--this._eventsCount === 0)
+ this._events = objectCreate(null);
+ else {
+ delete events[type];
+ if (events.removeListener)
+ this.emit('removeListener', type, list.listener || listener);
+ }
+ } else if (typeof list !== 'function') {
+ position = -1;
+
+ for (i = list.length - 1; i >= 0; i--) {
+ if (list[i] === listener || list[i].listener === listener) {
+ originalListener = list[i].listener;
+ position = i;
+ break;
+ }
+ }
+
+ if (position < 0)
+ return this;
+
+ if (position === 0)
+ list.shift();
+ else
+ spliceOne(list, position);
+
+ if (list.length === 1)
+ events[type] = list[0];
+
+ if (events.removeListener)
+ this.emit('removeListener', type, originalListener || listener);
+ }
+
+ return this;
+ };
+
+EventEmitter.prototype.removeAllListeners =
+ function removeAllListeners(type) {
+ var listeners, events, i;
+
+ events = this._events;
+ if (!events)
+ return this;
+
+ // not listening for removeListener, no need to emit
+ if (!events.removeListener) {
+ if (arguments.length === 0) {
+ this._events = objectCreate(null);
+ this._eventsCount = 0;
+ } else if (events[type]) {
+ if (--this._eventsCount === 0)
+ this._events = objectCreate(null);
+ else
+ delete events[type];
+ }
+ return this;
+ }
+
+ // emit removeListener for all listeners on all events
+ if (arguments.length === 0) {
+ var keys = objectKeys(events);
+ var key;
+ for (i = 0; i < keys.length; ++i) {
+ key = keys[i];
+ if (key === 'removeListener') continue;
+ this.removeAllListeners(key);
+ }
+ this.removeAllListeners('removeListener');
+ this._events = objectCreate(null);
+ this._eventsCount = 0;
+ return this;
+ }
+
+ listeners = events[type];
+
+ if (typeof listeners === 'function') {
+ this.removeListener(type, listeners);
+ } else if (listeners) {
+ // LIFO order
+ for (i = listeners.length - 1; i >= 0; i--) {
+ this.removeListener(type, listeners[i]);
+ }
+ }
+
+ return this;
+ };
+
+function _listeners(target, type, unwrap) {
+ var events = target._events;
+
+ if (!events)
+ return [];
+
+ var evlistener = events[type];
+ if (!evlistener)
+ return [];
+
+ if (typeof evlistener === 'function')
+ return unwrap ? [evlistener.listener || evlistener] : [evlistener];
+
+ return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
+}
+
+EventEmitter.prototype.listeners = function listeners(type) {
+ return _listeners(this, type, true);
+};
+
+EventEmitter.prototype.rawListeners = function rawListeners(type) {
+ return _listeners(this, type, false);
+};
+
+EventEmitter.listenerCount = function(emitter, type) {
+ if (typeof emitter.listenerCount === 'function') {
+ return emitter.listenerCount(type);
+ } else {
+ return listenerCount.call(emitter, type);
+ }
+};
+
+EventEmitter.prototype.listenerCount = listenerCount;
+function listenerCount(type) {
+ var events = this._events;
+
+ if (events) {
+ var evlistener = events[type];
+
+ if (typeof evlistener === 'function') {
+ return 1;
+ } else if (evlistener) {
+ return evlistener.length;
+ }
+ }
+
+ return 0;
+}
+
+EventEmitter.prototype.eventNames = function eventNames() {
+ return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
+};
+
+// About 1.5x faster than the two-arg version of Array#splice().
+function spliceOne(list, index) {
+ for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
+ list[i] = list[k];
+ list.pop();
+}
+
+function arrayClone(arr, n) {
+ var copy = new Array(n);
+ for (var i = 0; i < n; ++i)
+ copy[i] = arr[i];
+ return copy;
+}
+
+function unwrapListeners(arr) {
+ var ret = new Array(arr.length);
+ for (var i = 0; i < ret.length; ++i) {
+ ret[i] = arr[i].listener || arr[i];
+ }
+ return ret;
+}
+
+function objectCreatePolyfill(proto) {
+ var F = function() {};
+ F.prototype = proto;
+ return new F;
+}
+function objectKeysPolyfill(obj) {
+ var keys = [];
+ for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) {
+ keys.push(k);
+ }
+ return k;
+}
+function functionBindPolyfill(context) {
+ var fn = this;
+ return function () {
+ return fn.apply(context, arguments);
+ };
+}
+
},{}],63:[function(require,module,exports){
'use strict';
module.exports = function(boundThis) {
@@ -64404,8 +64506,8 @@ function read(json) {
}
},{"./graph":79,"./lodash":82}],82:[function(require,module,exports){
-arguments[4][41][0].apply(exports,arguments)
-},{"dup":41,"lodash":109}],83:[function(require,module,exports){
+arguments[4][40][0].apply(exports,arguments)
+},{"dup":40,"lodash":109}],83:[function(require,module,exports){
module.exports = '2.1.5';
},{}],84:[function(require,module,exports){
@@ -64413,19 +64515,13 @@ module.exports = '2.1.5';
"use strict";
exports.__esModule = true;
-exports.UNPARSEABLE_TAGS = exports.TYPEDARRAY_TAGS = exports.TOSTRING_TAGS = exports.SELF_TAGS = exports.PRIMITIVE_TAGS = exports.ITERABLE_TAGS = exports.OBJECT_CLASS_TYPE_MAP = exports.OBJECT_CLASS_MAP = exports.OBJECT_CLASSES = exports.SVG_ELEMENT_REGEXP = exports.HTML_ELEMENT_REGEXP = exports.HAS_UINT16ARRAY_SUPPORT = exports.HAS_BUFFER_FROM_SUPPORT = exports.CIRCULAR_VALUE = void 0;
+exports.UNPARSEABLE_TAGS = exports.TYPEDARRAY_TAGS = exports.TOSTRING_TAGS = exports.SELF_TAGS = exports.PRIMITIVE_TAGS = exports.ITERABLE_TAGS = exports.OBJECT_CLASS_TYPE_MAP = exports.OBJECT_CLASS_MAP = exports.SVG_ELEMENT_REGEXP = exports.HTML_ELEMENT_REGEXP = exports.HAS_UINT16ARRAY_SUPPORT = exports.HAS_BUFFER_FROM_SUPPORT = void 0;
var _SELF_TAGS, _TOSTRING_TAGS, _TYPEDARRAY_TAGS, _UNPARSEABLE_TAGS;
-/**
- * @constant {string} CIRCULAR_VALUE
- */
-var CIRCULAR_VALUE = '~';
/**
* @constant {boolean} HAS_BUFFER_FROM_SUPPORT
*/
-
-exports.CIRCULAR_VALUE = CIRCULAR_VALUE;
var HAS_BUFFER_FROM_SUPPORT = typeof Buffer !== 'undefined' && typeof Buffer.from === 'function';
/**
* @constant {boolean} HAS_UINT16ARRAY_SUPPORT
@@ -64455,7 +64551,6 @@ var OBJECT_CLASSES = ['Arguments', 'Array', 'ArrayBuffer', 'Boolean', 'DataView'
* @constant {Object} OBJECT_CLASS_MAP
*/
-exports.OBJECT_CLASSES = OBJECT_CLASSES;
var OBJECT_CLASS_MAP = OBJECT_CLASSES.reduce(function (objectClasses, type) {
objectClasses["[object " + type + "]"] = type;
return objectClasses;
@@ -64543,15 +64638,11 @@ hash.is = (0, _curriable.curry)(function (object, otherObject) {
* @returns {boolean} are the objects equal
*/
-hash.is.all = (0, _curriable.curry)(function () {
- for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
- objects[_key] = arguments[_key];
- }
-
- var isEqual = hash.is(objects.shift());
+hash.is.all = (0, _curriable.curry)(function (objectBasis) {
+ var isEqual = hash.is(objectBasis);
- for (var index = 0; index < objects.length; index++) {
- if (!isEqual(objects[index])) {
+ for (var index = 1; index < arguments.length; ++index) {
+ if (!isEqual(arguments[index])) {
return false;
}
}
@@ -64568,15 +64659,11 @@ hash.is.all = (0, _curriable.curry)(function () {
* @returns {boolean} are the objects equal
*/
-hash.is.any = (0, _curriable.curry)(function () {
- for (var _len2 = arguments.length, objects = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- objects[_key2] = arguments[_key2];
- }
+hash.is.any = (0, _curriable.curry)(function (objectBasis) {
+ var isEqual = hash.is(objectBasis);
- var isEqual = hash.is(objects.shift());
-
- for (var index = 0; index < objects.length; index++) {
- if (isEqual(objects[index])) {
+ for (var index = 1; index < arguments.length; index++) {
+ if (isEqual(arguments[index])) {
return true;
}
}
@@ -64598,7 +64685,7 @@ hash.is.not = (0, _curriable.curry)(function (object, otherObject) {
});
var _default = hash;
exports.default = _default;
-},{"./utils":86,"curriable":30}],86:[function(require,module,exports){
+},{"./utils":86,"curriable":29}],86:[function(require,module,exports){
(function (Buffer){(function (){
"use strict";
@@ -64609,7 +64696,7 @@ exports.getSortedEvent = getSortedEvent;
exports.shouldSort = shouldSort;
exports.shouldSortPair = shouldSortPair;
exports.sort = sort;
-exports.getSortedIterablePairs = getSortedIterablePairs;
+exports.getSortedIterable = getSortedIterable;
exports.getSortedObject = getSortedObject;
exports.getStringifiedArrayBufferFallback = getStringifiedArrayBufferFallback;
exports.getStringifiedArrayBufferModern = getStringifiedArrayBufferModern;
@@ -64623,10 +64710,7 @@ exports.getStringifiedArrayBuffer = void 0;
var _constants = require("./constants");
-// external dependencies
-// constants
-var SEPARATOR = '|';
-var charCodeAt = String.prototype.charCodeAt;
+var FUNCTION_NAME_REGEX = /^\s*function\s*([^(]*)/i;
var toString = Object.prototype.toString;
var keys = Object.keys;
/**
@@ -64640,7 +64724,7 @@ var keys = Object.keys;
*/
function getFunctionName(fn) {
- return fn.name || (fn.toString().match(/^\s*function\s*([^\(]*)/i) || [])[1] || 'anonymous';
+ return fn.name || (fn.toString().match(FUNCTION_NAME_REGEX) || [])[1] || 'anonymous';
}
/**
* @function getIntegerHashValue
@@ -64662,7 +64746,7 @@ function getIntegerHashValue(string) {
charCode;
while (index--) {
- charCode = charCodeAt.call(string, index);
+ charCode = string.charCodeAt(index);
hashA = hashA * 33 ^ charCode;
hashB = hashB * 33 ^ charCode;
}
@@ -64733,7 +64817,7 @@ function shouldSort(valueA, valueB) {
function shouldSortPair(pairA, pairB) {
- return shouldSort(pairA[0], pairB[0]);
+ return pairA[0] > pairB[0];
}
/**
* @function sort
@@ -64750,10 +64834,10 @@ function shouldSortPair(pairA, pairB) {
function sort(array, fn) {
var subIndex, value;
- for (var index = 0; index < array.length; index++) {
+ for (var index = 0; index < array.length; ++index) {
value = array[index];
- for (subIndex = index - 1; ~subIndex && fn(array[subIndex], value); subIndex--) {
+ for (subIndex = index - 1; ~subIndex && fn(array[subIndex], value); --subIndex) {
array[subIndex + 1] = array[subIndex];
}
@@ -64773,35 +64857,33 @@ function sort(array, fn) {
*/
-function getSortedIterablePairs(iterable, cache, keys) {
+function getSortedIterable(iterable, cache, keys) {
var isMap = typeof iterable.get === 'function';
- var pairs = [];
+ var entries = [];
if (isMap) {
iterable.forEach(function (value, key) {
- // eslint-disable-next-line no-use-before-define
- pairs.push([stringify(key, cache, keys), stringify(value, cache, keys)]);
+ entries.push([// eslint-disable-next-line no-use-before-define
+ stringify(key, cache, keys), // eslint-disable-next-line no-use-before-define
+ stringify(value, cache, keys)]);
});
+ sort(entries, shouldSortPair);
} else {
iterable.forEach(function (value) {
// eslint-disable-next-line no-use-before-define
- pairs.push([stringify(value, cache, keys)]);
+ entries.push(stringify(value, cache, keys));
});
+ sort(entries, shouldSort);
}
- sort(pairs, shouldSortPair);
- var length = pairs.length;
- var lastIndex = length - 1;
- var _final = '[';
- var pair;
+ var _final = getFunctionName(iterable.constructor) + "|[";
- for (var index = 0; index < length; index++) {
- pair = pairs[index];
- _final += isMap ? '[' + pair[0] + ',' + pair[1] + ']' : pair[0];
- _final += index === lastIndex ? ']' : ',';
+ for (var index = 0, length = entries.length, entry; index < length; ++index) {
+ entry = entries[index];
+ _final += "" + (index ? ',' : '') + (isMap ? "[" + entry[0] + "," + entry[1] + "]" : entry);
}
- return getFunctionName(iterable.constructor) + SEPARATOR + _final;
+ return _final + "]";
}
/**
* @function getSortedObject
@@ -64819,7 +64901,7 @@ function getSortedObject(object) {
var newObject = {};
var key;
- for (var index = 0; index < objectKeys.length; index++) {
+ for (var index = 0; index < objectKeys.length; ++index) {
key = objectKeys[index];
newObject[key] = object[key];
}
@@ -64906,7 +64988,7 @@ function getStringifiedDocumentFragment(fragment) {
var children = fragment.children;
var innerHTML = '';
- for (var index = 0; index < children.length; index++) {
+ for (var index = 0; index < children.length; ++index) {
innerHTML += children[index].outerHTML;
}
@@ -64926,7 +65008,7 @@ function getStringifiedDocumentFragment(fragment) {
function getCutoffIndex(array, value) {
- for (var index = 0; index < array.length; index++) {
+ for (var index = 0; index < array.length; ++index) {
if (array[index] === value) {
return index + 1;
}
@@ -64952,11 +65034,11 @@ function getNormalizedValue(value, cache, keys, passedTag) {
var type = typeof value;
if (type === 'string' || _constants.PRIMITIVE_TAGS[type]) {
- return type + SEPARATOR + value;
+ return type + "|" + value;
}
if (value === null) {
- return 'null' + SEPARATOR + value;
+ return "null|" + value;
}
}
@@ -64971,19 +65053,19 @@ function getNormalizedValue(value, cache, keys, passedTag) {
}
if (_constants.TOSTRING_TAGS[tag]) {
- return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + value.toString();
+ return _constants.OBJECT_CLASS_MAP[tag] + "|" + value.toString();
}
if (_constants.ITERABLE_TAGS[tag]) {
- return getSortedIterablePairs(value, cache, keys);
+ return getSortedIterable(value, cache, keys);
}
if (tag === _constants.OBJECT_CLASS_TYPE_MAP.DATE) {
- return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + value.getTime();
+ return _constants.OBJECT_CLASS_MAP[tag] + "|" + value.getTime();
}
if (tag === _constants.OBJECT_CLASS_TYPE_MAP.ERROR) {
- return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + value.stack;
+ return _constants.OBJECT_CLASS_MAP[tag] + "|" + value.stack;
}
if (tag === _constants.OBJECT_CLASS_TYPE_MAP.EVENT) {
@@ -64991,27 +65073,27 @@ function getNormalizedValue(value, cache, keys, passedTag) {
}
if (_constants.UNPARSEABLE_TAGS[tag]) {
- return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + 'NOT_ENUMERABLE';
+ return _constants.OBJECT_CLASS_MAP[tag] + "|NOT_ENUMERABLE";
}
if (_constants.HTML_ELEMENT_REGEXP.test(tag) || _constants.SVG_ELEMENT_REGEXP.test(tag)) {
- return tag.slice(8, -1) + SEPARATOR + value.outerHTML;
+ return tag.slice(8, -1) + "|" + value.outerHTML;
}
if (tag === _constants.OBJECT_CLASS_TYPE_MAP.DOCUMENTFRAGMENT) {
- return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + getStringifiedDocumentFragment(value);
+ return _constants.OBJECT_CLASS_MAP[tag] + "|" + getStringifiedDocumentFragment(value);
}
if (_constants.TYPEDARRAY_TAGS[tag]) {
- return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + value.join(',');
+ return _constants.OBJECT_CLASS_MAP[tag] + "|" + value.join(',');
}
if (tag === _constants.OBJECT_CLASS_TYPE_MAP.ARRAYBUFFER) {
- return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + getStringifiedArrayBuffer(value);
+ return _constants.OBJECT_CLASS_MAP[tag] + "|" + getStringifiedArrayBuffer(value);
}
if (tag === _constants.OBJECT_CLASS_TYPE_MAP.DATAVIEW) {
- return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + getStringifiedArrayBuffer(value.buffer);
+ return _constants.OBJECT_CLASS_MAP[tag] + "|" + getStringifiedArrayBuffer(value.buffer);
}
return value;
@@ -65052,8 +65134,7 @@ function createReplacer(cache, keys) {
var valueCutoff = getCutoffIndex(cache, value);
if (valueCutoff !== 0) {
- var ref = keys.slice(0, valueCutoff).join('.') || '.';
- return "[~" + ref + "]";
+ return "[~" + (keys.slice(0, valueCutoff).join('.') || '.') + "]";
}
cache.push(value);
@@ -65098,10 +65179,10 @@ function stringify(value, cache, keys) {
},{"./constants":84,"buffer":27}],87:[function(require,module,exports){
/*!
- * hotkeys-js v3.8.1
+ * hotkeys-js v3.8.3
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
*
- * Copyright (c) 2020 kenny wong
+ * Copyright (c) 2021 kenny wong
* http://jaywcjlove.github.io/hotkeys
*
* Licensed under the MIT license.
@@ -65168,7 +65249,7 @@ var _keyMap = {
tab: 9,
clear: 12,
enter: 13,
- return: 13,
+ "return": 13,
esc: 27,
escape: 27,
space: 32,
@@ -65177,7 +65258,7 @@ var _keyMap = {
right: 39,
down: 40,
del: 46,
- delete: 46,
+ "delete": 46,
ins: 45,
insert: 45,
home: 36,
@@ -65185,6 +65266,22 @@ var _keyMap = {
pageup: 33,
pagedown: 34,
capslock: 20,
+ num_0: 96,
+ num_1: 97,
+ num_2: 98,
+ num_3: 99,
+ num_4: 100,
+ num_5: 101,
+ num_6: 102,
+ num_7: 103,
+ num_8: 104,
+ num_9: 105,
+ num_multiply: 106,
+ num_add: 107,
+ num_enter: 108,
+ num_subtract: 109,
+ num_decimal: 110,
+ num_divide: 111,
'⇪': 20,
',': 188,
'.': 190,
@@ -65657,8 +65754,8 @@ if (typeof window !== 'undefined') {
module.exports = hotkeys;
},{}],88:[function(require,module,exports){
-/*! hotkeys-js v3.8.1 | MIT (c) 2020 kenny wong | http://jaywcjlove.github.io/hotkeys */
-"use strict";var isff="undefined"!=typeof navigator&&0 | http://jaywcjlove.github.io/hotkeys */
+"use strict";var isff="undefined"!=typeof navigator&&0 */
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
var e, m
var eLen = (nBytes * 8) - mLen - 1
@@ -65825,7 +65923,7 @@ if("object"==typeof exports)var graphlib=require("graphlib"),dagre=require("dagr
}));
-},{"backbone":11,"dagre":32,"graphlib":64,"jquery":92,"lodash":93}],92:[function(require,module,exports){
+},{"backbone":11,"dagre":31,"graphlib":64,"jquery":92,"lodash":93}],92:[function(require,module,exports){
/*!
* jQuery JavaScript Library v3.3.1
* https://jquery.com/
@@ -93305,17 +93403,17 @@ return jQuery;
},{}],94:[function(require,module,exports){
/*!
- * jQuery JavaScript Library v3.5.1
+ * jQuery JavaScript Library v3.6.0
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
- * Copyright JS Foundation and other contributors
+ * Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
- * Date: 2020-05-04T22:49Z
+ * Date: 2021-03-02T17:08Z
*/
( function( global, factory ) {
@@ -93382,12 +93480,16 @@ var support = {};
var isFunction = function isFunction( obj ) {
- // Support: Chrome <=57, Firefox <=52
- // In some browsers, typeof returns "function" for HTML elements
- // (i.e., `typeof document.createElement( "object" ) === "function"`).
- // We don't want to classify *any* DOM node as a function.
- return typeof obj === "function" && typeof obj.nodeType !== "number";
- };
+ // Support: Chrome <=57, Firefox <=52
+ // In some browsers, typeof returns "function" for HTML elements
+ // (i.e., `typeof document.createElement( "object" ) === "function"`).
+ // We don't want to classify *any* DOM node as a function.
+ // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
+ // Plus for old WebKit, typeof returns "function" for HTML collections
+ // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
+ return typeof obj === "function" && typeof obj.nodeType !== "number" &&
+ typeof obj.item !== "function";
+ };
var isWindow = function isWindow( obj ) {
@@ -93453,7 +93555,7 @@ function toType( obj ) {
var
- version = "3.5.1",
+ version = "3.6.0",
// Define a local copy of jQuery
jQuery = function( selector, context ) {
@@ -93707,7 +93809,7 @@ jQuery.extend( {
if ( isArrayLike( Object( arr ) ) ) {
jQuery.merge( ret,
typeof arr === "string" ?
- [ arr ] : arr
+ [ arr ] : arr
);
} else {
push.call( ret, arr );
@@ -93802,9 +93904,9 @@ if ( typeof Symbol === "function" ) {
// Populate the class2type map
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
-function( _i, name ) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-} );
+ function( _i, name ) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+ } );
function isArrayLike( obj ) {
@@ -93824,14 +93926,14 @@ function isArrayLike( obj ) {
}
var Sizzle =
/*!
- * Sizzle CSS Selector Engine v2.3.5
+ * Sizzle CSS Selector Engine v2.3.6
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
- * Date: 2020-03-14
+ * Date: 2021-02-16
*/
( function( window ) {
var i,
@@ -94414,8 +94516,8 @@ support = Sizzle.support = {};
* @returns {Boolean} True iff elem is a non-HTML XML node
*/
isXML = Sizzle.isXML = function( elem ) {
- var namespace = elem.namespaceURI,
- docElem = ( elem.ownerDocument || elem ).documentElement;
+ var namespace = elem && elem.namespaceURI,
+ docElem = elem && ( elem.ownerDocument || elem ).documentElement;
// Support: IE <=8
// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
@@ -96330,9 +96432,9 @@ var rneedsContext = jQuery.expr.match.needsContext;
function nodeName( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
-};
+}
var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
@@ -97303,8 +97405,8 @@ jQuery.extend( {
resolveContexts = Array( i ),
resolveValues = slice.call( arguments ),
- // the master Deferred
- master = jQuery.Deferred(),
+ // the primary Deferred
+ primary = jQuery.Deferred(),
// subordinate callback factory
updateFunc = function( i ) {
@@ -97312,30 +97414,30 @@ jQuery.extend( {
resolveContexts[ i ] = this;
resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
if ( !( --remaining ) ) {
- master.resolveWith( resolveContexts, resolveValues );
+ primary.resolveWith( resolveContexts, resolveValues );
}
};
};
// Single- and empty arguments are adopted like Promise.resolve
if ( remaining <= 1 ) {
- adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
+ adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
!remaining );
// Use .then() to unwrap secondary thenables (cf. gh-3000)
- if ( master.state() === "pending" ||
+ if ( primary.state() === "pending" ||
isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
- return master.then();
+ return primary.then();
}
}
// Multiple arguments are aggregated like Promise.all array elements
while ( i-- ) {
- adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
+ adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
}
- return master.promise();
+ return primary.promise();
}
} );
@@ -97486,8 +97588,8 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
for ( ; i < len; i++ ) {
fn(
elems[ i ], key, raw ?
- value :
- value.call( elems[ i ], i, fn( elems[ i ], key ) )
+ value :
+ value.call( elems[ i ], i, fn( elems[ i ], key ) )
);
}
}
@@ -98395,10 +98497,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
}
-var
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
- rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
+var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
function returnTrue() {
return true;
@@ -98693,8 +98792,8 @@ jQuery.event = {
event = jQuery.event.fix( nativeEvent ),
handlers = (
- dataPriv.get( this, "events" ) || Object.create( null )
- )[ event.type ] || [],
+ dataPriv.get( this, "events" ) || Object.create( null )
+ )[ event.type ] || [],
special = jQuery.event.special[ event.type ] || {};
// Use the fix-ed jQuery.Event rather than the (read-only) native event
@@ -98818,12 +98917,12 @@ jQuery.event = {
get: isFunction( hook ) ?
function() {
if ( this.originalEvent ) {
- return hook( this.originalEvent );
+ return hook( this.originalEvent );
}
} :
function() {
if ( this.originalEvent ) {
- return this.originalEvent[ name ];
+ return this.originalEvent[ name ];
}
},
@@ -98962,7 +99061,13 @@ function leverageNative( el, type, expectSync ) {
// Cancel the outer synthetic event
event.stopImmediatePropagation();
event.preventDefault();
- return result.value;
+
+ // Support: Chrome 86+
+ // In Chrome, if an element having a focusout handler is blurred by
+ // clicking outside of it, it invokes the handler synchronously. If
+ // that handler calls `.remove()` on the element, the data is cleared,
+ // leaving `result` undefined. We need to guard against this.
+ return result && result.value;
}
// If this is an inner synthetic event for an event with a bubbling surrogate
@@ -99127,34 +99232,7 @@ jQuery.each( {
targetTouches: true,
toElement: true,
touches: true,
-
- which: function( event ) {
- var button = event.button;
-
- // Add which for key events
- if ( event.which == null && rkeyEvent.test( event.type ) ) {
- return event.charCode != null ? event.charCode : event.keyCode;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
- if ( button & 1 ) {
- return 1;
- }
-
- if ( button & 2 ) {
- return 3;
- }
-
- if ( button & 4 ) {
- return 2;
- }
-
- return 0;
- }
-
- return event.which;
- }
+ which: true
}, jQuery.event.addProp );
jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
@@ -99180,6 +99258,12 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
return true;
},
+ // Suppress native focus or blur as it's already being fired
+ // in leverageNative.
+ _default: function() {
+ return true;
+ },
+
delegateType: delegateType
};
} );
@@ -99847,6 +99931,10 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
// set in CSS while `offset*` properties report correct values.
// Behavior in IE 9 is more subtle than in newer versions & it passes
// some versions of this test; make sure not to make it pass there!
+ //
+ // Support: Firefox 70+
+ // Only Firefox includes border widths
+ // in computed dimensions. (gh-4529)
reliableTrDimensions: function() {
var table, tr, trChild, trStyle;
if ( reliableTrDimensionsVal == null ) {
@@ -99854,17 +99942,32 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
tr = document.createElement( "tr" );
trChild = document.createElement( "div" );
- table.style.cssText = "position:absolute;left:-11111px";
+ table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
+ tr.style.cssText = "border:1px solid";
+
+ // Support: Chrome 86+
+ // Height set through cssText does not get applied.
+ // Computed height then comes back as 0.
tr.style.height = "1px";
trChild.style.height = "9px";
+ // Support: Android 8 Chrome 86+
+ // In our bodyBackground.html iframe,
+ // display for all div elements is set to "inline",
+ // which causes a problem only in Android 8 Chrome 86.
+ // Ensuring the div is display: block
+ // gets around this issue.
+ trChild.style.display = "block";
+
documentElement
.appendChild( table )
.appendChild( tr )
.appendChild( trChild );
trStyle = window.getComputedStyle( tr );
- reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
+ reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
+ parseInt( trStyle.borderTopWidth, 10 ) +
+ parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
documentElement.removeChild( table );
}
@@ -100328,10 +100431,10 @@ jQuery.each( [ "height", "width" ], function( _i, dimension ) {
// Running getBoundingClientRect on a disconnected node
// in IE throws an error.
( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
- swap( elem, cssShow, function() {
- return getWidthOrHeight( elem, dimension, extra );
- } ) :
- getWidthOrHeight( elem, dimension, extra );
+ swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, dimension, extra );
+ } ) :
+ getWidthOrHeight( elem, dimension, extra );
}
},
@@ -100390,7 +100493,7 @@ jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
swap( elem, { marginLeft: 0 }, function() {
return elem.getBoundingClientRect().left;
} )
- ) + "px";
+ ) + "px";
}
}
);
@@ -100529,7 +100632,7 @@ Tween.propHooks = {
if ( jQuery.fx.step[ tween.prop ] ) {
jQuery.fx.step[ tween.prop ]( tween );
} else if ( tween.elem.nodeType === 1 && (
- jQuery.cssHooks[ tween.prop ] ||
+ jQuery.cssHooks[ tween.prop ] ||
tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
} else {
@@ -100774,7 +100877,7 @@ function defaultPrefilter( elem, props, opts ) {
anim.done( function() {
- /* eslint-enable no-loop-func */
+ /* eslint-enable no-loop-func */
// The final step of a "hide" animation is actually hiding the element
if ( !hidden ) {
@@ -100894,7 +100997,7 @@ function Animation( elem, properties, options ) {
tweens: [],
createTween: function( prop, end ) {
var tween = jQuery.Tween( elem, animation.opts, prop, end,
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
animation.tweens.push( tween );
return tween;
},
@@ -101067,7 +101170,8 @@ jQuery.fn.extend( {
anim.stop( true );
}
};
- doAnimation.finish = doAnimation;
+
+ doAnimation.finish = doAnimation;
return empty || optall.queue === false ?
this.each( doAnimation ) :
@@ -101707,8 +101811,8 @@ jQuery.fn.extend( {
if ( this.setAttribute ) {
this.setAttribute( "class",
className || value === false ?
- "" :
- dataPriv.get( this, "__className__" ) || ""
+ "" :
+ dataPriv.get( this, "__className__" ) || ""
);
}
}
@@ -101723,7 +101827,7 @@ jQuery.fn.extend( {
while ( ( elem = this[ i++ ] ) ) {
if ( elem.nodeType === 1 &&
( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
- return true;
+ return true;
}
}
@@ -102013,9 +102117,7 @@ jQuery.extend( jQuery.event, {
special.bindType || type;
// jQuery handler
- handle = (
- dataPriv.get( cur, "events" ) || Object.create( null )
- )[ event.type ] &&
+ handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
dataPriv.get( cur, "handle" );
if ( handle ) {
handle.apply( cur, data );
@@ -102162,7 +102264,7 @@ var rquery = ( /\?/ );
// Cross-browser xml parsing
jQuery.parseXML = function( data ) {
- var xml;
+ var xml, parserErrorElem;
if ( !data || typeof data !== "string" ) {
return null;
}
@@ -102171,12 +102273,17 @@ jQuery.parseXML = function( data ) {
// IE throws on parseFromString with invalid input.
try {
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
- } catch ( e ) {
- xml = undefined;
- }
+ } catch ( e ) {}
- if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
+ parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
+ if ( !xml || parserErrorElem ) {
+ jQuery.error( "Invalid XML: " + (
+ parserErrorElem ?
+ jQuery.map( parserErrorElem.childNodes, function( el ) {
+ return el.textContent;
+ } ).join( "\n" ) :
+ data
+ ) );
}
return xml;
};
@@ -102277,16 +102384,14 @@ jQuery.fn.extend( {
// Can add propHook for "elements" to filter or add form elements
var elements = jQuery.prop( this, "elements" );
return elements ? jQuery.makeArray( elements ) : this;
- } )
- .filter( function() {
+ } ).filter( function() {
var type = this.type;
// Use .is( ":disabled" ) so that fieldset[disabled] works
return this.name && !jQuery( this ).is( ":disabled" ) &&
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
( this.checked || !rcheckableType.test( type ) );
- } )
- .map( function( _i, elem ) {
+ } ).map( function( _i, elem ) {
var val = jQuery( this ).val();
if ( val == null ) {
@@ -102339,7 +102444,8 @@ var
// Anchor tag for parsing the document origin
originAnchor = document.createElement( "a" );
- originAnchor.href = location.href;
+
+originAnchor.href = location.href;
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
function addToPrefiltersOrTransports( structure ) {
@@ -102720,8 +102826,8 @@ jQuery.extend( {
// Context for global events is callbackContext if it is a DOM node or jQuery collection
globalEventContext = s.context &&
( callbackContext.nodeType || callbackContext.jquery ) ?
- jQuery( callbackContext ) :
- jQuery.event,
+ jQuery( callbackContext ) :
+ jQuery.event,
// Deferreds
deferred = jQuery.Deferred(),
@@ -103033,8 +103139,10 @@ jQuery.extend( {
response = ajaxHandleResponses( s, jqXHR, responses );
}
- // Use a noop converter for missing script
- if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
+ // Use a noop converter for missing script but not if jsonp
+ if ( !isSuccess &&
+ jQuery.inArray( "script", s.dataTypes ) > -1 &&
+ jQuery.inArray( "json", s.dataTypes ) < 0 ) {
s.converters[ "text script" ] = function() {};
}
@@ -103772,12 +103880,6 @@ jQuery.offset = {
options.using.call( elem, props );
} else {
- if ( typeof props.top === "number" ) {
- props.top += "px";
- }
- if ( typeof props.left === "number" ) {
- props.left += "px";
- }
curElem.css( props );
}
}
@@ -103946,8 +104048,11 @@ jQuery.each( [ "top", "left" ], function( _i, prop ) {
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
- function( defaultExtra, funcName ) {
+ jQuery.each( {
+ padding: "inner" + name,
+ content: type,
+ "": "outer" + name
+ }, function( defaultExtra, funcName ) {
// Margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) {
@@ -104032,7 +104137,8 @@ jQuery.fn.extend( {
}
} );
-jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
+jQuery.each(
+ ( "blur focus focusin focusout resize scroll click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
"change select submit keydown keypress keyup contextmenu" ).split( " " ),
function( _i, name ) {
@@ -104043,7 +104149,8 @@ jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
this.on( name, null, data, fn ) :
this.trigger( name );
};
- } );
+ }
+);
@@ -104352,7 +104459,7 @@ var Almanac = function () {
}();
exports.default = Almanac;
-},{"./debug":97,"./errors":101,"./fact":102,"lodash.isobjectlike":108,"selectn":136}],96:[function(require,module,exports){
+},{"./debug":97,"./errors":101,"./fact":102,"lodash.isobjectlike":108,"selectn":135}],96:[function(require,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
@@ -104554,7 +104661,7 @@ function debug(message) {
}
}).call(this)}).call(this,require('_process'))
-},{"_process":135}],98:[function(require,module,exports){
+},{"_process":134}],98:[function(require,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
@@ -104953,7 +105060,7 @@ var Engine = function (_EventEmitter) {
}(_events.EventEmitter);
exports.default = Engine;
-},{"./almanac":95,"./debug":97,"./engine-default-operators":98,"./engine-facts":99,"./fact":102,"./operator":105,"./rule":107,"events":28}],101:[function(require,module,exports){
+},{"./almanac":95,"./debug":97,"./engine-default-operators":98,"./engine-facts":99,"./fact":102,"./operator":105,"./rule":107,"events":62}],101:[function(require,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
@@ -105264,7 +105371,7 @@ var RuleResult = function () {
}();
exports.default = RuleResult;
-},{"clone":29}],107:[function(require,module,exports){
+},{"clone":28}],107:[function(require,module,exports){
'use strict';
Object.defineProperty(exports, "__esModule", {
@@ -105621,7 +105728,7 @@ var Rule = function (_EventEmitter) {
}(_events.EventEmitter);
exports.default = Rule;
-},{"./condition":96,"./debug":97,"./rule-result":106,"events":28}],108:[function(require,module,exports){
+},{"./condition":96,"./debug":97,"./rule-result":106,"events":62}],108:[function(require,module,exports){
/**
* lodash 4.0.0 (Custom Build)
* Build: `lodash modularize exports="npm" -o ./`
@@ -105676,14 +105783,15 @@ module.exports = isObjectLike;
var undefined;
/** Used as the semantic version number. */
- var VERSION = '4.17.20';
+ var VERSION = '4.17.21';
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/** Error message constants. */
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
- FUNC_ERROR_TEXT = 'Expected a function';
+ FUNC_ERROR_TEXT = 'Expected a function',
+ INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
@@ -105816,10 +105924,11 @@ module.exports = isObjectLike;
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);
- /** Used to match leading and trailing whitespace. */
- var reTrim = /^\s+|\s+$/g,
- reTrimStart = /^\s+/,
- reTrimEnd = /\s+$/;
+ /** Used to match leading whitespace. */
+ var reTrimStart = /^\s+/;
+
+ /** Used to match a single whitespace character. */
+ var reWhitespace = /\s/;
/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
@@ -105829,6 +105938,18 @@ module.exports = isObjectLike;
/** Used to match words composed of alphanumeric characters. */
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
+ /**
+ * Used to validate the `validate` option in `_.template` variable.
+ *
+ * Forbids characters which could potentially change the meaning of the function argument definition:
+ * - "()," (modification of function parameters)
+ * - "=" (default value)
+ * - "[]{}" (destructuring of function parameters)
+ * - "/" (beginning of a comment)
+ * - whitespace
+ */
+ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
+
/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;
@@ -106657,6 +106778,19 @@ module.exports = isObjectLike;
});
}
+ /**
+ * The base implementation of `_.trim`.
+ *
+ * @private
+ * @param {string} string The string to trim.
+ * @returns {string} Returns the trimmed string.
+ */
+ function baseTrim(string) {
+ return string
+ ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
+ : string;
+ }
+
/**
* The base implementation of `_.unary` without support for storing metadata.
*
@@ -106990,6 +107124,21 @@ module.exports = isObjectLike;
: asciiToArray(string);
}
+ /**
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
+ * character of `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the last non-whitespace character.
+ */
+ function trimmedEndIndex(string) {
+ var index = string.length;
+
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
+ return index;
+ }
+
/**
* Used by `_.unescape` to convert HTML entities to characters.
*
@@ -118158,7 +118307,7 @@ module.exports = isObjectLike;
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
- value = value.replace(reTrim, '');
+ value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
@@ -120530,6 +120679,12 @@ module.exports = isObjectLike;
if (!variable) {
source = 'with (obj) {\n' + source + '\n}\n';
}
+ // Throw an error if a forbidden character was found in `variable`, to prevent
+ // potential command injection attacks.
+ else if (reForbiddenIdentifierChars.test(variable)) {
+ throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
+ }
+
// Cleanup code by stripping empty strings.
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
.replace(reEmptyStringMiddle, '$1')
@@ -120643,7 +120798,7 @@ module.exports = isObjectLike;
function trim(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
- return string.replace(reTrim, '');
+ return baseTrim(string);
}
if (!string || !(chars = baseToString(chars))) {
return string;
@@ -120678,7 +120833,7 @@ module.exports = isObjectLike;
function trimEnd(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
- return string.replace(reTrimEnd, '');
+ return string.slice(0, trimmedEndIndex(string) + 1);
}
if (!string || !(chars = baseToString(chars))) {
return string;
@@ -122827,160 +122982,6 @@ module.exports = isObjectLike;
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],110:[function(require,module,exports){
-/**
- * Helpers.
- */
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var y = d * 365.25;
-
-/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
- */
-
-module.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isNaN(val) === false) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
-};
-
-/**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
-
-function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
- }
-}
-
-/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function fmtShort(ms) {
- if (ms >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (ms >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (ms >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (ms >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
-}
-
-/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function fmtLong(ms) {
- return plural(ms, d, 'day') ||
- plural(ms, h, 'hour') ||
- plural(ms, m, 'minute') ||
- plural(ms, s, 'second') ||
- ms + ' ms';
-}
-
-/**
- * Pluralization helper.
- */
-
-function plural(ms, n, name) {
- if (ms < n) {
- return;
- }
- if (ms < n * 1.5) {
- return Math.floor(ms / n) + ' ' + name;
- }
- return Math.ceil(ms / n) + ' ' + name + 's';
-}
-
-},{}],111:[function(require,module,exports){
/**
* @license AngularJS v1.7.9
* (c) 2010-2018 Google, Inc. http://angularjs.org
@@ -124248,9 +124249,9 @@ function ngViewFillContentFactory($compile, $controller, $route) {
})(window, window.angular);
-},{}],112:[function(require,module,exports){
+},{}],111:[function(require,module,exports){
arguments[4][4][0].apply(exports,arguments)
-},{"./angular-route":111,"dup":4}],113:[function(require,module,exports){
+},{"./angular-route":110,"dup":4}],112:[function(require,module,exports){
'use strict';
var commonConfig = function () {
@@ -124296,14 +124297,14 @@ var common = function ($q, $rootScope, commonConfig, logger) {
};
module.exports = {commonModule: common, commonConfig: commonConfig};
-},{}],114:[function(require,module,exports){
+},{}],113:[function(require,module,exports){
'use strict';
var commonModule = angular.module('common', []);
commonModule.provider('commonConfig', [require('./common').commonConfig]);
commonModule.factory('common', ['$q', '$rootScope', 'commonConfig', 'logger', require('./common').commonModule]);
commonModule.factory('logger', ['$log', require('./logger')]);
-},{"./common":113,"./logger":115}],115:[function(require,module,exports){
+},{"./common":112,"./logger":114}],114:[function(require,module,exports){
'use strict';
var toastr = require('toastr');
@@ -124373,7 +124374,7 @@ function logger($log) {
}
module.exports = logger;
-},{"toastr":139}],116:[function(require,module,exports){
+},{"toastr":139}],115:[function(require,module,exports){
'use strict';
var core = angular.module('owasp-threat-dragon-core');
@@ -124408,7 +124409,7 @@ core.config(['$logProvider', function ($logProvider) {
core.config(['commonConfigProvider', function (cfg) {
cfg.config.controllerActivateSuccessEvent = config.events.controllerActivateSuccess;
}]);
-},{"toastr":139}],117:[function(require,module,exports){
+},{"toastr":139}],116:[function(require,module,exports){
'use strict';
var _ = require('lodash');
@@ -124909,7 +124910,7 @@ function diagram($scope, $document, $location, $routeParams, $timeout, dialogs,
module.exports = diagram;
-},{"lodash":109}],118:[function(require,module,exports){
+},{"lodash":109}],117:[function(require,module,exports){
'use strict';
var $ = require('jquery');
@@ -125169,7 +125170,7 @@ var diagram = function (common, diagramming) {
module.exports = { stencil: stencil, diagram: diagram };
-},{"jquery":94}],119:[function(require,module,exports){
+},{"jquery":94}],118:[function(require,module,exports){
'use strict';
var $ = require('jquery');
@@ -125360,7 +125361,7 @@ module.exports = {
elementThreats: elementThreats
};
-},{"jquery":94}],120:[function(require,module,exports){
+},{"jquery":94}],119:[function(require,module,exports){
'use strict';
var core = angular.module('owasp-threat-dragon-core');
@@ -125374,7 +125375,7 @@ core.directive('tmtElementProperties', [elementPropertyDirectives.elementPropert
core.directive('tmtElementThreats', ['$routeParams', '$location', 'common', 'dialogs', elementPropertyDirectives.elementThreats]);
core.controller('diagram', ['$scope', '$document', '$location', '$routeParams', '$timeout', 'dialogs', 'common', 'datacontext', 'threatengine', 'diagramming', 'threatmodellocator', 'hotkeys', diagram]);
-},{"./diagram":117,"./diagramdirectives":118,"./elementpropdirectives":119}],121:[function(require,module,exports){
+},{"./diagram":116,"./diagramdirectives":117,"./elementpropdirectives":118}],120:[function(require,module,exports){
'use strict';
window.jQuery = require('jquery');
require('bootstrap');
@@ -125389,7 +125390,7 @@ require('./services');
require('./diagrams');
require('./layout');
require('./threatmodels');
-},{"./common":114,"./config":116,"./diagrams":120,"./layout":123,"./services":127,"./services/joint.shapes.tm":128,"./templates":131,"./threatmodels":132,"angular-route":112,"angular-ui-bootstrap":6,"bootstrap":13,"jquery":94}],122:[function(require,module,exports){
+},{"./common":113,"./config":115,"./diagrams":119,"./layout":122,"./services":126,"./services/joint.shapes.tm":127,"./templates":130,"./threatmodels":131,"angular-route":111,"angular-ui-bootstrap":6,"bootstrap":13,"jquery":94}],121:[function(require,module,exports){
'use strict';
var pager = function() {
@@ -125417,11 +125418,11 @@ var pager = function() {
};
module.exports = pager;
-},{}],123:[function(require,module,exports){
+},{}],122:[function(require,module,exports){
var core = angular.module('owasp-threat-dragon-core');
var directives = require('./directives');
core.directive('tmtPager', [directives]);
-},{"./directives":122}],124:[function(require,module,exports){
+},{"./directives":121}],123:[function(require,module,exports){
'use strict';
var joint = require('jointjs');
@@ -125592,7 +125593,7 @@ function diagramming() {
module.exports = diagramming;
-},{"jointjs":91}],125:[function(require,module,exports){
+},{"jointjs":91}],124:[function(require,module,exports){
'use strict';
var _ = require('lodash');
@@ -125640,7 +125641,7 @@ function confirmController($scope, $uibModalInstance, ok, cancel, parameter) {
}
module.exports = controllers;
-},{"lodash":109}],126:[function(require,module,exports){
+},{"lodash":109}],125:[function(require,module,exports){
'use strict';
function dialogs($location, $modal) {
@@ -125698,7 +125699,7 @@ function dialogs($location, $modal) {
}
module.exports = dialogs;
-},{}],127:[function(require,module,exports){
+},{}],126:[function(require,module,exports){
var core = angular.module('owasp-threat-dragon-core');
require('angular-ui-bootstrap');
core.factory('routemediator', ['$rootScope', '$location', 'config', 'logger', require('./routemediator')]);
@@ -125709,7 +125710,7 @@ core.factory('dialogs', ['$location', '$uibModal', require('./dialogs')]);
core.factory('diagramming', [require('./diagramming')]);
core.value('hotkeys', require('hotkeys-js'));
-},{"./diagramming":124,"./dialogControllers":125,"./dialogs":126,"./routemediator":129,"./threatengine":130,"angular-ui-bootstrap":6,"hotkeys-js":89}],128:[function(require,module,exports){
+},{"./diagramming":123,"./dialogControllers":124,"./dialogs":125,"./routemediator":128,"./threatengine":129,"angular-ui-bootstrap":6,"hotkeys-js":89}],127:[function(require,module,exports){
'use strict';
var joint = require('jointjs');
@@ -126117,7 +126118,7 @@ if (typeof exports === 'object') {
module.exports = joint.shapes.tm;
}
-},{"jointjs":91}],129:[function(require,module,exports){
+},{"jointjs":91}],128:[function(require,module,exports){
'use strict';
function routemediator($rootScope, $location, config, logger) {
@@ -126161,7 +126162,7 @@ function routemediator($rootScope, $location, config, logger) {
}
module.exports = routemediator;
-},{}],130:[function(require,module,exports){
+},{}],129:[function(require,module,exports){
'use strict';
var Engine = require('json-rules-engine').Engine;
@@ -126854,7 +126855,7 @@ function threatengine() {
module.exports = threatengine;
-},{"json-rules-engine":103}],131:[function(require,module,exports){
+},{"json-rules-engine":103}],130:[function(require,module,exports){
angular.module('templates', [])
.run(['$templateCache', function($templateCache) {
$templateCache.put('diagrams/CiaEditPane.html',
@@ -127841,7 +127842,7 @@ angular.module('templates', [])
}]);
-},{}],132:[function(require,module,exports){
+},{}],131:[function(require,module,exports){
'use strict';
var core = angular.module('owasp-threat-dragon-core');
@@ -127850,7 +127851,7 @@ var threatModelDirectives = require('./threatmodeldirectives');
core.directive('tmtThreatModelReport', ['$location', '$routeParams', 'threatmodellocator', 'diagramming', threatModelDirectives.threatModelReport]);
core.controller('threatmodel', ['$scope', '$location', '$routeParams', 'dialogs', 'common', 'datacontext', 'threatmodellocator', threatmodel]);
-},{"./threatmodel":133,"./threatmodeldirectives":134}],133:[function(require,module,exports){
+},{"./threatmodel":132,"./threatmodeldirectives":133}],132:[function(require,module,exports){
'use strict';
var _ = require('lodash');
@@ -128093,7 +128094,7 @@ function threatModel($scope, $location, $routeParams, dialogs, common, dataconte
module.exports = threatModel;
-},{"lodash":109}],134:[function(require,module,exports){
+},{"lodash":109}],133:[function(require,module,exports){
'use strict';
var _ = require('lodash');
@@ -128202,7 +128203,7 @@ module.exports = {
threatModelReport: threatModelReport
};
-},{"lodash":109}],135:[function(require,module,exports){
+},{"lodash":109}],134:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
@@ -128388,7 +128389,7 @@ process.chdir = function (dir) {
};
process.umask = function() { return 0; };
-},{}],136:[function(require,module,exports){
+},{}],135:[function(require,module,exports){
'use strict'
var curry2 = require('curry2')
@@ -128434,7 +128435,7 @@ function selectn (path, object) {
return typeof ref === 'function' ? ref() : ref
}
-},{"brackets2dots":26,"curry2":31,"debug":137,"dotsplit.js":62}],137:[function(require,module,exports){
+},{"brackets2dots":26,"curry2":30,"debug":136,"dotsplit.js":61}],136:[function(require,module,exports){
(function (process){(function (){
/**
* This is the web browser implementation of `debug()`.
@@ -128624,7 +128625,7 @@ function localstorage() {
}).call(this)}).call(this,require('_process'))
-},{"./debug":138,"_process":135}],138:[function(require,module,exports){
+},{"./debug":137,"_process":134}],137:[function(require,module,exports){
/**
* This is the common logic for both the Node.js and web browser
@@ -128828,7 +128829,161 @@ function coerce(val) {
return val;
}
-},{"ms":110}],139:[function(require,module,exports){
+},{"ms":138}],138:[function(require,module,exports){
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ * - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function(val, options) {
+ options = options || {};
+ var type = typeof val;
+ if (type === 'string' && val.length > 0) {
+ return parse(val);
+ } else if (type === 'number' && isNaN(val) === false) {
+ return options.long ? fmtLong(val) : fmtShort(val);
+ }
+ throw new Error(
+ 'val is not a non-empty string or a valid number. val=' +
+ JSON.stringify(val)
+ );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+ str = String(str);
+ if (str.length > 100) {
+ return;
+ }
+ var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
+ str
+ );
+ if (!match) {
+ return;
+ }
+ var n = parseFloat(match[1]);
+ var type = (match[2] || 'ms').toLowerCase();
+ switch (type) {
+ case 'years':
+ case 'year':
+ case 'yrs':
+ case 'yr':
+ case 'y':
+ return n * y;
+ case 'days':
+ case 'day':
+ case 'd':
+ return n * d;
+ case 'hours':
+ case 'hour':
+ case 'hrs':
+ case 'hr':
+ case 'h':
+ return n * h;
+ case 'minutes':
+ case 'minute':
+ case 'mins':
+ case 'min':
+ case 'm':
+ return n * m;
+ case 'seconds':
+ case 'second':
+ case 'secs':
+ case 'sec':
+ case 's':
+ return n * s;
+ case 'milliseconds':
+ case 'millisecond':
+ case 'msecs':
+ case 'msec':
+ case 'ms':
+ return n;
+ default:
+ return undefined;
+ }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+ if (ms >= d) {
+ return Math.round(ms / d) + 'd';
+ }
+ if (ms >= h) {
+ return Math.round(ms / h) + 'h';
+ }
+ if (ms >= m) {
+ return Math.round(ms / m) + 'm';
+ }
+ if (ms >= s) {
+ return Math.round(ms / s) + 's';
+ }
+ return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+ return plural(ms, d, 'day') ||
+ plural(ms, h, 'hour') ||
+ plural(ms, m, 'minute') ||
+ plural(ms, s, 'second') ||
+ ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, n, name) {
+ if (ms < n) {
+ return;
+ }
+ if (ms < n * 1.5) {
+ return Math.floor(ms / n) + ' ' + name;
+ }
+ return Math.ceil(ms / n) + ' ' + name + 's';
+}
+
+},{}],139:[function(require,module,exports){
/*
* Toastr
* Copyright 2012-2015
@@ -130906,7 +131061,7 @@ app.run(['editableOptions', function (editableOptions) {
editableOptions.theme = 'bs3';
}]);
-},{"./config.route":142,"./layout":143,"./services":146,"./threatmodels":149,"./welcome":151,"angular":10,"angular-animate":2,"angular-route":4,"angular-ui-bootstrap":6,"angular-xeditable":8,"jquery":94,"owasp-threat-dragon-core":121}],142:[function(require,module,exports){
+},{"./config.route":142,"./layout":143,"./services":146,"./threatmodels":149,"./welcome":151,"angular":10,"angular-animate":2,"angular-route":4,"angular-ui-bootstrap":6,"angular-xeditable":8,"jquery":94,"owasp-threat-dragon-core":120}],142:[function(require,module,exports){
'use strict';
var app = require('angular').module('app');
@@ -131532,4 +131687,4 @@ function welcome($location, common, commonConfig) {
module.exports = welcome;
},{}]},{},[141])
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci1hbmltYXRlL2FuZ3VsYXItY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5ncyhub2RlLCBmdWxsQ2xhc3NOYW1lLCBjYWNoZUtleSwgZmFsc2UpO1xuICAgICAgICAgICAgcmVsYXRpdmVEZWxheSA9IHRpbWluZ3MubWF4RGVsYXk7XG4gICAgICAgICAgICBtYXhEZWxheSA9IE1hdGgubWF4KHJlbGF0aXZlRGVsYXksIDApO1xuICAgICAgICAgICAgbWF4RHVyYXRpb24gPSB0aW1pbmdzLm1heER1cmF0aW9uO1xuXG4gICAgICAgICAgICBpZiAobWF4RHVyYXRpb24gPT09IDApIHtcbiAgICAgICAgICAgICAgY2xvc2UoKTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmbGFncy5oYXNUcmFuc2l0aW9ucyA9IHRpbWluZ3MudHJhbnNpdGlvbkR1cmF0aW9uID4gMDtcbiAgICAgICAgICAgIGZsYWdzLmhhc0FuaW1hdGlvbnMgPSB0aW1pbmdzLmFuaW1hdGlvbkR1cmF0aW9uID4gMDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmxhZ3MuYXBwbHlBbmltYXRpb25EZWxheSkge1xuICAgICAgICAgICAgcmVsYXRpdmVEZWxheSA9IHR5cGVvZiBvcHRpb25zLmRlbGF5ICE9PSAnYm9vbGVhbicgJiYgdHJ1dGh5VGltaW5nVmFsdWUob3B0aW9ucy5kZWxheSlcbiAgICAgICAgICAgICAgICAgID8gcGFyc2VGbG9hdChvcHRpb25zLmRlbGF5KVxuICAgICAgICAgICAgICAgICAgOiByZWxhdGl2ZURlbGF5O1xuXG4gICAgICAgICAgICBtYXhEZWxheSA9IE1hdGgubWF4KHJlbGF0aXZlRGVsYXksIDApO1xuICAgICAgICAgICAgdGltaW5ncy5hbmltYXRpb25EZWxheSA9IHJlbGF0aXZlRGVsYXk7XG4gICAgICAgICAgICBkZWxheVN0eWxlID0gZ2V0Q3NzRGVsYXlTdHlsZShyZWxhdGl2ZURlbGF5LCB0cnVlKTtcbiAgICAgICAgICAgIHRlbXBvcmFyeVN0eWxlcy5wdXNoKGRlbGF5U3R5bGUpO1xuICAgICAgICAgICAgbm9kZS5zdHlsZVtkZWxheVN0eWxlWzBdXSA9IGRlbGF5U3R5bGVbMV07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgbWF4RGVsYXlUaW1lID0gbWF4RGVsYXkgKiBPTkVfU0VDT05EO1xuICAgICAgICAgIG1heER1cmF0aW9uVGltZSA9IG1heER1cmF0aW9uICogT05FX1NFQ09ORDtcblxuICAgICAgICAgIGlmIChvcHRpb25zLmVhc2luZykge1xuICAgICAgICAgICAgdmFyIGVhc2VQcm9wLCBlYXNlVmFsID0gb3B0aW9ucy5lYXNpbmc7XG4gICAgICAgICAgICBpZiAoZmxhZ3MuaGFzVHJhbnNpdGlvbnMpIHtcbiAgICAgICAgICAgICAgZWFzZVByb3AgPSBUUkFOU0lUSU9OX1BST1AgKyBUSU1JTkdfS0VZO1xuICAgICAgICAgICAgICB0ZW1wb3JhcnlTdHlsZXMucHVzaChbZWFzZVByb3AsIGVhc2VWYWxdKTtcbiAgICAgICAgICAgICAgbm9kZS5zdHlsZVtlYXNlUHJvcF0gPSBlYXNlVmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGZsYWdzLmhhc0FuaW1hdGlvbnMpIHtcbiAgICAgICAgICAgICAgZWFzZVByb3AgPSBBTklNQVRJT05fUFJPUCArIFRJTUlOR19LRVk7XG4gICAgICAgICAgICAgIHRlbXBvcmFyeVN0eWxlcy5wdXNoKFtlYXNlUHJvcCwgZWFzZVZhbF0pO1xuICAgICAgICAgICAgICBub2RlLnN0eWxlW2Vhc2VQcm9wXSA9IGVhc2VWYWw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHRpbWluZ3MudHJhbnNpdGlvbkR1cmF0aW9uKSB7XG4gICAgICAgICAgICBldmVudHMucHVzaChUUkFOU0lUSU9ORU5EX0VWRU5UKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodGltaW5ncy5hbmltYXRpb25EdXJhdGlvbikge1xuICAgICAgICAgICAgZXZlbnRzLnB1c2goQU5JTUFUSU9ORU5EX0VWRU5UKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBzdGFydFRpbWUgPSBEYXRlLm5vdygpO1xuICAgICAgICAgIHZhciB0aW1lclRpbWUgPSBtYXhEZWxheVRpbWUgKyBDTE9TSU5HX1RJTUVfQlVGRkVSICogbWF4RHVyYXRpb25UaW1lO1xuICAgICAgICAgIHZhciBlbmRUaW1lID0gc3RhcnRUaW1lICsgdGltZXJUaW1lO1xuXG4gICAgICAgICAgdmFyIGFuaW1hdGlvbnNEYXRhID0gZWxlbWVudC5kYXRhKEFOSU1BVEVfVElNRVJfS0VZKSB8fCBbXTtcbiAgICAgICAgICB2YXIgc2V0dXBGYWxsYmFja1RpbWVyID0gdHJ1ZTtcbiAgICAgICAgICBpZiAoYW5pbWF0aW9uc0RhdGEubGVuZ3RoKSB7XG4gICAgICAgICAgICB2YXIgY3VycmVudFRpbWVyRGF0YSA9IGFuaW1hdGlvbnNEYXRhWzBdO1xuICAgICAgICAgICAgc2V0dXBGYWxsYmFja1RpbWVyID0gZW5kVGltZSA+IGN1cnJlbnRUaW1lckRhdGEuZXhwZWN0ZWRFbmRUaW1lO1xuICAgICAgICAgICAgaWYgKHNldHVwRmFsbGJhY2tUaW1lcikge1xuICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwoY3VycmVudFRpbWVyRGF0YS50aW1lcik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBhbmltYXRpb25zRGF0YS5wdXNoKGNsb3NlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc2V0dXBGYWxsYmFja1RpbWVyKSB7XG4gICAgICAgICAgICB2YXIgdGltZXIgPSAkdGltZW91dChvbkFuaW1hdGlvbkV4cGlyZWQsIHRpbWVyVGltZSwgZmFsc2UpO1xuICAgICAgICAgICAgYW5pbWF0aW9uc0RhdGFbMF0gPSB7XG4gICAgICAgICAgICAgIHRpbWVyOiB0aW1lcixcbiAgICAgICAgICAgICAgZXhwZWN0ZWRFbmRUaW1lOiBlbmRUaW1lXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYW5pbWF0aW9uc0RhdGEucHVzaChjbG9zZSk7XG4gICAgICAgICAgICBlbGVtZW50LmRhdGEoQU5JTUFURV9USU1FUl9LRVksIGFuaW1hdGlvbnNEYXRhKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZXZlbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgZWxlbWVudC5vbihldmVudHMuam9pbignICcpLCBvbkFuaW1hdGlvblByb2dyZXNzKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAob3B0aW9ucy50bykge1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMuY2xlYW51cFN0eWxlcykge1xuICAgICAgICAgICAgICByZWdpc3RlclJlc3RvcmFibGVTdHlsZXMocmVzdG9yZVN0eWxlcywgbm9kZSwgT2JqZWN0LmtleXMob3B0aW9ucy50bykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXBwbHlBbmltYXRpb25Ub1N0eWxlcyhlbGVtZW50LCBvcHRpb25zKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBvbkFuaW1hdGlvbkV4cGlyZWQoKSB7XG4gICAgICAgICAgdmFyIGFuaW1hdGlvbnNEYXRhID0gZWxlbWVudC5kYXRhKEFOSU1BVEVfVElNRVJfS0VZKTtcblxuICAgICAgICAgIC8vIHRoaXMgd2lsbCBiZSBmYWxzZSBpbiB0aGUgZXZlbnQgdGhhdCB0aGUgZWxlbWVudCB3YXNcbiAgICAgICAgICAvLyByZW1vdmVkIGZyb20gdGhlIERPTSAodmlhIGEgbGVhdmUgYW5pbWF0aW9uIG9yIHNvbWV0aG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JPdXQgfHwgYW5pbWF0b3JJbjtcblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBydW5uZXI7XG5cbiAgICAgICAgICB2YXIgY3VycmVudEFuaW1hdGlvbiA9IHN0YXJ0aW5nQW5pbWF0b3Iuc3RhcnQoKTtcbiAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIGlmICghYW5pbWF0b3JJbikge1xuICAgICAgICAgICAgICBhbmltYXRvckluID0gcHJlcGFyZUluQW5pbWF0aW9uKCk7XG4gICAgICAgICAgICAgIGlmIChhbmltYXRvckluKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudEFuaW1hdGlvbiA9IGFuaW1hdG9ySW4uc3RhcnQoKTtcbiAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIGVuZCgpO1xuICAgICAgICAgICAgICAgICAgcnVubmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnRBbmltYXRpb247XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGluIHRoZSBldmVudCB0aGF0IHRoZXJlIGlzIG5vIGBpbmAgYW5pbWF0aW9uXG4gICAgICAgICAgICBlbmQoKTtcbiAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSgpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcnVubmVyID0gbmV3ICQkQW5pbWF0ZVJ1bm5lcih7XG4gICAgICAgICAgICBlbmQ6IGVuZEZuLFxuICAgICAgICAgICAgY2FuY2VsOiBlbmRGblxuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcmV0dXJuIHJ1bm5lcjtcblxuICAgICAgICAgIGZ1bmN0aW9uIGVuZEZuKCkge1xuICAgICAgICAgICAgaWYgKGN1cnJlbnRBbmltYXRpb24pIHtcbiAgICAgICAgICAgICAgY3VycmVudEFuaW1hdGlvbi5lbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIGZ1bmN0aW9uIGNhbGN1bGF0ZUFuY2hvclN0eWxlcyhhbmNob3IpIHtcbiAgICAgICAgdmFyIHN0eWxlcyA9IHt9O1xuXG4gICAgICAgIHZhciBjb29yZHMgPSBnZXREb21Ob2RlKGFuY2hvcikuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG5cbiAgICAgICAgLy8gd2UgaXRlcmF0ZSBkaXJlY3RseSBzaW5jZSBzYWZhcmkgbWVzc2VzIHVwIGFuZCBkb2Vzbid0IHJldHVyblxuICAgICAgICAvLyBhbGwgdGhlIGtleXMgZm9yIHRoZSBjb29yZHMgb2JqZWN0IHdoZW4gaXRlcmF0ZWRcbiAgICAgICAgZm9yRWFjaChbJ3dpZHRoJywnaGVpZ2h0JywndG9wJywnbGVmdCddLCBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICB2YXIgdmFsdWUgPSBjb29yZHNba2V5XTtcbiAgICAgICAgICBzd2l0Y2ggKGtleSkge1xuICAgICAgICAgICAgY2FzZSAndG9wJzpcbiAgICAgICAgICAgICAgdmFsdWUgKz0gYm9keU5vZGUuc2Nyb2xsVG9wO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2xlZnQnOlxuICAgICAgICAgICAgICB2YWx1ZSArPSBib2R5Tm9kZS5zY3JvbGxMZWZ0O1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgc3R5b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ndWxhckFuaW1hdGlvbih0bywgbm9vcCk7XG5cbiAgICAgIHZhciBhbmNob3JBbmltYXRpb25zID0gW107XG4gICAgICBmb3JFYWNoKGFuY2hvcnMsIGZ1bmN0aW9uKGFuY2hvcikge1xuICAgICAgICB2YXIgb3V0RWxlbWVudCA9IGFuY2hvclsnb3V0J107XG4gICAgICAgIHZhciBpbkVsZW1lbnQgPSBhbmNob3JbJ2luJ107XG4gICAgICAgIHZhciBhbmltYXRvciA9IHByZXBhcmVBbmNob3JlZEFuaW1hdGlvbihjbGFzc2VzLCBvdXRFbGVtZW50LCBpbkVsZW1lbnQpO1xuICAgICAgICBpZiAoYW5pbWF0b3IpIHtcbiAgICAgICAgICBhbmNob3JBbmltYXRpb25zLnB1c2goYW5pbWF0b3IpO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgLy8gbm8gcG9pbnQgaW4gZG9pbmcgYW55dGhpbmcgd2hlbiB0aGVyZSBhcmUgbm8gZWxlbWVudHMgdG8gYW5pbWF0ZVxuICAgICAgaWYgKCFmcm9tQW5pbWF0aW9uICYmICF0b0FuaW1hdGlvbiAmJiBhbmNob3JBbmltYXRpb25zLmxlbmd0aCA9PT0gMCkgcmV0dXJuO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICBzdGFydDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGFuaW1hdGlvblJ1bm5lcnMgPSBbXTtcblxuICAgICAgICAgIGlmIChmcm9tQW5pbWF0aW9uKSB7XG4gICAgICAgICAgICBhbmltYXRpb25SdW5uZXJzLnB1c2goZnJvbUFuaW1hdGlvbi5zdGFydCgpKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodG9BbmltYXRpb24pIHtcbiAgICAgICAgICAgIGFuaW1hdGlvblJ1bm5lcnMucHVzaCh0b0FuaW1hdGlvbi5zdGFydCgpKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBmb3JFYWNoKGFuY2hvckFuaW1hdGlvbn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A9IG5ldyAkJEFuaW1hdGVSdW5uZXIoKTtcbiAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSh0cnVlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHJ1bm5lcjtcbiAgICAgICAgfSxcbiAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmIChydW5uZXIpIHtcbiAgICAgICAgICAgIHJldHVybiBydW5uZXI7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcnVubmVyID0gbmV3ICQkQW5pbWF0ZVJ1bm5lcigpO1xuICAgICAgICAgIHZhciBjbG9zZUFjdGl2ZUFuaW1hdGlvbnM7XG4gICAgICAgICAgdmFyIGNoYWluID0gW107XG5cbiAgICAgICAgICBpZiAoYmVmb3JlKSB7XG4gICAgICAgICAgICBjaGFpbi5wdXNoKGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgICAgIGNsb3NlQWN0aXZlQW5pbWF0aW9ucyA9IGJlZm9yZShmbik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoY2hhaW4ubGVuZ3RoKSB7XG4gICAgICAgICAgICBjaGFpbi5wdXNoKGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgICAgIGFwcGx5T3B0aW9ucygpO1xuICAgICAgICAgICAgICBmbih0cnVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhcHBseU9wdGlvbnMoKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoYWZ0ZXIpIHtcbiAgICAgICAgICAgIGNoYWluLnB1c2goZnVuY3Rpb24oZm4pIHtcbiAgICAgICAgICAgICAgY2xvc2VBY3RpdmVBbmltYXRpb25zID0gYWZ0ZXIoZm4pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcnVubmVyLnNldEhvc3Qoe1xuICAgICAgICAgICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgZW5kQW5pbWF0aW9ucygpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNhbmNlbDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGVuZEFuaW1hdGlvbnModHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAkJEFuaW1hdGVSdW5uZXIuY2hhaW4oY2hhaW4sIG9uQ29tcGxldGUpO1xuICAgICAgICAgIHJldHVybiBydW5uZXI7XG5cbiAgICAgICAgICBmdW5jdGlvbiBvbkNvbXBsZXRlKHN1Y2Nlc3MpIHtcbiAgICAgICAgICAgIGNsb3NlKHN1Y2Nlc3MpO1xuICAgICAgICAgICAgcnVubmVyLmNvbXBsZXRlKHN1Y2Nlc3MpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGZ1bmN0aW9uIGVuZEFuaW1hdGlvbnMoY2FuY2VsbGVkKSB7XG4gICAgICAgICAgICBpZiAoIWFuaW1hdGlvbkNsb3NlZCkge1xuICAgICAgICAgICAgICAoY2xvc2VBY3RpdmVBbmltYXRpb25zIHx8IG5vb3ApKGNhbmNlbGxlZCk7XG4gICAgICAgICAgICAgIG9uQ29tcGxldGUoY2FuY2VsbGVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIGZ1bmN0aW9uIGV4ZWN1dGVBbmltYXRpb25GbihmbiwgZWxlbWVudCwgZXZlbnQsIG9wdGlvbnMsIG9uRG9uZSkge1xuICAgICAgICB2YXIgYXJncztcbiAgICAgICAgc3dpdGNoIChldmVudCkge1xuICAgICAgICAgIGNhc2UgJ2FuaW1hdGUnOlxuICAgICAgICAgICAgYXJncyA9IFtlbGVtZW50LCBvcHRpb25zLmZyb20sIG9wdGlvbnMudG8sIG9uRG9uZV07XG4gICAgICAgICAgICBicmVhaztcblxuICAg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G4gICAgICAgIHJldHVybiBub29wO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsIGV2ZW50LCBvcHRpb25zLCBhbmltYXRpb25zLCBmbk5hbWUpIHtcbiAgICAgICAgdmFyIG9wZXJhdGlvbnMgPSBbXTtcbiAgICAgICAgZm9yRWFjaChhbmltYXRpb25zLCBmdW5jdGlvbihhbmkpIHtcbiAgICAgICAgICB2YXIgYW5pbWF0aW9uID0gYW5pW2ZuTmFtZV07XG4gICAgICAgICAgaWYgKCFhbmltYXRpb24pIHJldHVybjtcblxuICAgICAgICAgIC8vIG5vdGUgdGhhdCBhbGwgb2YgdGhlc2UgYW5pbWF0aW9ucyB3aWxsIHJ1biBpbiBwYXJhbGxlbFxuICAgICAgICAgIG9wZXJhdGlvbnMucHVzaChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBydW5uZXI7XG4gICAgICAgICAgICB2YXIgZW5kUHJvZ3Jlc3NDYjtcblxuICAgICAgICAgICAgdmFyIHJlc29sdmVkID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgb25BbmltYXRpb25Db21wbGV0ZSA9IGZ1bmN0aW9uKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIGlmICghcmVzb2x2ZWQpIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgKGVuZFByb2dyZXNzQ2IgfHwgbm9vcCkocmVqZWN0ZWQpO1xuICAgICAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSghcmVqZWN0ZWQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBydW5uZXIgPSBuZXcgJCRBbmltYXRlUnVubmVyKHtcbiAgICAgICAgICAgICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBvbkFuaW1hdGlvbkNvbXBsZXRlKCk7XG4gICAg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gICAgICAgIGIgPSBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsICdhZGRDbGFzcycsIG9wdGlvbnMsIGFuaW1hdGlvbnMsICdiZWZvcmVBZGRDbGFzcycpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoZm5OYW1lID09PSAnc2V0Q2xhc3MnKSB7XG4gICAgICAgICAgICBhID0gZ3JvdXBFdmVudGVkQW5pbWF0aW9ucyhlbGVtZW50LCAncmVtb3ZlQ2xhc3MnLCBvcHRpb25zLCBhbmltYXRpb25zLCAncmVtb3ZlQ2xhc3MnKTtcbiAgICAgICAgICAgIGIgPSBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsICdhZGRDbGFzcycsIG9wdGlvbnMsIGFuaW1hdGlvbnMsICdhZGRDbGFzcycpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChhKSB7XG4gICAgICAgICAgICBvcGVyYXRpb25zID0gb3BlcmF0aW9ucy5jb25jYXQoYSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChiKSB7XG4gICAgICAgICAgICBvcGVyYXRpb25zID0gb3BlcmF0aW9ucy5jb25jYXQoYik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG9wZXJhdGlvbnMubGVuZ3RoID09PSAwKSByZXR1cm47XG5cbiAgICAgICAgLy8gVE9ETyhtYXRza28pOiBhZGQgZG9jdW1lbnRhdGlvblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gc3RhcnRBbmltYXRpb24oY2FsbGJhY2spIHtcbiAgICAgICAgICB2YXIgcnVubmVycyA9IFtdO1xuICAgICAgICAgIGlmIChvcGVyYXRpb25zLmxlbmd0aCkge1xuICAgICAgICAgICAgZm9yRWFjaChvcGVyYXRpb25zLCBmdW5jdGlvbihhbmltYXRlRm4pIHtcbiAgICAgICAgICAgICAgcnVubmVycy5wdXNoKGFuaW1hdGVGbigpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChydW5uZXJzLmxlbmd0aCkge1xuICAgICAgICAgICAgJCRBbmltYXRlUnVubmVyLmFsbChydW5uZXJzLCBjYWxsYmFjayk7XG4gICAgICAgICAgfSAgZWxzZSB7XG4gICAgICAgICAgICBjYWxsYmFjaygpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBmdW5jdGlvbiBlbmRGbihyZWplY3QpIHtcbiAgICAgICAgICAgIGZvckVhY2gocnVubmVycywgZnVuY3Rpb24ocnVubmVyKSB7XG4gICAgICAgICAgICAgIGlmIChyZWplY3QpIHtcbiAgICAgICAgICAgICAgICBydW5uZXIuY2FuY2VsKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcnVubmVyLmVuZCgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9O1xuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG5cbiAgICBmdW5jdGlvbiBsb29rdXBBbmltYXRpb25zKGNsYXNzZXMpIHtcbiAgICAgIGNsYXNzZXMgPSBpc0FycmF5KGNsYXNzZXMpID8gY2xhc3NlcyA6IGNsYXNzZXMuc3BsaXQoJyAnKTtcbiAgICAgIHZhciBtYXRjaGVzID0gW10sIGZsYWdNYXAgPSB7fTtcbiAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2xhc3Nlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIga2xhc3MgPSBjbGFzc2VzW2ldLFxuICAgICAgICAgICAgYW5pbWF0aW9uRmFjdG9yeSA9ICRhbmltYXRlUHJvdmlkZXIuJCRyZWdpc3RlcmVkQW5pbWF0aW9uc1trbGFzc107XG4gICAgICAgIGlmIChhbmltYXRpb25GYWN0b3J5ICYmICFmbGFnTWFwW2tsYXNzXSkge1xuICAgICAgICAgIG1hdGNoZXMucHVzaCgkaW5qZWN0b3IuZ2V0KGFuaW1hdGlvbkZhY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YXJ0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodG9BbmltYXRpb24pIHtcbiAgICAgICAgICAgICAgYW5pbWF0aW9uUnVubmVycy5wdXNoKHRvQW5pbWF0aW9uLnN0YXJ0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAkJEFuaW1hdGVSdW5uZXIuYWxsKGFuaW1hdGlvblJ1bm5lcnMsIGRvbmUpO1xuXG4gICAgICAgICAgICB2YXIgcnVubmVyID0gbmV3ICQkQW5pbWF0ZVJ1bm5lcih7XG4gICAgICAgICAgICAgIGVuZDogZW5kRm5GYWN0b3J5KCksXG4gICAgICAgICAgICAgIGNhbmNlbDogZW5kRm5GYWN0b3J5KClcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gcnVubmVyO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBlbmRGbkZhY3RvcnkoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBmb3JFYWNoKGFuaW1hdGlvblJ1bm5lcnMsIGZ1bmN0aW9uKHJ1bm5lcikge1xuICAgICAgICAgICAgICAgICAgLy8gYXQgdGhpcyBwb2ludCB3ZSBjYW5ub3QgY2FuY2VsIGFuaW1hdGlvbnMgZm9yIGdyb3VwcyBqdXN0IHlldC4gMS41K1xuICAgICAgICAgICAgICAgICAgcnVubmVyLmVuZCgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBkb25lKHN0YXR1cykge1xuICAgICAgICAgICAgICBydW5uZXIuY29tcGxldGUoc3RhdHVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gcHJlcGFyZUFuaW1hdGlvbihhbmltYXRpb25EZXRhaWxzKTt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Rpb24oKSB7XG4gICAgICAgICAgdmFyIGFuaW1hdGlvbkRldGFpbHMgPSBhY3RpdmVBbmltYXRpb25zTG9va3VwLmdldChub2RlKTtcblxuICAgICAgICAgIGlmICghYW5pbWF0aW9uRGV0YWlscykge1xuICAgICAgICAgICAgLy8gSWYgdGhlcmUncyBhbiBhbmltYXRpb24gb25nb2luZywgdGhlIGNhbGxiYWNrIGNhbGxpbmcgY29kZSB3aWxsIHJlbW92ZVxuICAgICAgICAgICAgLy8gdGhlIGV2ZW50IGxpc3RlbmVycy4gSWYgd2UnZCByZW1vdmUgaGVyZSwgdGhlIGNhbGxiYWNrcyB3b3VsZCBiZSByZW1vdmVkXG4gICAgICAgICAgICAvLyBiZWZvcmUgdGhlIGFuaW1hdGlvbiBlbmRzXG4gICAgICAgICAgICAkYW5pbWF0ZS5vZmYoZXZlbnQsIGNvbnRhaW5lciwgY2FsbGJhY2spO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9LFxuXG4gICAgICBvZmY6IGZ1bmN0aW9uKGV2ZW50LCBjb250YWluZXIsIGNhbGxiYWNrKSB7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxICYmICFpc1N0cmluZyhhcmd1bWVudHNbMF0pKSB7XG4gICAgICAgICAgY29udGFpbmVyID0gYXJndW1lbnRzWzBdO1xuICAgICAgICAgIGZvciAodmFyIGV2ZW50VHlwZSBpbiBjYWxsYmFja1JlZ2lzdHJ5KSB7XG4gICAgICAgICAgICBjYWxsYmFja1JlZ2lzdHJ5W2V2ZW50VHlwZV0gPSBmaWx0ZXJGcm9tUmVnaXN0cnkoY2FsbGJhY2tSZWdpc3RyeVtldmVudFR5cGVdLCBjb250YWluZXIpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBlbnRyaWVzID0gY2FsbGJhY2tSZWdpc3RyeVtldmVudF07XG4gICAgICAgIGlmICghZW50cm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zZXR0ZXI8RjM3PlxuICAgICAgZW5hYmxlZDogZnVuY3Rpb24oZWxlbWVudCwgYm9vbCkge1xuICAgICAgICB2YXIgYXJnQ291bnQgPSBhcmd1bWVudHMubGVuZ3RoO1xuXG4gICAgICAgIGlmIChhcmdDb3VudCA9PT0gMCkge1xuICAgICAgICAgIC8vICgpIC0gR2xvYmFsIGdldHRlclxuICAgICAgICAgIGJvb2wgPSAhIWFuaW1hdGlvbnNFbmFibGVkO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhciBoYXNFbGVtZW50ID0gaXNFbGVtZW50KGVsZW1lbnQpO1xuXG4gICAgICAgICAgaWYgKCFoYXNFbGVtZW50KSB7XG4gICAgICAgICAgICAvLyAoYm9vbCkgLSBHbG9iYWwgc2V0dGVyXG4gICAgICAgICAgICBib29sID0gYW5pbWF0aW9uc0VuYWJsZWQgPSAhIWVsZW1lbnQ7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBub2RlID0gZ2V0RG9tTm9kZShlbGVtZW50KTtcblxuICAgICAgICAgICAgaWYgKGFyZ0NvdW50ID09PSAxKSB7XG4gICAgICAgICAgICAgIC8vIChlbGVtZW50KSAtIEVsZW1lbnQgZ2V0dGVyXG4gICAgICAgICAgICAgIGJvb2wgPSAhZGlzYWJsZWRFbGVtZW50c0xvb2t1cC5nZXQobm9kZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAvLyAoZWxlbWVudCwgYm9vbCkgLSBFbGVtZW50IHNldHRlclxuICAgICAgICAgICAgICBpZiAoIWRpc2FibGVkRWxlbWVudHNMb29rdXAuaGFzKG5vZGUpKSB7XG4gICAgICAgICAgICAgICAgLy8gVGhlIGVsZW1lbnQgaXMgYWRkZWQgdG8gdGhlIG1hcCBmb3IgdGhlIGZpcnN0IHRpbWUuXG4gICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGEgbGlzdGVuZXIgdG8gcmVtb3ZlIGl0IG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ZG9tTm9kZSxcbiAgICAgICAgICBlbGVtZW50OiBhbmltYXRpb24uZWxlbWVudCxcbiAgICAgICAgICBmbjogYW5pbWF0aW9uLmZuLFxuICAgICAgICAgIGNoaWxkcmVuOiBbXVxuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgICAgZm9yIChpID0gMDsgaSA8IGFuaW1hdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgcHJvY2Vzc05vZGUoYW5pbWF0aW9uc1tpXSk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBmbGF0dGVuKHRyZWUpO1xuXG4gICAgICBmdW5jdGlvbiBwcm9jZXNzTm9kZShlbnRyeSkge1xuICAgICAgICBpZiAoZW50cnkucHJvY2Vzc2VkKSByZXR1cm4gZW50cnk7XG4gICAgICAgIGVudHJ5LnByb2Nlc3NlZCA9IHRydWU7XG5cbiAgICAgICAgdmFyIGVsZW1lbnROb2RlID0gZW50cnkuZG9tTm9kZTtcbiAgICAgICAgdmFyIHBhcmVudE5vZGUgPSBlbGVtZW50Tm9kZS5wYXJlbnROb2RlO1xuICAgICAgICBsb29rdXAuc2V0KGVsZW1lbnROb2RlLCBlbnRyeSk7XG5cbiAgICAgICAgdmFyIHBhcmVudEVudHJ5O1xuICAgICAgICB3aGlsZSAocGFyZW50Tm9kZSkge1xuICAgICAgICAgIHBhcmVudEVudHJ5ID0gbG9va3VwLmdldChwYXJlbnROb2RlKTtcbiAgICAgICAgICBpZiAocGFyZW50RW50cnkpIHtcbiAgICAgICAgICAgIGlmICghcGFyZW50RW50cnkucHJvY2Vzc2VkKSB7XG4gICAgICAgICAgICAgIHBhcmVudEVudHJ5ID0gcHJvY2Vzc05vZGUocGFyZW50RW50cnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBhcmVudE5vZGUgPSBwYXJlbnROb2RlLnBhcmVudE5vZGU7XG4gICAgICAgIH1cblxuICAgICAgICAocGFyZW50RW50cnkgfHwgdHJlZSkuY2hpbGRyZW4ucHVzaChlbnRyeSk7XG4gICAgICAgIHJldHVybiBlbnRyeTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gZmxhdHRlbih0cmVlKSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICAgICAgdmFyIHF1ZXVlID0gW107XG4gICAgICAgIHZhciBpO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0cmVlLmNoaWxkcmVuLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgcXVldWUucHVzaCh0cmVlLmNoaWxkcmVuW2ldKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciByZW1haW5pbmdMZXZlbEVudHJpZXMgPSBxdWV1ZS5sZW5ndGg7XG4gICAgICAgIHZhciBuZXh0TGV2ZWxFbnRyaWVzID0gMDtcbiAgICAgICAgdmFyIHJvdyA9IFtdO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgIHZhciBlbnRyeSA9IHF1ZXVlW2ldO1xuICAgICAgICAgIGlmIChyZW1haW5pbmdMZXZlbEVudHJpZXMgPD0gMCkge1xuICAgICAgICAgICAgcmVtYWluaW5nTGV2ZWxFbnRyaWVzID0gbmV4dExldmVsRW50cmllcztcbiAgICAgICAgICAgIG5leHRMZXZlbEVudHJpZXMgPSAwO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2gocm93KTtcbiAgICAgICAgICAgIHJvdyA9IFtdO1xuICAgICAgICAgIH1cbiAgICAgICAgICByb3cucHVzaChlbnRyeSk7XG4gICAgICAgICAgZW50cnkuY2hpbGRyZW4uZm9yRWFjaChmdW5jdGlvbihjaGlsZEVudHJ5KSB7XG4gICAgICAgICAgICBuZXh0TGV2ZWxFbnRyaWVzKys7XG4gICAgICAgICAgICBxdWV1ZS5wdXNoKGNoaWxkRW50cnkpO1xuICAgICAgICAgIH0pO1xuICA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aW5nIHRoZSBSQUYgc2VxdWVuY2luZyB0aGVuIHdlIHNob3VsZCBub3QgdHJpZ2dlciB0aGUgYW5pbWF0aW9uLlxuICAgICAgICAgICAgICB2YXIgdGFyZ2V0RWxlbWVudCA9IGFuaW1hdGlvbkVudHJ5LmFuY2hvcnNcbiAgICAgICAgICAgICAgICAgID8gKGFuaW1hdGlvbkVudHJ5LmZyb20uZWxlbWVudCB8fCBhbmltYXRpb25FbnRyeS50by5lbGVtZW50KVxuICAgICAgICAgICAgICAgICAgOiBhbmltYXRpb25FbnRyeS5lbGVtZW50O1xuXG4gICAgICAgICAgICAgIGlmIChnZXRSdW5uZXIodGFyZ2V0RWxlbWVudCkpIHtcbiAgICAgICAgICAgICAgICB2YXIgb3BlcmF0aW9uID0gaW52b2tlRmlyc3REcml2ZXIoYW5pbWF0aW9uRW50cnkpO1xuICAgICAgICAgICAgICAgIGlmIChvcGVyYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgIHN0YXJ0QW5pbWF0aW9uRm4gPSBvcGVyYXRpb24uc3RhcnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKCFzdGFydEFuaW1hdGlvbkZuKSB7XG4gICAgICAgICAgICAgICAgY2xvc2VGbigpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBhbmltYXRpb25SdW5uZXIgPSBzdGFydEFuaW1hdGlvbkZuKCk7XG4gICAgICAgICAgICAgICAgYW5pbWF0aW9uUnVubmVyLmRvbmUoZnVuY3Rpb24oc3RhdHVzKSB7XG4gICAgICAgICAgICAgICAgICBjbG9zZUZuKCFzdGF0dXMpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHVwZGF0ZUFuaW1hdGlvblJ1bm5lcnMoYW5pbWF0aW9uRW50cnksIGFuaW1hdGlvblJ1bm5lcik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgIC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ICAgICAgcmVmTG9va3VwW2tleV0gPSByZWZMb29rdXBba2V5XSB8fCB7fTtcbiAgICAgICAgICAgICAgcmVmTG9va3VwW2tleV1bZGlyZWN0aW9uXSA9IHtcbiAgICAgICAgICAgICAgICBhbmltYXRpb25JRDogaW5kZXgsXG4gICAgICAgICAgICAgICAgZWxlbWVudDoganFMaXRlKGFuY2hvcilcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChhbmltYXRpb24pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgdmFyIHVzZWRJbmRpY2VzTG9va3VwID0ge307XG4gICAgICAgIHZhciBhbmNob3JHcm91cHMgPSB7fTtcbiAgICAgICAgZm9yRWFjaChyZWZMb29rdXAsIGZ1bmN0aW9uKG9wZXJhdGlvbnMsIGtleSkge1xuICAgICAgICAgIHZhciBmcm9tID0gb3BlcmF0aW9ucy5mcm9tO1xuICAgICAgICAgIHZhciB0byA9IG9wZXJhdGlvbnMudG87XG5cbiAgICAgICAgICBpZiAoIWZyb20gfHwgIXRvKSB7XG4gICAgICAgICAgICAvLyBvbmx5IG9uZSBvZiB0aGVzZSBpcyBzZXQgdGhlcmVmb3JlIHdlIGNhbid0IGhhdmUgYW5cbiAgICAgICAgICAgIC8vIGFuY2hvciBhbmltYXRpb24gc2luY2UgYWxsIHRocmVlIHBpZWNlcyBhcmUgcmVxdWlyZWRcbiAgICAgICAgICAgIHZhciBpbmRleCA9IGZyb20gPyBmcm9tLmFuaW1hdGlvbklEIDogdG8uYW5pbWF0aW9uSUQ7XG4gICAgICAgICAgICB2YXIgaW5kZXhLZXkgPSBpbmRleC50b1N0cmluZygpO1xuICAgICAgICAgICAgaWYgKCF1c2VkSW5kaWNlc0xvb2t1cFtpbmRleEtleV0pIHtcbiAgICAgICAgICAgICAgdXNlZEluZGljZXNMb29rdXBbaW5kZXhLZXldID0gdHJ1ZTtcbiAgICAgICAgICAgICAgcHJlcGFyZWRBbmltYXRpb25zLnB1c2goYW5pbWF0aW9uc1tpbmRleF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBmcm9tQW5pbWF0aW9uID0gYW5pbWF0aW9uc1tmcm9tLmFuaW1hdGlvbklEXTtcbiAgICAgICAgICB2YXIgdG9BbmltYXRpb24gPSBhbmltYXRpb25zW3RvLmFuaW1hdGlvbklEXTtcbiAgICAgICAgICB2YXIgbG9va3VwS2V5ID0gZnJvbS5hbmltYXRpb25JRC50b1N0cmluZygpO1xuICAgICAgICAgIGlmICghYW5jaG9yR3JvdXBzW2xvb2t1cEtleV0pIHtcbiAgICAgICAgICAgIHZhciBncm91cCA9IGFuY2hvckdyb3Vwc1tsb29rdXBLZXldID0ge1xuICAgICAgICAgICAgICBzdHJ1Y3R1cmFsOiB0cnVlLFxuICAgICAgICAgICAgICBiZWZvcmVTdGFydDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgZnJvbUFuaW1hdGlvbi5iZWZvcmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIHRvQW5pbWF0aW9uLmJlZm9yZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGNsb3NlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBmcm9tQW5pbWF0aW9uLmNsb3NlKCk7XG4gICAgICAgICAgICAgICAgdG9BbmltYXRpb24uY2xvc2UoKTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgY2xhc3NlczogY3NzQ2xhc3Nlc0ludGVyc2VjdGlvbihmcm9tQW5pbWF0aW9uLmNsYXNzZXMsIHRvQW5pbWF0aW9uLmNsYXNzZXMpLFxuICAgICAgICAgICAgICBmcm9tOiBmcm9tQW5pbWF0aW9uLFxuICAgICAgICAgICAgICB0bzogdG9BbmltYXRpb24sXG4gICAgICAgICAgICAgIGFuY2hvcnM6IFtdIC8vIFRPRE8obWF0c2tvKTogY2hhbmdlIHRvIHJlZmVyZW5jZSBub2Rlc1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgLy8gdGhlIGFuY2hvciBhbmltYXRpb25zIHJlcXVpcmUgdGhhdCB0aGUgZnJvbSBhbmQgdG8gZWxlbWVudHMgYm90aCBoYXZlIGF0IGxlYXN0XG4gICAgICAgICAgICAvLyBvbmUgc2hhcmVkIENTUyBjbGFzcyB3aGljaCBlZmZlY3RpdmVseSBtYXJyaWVzIHRoZSB0d28gZWxlbWVudHMgdG9nZXRoZXIgdG8gdXNlXG4gICAgICAgICAgICAvLyB0aGUgc2FtZSBhbmltYXRpb24gZHJpdmVyIGFuZCB0byBwcm9wZXJseSBzZXF1ZW5jZSB0aGUgYW5jaG9yIGFuaW1hdGlvbi5cbiAgICAgICAgICAgIGlmIChncm91cC5jbGFzc2VzLmxlbmd0aCkge1xuICAgICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChncm91cCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChmcm9tQW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgcHJlcGFyZWRBbmltYXRpb25zLnB1c2godG9BbmltYXRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGFuY2hvckdyb3Vwc1tsb29rdXBLZXldLmFuY2hvcnMucHVzaCh7XG4gICAgICAgICAgICAnb3V0JzogZnJvbS5lbGVtZW50LCAnaW4nOiB0by5lbGVtZW50XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBwcmVwYXJlZEFuaW1hdGlvbnM7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGNzc0NsYXNzZXNJbnRlcnNlY3Rpb24oYSxiKSB7XG4gICAgICAgIGEgPSBhLnNwbGl0KCcgJyk7XG4gICAgICAgIGIgPSBiLnNwbGl0KCcgJyk7XG4gICAgICAgIHZhciBtYXRjaGVzID0gW107XG5cbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgdmFyIGFhID0gYVtpXTtcbiAgICAgICAgICBpZiAoYWEuc3Vic3RyaW5nKDAsMykgPT09ICduZy0nKSBjb250aW51ZTtcblxuICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgYi5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgaWYgKGFhID09PSBiW2pdKSB7XG4gICAgICAgICAgICAgIG1hdGNoZXMucHVzaChhYSk7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBtYXRjaGVzLmpvaW4oJyAnKTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gaW52b2tlRmlyc3REcml2ZXIoYW5pbWF0aW9uRGV0YWlscykge1xuICAgICAgICAvLyB3ZSBsb29wIGluIHJldmVyc2Ugb3JkZXIgc2luY2UgdGhlIG1vcmUgZ2VuZXJhbCBkcml2ZXJzIChsaWtlIENTUyBhbmQgSlMpXG4gICAgICAgIC8vIG1heSBhdHRlbXB0IG1vcmUgZWxlbWVudHMsIGJ1dCBjdXN0b20gZHJpdmVycyBhcmUgbW9yZSBwYXJ0aWN1bGFyXG4gICAgICAgIGZvciAodmFyIGkgPSBkcml2ZXJzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7XG4gICAgICAgICAgdmFyIGRyaXZlck5hbWUgPSBkcml2ZXJzW2ldO1xuICAgICAgICAgIHZhciBmYWN0b3J5ID0gJGluamVjdG9yLmdldChkcml2ZXJOYW1lKTtcbiAgICAgICAgICB2YXIgZHJpdmVyID0gZmFjdG9yeShhbmltYXRpb25E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0tLS0tLS0tLS0tLS0tfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOmZvcm0jYW5pbWF0aW9ucyBmb3JtIC8gbmdGb3JtfSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh7QGxpbmsgbmcuZGlyZWN0aXZlOmZvcm0jY3NzLWNsYXNzZXMgdmFyaW91cyBjbGFzc2VzfSkgICAgfFxuICogfCB7QGxpbmsgbmdBbmltYXRlLmRpcmVjdGl2ZTpuZ0FuaW1hdGVTd2FwI2FuaW1hdGlvbnMgbmdBbmltYXRlU3dhcH0gICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3MjYW5pbWF0aW9ucyBuZ0NsYXNzIC8ge3tjbGFzcyYjMTI1OyYjODIwMzsmIzEyNTt9ICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3NFdmVuI2FuaW1hdGlvbnMgbmdDbGFzc0V2ZW59ICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3NPZGQjYW5pbWF0aW9ucyBuZ0NsYXNzT2RkfSAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSGlkZSNhbmltYXRpb25zIG5nSGlkZX0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWhpZGVgIGNsYXNzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSWYjYW5pbWF0aW9ucyBuZ0lmfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSW5jbHVkZSNhbmltYXRpb25zIG5nSW5jbHVkZX0gICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbW9kdWxlOm5nTWVzc2FnZXMjYW5pbWF0aW9ucyBuZ01lc3NhZ2UgLyBuZ01lc3NhZ2VFeHB9ICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbW9kdWxlOm5nTWVzc2FnZXMjYW5pbWF0aW9ucyBuZ01lc3NhZ2VzfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWFjdGl2ZWAvYG5nLWluYWN0aXZlYCBjbGFzc2VzKSAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nTW9kZWwjYW5pbWF0aW9ucyBuZ01vZGVsfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh7QGxpbmsgbmcuZGlyZWN0aXZlOm5nTW9kZWwjY3NzLWNsYXNzZXMgdmFyaW91cyBjbGFzc2VzfSkgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nUmVwZWF0I2FuaW1hdGlvbnMgbmdSZXBlYXR9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyLCBsZWF2ZSwgYW5kIG1vdmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nU2hvdyNhbmltYXRpb25zIG5nU2hvd30gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWhpZGVgIGNsYXNzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nU3dpdGNoI2FuaW1hdGlvbnMgbmdTd2l0Y2h9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmdSb3V0ZS5kaXJlY3RpdmU6bmdWaWV3I2FuaW1hdGlvbnMgbmdWaWV3fSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICpcbiAqIChNb3JlIGluZm9ybWF0aW9uIGNhbiBiZSBmb3VuZCBieSB2aXNpdGluZyB0aGUgZG9jdW1lbnRhdGlvbiBhc3NvY2lhdGVkIHdpdGggZWFjaCBkaXJlY3RpdmUuKVxuICpcbiAqIEZvciBhIGZ1bGwgYnJlYWtkb3duIG9mIHRoZSBzdGVwc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VkID0gZW5hYmxlZDtcbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIHJldHVybiBpc0VhZ2VySW5zdGFudGlhdGlvbkVuYWJsZWQ7XG4gIH07XG5cblxuICB0aGlzLiRnZXQgPSBbJyRyb290U2NvcGUnLFxuICAgICAgICAgICAgICAgJyRsb2NhdGlvbicsXG4gICAgICAgICAgICAgICAnJHJvdXRlUGFyYW1zJyxcbiAgICAgICAgICAgICAgICckcScsXG4gICAgICAgICAgICAgICAnJGluamVjdG9yJyxcbiAgICAgICAgICAgICAgICckdGVtcGxhdGVSZXF1ZXN0JyxcbiAgICAgICAgICAgICAgICckc2NlJyxcbiAgICAgICAgICAgICAgICckYnJvd3NlcicsXG4gICAgICBmdW5jdGlvbigkcm9vdFNjb3BlLCAkbG9jYXRpb24sICRyb3V0ZVBhcmFtcywgJHEsICRpbmplY3RvciwgJHRlbXBsYXRlUmVxdWVzdCwgJHNjZSwgJGJyb3dzZXIpIHtcblxuICAgIC8qKlxuICAgICAqIEBuZ2RvYyBzZXJ2aWNlXG4gICAgICogQG5hbWUgJHJvdXRlXG4gICAgICogQHJlcXVpcmVzICRsb2NhdGlvblxuICAgICAqIEByZXF1aXJlcyAkcm91dGVQYXJhbXNcbiAgICAgKlxuICAgICAqIEBwcm9wZXJ0eSB7T2JqZWN0fSBjdXJyZW50IFJlZmVyZW5jZSB0byB0aGUgY3VycmVudCByb3V0ZSBkZWZpbml0aW9uLlxuICAgICAqIFRoZSByb3V0ZSBkZWZpbml0aW9uIGNvbnRhaW5zOlxuICAgICAqXG4gICAgICogICAtIGBjb250cm9sbGVyYDogVGhlIGNvbnRyb2xsZXIgY29uc3RydWN0b3IgYXMgZGVmaW5lZCBpbiB0aGUgcm91dGUgZGVmaW5pdGlvbi5cbiAgICAgKiAgIC0gYGxvY2Fsc2A6IEEgbWFwIG9mIGxvY2FscyB3aGljaCBpcyB1c2VkIGJ5IHtAbGluayBuZy4kY29udHJvbGxlciAkY29udHJvbGx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WNvbnRyb2xsZXI9XCJNYWluQ29udHJvbGxlclwiPlxuICAgICAqICAgICAgIENob29zZTpcbiAgICAgKiAgICAgICA8YSBocmVmPVwiQm9vay9Nb2J5XCI+TW9ieTwvYT4gfFxuICAgICAqICAgICAgIDxhIGhyZWY9XCJCb29rL01vYnkvY2gvMVwiPk1vYnk6IENoMTwvYT4gfFxuICAgICAqICAgICAgIDxhIGhyZWY9XCJCb29rL0dhdHNieVwiPkdhdHNieTwvYT4gfFxuICAgICAqICAgICAgIDxhIGhyZWY9XCJCb29rL0dhdHNieS9jaC80P2tleT12YWx1ZVwiPkdhdHNieTogQ2g0PC9hPiB8XG4gICAgICogICAgICAgPGEgaHJlZj1cIkJvb2svU2NhcmxldFwiPlNjYXJsZXQgTGV0dGVyPC9hPjxici8+XG4gICAgICpcbiAgICAgKiAgICAgICA8ZGl2IG5nLXZpZXc+PC9kaXY+XG4gICAgICpcbiAgICAgKiAgICAgICA8aHIgLz5cbiAgICAgKlxuICAgICAqICAgICAgIDxwcmU+JGxvY2F0aW9uLnBhdGgoKSA9IHt7JGxvY2F0aW9uLnBhdGgoKX19PC9wcmU+XG4gICAgICogICAgICAgPHByZT4kcm91dGUuY3VycmVudC50ZW1wbGF0ZVVybCA9IHt7JHJvdXRlLmN1cnJlbnQudGVtcGxhdGVVcmx9fTwvcHJlPlxuICAgICAqICAgICAgIDxwcmU+JHJvdXRlLmN1cnJlbnQucGFyYW1zID0ge3skcm91dGUuY3VycmVudC5wYXJhbXN9fTwvcHJlPlxuICAgICAqICAgICAgIDxwcmU+JHJvdXRlLmN1cnJlbnQuc2NvcGUubmFtZSA9IHt7JHJvdXRlLmN1cnJlbnQuc2NvcGUubmFtZX19PC9wcmU+XG4gICAgICogICAgICAgPHByZT4kcm91dGVQYXJhbXMgPSB7eyRyb3V0ZVBhcmFtc319PC9wcmU+XG4gICAgICogICAgIDwvZGl2PlxuICAgICAqICAgPC9maWxlPlxuICAgICAqXG4gICAgICogICA8ZmlsZSBuYW1lPVwiYm9vay5odG1sXCI+XG4gICAgICogICAgIGNvbnRyb2xsZXI6IHt7bmFtZX19PGJyIC8+XG4gICAgICogICAgIEJvb2sgSWQ6IHt7cGFyYW1zLmJvb2tJZH19PGJyIC8+XG4gICAgICogICA8L2ZpbGU+XG4gICAgICpcbiAgICAgKiAgIDxmaWxlIG5hbWU9XCJjaGFwdGVyLmh0bWxcIj5cbiAgICAgKiAgICAgY29udHJvbGxlcjoge3tuYW1lfX08YnIgLz5cbiAgICAgKiAgICAgQm9vayBJZDoge3twYXJhbXMuYm9va0lkfX08YnIgLz5cbiAgICAgKiAgICAgQ2hhcHRlciBJZDoge3twYXJhbXMuY2hhcHRlcklkfX1cbiAgICAgKiAgIDwvZmlsZT5cbiAgICAgKlxuICAgICAqICAgPGZpbGUgbmFtZT1cInNjcmlwdC5qc1wiPlxuICAgICAqICAgICBhbmd1bGFyLm1vZHVsZSgnbmdSb3V0ZUV4YW1wbGUnLCBbJ25nUm91dGUnXSlcbiAgICAgKlxuICAgICAqICAgICAgLmNvbnRyb2xsZXIoJ01haW5Db250cm9sbGVyJywgZnVuY3Rpb24oJHNjb3BlLCAkcm91dGUsICRyb3V0ZVBhcmFtcywgJGxvY2F0aW9uKSB7XG4gICAgICogICAgICAgICAgJHNjb3BlLiRyb3V0ZSA9ICRyb3V0ZTtcbiAgICAgKiAgICAgICAgICAkc2NvcGUuJGxvY2F0aW9uID0gJGxvY2F0aW9uO1xuICAgICAqICAgICAgICAgICRzY29wZS4kcm91dGVQYXJhbXMgPSAkcm91dGVQYXJhbXM7XG4gICAgICogICAgICB9KVxuICAgICAqXG4gICAgICogICAgICAuY29udHJvbGxlcignQm9va0NvbnRyb2xsZXInLCBmdW5jdGlvbigkc2NvcGUsICRyb3V0ZVBhcmFtcykge1xuICAgICAqICAgICAgICAgICRzY29wZS5uYW1lID0gJ0Jvb2tDb250cm9sbGVyJztcbiAgICAgKiAgICAgICAgICAkc2NvcGUucGFyYW1zID0gJHJvdXRlUGFyYW1zO1xuICAgICAqICAgICAgfSlcbiAgICAgKlxuICAgICAqICAgICAgLmNvbnRyb2xsZXIoJ0NoYXB0ZXJDb250cm9sbGVyJywgZnVuY3Rpb24oJHNjb3BlLCAkcm91dGVQYXJhbXMpIHtcbiAgICAgKiAgICAgICAgICAkc2NvcGUubmFtZSA9ICdDaGFwdGVyQ29udHJvbGxlcic7XG4gICAgICogICAgICAgICAgJHNjb3BlLnBhcmFtcyA9ICRyb3V0ZVBhcmFtcztcbiAgICAgKiAgICAgIH0pXG4gICAgICpcbiAgICAgKiAgICAgLmNvbmZpZyhmdW5jdGlvbigkcm91dGVQcm92aWRlciwgJGxvY2F0aW9uUHJvdmlkZXIpIHtcbiAgICAgKiAgICAgICAkcm91dGVQcm92aWRlclxuICAgICAqICAgICAgICAud2hlbignL0Jvb2svOmJvb2tJZCcsIHtcbiAgICAgKiAgICAgICAgIHRlbXBsYXRlVXJsOiAnYm9vay5odG1sJyxcbiAgICAgKiAgICAgICAgIGNvbnRyb2xsZXI6ICdCb29rQ29udHJvbGxlcicsXG4gICAgICogICAgICAgICByZXNvbHZlOiB7XG4gICAgICogICAgICAgICAgIC8vIEkgd2lsbCBjYXVzZSBhIDEgc2Vjb25kIGRlbGF5XG4gICAgICogICAgICAgICAgIGRlbGF5OiBmdW5jdGlvbigkcSwgJHRpbWVvdXQpIHtcbiAgICAgKiAgICAgICAgICAgICB2YXIgZGVsYXkgPSAkcS5kZWZlcigpO1xuICAgICAqICAgICAgICAgICAgICR0aW1lb3V0KGRlbGF5LnJlc29sdmUsIDEwMDApO1xuICAgICAqICAgICAgICAgICAgIHJldHVybiBkZWxheS5wcm9taXNlO1xuICAgICAqICAgICAgICAgICB9XG4gICAgICogICAgICAgICB9XG4gICAgICogICAgICAgfSlcbiAgICAgKiAgICAgICAud2hlbignL0Jvb2svOmJvb2tJZC9jaC86Y2hhcHRlcklkJywge1xuICAgICAqICAgICAgICAgdGVtcGxhdGVVcmw6ICdjaGFwdGVyLmh0bWwnLFxuICAgICAqICAgICAgICAgY29udHJvbGxlcjogJ0NoYXB0ZXJDb250cm9sbGVyJ1xuICAgICAqICAgICAgIH0pO1xuICAgICAqXG4gICAgICogICAgICAgLy8gY29uZmlndXJlIGh0bWw1IHRvIGdldCBsaW5rcyB3b3JraW5nIG9uIGpzZmlkZGxlXG4gICAgICogICAgICAgJGxvY2F0aW9uUHJvdmlkZXIuaHRtbDVNb2RlKHRydWUpO1xuICAgICAqICAgICB9KTtcbiAgICAgKlxuICAgICAqICAgPC9maWxlPlxuICAgICAqXG4gICAgICogICA8ZmlsZSBuYW1lPVwicHJvdHJhY3Rvci5qc1wiIHR5cGU9XCJwcm90cmFjdG9yXCI+XG4gICAgICogICAgIGl0KCdzaG91bGQgbG9hZCBhbmQgY29tcGlsZSBjb3JyZWN0IHRlbXBsYXRlJywgZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgZWxlbWVudChieS5saW5rVGV4dCgnTW9ieTogQ2gxJykpLmNsaWNrKCk7XG4gICAgICogICAgICAgdmFyIGNvbnRlbnQgPSBlbGVtZW50KGJ5LmNzcygnW25nLXZpZXddJykpLmdldFRleHQoKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvY29udHJvbGxlcjogQ2hhcHRlckNvbnRyb2xsZXIvKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvQm9vayBJZDogTW9ieS8pO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9DaGFwdGVyIElkOiAxLyk7XG4gICAgICpcbiAgICAgKiAgICAgICBlbGVtZW50KGJ5LnBhcnRpYWxMaW5rVGV4dCgnU2NhcmxldCcpKS5jbGljaygpO1xuICAgICAqXG4gICAgICogICAgICAgY29udGVudCA9IGVsZW1lbnQoYnkuY3NzKCdbbmctdmlld10nKSkuZ2V0VGV4dCgpO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9jb250c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kbG9jYXRpb259IGhhc24ndCBjaGFuZ2VkLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQXMgYSByZXN1bHQgb2YgdGhhdCwge0BsaW5rIG5nUm91dGUuZGlyZWN0aXZlOm5nVmlldyBuZ1ZpZXd9XG4gICAgICAgICAgICogY3JlYXRlcyBuZXcgc2NvcGUgYW5kIHJlaW5zdGFudGlhdGVzIHRoZSBjb250cm9sbGVyLlxuICAgICAgICAgICAqL1xuICAgICAgICAgIHJlbG9hZDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBmb3JjZVJlbG9hZCA9IHRydWU7XG5cbiAgICAgICAgICAgIHZhciBmYWtlTG9jYXRpb25FdmVudCA9IHtcbiAgICAgICAgICAgICAgZGVmYXVsdFByZXZlbnRlZDogZmFsc2UsXG4gICAgICAgICAgICAgIHByZXZlbnREZWZhdWx0OiBmdW5jdGlvbiBmYWtlUHJldmVudERlZmF1bHQoKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5kZWZhdWx0UHJldmVudGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBmb3JjZVJlbG9hZCA9IGZhbHNlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAkcm9vdFNjb3BlLiRldmFsQXN5bmMoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHByZXBhcmVSb3V0ZShmYWtlTG9jYXRpb25FdmVudCk7XG4gICAgICAgICAgICAgIGlmICghZmFrZUxvY2F0aW9uRXZlbnQuZGVmYXVsdFByZXZlbnRlZCkgY29tbWl0Um91dGUoKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0sXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAgICogQG5hbWUgJHJvdXRlI3VwZGF0ZVBhcmFtc1xuICAgICAgICAgICAqXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAg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uXG4gICAgICAgICAgICAgIHRoZW4oZnVuY3Rpb24obG9jYWxzKSB7XG4gICAgICAgICAgICAgICAgLy8gYWZ0ZXIgcm91dGUgY2hhbmdlXG4gICAgICAgICAgICAgICAgaWYgKG5leHRSb3V0ZSA9PT0gJHJvdXRlLmN1cnJlbnQpIHtcbiAgICAgICAgICAgICAgICAgIGlmIChuZXh0Um91dGUpIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dFJvdXRlLmxvY2FscyA9IGxvY2FscztcbiAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5jb3B5KG5leHRSb3V0ZS5wYXJhbXMsICRyb3V0ZVBhcmFtcyk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRicm9hZGNhc3QoJyRyb3V0ZUNoYW5nZVN1Y2Nlc3MnLCBuZXh0Um91dGUsIGxhc3RSb3V0ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KS5jYXRjaChmdW5jdGlvbihlcnJvcikge1xuICAgICAgICAgICAgaWYgKG5leHRSb3V0ZSA9PT0gJHJvdXRlLmN1cnJlbnQpIHtcbiAgICAgICAgICAgICAgJHJvb3RTY29wZS4kYnJvYWRjYXN0KCckcm91dGVDaGFuZ2VFcnJvcicsIG5leHRSb3V0ZSwgbGFzdFJvdXRlLCBlcnJvcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSkuZmluYWxseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIC8vIEJlY2F1c2UgYGNvbW1pdFJvdXRlKClgIGlzIGNhbGxlZCBmcm9tIGEgYCRyb290U2NvcGUuJGV2YWxBc3luY2AgYmxvY2sgKHNlZVxuICAgICAgICAgICAgLy8gYCRsb2NhdGlvbldhdGNoYCksIHRoaXMgYCQkY29tcGxldGVPdXRzdGFuZGluZ1JlcXVlc3QoKWAgY2FsbCB3aWxsIG5vdCBjYXVzZVxuICAgICA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XRoLCBvbGRTZWFyY2gpO1xuXG4gICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQobmV3VXJsKSkge1xuICAgICAgICAgICAgICBkYXRhLnVybCA9IG5ld1VybDtcbiAgICAgICAgICAgICAgZGF0YS5oYXNSZWRpcmVjdGlvbiA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHJvdXRlLnJlc29sdmVSZWRpcmVjdFRvKSB7XG4gICAgICAgICAgcmV0dXJuICRxLlxuICAgICAgICAgICAgcmVzb2x2ZSgkaW5qZWN0b3IuaW52b2tlKHJvdXRlLnJlc29sdmVSZWRpcmVjdFRvKSkuXG4gICAgICAgICAgICB0aGVuKGZ1bmN0aW9uKG5ld1VybCkge1xuICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQobmV3VXJsKSkge1xuICAgICAgICAgICAgICAgIGRhdGEudXJsID0gbmV3VXJsO1xuICAgICAgICAgICAgICAgIGRhdGEuaGFzUmVkaXJlY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgcmV0dXJuIGRhdGE7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICByZXR1cm4gZGF0YTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBoYW5kbGVQb3NzaWJsZVJlZGlyZWN0aW9uKGRhdGEpIHtcbiAgICAgIHZhciBrZWVwUHJvY2Vzc2luZ1JvdXRlID0gdHJ1ZTtcblxuICAgICAgaWYgKGRhdGEucm91dGUgIT09ICRyb3V0ZS5jdXJyZW50KSB7XG4gICAgICAgIGtlZXBQcm9jZXNzaW5nUm91dGUgPSBmYWxzZTtcbiAgICAgIH0gZWxzZSBpZiAoZGF0YS5oYXNSZWRpcmVjdGlvbikge1xuICAgICAgICB2YXIgb2xkVXJsID0gJGxvY2F0aW9uLnVybCgpO1xuICAgICAgICB2YXIgbmV3VXJsID0gZGF0YS51cmw7XG5cbiAgICAgICAgaWYgKG5ld1VybCkge1xuICAgICAgICAgICRsb2NhdGlvbi5cbiAgICAgICAgICAgIHVybChuZXdVcmwpLlxuICAgICAgICAgICAgcmVwbGFjZSgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG5ld1VybCA9ICRsb2NhdGlvbi5cbiAgICAgICAgICAgIHBhdGgoZGF0YS5wYXRoKS5cbiAgICAgICAgICAgIHNlYXJjaChkYXRhLnNlYXJjaCkuXG4gICAgICAgICAgICByZXBsYWNlKCkuXG4gICAgICAgICAgICB1cmwoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChuZXdVcmwgIT09IG9sZFVybCkge1xuICAgICAgICAgIC8vIEV4aXQgb3V0IGFuZCBkb24ndCBwcm9jZXNzIGN1cnJlbnQgbmV4dCB2YWx1ZSxcbiAgICAgICAgICAvLyB3YWl0IGZvciBuZXh0IGxvY2F0aW9uIGNoYW5nZSBmcm9tIHJlZGlyZWN0XG4gICAgICAgICAga2VlcFByb2Nlc3NpbmdSb3V0ZSA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBrZWVwUHJvY2Vzc2luZ1JvdXRlO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlc29sdmVMb2NhbHMocm91dGUpIHtcbiAgICAgIGlmIChyb3V0ZSkge1xuICAgICAgICB2YXIgbG9jYWxzID0gYW5ndWxhci5leHRlbmQoe30sIHJvdXRlLnJlc29sdmUpO1xuICAgICAgICBhbmd1bGFyLmZvckVhY2gobG9jYWxzLCBmdW5jdGlvbih2YWx1ZSwga2V5KSB7XG4gICAgICAgICAgbG9jYWxzW2tleV0gPSBhbmd1bGFyLmlzU3RyaW5nKHZhbHVlKSA/XG4gICAgICAgICAgICAgICRpbmplY3Rvci5nZXQodmFsdWUpIDpcbiAgICAgICAgICAgICAgJGluamVjdG9yLmludm9rZSh2YWx1ZSwgbnVsbCw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tcbiAgICAgICAgICBib3JkZXI6MXB4IHNvbGlkIGJsYWNrO1xuICAgICAgICAgIGhlaWdodDo0MHB4O1xuICAgICAgICAgIG92ZXJmbG93OmhpZGRlbjtcbiAgICAgICAgfVxuXG4gICAgICAgIC52aWV3LWFuaW1hdGUge1xuICAgICAgICAgIHBhZGRpbmc6MTBweDtcbiAgICAgICAgfVxuXG4gICAgICAgIC52aWV3LWFuaW1hdGUubmctZW50ZXIsIC52aWV3LWFuaW1hdGUubmctbGVhdmUge1xuICAgICAgICAgIHRyYW5zaXRpb246YWxsIGN1YmljLWJlemllcigwLjI1MCwgMC40NjAsIDAuNDUwLCAwLjk0MCkgMS41cztcblxuICAgICAgICAgIGRpc3BsYXk6YmxvY2s7XG4gICAgICAgICAgd2lkdGg6MTAwJTtcbiAgICAgICAgICBib3JkZXItbGVmdDoxcHggc29saWQgYmxhY2s7XG5cbiAgICAgICAgICBwb3NpdGlvbjphYnNvbHV0ZTtcbiAgICAgICAgICB0b3A6MDtcbiAgICAgICAgICBsZWZ0OjA7XG4gICAgICAgICAgcmlnaHQ6MDtcbiAgICAgICAgICBib3R0b206MDtcbiAgICAgICAgICBwYWRkaW5nOjEwcHg7XG4gICAgICAgIH1cblxuICAgICAgICAudmlldy1hbmltYXRlLm5nLWVudGVyIHtcbiAgICAgICAgICBsZWZ0OjEwMCU7XG4gICAgICAgIH1cbiAgICAgICAgLnZpZXctYW5pbWF0ZS5uZy1lbnRlci5uZy1lbnRlci1hY3RpdmUge1xuICAgICAgICAgIGxlZnQ6MDtcbiAgICAgICAgfVxuICAgICAgICAudmlldy1hbmltYXRlLm5nLWxlYXZlLm5nLWxlYXZlLWFjdGl2ZSB7XG4gICAgICAgICAgbGVmdDotMTAwJTtcbiAgICAgICAgfVxuICAgICAgPC9maWxlPlxuXG4gICAgICA8ZmlsZSBuYW1lPVwic2NyaXB0LmpzXCI+XG4gICAgICAgIGFuZ3VsYXIubW9kdWxlKCduZ1ZpZXdFeGFtcGxlJywgWyduZ1JvdXRlJywgJ25nQW5pbWF0ZSddKVxuICAgICAgICAgIC5jb25maWcoWyckcm91dGVQcm92aWRlcicsICckbG9jYXRpb25Qcm92aWRlcicsXG4gICAgICAgICAgICBmdW5jdGlvbigkcm91dGVQcm92aWRlciwgJGxvY2F0aW9uUHJvdmlkZXIpIHtcbiAgICAgICAgICAgICAgJHJvdXRlUHJvdmlkZXJcbiAgICAgICAgICAgICAgICAud2hlbignL0Jvb2svOmJvb2tJZCcsIHtcbiAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYm9vay5odG1sJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6ICdCb29rQ3RybCcsXG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyQXM6ICdib29rJ1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLndoZW4oJy9Cb29rLzpib29rSWQvY2gvOmNoYXB0ZXJJZCcsIHtcbiAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnY2hhcHRlci5odG1sJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6ICdDaGFwdGVyQ3RybCcsXG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyQXM6ICdjaGFwdGVyJ1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICRsb2NhdGlvblByb3ZpZGVyLmh0bWw1TW9kZSh0cnVlKTtcbiAgICAgICAgICB9XSlcbiAgICAgICAgICAuY29udHJvbGxlcignTWFpbkN0cmwnLCBbJyRyb3V0ZScsICckcm91dGVQYXJhbXMnLCAnJGxvY2F0aW9uJyxcbiAgICAgICAgICAgIGZ1bmN0aW9uIE1haW5DdHJsKCRyb3V0ZSwgJHJvdXRlUGFyYW1zLCAkbG9jYXRpb24pIHtcbiAgICAgICAgICAgICAgdGhpcy4kcm91dGUgPSAkcm91dGU7XG4gICAgICAgICAgICAgIHRoaXMuJGxvY2F0aW9uID0gJGxvY2F0aW9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dmFyIGN1cnJlbnRTY29wZSxcbiAgICAgICAgICAgIGN1cnJlbnRFbGVtZW50LFxuICAgICAgICAgICAgcHJldmlvdXNMZWF2ZUFuaW1hdGlvbixcbiAgICAgICAgICAgIGF1dG9TY3JvbGxFeHAgPSBhdHRyLmF1dG9zY3JvbGwsXG4gICAgICAgICAgICBvbmxvYWRFeHAgPSBhdHRyLm9ubG9hZCB8fCAnJztcblxuICAgICAgICBzY29wZS4kb24oJyRyb3V0ZUNoYW5nZVN1Y2Nlc3MnLCB1cGRhdGUpO1xuICAgICAgICB1cGRhdGUoKTtcblxuICAgICAgICBmdW5jdGlvbiBjbGVhbnVwTGFzdFZpZXcoKSB7XG4gICAgICAgICAgaWYgKHByZXZpb3VzTGVhdmVBbmltYXRpb24pIHtcbiAgICAgICAgICAgICRhbmltYXRlLmNhbmNlbChwcmV2aW91c0xlYXZlQW5pbWF0aW9uKTtcbiAgICAgICAgICAgIHByZXZpb3VzTGVhdmVBbmltYXRpb24gPSBudWxsO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChjdXJyZW50U2NvcGUpIHtcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZS4kZGVzdHJveSgpO1xuICAgICAgICAgICAgY3VycmVudFNjb3BlID0gbnVsbDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGN1cnJlbnRFbGVtZW50KSB7XG4gICAgICAgICAgICBwcmV2aW91c0xlYXZlQW5pbWF0aW9uID0gJGFuaW1hdGUubGVhdmUoY3VycmVudEVsZW1lbnQpO1xuICAgICAgICAgICAgcHJldmlvdXNMZWF2ZUFuaW1hdGlvbi5kb25lKGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgIGlmIChyZXNwb25zZSAhPT0gZmFsc2UpIHByZXZpb3VzTGVhdmVBbmltYXRpb24gPSBudWxsO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBjdXJyZW50RWxlbWVudCA9IG51bGw7XG4gICAgICAg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xuICAgICAgICAgICAgdmFyIGNsb25lID0gJHRyYW5zY2x1ZGUobmV3U2NvcGUsIGZ1bmN0aW9uKGNsb25lKSB7XG4gICAgICAgICAgICAgICRhbmltYXRlLmVudGVyKGNsb25lLCBudWxsLCBjdXJyZW50RWxlbWVudCB8fCAkZWxlbWVudCkuZG9uZShmdW5jdGlvbiBvbk5nVmlld0VudGVyKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlICE9PSBmYWxzZSAmJiBhbmd1bGFyLmlzRGVmaW5lZChhdXRvU2Nyb2xsRXhwKVxuICAgICAgICAgICAgICAgICAgJiYgKCFhdXRvU2Nyb2xsRXhwIHx8IHNjb3BlLiRldmFsKGF1dG9TY3JvbGxFeHApKSkge1xuICAgICAgICAgICAgICAgICAgJGFuY2hvclNjcm9sbCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGNsZWFudXBMYXN0VmlldygpO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGN1cnJlbnRFbGVtZW50ID0gY2xvbmU7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUgPSBjdXJyZW50LnNjb3BlID0gbmV3U2NvcGU7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUuJGVtaXQoJyR2aWV3Q29udGVudExvYWRlZCcpO1xuICAgICAgICAgICAgY3VycmVudFNjb3BlLiRldmFsKG9ubG9hZEV4cCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNsZWFudXBMYXN0VmlldygpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgfTtcbn1cblxuLy8gVGhpcyBkaXJlY3RpdmUgaXMgY2FsbGVkIGR1cmluZyB0aGUgJHRyYW5zY2x1ZGUgY2FsbCBvZiB0aGUgZmlyc3QgYG5nVmlld2AgZGlyZWN0aXZlLlxuLy8gSXQgd2lsbCByZXBsYWNlIGFu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Y3NzVG8gPSB7d2lkdGg6ICcwJ307XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNzcyA9IHtcbiAgICAgICAgICAgICAgaGVpZ2h0OiAnJ1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGNzc1RvID0ge2hlaWdodDogJzAnfTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKCFzY29wZS4kZXZhbChhdHRycy51aWJDb2xsYXBzZSkpIHtcbiAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2luJylcbiAgICAgICAgICAgICAgLmFkZENsYXNzKCdjb2xsYXBzZScpXG4gICAgICAgICAgICAgIC5hdHRyKCdhcmlhLWV4cGFuZGVkJywgdHJ1ZSlcbiAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtaGlkZGVuJywgZmFsc2UpXG4gICAgICAgICAgICAgIC5jc3MoY3NzKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBnZXRTY3JvbGxGcm9tRWxlbWVudChlbGVtZW50KSB7XG4gICAgICAgICAgaWYgKGhvcml6b250YWwpIHtcbiAgICAgICAgICAgIHJldHVybiB7d2lkdGg6IGVsZW1lbnQuc2Nyb2xsV2lkdGggKyAncHgnfTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHtoZWlnaHQ6IGVsZW1lbnQuc2Nyb2xsSGVpZ2h0ICsgJ3B4J307XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBleHBhbmQoKSB7XG4gICAgICAgICAgaWYgKGVsZW1lbnQuaGFzQ2xhc3MoJ2NvbGxhcHNlJykgJiYgZWxlbWVudC5oYXNDbGFzcygnaW4nKSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgICRxLnJlc29sdmUoZXhwYW5kaW5nRXhwcihzY29wZSkpXG4gICAgICAgICAgICAudGhlbihmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcygnY29sbGFwc2UnKVxuICAgICAgICAgICAgICAgIC5hZGRDbGFzcygnY29sbGFwc2luZycpXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtZXhwYW5kZWQnLCB0cnVlKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdhcmlhLWhpZGRlbicsIGZhbHNlKTtcblxuICAgICAgICAgICAgICBpZiAoJGFuaW1hdGVDc3MpIHtcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZUNzcyhlbGVtZW50LCB7XG4gICAgICAgICAgICAgICAgICBhZGRDbGFzczogJ2luJyxcbiAgICAgICAgICAgICAgICAgIGVhc2luZzogJ2Vhc2UnLFxuICAgICAgICAgICAgICAgICAgY3NzOiB7XG4gICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiAnaGlkZGVuJ1xuICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIHRvOiBnZXRTY3JvbGxGcm9tRWxlbWVudChlbGVtZW50WzBdKVxuICAgICAgICAgICAgICAgIH0pLnN0YXJ0KClbJ2ZpbmFsbHknXShleHBhbmREb25lKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZS5hZGRDbGFzcyhlbGVtZW50LCAnaW4nLCB7XG4gICAgICAgICAgICAgICAgICBjc3M6IHtcbiAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgdG86IGdldFNjcm9sbEZyb21FbGVtZW50KGVsZW1lbnRbMF0pXG4gICAgICAgICAgICAgICAgfSkudGhlbihleHBhbmREb25lKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgYW5ndWxhci5ub29wKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGV4cGFuZERvbmUoKSB7XG4gICAg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xuICAgICAgICAgICAgICAgIC5yZW1vdmVDbGFzcygnY29sbGFwc2UnKVxuICAgICAgICAgICAgICAgIC5hZGRDbGFzcygnY29sbGFwc2luZycpXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtZXhwYW5kZWQnLCBmYWxzZSlcbiAgICAgICAgICAgICAgICAuYXR0cignYXJpYS1oaWRkZW4nLCB0cnVlKTtcblxuICAgICAgICAgICAgICBpZiAoJGFuaW1hdGVDc3MpIHtcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZUNzcyhlbGVtZW50LCB7XG4gICAgICAgICAgICAgICAgICByZW1vdmVDbGFzczogJ2luJyxcbiAgICAgICAgICAgICAgICAgIHRvOiBjc3NUb1xuICAgICAgICAgICAgICAgIH0pLnN0YXJ0KClbJ2ZpbmFsbHknXShjb2xsYXBzZURvbmUpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICRhbmltYXRlLnJlbW92ZUNsYXNzKGVsZW1lbnQsICdpbicsIHtcbiAgICAgICAgICAgICAgICAgIHRvOiBjc3NUb1xuICAgICAgICAgICAgICAgIH0pLnRoZW4oY29sbGFwc2VEb25lKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgYW5ndWxhci5ub29wKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGNvbGxhcHNlRG9uZSgpIHtcbiAgICAgICAgICBlbGVtZW50LmNzcyhjc3NUbyk7IC8vIFJlcXVpcmVkIHNvIHRoYXQgY29sbGFwc2Ugd29ya3Mgd2hlbiBhbmltYXRpb24gaXMgZGlzYWJsZWRcbiAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKCdjb2xsYXBzaW5nJylcbiAgICAgICAgICAgIC5hZGRDbGFzcygnY29sbGFwc2UnKTtcbiAgICAgICAgICBjb2xsYXBzZWRFeHByKHNjb3BlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHNjb3BlLiR3YXRjaChh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uICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZm9ybWF0dGVyOiBmdW5jdGlvbihkYXRlKSB7IHJldHVybiBkYXRlRmlsdGVyKGRhdGUsICdhJyk7IH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIGtleTogJ1onLFxuICAgICAgICByZWdleDogJ1srLV1cXFxcZHs0fScsXG4gICAgICAgIGFwcGx5OiBmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgIHZhciBtYXRjaGVzID0gdmFsdWUubWF0Y2goLyhbKy1dKShcXGR7Mn0pKFxcZHsyfSkvKSxcbiAgICAgICAgICAgIHNpZ24gPSBtYXRjaGVzWzFdLFxuICAgICAgICAgICAgaG91cnMgPSBtYXRjaGVzWzJdLFxuICAgICAgICAgICAgbWludXRlcyA9IG1hdGNoZXNbM107XG4gICAgICAgICAgdGhpcy5ob3VycyArPSB0b0ludChzaWduICsgaG91cnMpO1xuICAgICAgICAgIHRoaXMubWludXRlcyArPSB0b0ludChzaWduICsgbWludXRlcyk7XG4gICAgICAgIH0sXG4gICAgICAgIGZvcm1hdHRlcjogZnVuY3Rpb24oZGF0ZSkge1xuICAgICAgICAgIHJldHVybiBkYXRlRmlsdGVyKGRhdGUsICdaJyk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIGtleTogJ3d3JyxcbiAgICAgICAgcmVnZXg6ICdbMC00XVswLTldfDVbMC0zXScsXG4gICAgICAgIGZvcm1hdHRlcjogZnVuY3Rpb24oZGF0ZSkgeyByZXR1cm4gZGF0ZUZpbHRlcihkYXRlLCAnd3cnKTsgfVxuICAgICAgfSxcbiAgICAgIHtcbiAgICAgICAga2V5OiAndycsXG4gICAgICAgIHJlZ2V4OiAnWzAtOV18WzEtNF1bMC05XXw1WzAtM10nLFxuICAgICAgICBmb3JtYXR0ZXI6IGZ1bmN0aW9uKGRhdGUpIHsgcmV0dXJuIGRhdGVGaWx0ZXIoZGF0ZSwgJ3cnKT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AgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAoZGF0YS5sYXN0QWN0aXZhdGVkICE9PSBuZXdBY3RpdmF0ZWQpIHtcbiAgICAgICAgICAgICAgaWYgKGRhdGEubGFzdEFjdGl2YXRlZCkge1xuICAgICAgICAgICAgICAgICRhbmltYXRlLnJlbW92ZUNsYXNzKGRhdGEubGFzdEFjdGl2YXRlZC5lbGVtZW50LCBjbGF6eik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKG5ld0FjdGl2YXRlZCkge1xuICAgICAgICAgICAgICAgICRhbmltYXRlLmFkZENsYXNzKG5ld0FjdGl2YXRlZC5lbGVtZW50LCBjbGF6eik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZGF0YS5sYXN0QWN0aXZhdGVkID0gbmV3QWN0aXZhdGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH07XG4gICAgICAgICAgZXhwVG9EYXRhW2V4cF0gPSBkYXRhID0ge1xuICAgICAgICAgICAgbGFzdEFjdGl2YXRlZDogbnVsbCxcbiAgICAgICAgICAgIHNjb3BlOiBzY29wZSxcbiAgICAgICAgICAgIHdhdGNoRm46IHdhdGNoRm4sXG4gICAgICAgICAgICBjb21wYXJlV2l0aEV4cDogY29tcGFyZVdpdGhFeHAsXG4gICAgICAgICAgICB3YXRjaGVyOiBzY29wZS4kd2F0Y2goY29tcGFyZVdpdGhFeHAsIHdhdGNoRm4pXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBkYXRhLndhdGNoRm4oc2NvcGUuJGV2YWwoY29tcGFyZVdpdGhFeHApKTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gcmVtb3ZlU2NvcGUoZSkge1xuICAgICAgICB2YXIgcmVtb3ZlZFNjb3BlID0gZS50YXJnZXRTY29wZTtcbiAgICAgICAgdmFyIGluZGV4ID0g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gYm9yZGVyUmFkaXVzUHJvcCArPSBwbGFjZW1lbnRbMF0gKyAnLScgKyBwbGFjZW1lbnRbMV07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYm9yZGVyUmFkaXVzUHJvcCArPSBwbGFjZW1lbnRbMV0gKyAnLScgKyBwbGFjZW1lbnRbMF07XG4gICAgICAgIH1cbiAgICAgICAgYm9yZGVyUmFkaXVzUHJvcCArPSAnLXJhZGl1cyc7XG4gICAgICAgIHZhciBib3JkZXJSYWRpdXMgPSAkd2luZG93LmdldENvbXB1dGVkU3R5bGUoaXNUb29sdGlwID8gaW5uZXJFbGVtIDogZWxlbSlbYm9yZGVyUmFkaXVzUHJvcF07XG5cbiAgICAgICAgc3dpdGNoIChwbGFjZW1lbnRbMF0pIHtcbiAgICAgICAgICBjYXNlICd0b3AnOlxuICAgICAgICAgICAgYXJyb3dDc3MuYm90dG9tID0gaXNUb29sdGlwID8gJzAnIDogJy0nICsgYm9yZGVyV2lkdGg7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdib3R0b20nOlxuICAgICAgICAgICAgYXJyb3dDc3MudG9wID0gaXNUb29sdGlwID8gJzAnIDogJy0nICsgYm9yZGVyV2lkdGg7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdsZWZ0JzpcbiAgICAgICAgICAgIGFycm93Q3NzLnJpZ2h0ID0gaXNUb29sdGlwID8gJzAnIDogJy0nICsgYm9yZGVyV2lkdGg7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdyaWdodCc6XG4gICAgICAgICAgICBhcnJvd0Nzcy5sZWZ0ID0gaXNUb29sdGlwID8gJzAnIDogJy0nICsgYm9yZGVyV2lkdGg7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIGFycm93Q3NzW3BsYWNlbWVudFsxXV0gPSBib3JkZXJSYWRpdXM7XG5cbiAgICAgICAgYW5ndWxhci5lbGV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MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMpO1xuICAgICAgICBpZiAodGltZW91dFByb21pc2UpIHtcbiAgICAgICAgICAkdGltZW91dC5jYW5jZWwodGltZW91dFByb21pc2UpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGltZW91dFByb21pc2UgPSAkdGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICBjYWxsYmFjay5hcHBseShzZWxmLCBhcmdzKTtcbiAgICAgICAgfSwgZGVib3VuY2VUaW1lKTtcbiAgICAgIH07XG4gICAgfTtcbiAgfV0pO1xuXG5hbmd1bGFyLm1vZHVsZSgndWkuYm9vdHN0cmFwLm11bHRpTWFwJywgW10pXG4vKipcbiAqIEEgaGVscGVyLCBpbnRlcm5hbCBkYXRhIHN0cnVjdHVyZSB0aGF0IHN0b3JlcyBhbGwgcmVmZXJlbmNlcyBhdHRhY2hlZCB0byBrZXlcbiAqL1xuICAuZmFjdG9yeSgnJCRtdWx0aU1hcCcsIGZ1bmN0aW9uKCkge1xuICAgIHJldHVybiB7XG4gICAgICBjcmVhdGVOZXc6IGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgbWFwID0ge307XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBlbnRyaWVzOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiBPYmplY3Qua2V5cyhtYXApLm1hcChmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBrZXk6IGtleSxcbiAgICAgICAgICAgICAgICB2YWx1ZTogbWFwW2tleV1cbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2V0OiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICAgIHJldHVybiBtYXBba2V5XTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGhhc0tleTogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgICByZXR1cm4gISFtYXBba2V5XTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGtleXM6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKG1hcCk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBwdXQ6IGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICAgICAgICAgIGlmICghbWFwW2tleV0pIHtcbiAgICAgICAgICAgICAgbWFwW2tleV0gPSBbXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbWFwW2tleV0ucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICByZW1vdmU6IGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICAgICAgICAgIHZhciB2YWx1ZXMgPSBtYXBba2V5XTtcblxuICAgICAgICAgICAgaWYgKCF2YWx1ZXMpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgaWR4ID0gdmFsdWVzLmluZGV4T2YodmFsdWUpO1xuXG4gICAgICAgICAgICBpZiAoaWR4ICE9PSAtMSkge1xuICAgICAgICAgICAgICB2YWx1ZXMuc3BsaWNlKGlkeCwgMSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICghdmFsdWVzLmxlbmd0aCkge1xuICAgICAgICAgICAgICBkZWxldGUgbWFwW2tleV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG4gIH0pO1xuXG5hbmd1bGFyLm1vZHVsZSgndWkuYm9vdHN0cmFwLmRyb3Bkb3duJywgWyd1aS5ib290c3RyYXAubXVsdGlNYXAnLCAndWkuYm9vdHN0cmFwLnBvc2l0aW9uJ10pXG5cbi5jb25zdGFudCgndWliRHJvcGRvd25Db25maWcnLCB7XG4gIGFwcGVuZFRvT3BlbkNs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gICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBhZGQ6IGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICAgICAgICAgIHN0YWNrLnB1c2goe1xuICAgICAgICAgICAgICBrZXk6IGtleSxcbiAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldDogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIGlmIChrZXkgPT09IHN0YWNrW2ldLmtleSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzdGFja1tpXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAga2V5czogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIga2V5cyA9IFtdO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdGFjay5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICBrZXlzLnB1c2goc3RhY2tbaV0ua2V5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBrZXlzO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgdG9wOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiBzdGFja1tzdGFjay5sZW5ndGggLSAxXTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHJlbW92ZTogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgICB2YXIgaWR4ID0gLTE7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIGlmIChrZXkgPT09IHN0YWNrW2ldLmtleSkge1xuICAgICAgICAgICAgICAgIGlkeCA9IGk7XG4gICAgICAgICAgICAgICAgYnJlYWs7X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dmVyKSA6IG51bGw7XG4gICAgICByZXR1cm4ge1xuICAgICAgICByZXNvbHZlOiBmdW5jdGlvbihpbnZvY2FibGVzLCBsb2NhbHMsIHBhcmVudCwgc2VsZikge1xuICAgICAgICAgIGlmIChyZXNvbHZlcikge1xuICAgICAgICAgICAgcmV0dXJuIHJlc29sdmVyLnJlc29sdmUoaW52b2NhYmxlcywgbG9jYWxzLCBwYXJlbnQsIHNlbGYpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBwcm9taXNlcyA9IFtdO1xuXG4gICAgICAgICAgYW5ndWxhci5mb3JFYWNoKGludm9jYWJsZXMsIGZ1bmN0aW9uKHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKHZhbHVlKSB8fCBhbmd1bGFyLmlzQXJyYXkodmFsdWUpKSB7XG4gICAgICAgICAgICAgIHByb21pc2VzLnB1c2goJHEucmVzb2x2ZSgkaW5qZWN0b3IuaW52b2tlKHZhbHVlKSkpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChhbmd1bGFyLmlzU3RyaW5nKHZhbHVlKSkge1xuICAgICAgICAgICAgICBwcm9taXNlcy5wdXNoKCRxLnJlc29sdmUoJGluamVjdG9yLmdldCh2YWx1ZSkpKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHByb21pc2VzLnB1c2goJHEucmVzb2x2ZSh2YWx1ZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcmV0dXJuICRxLmFsbChwcm9taXNlcykudGhlbihmdW5jdGlvbihyZXNvbHZlcykge1xuICAgICAgICAgICAgdmFyIHJlc29sdmVPYmogPSB7fTtcbiAgICAgICAgICAgIHZhciByZXNvbHZlSXRlciA9IDA7XG4gICAgICAgICAgICBhbmd1bGFyLmZvckVhY2goaW52b2NhYmxlcywgZnVuY3Rpb24odmFsdWUsIGtleSkge1xuICAgICAgICAgICAgICByZX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ZnRlckFuaW1hdGluZygpIHtcbiAgICAgICAgICBpZiAoYWZ0ZXJBbmltYXRpbmcuZG9uZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cbiAgICAgICAgICBhZnRlckFuaW1hdGluZy5kb25lID0gdHJ1ZTtcblxuICAgICAgICAgICRhbmltYXRlLmxlYXZlKGRvbUVsKS50aGVuKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHtcbiAgICAgICAgICAgICAgZG9uZSgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBkb21FbC5yZW1vdmUoKTtcbiAgICAgICAgICAgIGlmIChjbG9zZWREZWZlcnJlZCkge1xuICAgICAgICAgICAgICBjbG9zZWREZWZlcnJlZC5yZXNvbHZlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBzY29wZS4kZGVzdHJveSgpO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgICRkb2N1bWVudC5vbigna2V5ZG93bicsIGtleWRvd25MaXN0ZW5lcik7XG5cbiAgICAgICRyb290U2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAkZG9jdW1lbnQub2ZmKCdrZXlkb3duJywga2V5ZG93bkxpc3RlbmVyKTtcbiAgICAgIH0pO1xuXG4gICAgICBmdW5jdGlvbiBrZXlkb3duTGlzdGVuZXIoZXZ0KSB7XG4gICAgICAgIGlmIChldnQuaXNEZWZhdWx0UHJldmVudGVkKCkpIHtcbiAgICAgICAgICByZXR1cm4gZXZ0O1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIG1vZGFsID0gb3BlbmVkV2luZG93cy50b3AoKTtcbiAgICAgICAgaWYgKG1vZGFsKSB7XG4gICAgICAgICAgc3dpdGNoIChldnQud2hpY2gpIHtcbiAgICAgICAgICAgIGNhc2UgMjc6IHtcbiAgICAgICAgICAgICAgaWYgKG1vZGFsLnZhbHVlLmtleWJvYXJkKSB7XG4gICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgJHJvb3RTY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzKG1vZGFsLmtleSwgJ2VzY2FwZSBrZXkgcHJlc3MnKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgOToge1xuICAgICAgICAgICAgICB2YXIgbGlzdCA9ICRtb2RhbFN0YWNrLmxvYWRGb2N1c0VsZW1lbnRMaXN0KG1vZGFsKTtcbiAgICAgICAgICAgICAgdmFyIGZvY3VzQ2hhbmdlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICBpZiAoZXZ0LnNoaWZ0S2V5KSB7XG4gICAgICAgICAgICAgICAgaWYgKCRtb2RhbFN0YWNrLmlzRm9jdXNJbkZpcnN0SXRlbShldnQsIGxpc3QpIHx8ICRtb2RhbFN0YWNrLmlzTW9kYWxGb2N1c2VkKGV2dCwgbW9kYWwpKSB7XG4gICAgICAgICAgICAgICAgICBmb2N1c0NoYW5nZWQgPSAkbW9kYWxTdGFjay5mb2N1c0xhc3RGb2N1c2FibGVFbGVtZW50KGxpc3QpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoJG1vZGFsU3RhY2suaXNGb2N1c0luTGFzdEl0ZW0oZXZ0LCBsaXN0KSkge1xuICAgICAgICAgICAgICAgICAgZm9jdXNDaGFuZ2VkID0gJG1vZGFsU3RhY2suZm9jdXNGaXJzdEZvY3VzYWJsZUVsZW1lbnQobGlzdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKGZvY3Vz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wKSArIGluZGV4KjEwfScsXG4gICAgICAgICAgICAndWliLW1vZGFsLWFuaW1hdGlvbi1jbGFzcyc6ICdmYWRlJyxcbiAgICAgICAgICAgICdtb2RhbC1pbi1jbGFzcyc6ICdpbidcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBpZiAobW9kYWwuYmFja2Ryb3BDbGFzcykge1xuICAgICAgICAgICAgYmFja2Ryb3BEb21FbC5hZGRDbGFzcyhtb2RhbC5iYWNrZHJvcENsYXNzKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAobW9kYWwuYW5pbWF0aW9uKSB7XG4gICAgICAgICAgICBiYWNrZHJvcERvbUVsLmF0dHIoJ21vZGFsLWFuaW1hdGlvbicsICd0cnVlJyk7XG4gICAgICAgICAgfVxuICAgICAgICAgICRjb21waWxlKGJhY2tkcm9wRG9tRWwpKGJhY2tkcm9wU2NvcGUpO1xuICAgICAgICAgICRhbmltYXRlLmVudGVyKGJhY2tkcm9wRG9tRWwsIGFwcGVuZFRvRWxlbWVudCk7XG4gICAgICAgICAgaWYgKCR1aWJQb3NpdGlvbi5pc1Njcm9sbGFibGUoYXBwZW5kVG9FbGVtZW50KSkge1xuICAgICAgICAgICAgc2Nyb2xsYmFyUGFkZGluZyA9ICR1aWJQb3NpdGlvbi5zY3JvbGxiYXJQYWRkaW5nKGFwcGVuZFRvRWxlbWVudCk7XG4gICAgICAgICAgICBpZiAoc2Nyb2xsYmFyUGFkZGluZy5oZWlnaHRPdmVyZmxvdyAmJiBzY3JvbGxiYXJQYWRkaW5nLnNjcm9sbGJhcldpZHRoKSB7XG4gICAgICAgICAgICAgIGFwcGVuZFRvRWxlbWVudC5jc3Moe3BhZGRpbmdSaWdodDogc2Nyb2xsYmFyUGFkZGluZy5yaWdodCArICdweCd9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgY29udGVudDtcbiAgICAgICAgaWYgKG1vZGFsLmNvbXBvbm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G4gICAgICAgIGlmIChtb2RhbFdpbmRvdykge1xuICAgICAgICAgIHZhciBtb2RhbERvbUUxID0gbW9kYWxXaW5kb3cudmFsdWUubW9kYWxEb21FbDtcbiAgICAgICAgICBpZiAobW9kYWxEb21FMSAmJiBtb2RhbERvbUUxLmxlbmd0aCkge1xuICAgICAgICAgICAgdmFyIGVsZW1lbnRzID0gbW9kYWxEb21FMVswXS5xdWVyeVNlbGVjdG9yQWxsKHRhYmJhYmxlU2VsZWN0b3IpO1xuICAgICAgICAgICAgcmV0dXJuIGVsZW1lbnRzID9cbiAgICAgICAgICAgICAgQXJyYXkucHJvdG90eXBlLmZpbHRlci5jYWxsKGVsZW1lbnRzLCBmdW5jdGlvbihlbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVmlzaWJsZShlbGVtZW50KTtcbiAgICAgICAgICAgICAgfSkgOiBlbGVtZW50cztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHJldHVybiAkbW9kYWxTdGFjaztcbiAgICB9XSlcblxuICAucHJvdmlkZXIoJyR1aWJNb2RhbCcsIGZ1bmN0aW9uKCkge1xuICAgIHZhciAkbW9kYWxQcm92aWRlciA9IHtcbiAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgYW5pbWF0aW9uOiB0cnVlLFxuICAgICAgICBiYWNrZHJvcDogdHJ1ZSwgLy9jYW4gYWxzbyBiZSBmYWxzZSBvciAnc3RhdGljJ1xuICAgICAgICBrZXlib2FyZDogdHJ1ZVxuICAgICAgfSxcbiAgICAgICRnZXQ6IFsnJHJvb3RTY29wZScsICckcScsICckZG9jdW1lbnQnLCAnJHRlbXBsYXRlUmVxdWVzdCcsICckY29udHJvbGxlcicsICckdWliUmVzb2x2ZScsICckdWliTW9kYWxTdGFjaycsXG4gICAgICAgIGZ1bmN0aW9uICgkcm9vdFNjb3BlLCAkcSwgJGRvY3VtZW50LCAkdGVtcGxhdGVSZXF1ZXN0LCAk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ICAgICAgICAgICAgdmFyIG1vZGFsSW5zdGFuY2UgPSB7XG4gICAgICAgICAgICAgIHJlc3VsdDogbW9kYWxSZXN1bHREZWZlcnJlZC5wcm9taXNlLFxuICAgICAgICAgICAgICBvcGVuZWQ6IG1vZGFsT3BlbmVkRGVmZXJyZWQucHJvbWlzZSxcbiAgICAgICAgICAgICAgY2xvc2VkOiBtb2RhbENsb3NlZERlZmVycmVkLnByb21pc2UsXG4gICAgICAgICAgICAgIHJlbmRlcmVkOiBtb2RhbFJlbmRlckRlZmVycmVkLnByb21pc2UsXG4gICAgICAgICAgICAgIGNsb3NlOiBmdW5jdGlvbiAocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICRtb2RhbFN0YWNrLmNsb3NlKG1vZGFsSW5zdGFuY2UsIHJlc3VsdCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGRpc21pc3M6IGZ1bmN0aW9uIChyZWFzb24pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJG1vZGFsU3RhY2suZGlzbWlzcyhtb2RhbEluc3RhbmNlLCByZWFzb24pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAvL21lcmdlIGFuZCBjbGVhbiB1cCBvcHRpb25zXG4gICAgICAgICAgICBtb2RhbE9wdGlvbnMgPSBhbmd1bGFyLmV4dGVuZCh7fSwgJG1vZGFsUHJvdmlkZXIub3B0aW9ucywgbW9kYWxPcHRpb25zKTtcbiAgICAgICAgICAgIG1vZGFsT3B0aW9ucy5yZXNvbHZlID0gbW9kYWxPcHRpb25zLnJlc29sdmUgfHwge307XG4gICAgICAgICAgICBtb2RhbE9wdGlvbnMuYXBwZW5kVG8gPSBtb2RhbE9wdGlvbnMuYXBwZW5kVG8gfHwgJGRvY3VtZW50LmZpbmQoJ2JvZHknKS5lcSgwKTtcblxuICAgICAgICAgICAgaWYgKCFtb2RhbE9wdGlvbnMuYXBwZW5kVG8ubGVuZ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G1vZGFsSW5zdGFuY2UuZGlzbWlzcztcblxuICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgaWYgKCFtb2RhbFNjb3BlLiQkdWliRGVzdHJ1Y3Rpb25TY2hlZHVsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbW9kYWxTY29wZS4kZGlzbWlzcygnJHVpYlVuc2NoZWR1bGVkRGVzdHJ1Y3Rpb24nKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIHZhciBtb2RhbCA9IHtcbiAgICAgICAgICAgICAgICAgIHNjb3BlOiBtb2RhbFNjb3BlLFxuICAgICAgICAgICAgICAgICAgZGVmZXJyZWQ6IG1vZGFsUmVzdWx0RGVmZXJyZWQsXG4gICAgICAgICAgICAgICAgICByZW5kZXJEZWZlcnJlZDogbW9kYWxSZW5kZXJEZWZlcnJlZCxcbiAgICAgICAgICAgICAgICAgIGNsb3NlZERlZmVycmVkOiBtb2RhbENsb3NlZERlZmVycmVkLFxuICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uOiBtb2RhbE9wdGlvbnMuYW5pbWF0aW9uLFxuICAgICAgICAgICAgICAgICAgYmFja2Ryb3A6IG1vZGFsT3B0aW9ucy5iYWNrZHJvcCxcbiAgICAgICAgICAgICAgICAgIGtleWJvYXJkOiBtb2RhbE9wdGlvbnMua2V5Ym9hcmQsXG4gICAgICAgICAgICAgICAgICBiYWNrZHJvcENsYXNzOiBtb2RhbE9wdGlvbnMuYmFja2Ryb3BDbGFzcyxcbiAgICAgICAgICAgICAgICAgIHdpbmRvd1RvcENsYXNzOiBtb2RhbE9wdGlvbnMud2luZG93VG9wQ2xhc3MsXG4gICAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczogbW9kYWxPcHRpb25zLndpbmRvd0NsYXNzLFxuICAgICAgICAgICAgICAgICAgd2luZG93VGVtcGxhdGVVcmw6IG1vZGFsT3B0aW9ucy53aW5kb3dUZW1wbGF0ZVVybCxcbiAgICAgICAgICAgICAgICAgIGFyaWFMYWJlbGxlZEJ5OiBtb2RhbE9wdGlvbnMuYXJpYUxhYmVsbGVkQnksXG4gICAgICAgICAgICAgICAgICBhcmlhRGVzY3JpYmVkQnk6IG1vZGFsT3B0aW9ucy5hcmlhRGVzY3JpYmVkQnksXG4gICAgICAgICAgICAgICAgICBzaXplOiBtb2RhbE9wdGlvbnMuc2l6ZSxcbiAgICAgICAgICAgICAgICAgIG9wZW5lZENsYXNzOiBtb2RhbE9wdGlvbnMub3BlbmVkQ2xhc3MsXG4gICAgICAgICAgICAgICAgICBhcHBlbmRUbzogbW9kYWxPcHRpb25zLmFwcGVuZFRvXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB7fTtcbiAgICAgICAgICAgICAgICB2YXIgY3RybEluc3RhbmNlLCBjdHJsSW5zdGFudGlhdGUsIGN0cmxMb2NhbHMgPSB7fTtcblxuICAgICAgICAgICAgICAgIGlmIChtb2RhbE9wdGlvbnMuY29tcG9uZW50KSB7XG4gICAgICAgICAgICAgICAgICBjb25zdHJ1Y3RMb2NhbHMoY29tcG9uZW50LCBmYWxzZSwgdHJ1ZSwgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgY29tcG9uZW50Lm5hbWUgPSBtb2RhbE9wdGlvbnMuY29tcG9uZW50O1xuICAgICAgICAgICAgICAgICAgbW9kYWwuY29tcG9uZW50ID0gY29tcG9uZW50O1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobW9kYWxPcHRpb25zLmNvbnRyb2xsZXIpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0cnVjdExvY2FscyhjdHJsTG9jYWxzLCB0cnVlLCBmYWxzZSwgdHJ1ZSk7XG5cbiAgICAgICAgICAgICAgICAgIC8vIHRoZSB0aGlyZCBwYXJhbSB3aWxsIG1ha2UgdGhlIGNvbnRyb2xsZXIgaW5zdGFudGlhdGUgbGF0ZXIscHJpdmF0ZSBhcGlcbiAgICAgICAgICAgICAgICAgIC8vIEBzZWUgaHR0cHM6Ly9naXRodWIuY29tL2FuZ3VsYXIvYW5ndWxhci5qcy9ibG9iL21hc3Rlci9zcmMvbmcvY29udHJvbGxlci5qcyNMMTI2XG4gICAgICAgICAgICAgICAgICBjdHJsSW5zdGFudGlhdGUgPSAkY29udHJvbGxlcihtb2RhbE9wdGlvbnMuY29udHJvbGxlciwgY3RybExvY2FscywgdHJ1ZSwgbW9kYWxPcHRpb25zLmNvbnRyb2xsZXJBcyk7XG4gICAgICAgICAgICAgICAgICBpZiAobW9kYWxPcHRpb25zLmNvbnRyb2xsZXJBcyAmJiBtb2RhbE9wdGlvbnMuYmluZFRvQ29udHJvbGxlcikge1xuICAgICAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UgPSBjdHJsSW5zdGFudGlhdGUuaW5zdGFuY2U7XG4gICAgICAgICAgICAgICAgICAgIGN0cmxJbnN0YW5jZS4kY2xvc2UgPSBtb2RhbFNjb3BlLiRjbG9zZTtcbiAgICAgICAgICAgICAgICAgICAgY3RybEluc3RhbmNlLiRkaXNtaXNzID0gbW9kYWxTY29wZS4kZGlzbWlzcztcbiAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQoY3RybEluc3RhbmNlLCB7XG4gICAgICAgICAgICAgICAgICAgICAgJHJlc29sdmU6IGN0cmxMb2NhbHMuJHNjb3BlLiRyZXNvbHZlXG4gICAgICAgICAgICAgICAgICAgIH0sIHByb3ZpZGVkU2NvcGUpO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UgPSBjdHJsSW5zdGFudGlhdGUoKTtcblxuICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNGdW5jdGlvbihjdHJsSW5zdGFuY2UuJG9uSW5pdCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY3RybEluc3RhbmNlLiRvbkluaXQoKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoIW1vZGFsT3B0aW9ucy5jb21wb25lbnQpIHtcbiAgICAgICAgICAgICAgICAgIG1vZGFsLmNvbnRlbnQgPSB0cGxBbmRWYXJzWzBdO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICRtb2RhbFN0YWNrLm9wZW4obW9kYWxJbnN0YW5jZSwgbW9kYWwpO1xuICAgICAgICAgICAgICAgIG1vZGFsT3BlbmVkRGVmZXJyZWQucmVzb2x2ZSh0cnVlKTtcblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNvbnN0cnVjdExvY2FscyhvYmosIHRlbXBsYXRlLCBpbnN0YW5jZU9uU2NvcGUsIGluamVjdGFibGUpIHtcbiAgICAgICAgICAgICAgICAgIG9iai4kc2NvcGUgPSBtb2RhbFNjb3BlO1xuICAgICAgICAgICAgICAgICAgb2JqLiRzY29wZS4kcmVzb2x2ZSA9IHt9O1xuICAgICAgICAgICAgICAgICAgaWYgKGluc3RhbmNlT25TY29wZSkge1xuICAgICAgICAgICAgICAgICAgICBvYmouJHNjb3BlLiR1aWJNb2RhbEluc3RhbmNlID0gbW9kYWxJbnN0YW5jZTtcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9iai4kdWliTW9kYWxJbnN0YW5jZSA9IG1vZGFsSW5zdGFuY2U7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIHZhciByZXNvbHZlcyA9IHRlbXBsYXRlID8gdHBsQW5kVmFyc1sxXSA6IHRwbEFuZFZhcnM7XG4gICAgICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2gocmVzb2x2ZXMsIGZ1bmN0aW9uKHZhbHVlLCBrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluamVjdGFibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICBvYmpba2V5XSA9IHZhbHVlO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgb2JqLiRzY29wZS4kcmVzb2x2ZVtrZXldID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCBmdW5jdGlvbiByZXNvbHZlRXJyb3IocmVhc29uKSB7XG4gICAgICAgICAgICAgIG1vZGFsT3BlbmVkRGVmZXJyZWQucmVqZWN0KHJlYXNvbik7XG4gICAgICAgICAgICAgIG1vZGFsUmVzdWx0RGVmZXJyZWQucmVqZWN0KHJlYXNvbik7XG4gICAgICAgICAgICB9KVsnZmluYWxseSddKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAocHJvbWlzZUNoYWluID09PSBzYW1lUHJvbWlzZSkge1xuICAgICAgICAgICAgICAgIHByb21pc2VDaGFpbiA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gbW9kYWxJbnN0YW5jZTtcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgcmV0dXJuICRtb2RhbDtcbiAgICAgICAgfVxuICAgICAgXVxuICAgIH07XG5cbiAgICByZXR1cm4gJG1vZGFsUHJvdmlkZXI7XG4gIH0pO1xuXG5hbmd1bGFyLm1vZHVsZSgndWkuYm9vdHN0cmFwLnBhZ2luZycsIFtdKVxuLyoqXG4gKiBIZWxwZXIgaW50ZXJuYWwgc2VydmljZSBmb3IgZ2VuZXJhdGluZyBjb21tb24gY29udHJvbGxlciBjb2RlIGJldHdlZW4gdGhlXG4gKiBwYWdlciBhbmQgcGFnaW5hdGlvbiBjb21wb25lbnRzXG4gKi9cbi5mYWN0b3J5KCd1aWJQYWdpbmcnLCBbJyRwYXJzZScsIGZ1bmN0aW9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AgICAgIHZhciBzdGFydFN5bSA9ICRpbnRlcnBvbGF0ZS5zdGFydFN5bWJvbCgpO1xuICAgICAgdmFyIGVuZFN5bSA9ICRpbnRlcnBvbGF0ZS5lbmRTeW1ib2woKTtcbiAgICAgIHZhciB0ZW1wbGF0ZSA9XG4gICAgICAgICc8ZGl2ICcrIGRpcmVjdGl2ZU5hbWUgKyAnLXBvcHVwICcgK1xuICAgICAgICAgICd1aWItdGl0bGU9XCInICsgc3RhcnRTeW0gKyAndGl0bGUnICsgZW5kU3ltICsgJ1wiICcgK1xuICAgICAgICAgIChvcHRpb25zLnVzZUNvbnRlbnRFeHAgP1xuICAgICAgICAgICAgJ2NvbnRlbnQtZXhwPVwiY29udGVudEV4cCgpXCIgJyA6XG4gICAgICAgICAgICAnY29udGVudD1cIicgKyBzdGFydFN5bSArICdjb250ZW50JyArIGVuZFN5bSArICdcIiAnKSArXG4gICAgICAgICAgJ29yaWdpbi1zY29wZT1cIm9yaWdTY29wZVwiICcgK1xuICAgICAgICAgICdjbGFzcz1cInVpYi1wb3NpdGlvbi1tZWFzdXJlICcgKyBwcmVmaXggKyAnXCIgJyArXG4gICAgICAgICAgJ3Rvb2x0aXAtYW5pbWF0aW9uLWNsYXNzPVwiZmFkZVwiJyArXG4gICAgICAgICAgJ3VpYi10b29sdGlwLWNsYXNzZXMgJyArXG4gICAgICAgICAgJ25nLWNsYXNzPVwieyBpbjogaXNPcGVuIH1cIiAnICtcbiAgICAgICAgICAnPicgK1xuICAgICAgICAnPC9kaXY+JztcblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgY29tcGlsZTogZnVuY3Rpb24odEVsZW0sIHRBdHRycykge1xuICAgICAgICAgIHZhciB0b29sdGlwTGlua2VyID0gJGNvbXBpbGUodGVtcGxhdGUpO1xuXG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIGxpbmsoc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCB0b29sdGlwQ3RybCkge1xuICAgICAgICAgICAgd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cbiAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmVDbGFzcyhsYXN0UGxhY2VtZW50LnNwbGl0KCctJylbMF0pO1xuICAgICAgICAgICAgICAgICAgICB0b29sdGlwLmFkZENsYXNzKHBsYWNlbWVudENsYXNzZXNbMF0pO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBpZiAoIXRvb2x0aXAuaGFzQ2xhc3Mob3B0aW9ucy5wbGFjZW1lbnRDbGFzc1ByZWZpeCArIHR0UG9zaXRpb24ucGxhY2VtZW50KSkge1xuICAgICAgICAgICAgICAgICAgICB0b29sdGlwLnJlbW92ZUNsYXNzKG9wdGlvbnMucGxhY2VtZW50Q2xhc3NQcmVmaXggKyBsYXN0UGxhY2VtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5hZGRDbGFzcyhvcHRpb25zLnBsYWNlbWVudENsYXNzUHJlZml4ICsgdHRQb3NpdGlvbi5wbGFjZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBhZGp1c3RtZW50VGltZW91dCA9ICR0aW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY3VycmVudEhlaWdodCA9IGFuZ3VsYXIuaXNEZWZpbmVkKHRvb2x0aXAub2Zmc2V0SGVpZ2h0KSA/IHRvb2x0aXAub2Zmc2V0SGVpZ2h0IDogdG9vbHRpcC5wcm9wKCdvZmZzZXRIZWlnaHQnKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGFkanVzdG1lbnQgPSAkcG9zaXRpb24uYWRqdXN0VG9wKHBsYWNlbWVudENsYXNzZXMsIGVsZW1lbnRQb3MsIGluaXRpYWxIZWlnaHQsIGN1cnJlbnRIZWlnaHQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoYWRqdXN0bWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXAuY3NzKGFkanVzdG1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGFkanVzdG1lbnRUaW1lb3V0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIH0sIDAsIGZhbHNlKTtcblxuICAgICAgICAgICAgICAgICAgLy8gZmlyc3QgdGltZSB0aHJvdWdoIHR0IGVsZW1lbnQgd2lsbCBoYXZlIHRoZVxuICAgICAgICAgICAgICAgICAgLy8gdWliLXBvc2l0aW9uLW1lYXN1cmUgY2xhc3Mgb3IgaWYgdGhlIHBsYWNlbWVudFxuICAgICAgICAgICAgICAgICAgLy8gaGFzIGNoYW5nZWQgd2UgbmVlZCB0byBwb3NpdGlvbiB0aGUgYXJyb3cuXG4gICAgICAgICAgICAgICAgICBpZiAodG9vbHRpcC5oYXNDbGFzcygndWliLXBvc2l0aW9uLW1lYXN1cmUnKSkge1xuICAgICAgICAgICAgICAgICAgICAkcG9zaXRpb24ucG9zaXRpb25BcnJvdyh0b29sdGlwLCB0dFBvc2l0aW9uLnBsYWNlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIHRvb2x0aXAucmVtb3ZlQ2xhc3MoJ3VpYi1wb3NpdGlvbi1tZWFzdXJlJyk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxhc3RQbGFjZW1lbnQgIT09IHR0UG9zaXRpb24ucGxhY2VtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICRwb3NpdGlvbi5wb3NpdGlvbkFycm93KHRvb2x0aXAsIHR0UG9zaXRpb24ucGxhY2VtZW50KTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGxhc3RQbGFjZW1lbnQgPSB0dFBvc2l0aW9uLnBsYWNlbWVudDtcblxuICAgICAgICAgICAgICAgICAgcG9zaXRpb25UaW1lb3V0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9LCAwLCBmYWxzZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIC8vIFNldCB1cCB0aGUgY29ycmVjdCBzY29wZSB0byBhbGxvdyB0cmFuc2NsdXNpb24gbGF0ZXJcbiAgICAgICAgICAgIHR0U2NvcGUub3JpZ1Njb3BlID0gc2NvcGU7XG5cbiAgICAgICAgICAgIC8vIEJ5IGRlZmF1bHQsIHRoZSB0b29sdGlwIGlzIG5vdCBvcGVuLlxuICAgICAgICAgICAgLy8gVE9ETyBhZGQgYWJpbGl0eSB0byBzdGFydCB0b29sdGlwIG9wZW5lZFxuICAgICAgICAgICAgdHRTY29wZS5pc09wZW4gPSBmYWxzZTtcblxuICAgICAgICAgICAgZnVuY3Rpb24gdG9nZ2xlVG9vbHRpcEJpbmQoKSB7XG4gICAgICAgICAgICAgIGlmICghdHRTY29wZS5pc09wZW4pIHtcbiAgICAgICAgICAgICAgICBzaG93VG9vbHRpcEJpbmQoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBoaWRlVG9vbHRpcEJpbmQoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBTaG93IHRoZSB0b29sdGlwIHdpdGggZGVsYXkgaWYgc3BlY2lmaWVkLCBvdGhlcndpc2Ugc2hvdyBpdCBpbW1lZGlhdGVseVxuICAgICAgICAgICAgZnVuY3Rpb24gc2hvd1Rvb2x0aXBCaW5kKCkge1xuICAgICAgICAgICAgICBpZiAoaGFzRW5hYmxlRXhwICYmICFzY29wZS4kZXZhbChhdHRyc1twcmVmaXggKyAnRW5hYmxlJ10pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgY2FuY2VsSGlkZSgpO1xuICAgICAgICAgICAgICBwcmVwYXJlVG9vbHRpcCgpO1xuXG4gICAgICAgICAgICAgIGlmICh0dFNjb3BlLnBvcHVwRGVsYXkpIHtcbiAgICAgICAgICAgICAgICAvLyBEbyBub3RoaW5nIGlmIHRoZSB0b29sdGlwIHdhcyBhbHJlYWR5IHNjaGVkdWxlZCB0byBwb3AtdXAuXG4gICAgICAgICAgICAgICAgLy8gVGhpcyBoYXBwZW5zIGlmIHNob3cgaXMgdHJpZ2dlcmVkIG11bHRpcGxlIHRpbWVzIGJlZm9yZSBhbnkgaGlkZSBpcyB0cmlnZ2VyZWQuXG4gICAgICAgICAgICAgICAgaWYgKCFzaG93VGltZW91dCkge1xuICAgICAgICAgICAgICAgICAgc2hvd1RpbWVvdXQgPSAkdGltZW91dChzaG93LCB0dFNjb3BlLnBvcHVwRGVsYXksIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc2hvdygpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGhpZGVUb29sdGlwQmluZCgpIHtcbiAgICAgICAgICAgICAgY2FuY2VsU2hvdygpO1xuXG4gICAgICAgICAgICAgIGlmICh0dFNjb3BlLnBvcHVwQ2xvc2VEZWxheSkge1xuICAgICAgICAgICAgICAgIGlmICghaGlkZVRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAgIGhpZGVUaW1lb3V0ID0gJHRpbWVvdXQoaGlkZSwgdHRTY29wZS5wb3B1cENsb3NlRGVsYXksIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaGlkZSgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFNob3cgdGhlIHRvb2x0aXAgcG9wdXAgZWxlbWVudC5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHNob3coKSB7XG4gICAgICAgICAgICAgIGNhbmNlbFNob3coKTtcbiAgICAgICAgICAgICAgY2FuY2VsSGlkZSgpO1xuXG4gICAgICAgICAgICAgIC8vIERvbid0IHNob3cgZW1wdHkgdG9vbHRpcHMuXG4gICAgICAgICAgICAgIGlmICghdHRTY29wZS5jb250ZW50KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFuZ3VsYXIubm9vcDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGNyZWF0ZVRvb2x0aXAoKTtcblxuICAgICAgICAgICAgICAvLyBBbmQgc2hvdyB0aGUgdG9vbHRpcC5cbiAgICAgICAgICAgICAgdHRTY29wZS4kZXZhbEFzeW5jKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHR0U2NvcGUuaXNPcGVuID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBhc3NpZ25Jc09wZW4odHJ1ZSk7XG4gICAgICAgICAgICAgICAgcG9zaXRpb25Ub29sdGlwKCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBjYW5jZWxTaG93KCkge1xuICAgICAgICAgICAgICBpZiAoc2hvd1RpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwoc2hvd1RpbWVvdXQpO1xuICAgICAgICAgICAgICAgIHNob3dUaW1lb3V0ID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmIChwb3NpdGlvblRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwocG9zaXRpb25UaW1lb3V0KTtcbiAgICAgICAgICAgICAgICBwb3NpdGlvblRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEhpZGUgdGhlIHRvb2x0aXAgcG9wdXAgZWxlbWVudC5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGhpZGUoKSB7XG4gICAgICAgICAgICAgIGlmICghdHRTY29wZSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vIEZpcnN0IHRoaW5ncyBmaXJzdDogd2UgZG9uJ3Qgc2hvdyBpdCBhbnltb3JlLlxuICAgICAgICAgICAgICB0dFNjb3BlLiRldmFsQXN5bmMoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR0U2NvcGUpIHtcbiAgICAgICAgICAgICAgICAgIHR0U2NvcGUuaXNPcGVuID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBhc3NpZ25Jc09wZW4oZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgLy8gQW5kIG5vdyB3ZSByZW1vdmUgaXQgZnJvbSB0aGUgRE9NLiBIb3dldmVyLCBpZiB3ZSBoYXZlIGFuaW1hdGlvbiwgd2VcbiAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gd2FpdCBmb3IgaXQgdG8gZXhwaXJlIGJlZm9yZWhhbmQuXG4gICAgICAgICAgICAgICAgICAvLyBGSVhNRTogdGhpcyBpcyBhIHBsYWNlaG9sZGVyIGZvciBhIHBvcnQgb2YgdGhlIHRyYW5zaXRpb25zIGxpYnJhcnkuXG4gICAgICAgICAgICAgICAgICAvLyBUaGUgZmFkZSB0cmFuc2l0aW9uIGluIFRXQlMgaXMgMTUwbXMuXG4gICAgICAgICAgICAgICAgICBpZiAodHRTY29wZS5hbmltYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0cmFuc2l0aW9uVGltZW91dCkge1xuICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UaW1lb3V0ID0gJHRpbWVvdXQocmVtb3ZlVG9vbHRpcCwgMTUwLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBjYW5jZWxIaWRlKCkge1xuICAgICAgICAgICAgICBpZiAoaGlkZVRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwoaGlkZVRpbWVvdXQpO1xuICAgICAgICAgICAgICAgIGhpZGVUaW1lb3V0ID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0cmFuc2l0aW9uVGltZW91dCkge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbCh0cmFuc2l0aW9uVGltZW91dCk7XG4gICAgICAgICAgICAgICAgdHJhbnNpdGlvblRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNyZWF0ZVRvb2x0aXAoKSB7XG4gICAgICAgICAgICAgIC8vIFRoZXJlIGNhbiBvbmx5IGJlIG9uZSB0b29sdGlwIGVsZW1lbnQgcGVyIGRpcmVjdGl2ZSBzaG93biBhdCBvbmNlLlxuICAgICAgICAgICAgICBpZiAodG9vbHRpcCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZSA9IHR0U2NvcGUuJG5ldygpO1xuICAgICAgICAgICAgICB0b29sdGlwID0gdG9vbHRpcExpbmtlcih0b29sdGlwTGlua2VkU2NvcGUsIGZ1bmN0aW9uKHRvb2x0aXApIHtcbiAgICAgICAgICAgICAgICBpZiAoYXBwZW5kVG9Cb2R5KSB7XG4gICAgICAgICAgICAgICAgICAkZG9jdW1lbnQuZmluZCgnYm9keScpLmFwcGVuZCh0b29sdGlwKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZnRlcih0b29sdGlwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIG9wZW5lZFRvb2x0aXBzLmFkZCh0dFNjb3BlLCB7XG4gICAgICAgICAgICAgICAgY2xvc2U6IGhpZGVcbiAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgcHJlcE9ic2VydmVycygpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiByZW1vdmVUb29sdGlwKCkge1xuICAgICAgICAgICAgICBjYW5jZWxTaG93KCk7XG4gICAgICAgICAgICAgIGNhbmNlbEhpZGUoKTtcbiAgICAgICAgICAgICAgdW5yZWdpc3Rlck9ic2VydmVycygpO1xuXG4gICAgICAgICAgICAgIGlmICh0b29sdGlwKSB7XG4gICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICB0b29sdGlwID0gbnVsbDtcbiAgICAgICAgICAgICAgICBpZiAoYWRqdXN0bWVudFRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChhZGp1c3RtZW50VGltZW91dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgb3BlbmVkVG9vbHRpcHMucmVtb3ZlKHR0U2NvcGUpO1xuICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgaWYgKHRvb2x0aXBMaW5rZWRTY29wZSkge1xuICAgICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZS4kZGVzdHJveSgpO1xuICAgICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZSA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBTZXQgdGhlIGluaXRpYWwgc2NvcGUgdmFsdWVzLiBPbmNlXG4gICAgICAgICAgICAgKiB0aGUgdG9vbHRpcCBpcyBjcmVhdGVkLCB0aGUgb2JzZXJ2ZXJzXG4gICAgICAgICAgICAgKiB3aWxsIGJlIGFkZGVkIHRvIGtlZXAgdGhpbmdzIGluIHN5bmMuXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGZ1bmN0aW9uIHByZXBhcmVUb29sdGlwKCkge1xuICAgICAgICAgICAgICB0dFNjb3BlLnRpdGxlID0gYXR0cnNbcHJlZml4ICsgJ1RpdGxlJ107XG4gICAgICAgICAgICAgIGlmIChjb250ZW50UGFyc2UpIHtcbiAgICAgICAgICAgICAgICB0dFNjb3BlLmNvbnRlbnQgPSBjb250ZW50UGFyc2Uoc2NvcGUpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHR0U2NvcGUuY29udGVudCA9IGF0dHJzW3R0VHlwZV07XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB0dFNjb3BlLnBvcHVwQ2xhc3MgPSBhdHRyc1twcmVmaXggKyAnQ2xhc3MnXTtcbiAgICAgICAgICAgICAgdHRTY29wZS5wbGFjZW1lbnQgPSBhbmd1bGFyLmlzRGVmaW5lZChhdHRyc1twcmVmaXggKyAnUGxhY2VtZW50J10pID8gYXR0cnNbcHJlZml4ICsgJ1BsYWNlbWVudCddIDogb3B0aW9ucy5wbGFjZW1lbnQ7XG4gICAgICAgICAgICAgIHZhciBwbGFjZW1lbnQgPSAkcG9zaXRpb24ucGFyc2VQbGFjZW1lbnQodHRTY29wZS5wbGFjZW1lbnQpO1xuICAgICAgICAgICAgICBsYXN0UGxhY2VtZW50ID0gcGxhY2VtZW50WzFdID8gcGxhY2VtZW50WzBdICsgJy0nICsgcGxhY2VtZW50WzFdIDogcGxhY2VtZW50WzBdO1xuXG4gICAgICAgICAgICAgIHZhciBkZWxheSA9IHBhcnNlSW50KGF0dHJzW3ByZWZpeCArICdQb3B1cERlbGF5J10sIDEwKTtcbiAgICAgICAgICAgICAgdmFyIGNsb3NlRGVsYXkgPSBwYXJzZUludChhdHRyc1twcmVmaXggKyAnUG9wdXBDbG9zZURlbGF5J10sIDEwKTtcbiAgICAgICAgICAgICAgdHRTY29wZS5wb3B1cERlbGF5ID0gIWlzTmFOKGRlbGF5KSA/IGRlbGF5IDogb3B0aW9ucy5wb3B1cERlbGF5O1xuICAgICAgICAgICAgICB0dFNjb3BlLnBvcHVwQ2xvc2VEZWxheSA9ICFpc05hTihjbG9zZURlbGF5KSA/IGNsb3NlRGVsYXkgOiBvcHRpb25zLnBvcHVwQ2xvc2VEZWxheTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gYXNzaWduSXNPcGVuKGlzT3Blbikge1xuICAgICAgICAgICAgICBpZiAoaXNPcGVuUGFyc2UgJiYgYW5ndWxhci5pc0Z1bmN0aW9uKGlzT3BlblBhcnNlLmFzc2lnbikpIHtcbiAgICAgICAgICAgICAgICBpc09wZW5QYXJzZS5hc3NpZ24oc2NvcGUsIGlzT3Blbik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdHRTY29wZS5jb250ZW50RXhwID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJldHVybiB0dFNjb3BlLmNvbnRlbnQ7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIE9ic2VydmUgdGhlIHJlbGV2YW50IGF0dHJpYnV0ZXMuXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGF0dHJzLiRvYnNlcnZlKCdkaXNhYmxlZCcsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICBpZiAodmFsKSB7XG4gICAgICAgICAgICAgICAgY2FuY2VsU2hvdygpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKHZhbCAmJiB0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgIGhpZGUoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmIChpc09wZW5QYXJzZSkge1xuICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goaXNPcGVuUGFyc2UsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgIGlmICh0dFNjb3BlICYmICF2YWwgPT09IHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICB0b2dnbGVUb29sdGlwQmluZCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHByZXBPYnNlcnZlcnMoKSB7XG4gICAgICAgICAgICAgIG9ic2VydmVycy5sZW5ndGggPSAwO1xuXG4gICAgICAgICAgICAgIGlmIChjb250ZW50UGFyc2UpIHtcbiAgICAgICAgICAgICAgICBvYnNlcnZlcnMucHVzaChcbiAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChjb250ZW50UGFyc2UsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgICAgICB0dFNjb3BlLmNvbnRlbnQgPSB2YWw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdmFsICYmIHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICBvYnNlcnZlcnMucHVzaChcbiAgICAgICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZS4kd2F0Y2goZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVwb3NpdGlvblNjaGVkdWxlZCkge1xuICAgICAgICAgICAgICAgICAgICAgIHJlcG9zaXRpb25TY2hlZHVsZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZS4kJHBvc3REaWdlc3QoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXBvc2l0aW9uU2NoZWR1bGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHRTY29wZSAmJiB0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG9ic2VydmVycy5wdXNoKFxuICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUodHRUeXBlLCBmdW5jdGlvbih2YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgdHRTY29wZS5jb250ZW50ID0gdmFsO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbCAmJiB0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgICAgICAgIGhpZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgb2JzZXJ2ZXJzLnB1c2goXG4gICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1RpdGxlJywgZnVuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgICAgICB0dFNjb3BlLnRpdGxlID0gdmFsO1xuICAgICAgICAgICAgICAgICAgaWYgKHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgb2JzZXJ2ZXJzLnB1c2goXG4gICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1BsYWNlbWVudCcsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgICAgdHRTY29wZS5wbGFjZW1lbnQgPSB2YWwgPyB2YWwgOiBvcHRpb25zLnBsYWNlbWVudDtcbiAgICAgICAgICAgICAgICAgIGlmICh0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiB1bnJlZ2lzdGVyT2JzZXJ2ZXJzKCkge1xuICAgICAgICAgICAgICBpZiAob2JzZXJ2ZXJzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChvYnNlcnZlcnMsIGZ1bmN0aW9uKG9ic2VydmVyKSB7XG4gICAgICAgICAgICAgICAgICBvYnNlcnZlcigpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIG9ic2VydmVycy5sZW5ndGggPSAwO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIGhpZGUgdG9vbHRpcHMvcG9wb3ZlcnMgZm9yIG91dHNpZGVDbGljayB0cmlnZ2VyXG4gICAgICAgICAgICBmdW5jdGlvbiBib2R5SGlkZVRvb2x0aXBCaW5kKGUpIHtcbiAgICAgICAgICAgICAgaWYgKCF0dFNjb3BlIHx8ICF0dFNjb3BlLmlzT3BlbiB8fCAhdG9vbHRpcCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgdGhlIHRvb2x0aXAvcG9wb3ZlciBsaW5rIG9yIHRvb2wgdG9vbHRpcC9wb3BvdmVyIGl0c2VsZiB3ZXJlIG5vdCBjbGlja2VkXG4gICAgICAgICAgICAgIGlmICghZWxlbWVudFswXS5jb250YWlucyhlLnRhcmdldCkgJiYgIXRvb2x0aXBbMF0uY29udGFpbnMoZS50YXJnZXQpKSB7XG4gICAgICAgICAgICAgICAgaGlkZVRvb2x0aXBCaW5kKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gS2V5Ym9hcmRFdmVudCBoYW5kbGVyIHRvIGhpZGUgdGhlIHRvb2x0aXAgb24gRXNjYXBlIGtleSBwcmVzc1xuICAgICAgICAgICAgZnVuY3Rpb24gaGlkZU9uRXNjYXBlS2V5KGUpIHtcbiAgICAgICAgICAgICAgaWYgKGUud2hpY2ggPT09IDI3KSB7XG4gICAgICAgICAgICAgICAgaGlkZVRvb2x0aXBCaW5kKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHVucmVnaXN0ZXJUcmlnZ2VycyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB0cmlnZ2Vycy5zaG93LmZvckVhY2goZnVuY3Rpb24odHJpZ2dlcikge1xuICAgICAgICAgICAgICAgIGlmICh0cmlnZ2VyID09PSAnb3V0c2lkZUNsaWNrJykge1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5vZmYoJ2NsaWNrJywgdG9nZ2xlVG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBlbGVtZW50Lm9mZih0cmlnZ2VyLCBzaG93VG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5vZmYodHJpZ2dlciwgdG9nZ2xlVG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbGVtZW50Lm9mZigna2V5cHJlc3MnLCBoaWRlT25Fc2NhcGVLZXkpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgdHJpZ2dlcnMuaGlkZS5mb3JFYWNoKGZ1bmN0aW9uKHRyaWdnZXIpIHtcbiAgICAgICAgICAgICAgICBpZiAodHJpZ2dlciA9PT0gJ291dHNpZGVDbGljaycpIHtcbiAgICAgICAgICAgICAgICAgICRkb2N1bWVudC5vZmYoJ2NsaWNrJywgYm9keUhpZGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIGVsZW1lbnQub2ZmKHRyaWdnZXIsIGhpZGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHByZXBUcmlnZ2VycygpIHtcbiAgICAgICAgICAgICAgdmFyIHNob3dUcmlnZ2VycyA9IFtdLCBoaWRlVHJpZ2dlcnMgPSBbXTtcbiAgICAgICAgICAgICAgdmFyIHZhbCA9IHNjb3BlLiRldmFsKGF0dHJzW3ByZWZpeCArICdUcmlnZ2VyJ10pO1xuICAgICAgICAgICAgICB1bnJlZ2lzdGVyVHJpZ2dlcnMoKTtcblxuICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc09iamVjdCh2YWwpKSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXModmFsKS5mb3JFYWNoKGZ1bmN0aW9uKGtleSkge1xuICAgICAgICAgICAgICAgICAgc2hvd1RyaWdnZXJzLnB1c2goa2V5KTtcbiAgICAgICAgICAgICAgICAgIGhpZGVUcmlnZ2Vycy5wdXNoKHZhbFtrZXldKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB0cmlnZ2VycyA9IHtcbiAgICAgICAgICAgICAgICAgIHNob3c6IHNob3dUcmlnZ2VycyxcbiAgICAgICAgICAgICAgICAgIGhpZGU6IGhpZGVUcmlnZ2Vyc1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdHJpZ2dlcnMgPSBnZXRUcmlnZ2Vycyh2YWwpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKHRyaWdnZXJzLnNob3cgIT09ICdub25lJykge1xuICAgICAgICAgICAgICAgIHRyaWdnZXJzLnNob3cuZm9yRWFjaChmdW5jdGlvbih0cmlnZ2VyLCBpZHgpIHtcbiAgICAgICAgICAgICAgICAgIGlmICh0cmlnZ2VyID09PSAnb3V0c2lkZUNsaWNrJykge1xuICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm9uKCdjbGljaycsIHRvZ2dsZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9uKCdjbGljaycsIGJvZHlIaWRlVG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0cmlnZ2VyID09PSB0cmlnZ2Vycy5oaWRlW2lkeF0pIHtcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5vbih0cmlnZ2VyLCB0b2dnbGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRyaWdnZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5vbih0cmlnZ2VyLCBzaG93VG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm9uKHRyaWdnZXJzLmhpZGVbaWR4XSwgaGlkZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGVs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BjbG9uZSA9ICRjb21waWxlKHRlbXBsYXRlKShuZXdTY29wZSwgZnVuY3Rpb24oY2xvbmUpIHtcbiAgICAgICAgICAgICAgY2xlYW51cExhc3RJbmNsdWRlQ29udGVudCgpO1xuICAgICAgICAgICAgICAkYW5pbWF0ZS5lbnRlcihjbG9uZSwgZWxlbSk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY3VycmVudFNjb3BlID0gbmV3U2NvcGU7XG4gICAgICAgICAgICBjdXJyZW50RWxlbWVudCA9IGNsb25lO1xuXG4gICAgICAgICAgICBjdXJyZW50U2NvcGUuJGVtaXQoJyRpbmNsdWRlQ29udGVudExvYWRlZCcsIHNyYyk7XG4gICAgICAgICAgfSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBpZiAodGhpc0NoYW5nZUlkID09PSBjaGFuZ2VDb3VudGVyKSB7XG4gICAgICAgICAgICAgIGNsZWFudXBMYXN0SW5jbHVkZUNvbnRlbnQoKTtcbiAgICAgICAgICAgICAgc2NvcGUuJGVtaXQoJyRpbmNsdWRlQ29udGVudEVycm9yJywgc3JjKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgICBzY29wZS4kZW1pdCgnJGluY2x1ZGVDb250ZW50UmVxdWVzdGVkJywgc3JjKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjbGVhbnVwTGFzdEluY2x1ZGVDb250ZW50KCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICBzY29wZS4kb24oJyRkZXN0cm95JywgY2xlYW51cExhc3RJbmNsdWRlQ29udGVudCk7XG4gICAgfVxuICB9O1xufV0pXG5cbi8qKlxuICogTm90ZSB0aGF0IGl0J3MgaW50ZW50aW9uYWwgdGhhdCB0aGVzZSBjbGFzc2VzIGFyZSAqbm90KiBhcHBsaWVkIHRocm91Z2ggJGFuaW1hdGUuXG4gKiBUaGV5IG11c3Qgbm90IGJlIGFuaW1hdGVkIGF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wZS5pbmNyZW1lbnRIb3VycygpO1xuICAgICAgICAgICRzY29wZS4kYXBwbHkoKTtcbiAgICAgICAgfSBlbHNlIGlmIChlLndoaWNoID09PSA0MCkgeyAvLyBkb3duXG4gICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICRzY29wZS5kZWNyZW1lbnRIb3VycygpO1xuICAgICAgICAgICRzY29wZS4kYXBwbHkoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgbWludXRlc0lucHV0RWwub24oJ2tleWRvd24nLCBmdW5jdGlvbihlKSB7XG4gICAgICBpZiAoIWRpc2FibGVkKSB7XG4gICAgICAgIGlmIChlLndoaWNoID09PSAzOCkgeyAvLyB1cFxuICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAkc2NvcGUuaW5jcmVtZW50TWludXRlcygpO1xuICAgICAgICAgICRzY29wZS4kYXBwbHkoKTtcbiAgICAgICAgfSBlbHNlIGlmIChlLndoaWNoID09PSA0MCkgeyAvLyBkb3duXG4gICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICRzY29wZS5kZWNyZW1lbnRNaW51dGVzKCk7XG4gICAgICAgICAgJHNjb3BlLiRhcHBseSgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICBzZWNvbmRzSW5wdXRFbC5vbigna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgIGlmICghZGlzYWJsZWQpIHtcbiAgICAgICAgaWYgKGUud2hpY2ggPT09IDM4KSB7IC8vIHVwXG4gICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICRzY29wZS5pbmNyZW1lbnRTZWNvbmRzKCk7XG4gICAgICAgICAgJHNjb3BlLiRhcHBseSgpO1xuICAgICAgICB9IGVsc2UgaWYgKGUud2hpY2ggPT09IDQwKSB7IC8vIGRvd25cbiAgICAgICAgIC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dXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwb3B1cEF0dHIgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnB1dERhdGVQaWNrZXIuYXR0cihwb3B1cEF0dHJOYW1lc1tpXVsxXSwgcG9wdXBBdHRyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChhdHRycy5lTmdDaGFuZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5wdXREYXRlUGlja2VyLmF0dHIoJ25nLWNoYW5nZScsIGF0dHJzLmVOZ0NoYW5nZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5yZW1vdmVBdHRyKCduZy1jaGFuZ2UnKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoYXR0cnMuZVN0eWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlucHV0RGF0ZVBpY2tlci5hdHRyKCdzdHlsZScsIGF0dHJzLmVTdHlsZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5yZW1vdmVBdHRyKCdzdHlsZScpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBkYXRlT3B0aW9ucyA9IHtcbiAgICAgICAgICAgICAgICAgICAgbWF4RGF0ZTogc2NvcGUuJGV2YWwoYXR0cnMuZU1heERhdGUpIHx8IHVpYkRhdGVwaWNrZXJDb25maWcubWF4RGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgbWluRGF0ZTogc2NvcGUuJGV2YWwoYXR0cnMuZU1pbkRhdGUpIHx8IHVpYkRhdGVwaWNrZXJDb25maWcubWluRGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgc2hvd1dlZWtzOiBhdHRycy5lU2hvd1dlZWtzID8gYXR0cnMuZVNob3dXZWVrcy50b0xvd2VyQ2FzZSgpID09PSAndHJ1ZScgOiB1aWJEYXRlcGlja2VyQ29uZmlnLnNob3dXZWVrcyxcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRpbmdEYXk6IGF0dHJzLmVTdGFydGluZ0RheSB8fCAwLFxuICAgICAgICAgICAgICAgICAgICBpbml0RGF0ZTogc2NvcGUuJGV2YWwoYXR0cnMuZUluaXREYXRlKSB8fCBuZXcgRGF0ZSgpXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIGlmIChhdHRycy5lRGF0ZXBpY2tlck9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVEYXRlcGlja2VyT3B0aW9ucyA9ICRwYXJzZShhdHRycy5lRGF0ZXBpY2tlck9wdGlvbnMpKHNjb3BlKTtcbiAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQoZGF0ZU9wdGlvbnMsIGVEYXRlcGlja2VyT3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgeiA9IGRhdGVPcHRpb25zTmFtZXMubGVuZ3RoIC0gMTsgeiA+PSAwOyB6LS0pIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRvQXR0ciA9IGF0dHJzW2RhdGVPcHRpb25zTmFtZXNbel1bMF1dO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGRvQXR0ciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGVPcHRpb25zW2RhdGVPcHRpb25zTmFtZXNbel1bMV1dID0gZG9BdHRyO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgc2NvcGUuZGF0ZU9wdGlvbnMgPSBkYXRlT3B0aW9ucztcblxuICAgICAgICAgICAgICAgIHZhciBzaG93Q2FsZW5kYXJCdXR0b24gPSBhbmd1bGFyLmlzRGVmaW5lZChhdHRycy5lU2hvd0NhbGVuZGFyQnV0dG9uKSA/IGF0dHJzLmVTaG93Q2FsZW5kYXJCdXR0b24gOiBcInRydWVcIjtcblxuICAgICAgICAgICAgICAgIC8vU2VlIGlmIGNhbGVuZGFyIGJ1dHRvbiBzaG91bGQgYmUgZGlzcGxheWVkXG4gICAgICAgICAgICAgICAgaWYgKHNob3dDYWxlbmRhckJ1dHRvbiA9PT0gXCJ0cnVlXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGJ1dHRvbkRhdGVQaWNrZXIgPSBhbmd1bGFyLmVsZW1lbnQoJzxidXR0b24gdHlwZT1cImJ1dHRvblwiIGNsYXNzPVwiJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGhlbWUuY2FsZW5kYXJCdXR0b25DbGFzcyArICdcIj48aSBjbGFzcz1cIicgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmljb25fc2V0LmNhbGVuZGFyICsgJ1wiPjwvaT48L2J1dHRvbj4nKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGJ1dHRvbldyYXBwZXIgPSBhbmd1bGFyLmVsZW1lbnQoJzxzcGFuIGNsYXNzPVwiJyArIHRoaXMudGhlbWUuYnV0dG9uR3JvdXBBcHBlbmRDbGFzcysgJ1wiPjwvc3Bhbj4nKTtcblxuICAgICAgICAgICAgICAgICAgICBidXR0b25EYXRlUGlja2VyLmF0dHIoJ25nLWNsaWNrJywgYXR0cnMuZU5nQ2xpY2spO1xuXG4gICAgICAgICAgICAgICAgICAgIGJ1dHRvbldyYXBwZXIuYXBwZW5kKGJ1dHRvbkRhdGVQaWNrZXIpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hcHBlbmQoYnV0dG9uV3JhcHBlcik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgLy9JZiB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c3MnLCdpbnB1dC1ncm91cCcpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGF1dG9zdWJtaXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgnY2hhbmdlJywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRmb3JtLiRzdWJtaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9LCA1MDApO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgc2VsZi5pbnB1dEVsLmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vc3VibWl0IG9uIHRhYlxuICAgICAgICAgICAgICAgICAgICBpZiAoZS5rZXlDb2RlID09PSA5ICYmIHNlbGYuZWRpdG9yRWwuYXR0cignYmx1cicpID09PSAnc3VibWl0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kZm9ybS4kc3VibWl0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgIH0pO1xufV0pO1xuXG4vKlxuQW5ndWxhci11aSBib290c3RyYXAgZWRpdGFibGUgdGltZXBpY2tlclxuaHR0cDovL2FuZ3VsYXItdWkuZ2l0aHViLmlvL2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VuZGVyOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQucmVuZGVyLmNhbGwodGhpcyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLmFwcGVuZChlZGl0YWJsZVV0aWxzLnJlbmFtZSgndWktc2VsZWN0LW1hdGNoJywgdGhpcy5hdHRycy4kbWF0Y2hFbGVtZW50KSk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLmFwcGVuZChlZGl0YWJsZVV0aWxzLnJlbmFtZSgndWktc2VsZWN0LWNob2ljZXMnLCB0aGlzLmF0dHJzLiRjaG9pY2VzRWxlbWVudCkpO1xuICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5yZW1vdmVBdHRyKCduZy1tb2RlbCcpO1xuICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hdHRyKCduZy1tb2RlbCcsICckcGFyZW50LiRwYXJlbnQuJGRhdGEnKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhdXRvc3VibWl0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICAgICAgc2VsZi5pbnB1dEVsLmJpbmQoJ2NoYW5nZScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kZm9ybS4kc3VibWl0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSwgNTAwKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIHNlbGYuaW5wdXRFbC5iaW5kKCdrZXlkb3duJywgZnVuY3Rpb24oZSkge1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gICAgICAgICAgaWYgKCRhdHRycy5lTmFtZSkge1xuICAgICAgICAgICAgc2VsZi5zY29wZS4kd2F0Y2goJyRkYXRhJywgZnVuY3Rpb24gKG5ld1ZhbCkge1xuICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRmb3JtLiRkYXRhWyRhdHRycy5lTmFtZV0gPSBuZXdWYWw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBjb250cm9sIGlzIHNob3duLlxuICAgICAgICAgICAqIFNlZSBbZGVtb10oI3NlbGVjdC1yZW1vdGUpLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25zaG93XG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWVsZW1lbnRcbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpZiAoJGF0dHJzLm9uc2hvdykge1xuICAgICAgICAgICAgc2VsZi5vbnNob3cgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBzZWxmLmNhdGNoRXJyb3IoJHBhcnNlKCRhdHRycy5vbnNob3cpKCRzY29wZSkpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBjb250cm9sIGlzIGhpZGRlbiBhZnRlciBib3RoIHNhdmUgb3IgY2FuY2VsLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25oaWRlXG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWVsZW1lbnRcbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpZiAoJGF0dHJzLm9uaGlkZSkge1xuICAgICAgICAgICAgc2VsZi5vbmhpZGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgIHJldHVybiAkcGFyc2UoJGF0dHJzLm9uaGlkZSkoJHNjb3BlKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQ2FsbGVkIHdoZW4gY29udHJvbCBpcyBjYW5jZWxsZWQuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmNhbmNlbFxuICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1lbGVtZW50XG4gICAgICAgICAgICovXG4gICAgICAgICAgaWYgKCRhdHRycy5vbmNhbmNlbCkge1xuICAgICAgICAgICAgc2VsZi5vbmNhbmNlbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgcmV0dXJuICRwYXJzZSgkYXR0cnMub25jYW5jZWwpKCRzY29wZSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIENhbGxlZCBkdXJpbmcgc3VibWl0IGJlZm9yZSB2YWx1ZSBpcyBzYXZlZCB0byBtb2RlbC5cbiAgICAgICAgICAgKiBTZWUgW2RlbW9dKCNvbmJlZm9yZXNhdmUpLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25iZWZvcmVzYXZlXG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWVsZW1lbnRcbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpZiAoJGF0dHJzLm9uYmVmb3Jlc2F2ZSkge1xuICAgICAgICAgICAgc2VsZi5vbmJlZm9yZXNhdmUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBzZWxmLmNhdGNoRXJyb3IoJHBhcnNlKCRhdHRycy5vbmJlZm9yZXNhdmUpKCRzY29wZSkpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9XG5cbiAgICAgICAg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AgICAgIC8qXG4gICAgICAgIENhbGxlZCBhZnRlciBzaG93IHRvIGF0dGFjaCBsaXN0ZW5lcnNcbiAgICAgICAgKi9cbiAgICAgICAgc2VsZi5hZGRMaXN0ZW5lcnMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgLy8gYmluZCBrZXl1cCBmb3IgYGVzY2FwZWBcbiAgICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgna2V5dXAnLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgaWYgKCFzZWxmLnNpbmdsZSkge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIHRvZG86IG1vdmUgdGhpcyB0byBlZGl0YWJsZS1mb3JtIVxuICAgICAgICAgICAgc3dpdGNoIChlLmtleUNvZGUpIHtcbiAgICAgICAgICAgICAgLy8gaGlkZSBvbiBgZXNjYXBlYCBwcmVzc1xuICAgICAgICAgICAgICBjYXNlIDI3OlxuICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uJGNhbmNlbCgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgLy8gYXV0b3N1Ym1pdCB3aGVuIGBubyBidXR0b25zYFxuICAgICAgICAgIGlmIChzZWxmLnNpbmdsZSAmJiBzZWxmLmJ1dHRvbnMgPT09ICdubycpIHtcbiAgICAgICAgICAgIHNlbGYuYXV0b3N1Ym1pdCgpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIGNsaWNrIC0gbWFyayBlbGVtZW50IGFzIGNsaWNrZWQgdG8gZXhjbHVkZSBpbiBkb2N1bWVudCBjbGljayBoYW5kbGVyXG4gICAgICAgICAgc2VsZi5lZGl0b3JFbC5iaW5kKCdjbGljaycsIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAvLyBpZ25vcmUgcmlnaHQvbWlkZGxlIGJ1dHRvbiBjbGlja1xuICAgICAgICAgICAgaWYgKGUud2hpY2ggJiYgZS53aGljaCAhPT0gMSkge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChzZWxmLnNjb3BlLiRmb3JtLiR2aXNpYmxlKSB7XG4gICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uX2NsaWNrZWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuXG4gICAgICAgIC8vIHNldFdhaXRpbmdcbiAgICAgICAgc2VsZi5zZXRXYWl0aW5nID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICAvLyBwYXJ0aWNpcGF0ZSBpbiB3YWl0aW5nIG9ubHkgaWYgbm90IGRpc2FibGVkXG4gICAgICAgICAgICBpbldhaXRpbmcgPSAhc2VsZi5pbnB1dEVsLmF0dHIoJ2Rpc2FibGVkJykgJiZcbiAgICAgICAgICAgICAgIXNlbGYuaW5wdXRFbC5hdHRyKCduZy1kaXNhYmxlZCcpICYmXG4gICAgICAgICAgICAgICFzZWxmLmlucHV0RWwuYXR0cignbmctZW5hYmxlZCcpO1xuICAgICAgICAgICAgaWYgKGluV2FpdGluZykge1xuICAgICAgICAgICAgICBzZWxmLmlucHV0RWwuYXR0cignZGlzYWJsZWQnLCAnZGlzYWJsZWQnKTtcbiAgICAgICAgICAgICAgaWYgKHNlbGYuYnV0dG9uc0VsKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5idXR0b25zRWwuZmluZCgnYnV0dG9uJykuYXR0cignZGlzYWJsZWQnLCAnZGlzYWJsZWQnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoaW5XYWl0aW5nKSB7XG4gICAgICAgICAgICAgIHNlbGYuaW5wdXRFbC5yZW1vdmVBdHRyKCdkaXNhYmxlZCcpO1xuICAgICAgICAgICAgICBpZiAoc2VsZi5idXR0b25zRWwpIHtcbiAgICAgICAgICAgICAgICBzZWxmLmJ1dHRvbnNFbC5maW5kKCdidXR0b24nKS5yZW1vdmVBdHRyKCdkaXNhYmxlZCcpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHNlbGYuYWN0aXZhdGUgPSBmdW5jdGlvbiAoc3RhcnQsIGVuZCkge1xuICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGVsID0gc2VsZi5pbnB1dEVsWzBdO1xuXG4gICAgICAgICAgICBpZiAoZWRpdGFibGVPcHRpb25zLmFjdGl2YXRlID09PSAnZm9jdXMnICYmIGVsLmZvY3VzKSB7XG4gICAgICAgICAgICAgIGlmIChzdGFydCAhPT0gdW5kZWZpbmVkICYmIHN0YXJ0ICE9PSBcIlwiICYmIGVsLnNldFNlbGVjdGlvblJhbmdlKSB7XG4gICAgICAgICAgICAgICAgZW5kID0gZW5kIHx8IHN0YXJ0O1xuICAgICAgICAgICAgICAgIGVsLm9uZm9jdXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFNlbGVjdGlvblJhbmdlKHN0YXJ0LCBlbmQpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgLy9kbyBub3RoaW5nLCB0aGlzIGlucHV0IGRvZXNuJ3Qgc3VwcG9ydCBzZXRTZWxlY3Rpb25SYW5nZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9LmJpbmQodGhpcykpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAoc2VsZi5kaXJlY3RpdmVOYW1lID09ICdlZGl0YWJsZVJhZGlvbGlzdCcgfHwgc2VsZi5kaXJlY3RpdmVOYW1lID09ICdlZGl0YWJsZUNoZWNrbGlzdCcgfHxcbiAgICAgICAgICAgICAgICBzZWxmLmRpcmVjdGl2ZU5hbWUgPT0gJ2VkaXRhYmxlQnNkYXRlJyB8fCBzZWxmLmRpcmVjdGl2ZU5hbWUgPT0gJ2VkaXRhYmxlVGFnc0lucHV0Jykge1xuICAgICAgICAgICAgICAgIC8vU2V0IGZvY3VzIHRvIGZpcnN0IHByaXN0aW5lIGVsZW1lbnQgaW4gdGhlIGxpc3RcbiAgICAgICAgICAgICAgICBlbC5xdWVyeVNlbGVjdG9yKCcubmctcHJpc3RpbmUnKS5mb2N1cygpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGVsLmZvY3VzKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZWRpdGFibGVPcHRpb25zLmFjdGl2YXRlID09PSAnc2VsZWN0Jykge1xuICAgICAgICAgICAgICBpZiAoZWwuc2VsZWN0KSB7XG4gICAgICAgICAgICAgICAgZWwuc2VsZWN0KCk7XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoZWwuZm9jdXMpIHtcbiAgICAgICAgICAgICAgICBlbC5mb2N1cygpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSwgMCk7XG4gICAgICAgIH07XG5cbiAgICAgICAgc2VsZi5zZXRFcnJvciA9IGZ1bmN0aW9uIChtc2cpIHtcbiAgICAgICAgICBpZiAoIWFuZ3VsYXIuaXNPYmplY3QobXNnKSkge1xuICAgICAgICAgICAgJHNjb3BlLiRlcnJvciA9ICRzY2UudHJ1c3RBc0h0bWwobXNnKTtcbiAgICAgICAgICAgIHNlbGYuZXJyb3IgPSBtc2c7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIC8qXG4gICAgICAgIENoZWNrcyB0aGF0IHJlc3VsdCBpcyBzdHJpbmcgb3IgcHJvbWlzZSByZXR1cm5lZCBzdHJpbmcgYW5kIHNob3dzIGl0IGFzIGVycm9yIG1lc3NhZ2VcbiAgICAgICAgQXBwbGllZCB0byBvbnNob3csIG9uYmVmb3Jlc2F2ZSwgb25hZnRlcnNhdmVcbiAgICAgICAgKi9cbiAgICAgICAgc2VsZi5jYXRjaEVycm9yID0gZnVuY3Rpb24gKHJlc3VsdCwgbm9Qcm9taXNlKSB7XG4gICAgICAgICAgaWYgKGFuZ3VsYXIuaXNPYmplY3QocmVzdWx0KSAmJiBub1Byb21pc2UgIT09IHRydWUpIHtcbiAgICAgICAgICAgICRxLndoZW4ocmVzdWx0KS50aGVuKFxuICAgICAgICAgICAgICAvL3N1Y2Nlc3MgYW5kIGZhaWwgaGFuZGxlcnMgYXJlIGVxdWFsXG4gICAgICAgICAgICAgIGFuZ3VsYXIuYmluZCh0aGlzLCBmdW5jdGlvbiAocikge1xuICAgICAgICAgICAgICAgIHRoaXMuY2F0Y2hFcnJvcihyLCB0cnVlKTtcbiAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgIGFuZ3VsYXIuYmluZCh0aGlzLCBmdW5jdGlvbiAocikge1xuICAgICAgICAgICAgICAgIHRoaXMuY2F0Y2hFcnJvcihyLCB0cnVlKTtcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICAvL2NoZWNrICRodHRwIGVycm9yXG4gICAgICAgICAgfSBlbHNlIGlmIChub1Byb21pc2UgJiYgYW5ndWxhci5pc09iamVjdChyZXN1bHQpICYmIHJlc3VsdC5zdGF0dXMg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ybSA9IHRydWU7XG4gICAgICAgICAgfSBlbHNlIGlmIChlbGVtICYmIHR5cGVvZiBlbGVtLnBhcmVudHMgPT09IFwiZnVuY3Rpb25cIiAmJiBlbGVtLnBhcmVudHMoKS5sYXN0KCkuZmluZCgnZm9ybVtuYW1lPVwiJythdHRycy5lRm9ybSsnXCJdJykubGVuZ3RoKSB7IC8vIGZvcm0gZXhpc3RzIGJlbG93IG9yIG5vdCBleGlzdCBhdCBhbGw6IGNoZWNrIGRvY3VtZW50LmZvcm1zXG4gICAgICAgICAgICAvLyBmb3JtIGlzIGJlbG93IGFuZCBub3QgcHJvY2Vzc2VkIHlldFxuICAgICAgICAgICAgZUZvcm1DdHJsID0gbnVsbDtcbiAgICAgICAgICAgIGhhc0Zvcm0gPSB0cnVlO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBmb3JtIGV4aXN0cyBiZWxvdyBvciBub3QgZXhpc3QgYXQgYWxsOiBjaGVjayBkb2N1bWVudC5mb3Jtc1xuICAgICAgICAgICAgZm9yICh2YXIgaT0wOyBpPCRkb2N1bWVudFswXS5mb3Jtcy5sZW5ndGg7aSsrKSB7XG4gICAgICAgICAgICAgIGlmICgkZG9jdW1lbnRbMF0uZm9ybXNbaV0ubmFtZSA9PT0gYXR0cnMuZUZvcm0pIHtcbiAgICAgICAgICAgICAgICAvLyBmb3JtIGlzIGJlbG93IGFuZCBub3QgcHJvY2Vzc2VkIHlldFxuICAgICAgICAgICAgICAgIGVGb3JtQ3RybCA9IG51bGw7XG4gICAgICAgICAgICAgICAgaGFzRm9ybSA9IHRydWU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvKlxuICAgICAgICBpZihoYXNGb3JtICYmICFhdHRycy5lTmFtZSkge1xuICAgICAgICAgIHRocm93ICdZb3Ugc2hvdWxkIHByb3ZpZGUgYG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1bmN0aW9uIChwYXJlbnQsIGNoaWxkKSB7XG4gICAgICAgIGlmIChjaGlsZCA9PT0gcGFyZW50IHx8IChlZGl0YWJsZU9wdGlvbnMuYWN0aXZhdGlvbkV2ZW50ID09PSBcImZvY3VzXCIgJiYgY2hpbGQgPT09IHBhcmVudC5wYXJlbnROb2RlKSkge1xuICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIG5vZGUgPSBjaGlsZC5wYXJlbnROb2RlO1xuXG4gICAgICAgIHdoaWxlIChub2RlICE9PSBudWxsKSB7XG4gICAgICAgICAgaWYgKG5vZGUgPT09IHBhcmVudCkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIG5vZGUgPSBub2RlLnBhcmVudE5vZGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgfTtcblxuICAgICAgLy9DaGVjayBpZiBpdCBpcyBhIHJlYWwgYmx1ciA6IGlmIHRoZSBjbGljayBldmVudCBhcHBlYXIgb24gYSBzaG93biBlZGl0YWJsZSBlbGVtLCB0aGlzIGlzIG5vdCBhIGJsdXIuXG4gICAgICB2YXIgaXNCbHVyID0gZnVuY3Rpb24gKHNob3duLCBldmVudCkge1xuICAgICAgICB2YXIgaXNCbHVyID0gdHJ1ZTtcblxuICAgICAgICB2YXIgZWRpdGFibGVzID0gc2hvd24uJGVkaXRhYmxlcztcbiAgICAgICAgYW5ndWxhci5mb3JFYWNoKGVkaXRhYmxlcywgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICB2YXIgZWxlbWVudCA9IHYuZWRpdG9yRWxbMF07XG4gICAgICAgICAgaWYgKGlzU2VsZk9yRGVzY2VuZGFudChlbGVtZW50LCBldmVudC50YXJnZXQpKVxuICAgICAgICAgICAgaXNCbHVyID0gZmFsc2U7XG5cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiBpc0JsdXI7XG4gICAgICB9O1xuXG4gICAgICB2YXIgY2xpY2tIYW5kbGVyID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgLy8gaWdub3JlIHJpZ2h0L21pZGRsZSBidXR0b24gY2xpY2tcbiAgICAgICAgaWYgKGUud2hpY2ggJiYgZS53aGljaCAhPT0gMSkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciB0b0NhbmNlbCA9IFtdO1xuICAgICAgICB2YXIgdG9TdWJtaXQgPSBbXTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaG93bi5sZW5ndGg7IGkrKykge1xuICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwiaW4gZm9yXCIsIHNob3duW2ldKTtcbiAgICAgICAgICAvLyBleGNsdWRlIGNsaWNrZWRcbiAgICAgICAgICBpZiAoc2hvd25baV0uX2NsaWNrZWQpIHtcbiAgICAgICAgICAgIHNob3duW2ldLl9jbGlja2VkID0gZmFsc2U7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvLyBleGNsdWRlIHdhaXRpbmdcbiAgICAgICAgICBpZiAoc2hvd25baV0uJHdhaXRpbmcpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzaG93bltpXS5fYmx1ciA9PT0gJ2NhbmNlbCcgJiYgaXNCbHVyKHNob3duW2ldLCBlKSkge1xuICAgICAgICAgICAgdG9DYW5jZWwucHVzaChzaG93bltpXSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNob3duW2ldLl9ibHVyID09PSAnc3VibWl0JyAmJiBpc0JsdXIoc2hvd25baV0sIGUpKSB7XG4gICAgICAgICAgICB0b1N1Ym1pdC5wdXNoKHNob3duW2ldKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodG9DYW5jZWwubGVuZ3RoIHx8IHRv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2NvcGUuJGZvcm0pIHtcbiAgICAgICAgICAgIGVkaXRhYmxlLnNjb3BlLiRmb3JtID0gdGhpcztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvL2lmIGZvcm0gYWxyZWFkeSBzaG93biAtIGNhbGwgc2hvdygpIG9mIG5ldyBlZGl0YWJsZVxuICAgICAgICAgIGlmICh0aGlzLiR2aXNpYmxlKSB7XG4gICAgICAgICAgICBlZGl0YWJsZS5jYXRjaEVycm9yKGVkaXRhYmxlLnNob3coKSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGVkaXRhYmxlLmNhdGNoRXJyb3IoZWRpdGFibGUuc2V0V2FpdGluZyh0aGlzLiR3YWl0aW5nKSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgJHJlbW92ZUVkaXRhYmxlOiBmdW5jdGlvbiAoZWRpdGFibGUpIHtcbiAgICAgICAgICAvL2FycmF5UmVtb3ZlXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLiRlZGl0YWJsZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmICh0aGlzLiRlZGl0YWJsZXNbaV0gPT09IGVkaXRhYmxlKSB7XG4gICAgICAgICAgICAgIHRoaXMuJGVkaXRhYmxlcy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFNob3dzIGZvcm0gd2l0aCBlZGl0YWJsZSBjb250cm9scy5cbiAgICAgICAgICpcbiAgICAgICAgICogQG1ldGhvZCAkc2hvdygpXG4gICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAqL1xuICAgICAgICAkc2hvdzogZnVuY3Rpb24gKCkge1xuICAgICAgICAgIGlmICh0aGlzLiR2aXNpYmxlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgIC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gICAgICBzZWxlY3Rpb25FbmQ7XG4gICAgICAgICAgaWYgKHRoaXMuJGVkaXRhYmxlcy5sZW5ndGgpIHtcbiAgICAgICAgICAgIC8vYWN0aXZhdGUgYnkgbmFtZVxuICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNTdHJpbmcobmFtZSkpIHtcbiAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHRoaXMuJGVkaXRhYmxlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLiRlZGl0YWJsZXNbaV0ubmFtZSA9PT0gbmFtZSkge1xuICAgICAgICAgICAgICAgICAgdGhpcy4kZWRpdGFibGVzW2ldLmFjdGl2YXRlKCk7XG4gICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vdHJ5IGFjdGl2YXRlIGVycm9yIGZpZWxkXG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGhpcy4kZWRpdGFibGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIGlmICh0aGlzLiRlZGl0YWJsZXNbaV0uZXJyb3IpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRlZGl0YWJsZXNbaV0uYWN0aXZhdGUoKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuXG4gICAgICAgICAgICAvLyBiaW5kIGNsaWNrIHRvIGJvZHk6IGNhbmNlbHxzdWJtaXR8aWdub3JlIGZvcm1zXG4gICAgICAgICAgICBpZiAodGhpcy4kZWRpdGFibGVzWzBdLmF0dHJzLnVzZW1vdXNlZG93biA9PT0gXCJ0cnVlXCIpIHtcbiAgICAgICAgICAgICAgJGRvY3VtZW50LmJpbmQoJ21vdXNlZG93bicsIGNsaWNrSGFuZGxlcik7XG4gICAgICAgICAgICB9IGVsc2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BzZWxlY3Rpb25FbmQpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogSGlkZXMgZm9ybSB3aXRoIGVkaXRhYmxlIGNvbnRyb2xzIHdpdGhvdXQgc2F2aW5nLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAbWV0aG9kICRoaWRlKClcbiAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICovXG4gICAgICAgICRoaWRlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgaWYgKCF0aGlzLiR2aXNpYmxlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMuJHZpc2libGUgPSBmYWxzZTtcbiAgICAgICAgICAvLyBzZWxmIGhpZGVcbiAgICAgICAgICB0aGlzLiRvbmhpZGUoKTtcbiAgICAgICAgICAvLyBjaGlsZHJlbidzIGhpZGVcbiAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy4kZWRpdGFibGVzLCBmdW5jdGlvbiAoZWRpdGFibGUpIHtcbiAgICAgICAgICAgIGVkaXRhYmxlLmhpZGUoKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIC8vIHJlbW92ZSBmcm9tIGludGVybmFsIGxpc3Qgb2Ygc2hvd24gZm9ybXNcbiAgICAgICAgICBlZGl0YWJsZVV0aWxzLmFycmF5UmVtb3ZlKHNob3duLCB0aGlzKTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogVHJpZ2dlcnMgYG9uY2FuY2VsYCBldmVudCBhbmQgY2FsbHMgYCRoaWRlKClgLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAbWV0aG9kICRjYW5jZWwoKVxuICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgKi9cbiAgICAgICAgJGNhbmNlbDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgIG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hbWUgb2YgZmllbGRcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG1zZyBlcnJvciBtZXNzYWdlXG4gICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAqL1xuICAgICAgICAkc2V0RXJyb3I6IGZ1bmN0aW9uIChuYW1lLCBtc2cpIHtcbiAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy4kZWRpdGFibGVzLCBmdW5jdGlvbiAoZWRpdGFibGUpIHtcbiAgICAgICAgICAgIGlmICghbmFtZSB8fCBlZGl0YWJsZS5uYW1lID09PSBuYW1lKSB7XG4gICAgICAgICAgICAgIGVkaXRhYmxlLnNldEVycm9yKG1zZyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgJHN1Ym1pdDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgIGlmICh0aGlzLiR3YWl0aW5nKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy9jbGVhciBlcnJvcnNcbiAgICAgICAgICB0aGlzLiRzZXRFcnJvcihudWxsLCAnJyk7XG5cbiAgICAgICAgICAvL2NoaWxkcmVuIG9uYmVmb3Jlc2F2ZVxuICAgICAgICAgIHZhciBwYyA9IGVkaXRhYmxlUHJvbWlzZUNvbGxlY3Rpb24oKTtcbiAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy4kZWRpdGFibGVzLCBmdW5jdGlvbiAoZWRpdGFibGUpIHtcbiAgICAgICAgICAgIHBjLndoZW4oZWRpdGFibGUub25iZWZvcmVzYXZlKCkpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgLypcbiAgICAgICAgICBvbmJlZm9yZXNhdmUgcmVzdWx0OlxuICAgICAgICAgIC0gdHJ1ZS91bmRlZmluZWQ6IHNhdmUgZGF0YSBhbmQgY2xvc2UgZm9ybVxuICAgICAgICAgIC0gZmFs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pLFxuICAgICAgICAgICAgb25TdHJpbmc6IGFuZ3VsYXIuYmluZCh0aGlzLCB0aGlzLiRhY3RpdmF0ZSlcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcblxuICAgICAgICAkb25zaG93OiBhbmd1bGFyLm5vb3AsXG4gICAgICAgICRvbmNhbmNlbDogYW5ndWxhci5ub29wLFxuICAgICAgICAkb25oaWRlOiBhbmd1bGFyLm5vb3AsXG4gICAgICAgICRvbmJlZm9yZXNhdmU6IGFuZ3VsYXIubm9vcCxcbiAgICAgICAgJG9uYWZ0ZXJzYXZlOiBhbmd1bGFyLm5vb3BcbiAgICAgIH07XG5cbiAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiBhbmd1bGFyLmV4dGVuZCh7XG4gICAgICAgICAgJGVkaXRhYmxlczogW10sXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogRm9ybSB2aXNpYmlsaXR5IGZsYWcuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAdmFyIHtib29sfSAkdmlzaWJsZVxuICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICovXG4gICAgICAgICAgJHZpc2libGU6IGZhbHNlLFxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEZvcm0gd2FpdGluZyBmbGFnLiBJdCBiZWNvbWVzIGB0cnVlYCB3aGVuIGZvcm0gaXMgbG9hZGluZyBvciBzYXZpbmcgZGF0YS5cbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEB2YXIge2Jvb2x9ICR3YWl0aW5nXG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICAgKi9cbiAgICAgICAgICAkd2FpdGluZzogZmFsc2UsXG4gICAgICAgICAgJGRhdGE6IHt9LFxuICAgICAgICAgIF9jbGlja2VkOiBmYWxzZSxcbiAgICAgICAgICBfYmx1cjogbnVsbFxuICAgICAgIC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VyO1xuICAgICAgICAgICAgdmFyIG5hbWUgPSBmb3JtLiRuYW1lO1xuICAgICAgICAgICAgaWYobmFtZSAmJiBidWYgJiYgYnVmW25hbWVdKSB7XG4gICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChidWZbbmFtZV0sIGZ1bmN0aW9uKGVkaXRhYmxlKSB7XG4gICAgICAgICAgICAgICAgZUZvcm0uJGFkZEVkaXRhYmxlKGVkaXRhYmxlKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGRlbGV0ZSBidWZbbmFtZV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBwb3N0OiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0cnMsIGN0cmwpIHtcbiAgICAgICAgICAgIHZhciBlRm9ybTtcblxuICAgICAgICAgICAgaWYoYXR0cnMuZWRpdGFibGVGb3JtICYmIHNjb3BlW2F0dHJzLmVkaXRhYmxlRm9ybV0gJiYgc2NvcGVbYXR0cnMuZWRpdGFibGVGb3JtXS4kc2hvdykge1xuICAgICAgICAgICAgICBlRm9ybSA9IHNjb3BlW2F0dHJzLmVkaXRhYmxlRm9ybV07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBlRm9ybSA9IGN0cmxbMF07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ2FsbGVkIHdoZW4gZm9ybSBpcyBzaG93bi5cbiAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25zaG93IFxuICAgICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgaWYoYXR0cnMub25zaG93KSB7XG4gICAgICAgICAgICAgIGVGb3JtLiRvbnNob3cgPSBhbmd1bGFyLmJpbmQoZUZvcm0sICRwYXJzZShhdHRycy5vbnNob3cpLCBzY29wZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ2FsbGVkIHdoZW4gZm9ybSBoaWRlcyBhZnRlciBib3RoIHNhdmUgb3IgY2FuY2VsLlxuICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmhpZGUgXG4gICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBpZihhdHRycy5vbmhpZGUpIHtcbiAgICAgICAgICAgICAgZUZvcm0uJG9uaGlkZSA9IGFuZ3VsYXIuYmluZChlRm9ybSwgJHBhcnNlKGF0dHJzLm9uaGlkZSksIHNjb3BlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBmb3JtIGlzIGNhbmNlbGxlZC5cbiAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25jYW5jZWxcbiAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGlmKGF0dHJzLm9uY2FuY2VsKSB7XG4gICAgICAgICAgICAgIGVGb3JtLiRvbmNhbmNlbCA9IGFuZ3VsYXIuYmluZChlRm9ybSwgJHBhcnNlKGF0dHJzLm9uY2FuY2VsKSwgc2NvcGUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIFdoZXRoZXIgZm9ybSBpbml0aWFsbHkgcmVuZGVyZWQgaW4gc2hvd24gc3RhdGUuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQHZhciB7Ym9vbHxhdHRyaWJ1dGV9IHNob3duXG4gICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBpZihhdHRycy5zaG93biAmJiAkcGFyc2UoYXR0cnMuc2hvd24pKHNjb3BlKSkge1xuICAgICAgICAgICAgICBlRm9ybS4kc2hvdygpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEFjdGlvbiB3aGVuIGZvcm0gbG9zc2VzIGZvY3VzLiBWYWx1ZXM6IGBjYW5jZWx8c3VibWl0fGlnbm9yZWAuXG4gICAgICAgICAgICAgKiBEZWZhdWx0IGlzIGBpZ25vcmVgLlxuICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgKiBAdmFyIHtzdHJpbmd8YXR0cmlidXRlfSBibHVyXG4gICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBlRm9ybS5fYmx1ciA9IGF0dHJzLmJsdXIgfHwgZWRpdGFibGVPcHRpb25zLmJsdXJGb3JtO1xuXG4gICAgICAgICAgICAvLyBvbmJlZm9yZXNhdmUsIG9uYWZ0ZXJzYXZlXG4gICAgICAgICAgICBpZighYXR0cnMubmdTdWJtaXQgJiYgIWF0dHJzLnN1Ym1pdCkge1xuICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICogQ2FsbGVkIGFmdGVyIGFsbCBjaGlsZHJlbiBgb25iZWZvcmVzYXZlYCBjYWxsYmFja3MgYnV0IGJlZm9yZSBzYXZpbmcgZm9ybSB2YWx1ZXNcbiAgICAgICAgICAgICAgICogdG8gbW9kZWwuICBcbiAgICAgICAgICAgICAgICogSWYgYXQgbGVhc3Qgb25lIGNoaWxkcmVuIGNhbGxiYWNrIHJldHVybnMgYG5vbi1zdHJpbmdgIC0gaXQgd2lsbCBub3Qgbm90IGJlIGNhbGxlZC4gIFxuICAgICAgICAgICAgICAgKiBTZWUgW2VkaXRhYmxlLWZvcm0gZGVtb10oI2VkaXRhYmxlLWZvcm0pIGZvciBkZXRhaWxzLlxuICAgICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25iZWZvcmVzYXZlXG4gICAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgaWYoYXR0cnMub25iZWZvcmVzYXZlKSB7XG4gICAgICAgICAgICAgICAgZUZvcm0uJG9uYmVmb3Jlc2F2ZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuICRwYXJzZShhdHRycy5vbmJlZm9yZXNhdmUpKHNjb3BlLCB7JGRhdGE6IGVGb3JtLiRkYXRhfSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBmb3JtIHZhbHVlcyBhcmUgc2F2ZWQgdG8gbW9kZWwuICBcbiAgICAgICAgICAgICAgICogU2VlIFtlZGl0YWJsZS1mb3JtIGRlbW9dKCNlZGl0YWJsZS1mb3JtKSBmb3IgZGV0YWlscy5cbiAgICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgICAqIEB2YXIge21ldGhvZHxhdHRyaWJ1dGV9IG9uYWZ0ZXJzYXZlIFxuICAgICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgIGlmKGF0dHJzLm9uYWZ0ZXJzYXZlKSB7XG4gICAgICAgICAgICAgICAgZUZvcm0uJG9uYWZ0ZXJzYXZlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gJHBhcnNlKGF0dHJzLm9uYWZ0ZXJzYXZlKShzY29wZSwgeyRkYXRhOiBlRm9ybS4kZGF0YX0pO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBlbGVtLmJpbmQoJ3N1Ym1pdCcsIGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBlRm9ybS4kc3VibWl0KCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG5cbiAgICAgICAgICAgIC8vIGNsaWNrIC0gbWFyayBmb3JtIGFzIGNsaWNrZWQgdG8gZXhjbHVkZSBpbiBkb2N1bWVudCBjbGljayBoYW5kbGVyXG4gICAgICAgICAgICBlbGVtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24oZSkge1xuICAgICAgICAgICAgICAvLyBpZ25vcmUgcmlnaHQvbWlkZGxlIGJ1dHRvbiBjbGlja1xuICAgICAgICAgICAgICBpZiAoZS53aGljaCAmJiBlLndoaWNoICE9PSAxKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKGVGb3JtLiR2aXNpYmxlKSB7XG4gICAgICAgICAgICAgICAgZUZvcm0uX2NsaWNrZWQgPSB0cnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTsgICBcblxuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICB9O1xufV0pO1xuLyoqXG4gKiBlZGl0YWJsZVByb21pc2VDb2xsZWN0aW9uXG4gKiAgXG4gKiBDb2xsZWN0IHJlc3VsdHMgb2YgZnVuY3Rpb24gY2FsbHMuIFNob3dzIHdhaXRpbmcgaWYgdGhlcmUgYXJlIHByb21pc2VzLiBcbiAqIEZpbmFsbHksIG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WUgfHwgcmVzdWx0ID09PSB1bmRlZmluZWQgfHwgcmVzdWx0ID09PSBudWxsXG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICB9LFxuICAgICAgLy9jYWxsYmFja3M6IG9uVHJ1ZSwgb25GYWxzZSwgb25TdHJpbmdcbiAgICAgIHRoZW46IGZ1bmN0aW9uKGNhbGxiYWNrcykge1xuICAgICAgICBjYWxsYmFja3MgPSBjYWxsYmFja3MgfHwge307XG4gICAgICAgIHZhciBvblRydWUgPSBjYWxsYmFja3Mub25UcnVlIHx8IGFuZ3VsYXIubm9vcDtcbiAgICAgICAgdmFyIG9uRmFsc2UgPSBjYWxsYmFja3Mub25GYWxzZSB8fCBhbmd1bGFyLm5vb3A7XG4gICAgICAgIHZhciBvblN0cmluZyA9IGNhbGxiYWNrcy5vblN0cmluZyB8fCBhbmd1bGFyLm5vb3A7XG4gICAgICAgIHZhciBvbldhaXQgPSBjYWxsYmFja3Mub25XYWl0IHx8IGFuZ3VsYXIubm9vcDtcblxuICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG5cbiAgICAgICAgaWYgKHRoaXMucHJvbWlzZXMubGVuZ3RoKSB7XG4gICAgICAgICAgb25XYWl0KHRydWUpO1xuICAgICAgICAgICRxLmFsbCh0aGlzLnByb21pc2VzKS50aGVuKFxuICAgICAgICAgICAgLy9hbGwgcmVzb2x2ZWQgICAgICAgXG4gICAgICAgICAgICBmdW5jdGlvbihyZXN1bHRzKSB7XG4gICAgICAgICAgICAgIG9uV2FpdChmYWxzZSk7XG4gICAgICAgICAgICAgIC8vY2hlY2sgYWxsIHJlc3VsdHMgdmlhIHNhbWUgYHdoZW5gIG1ldGhvZCAod2l0aG91dCBjaGVja2luZyBwcm9taXNlcylcbiAgICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHJlc3VsdHMsIGZ1bmN0aW9uKHJlc3VsdCkge1xuICAgICAgICAgICAgICAgIHNlbGYud2hlbihyZXN1bHQsIHRydWUpOyAgXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBhcHBseUNhbGxiYWNrKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy9zb21lIHJlamVjdGVkXG4gICAgICAgICAgICBmdW5jdGlvbihlcnJvcikgeyBcbiAgICAgICAgICAgICAgb25XYWl0KGZhbHNlKTtcbiAgICAgICAgICAgICAgb25TdHJpbmcoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYXBwbHlDYWxsYmFjaygpO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gYXBwbHlDYWxsYmFjaygpIHtcbiAgICAgICAgICBpZiAoIXNlbGYuaGFzU3RyaW5nICYmICFzZWxmLmhhc0ZhbHNlKSB7XG4gICAgICAgICAgICBvblRydWUoKTtcbiAgICAgICAgICB9IGVsc2UgaWYgKCFzZWxmLmhhc1N0cmluZyAmJiBzZWxmLmhhc0ZhbHNlKSB7XG4gICAgICAgICAgICBvbkZhbHNlKCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9uU3RyaW5nKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgIH1cbiAgICB9O1xuICB9XG5cbiAgcmV0dXJuIHByb21pc2VDb2xsZWN0aW9uO1xuXG59XSk7XG5cbi8qKlxuICogZWRpdGFibGVVdGlsc1xuICovXG4gYW5ndWxhci5tb2R1bGUoJ3hlZGl0YWJsZScpLmZhY3RvcnkoJ2VkaXRhYmxlVXRpbHMnLCBbZnVuY3Rpb24oKSB7XG4gIHJldHVybiB7XG4gICAgaW5kZXhPZjogZnVuY3Rpb24gKGFycmF5LCBvYmopIHtcbiAgICAgIGlmIChhcnJheS5pbmRleE9mKSByZXR1cm4gYXJyYXkuaW5kZXhPZihvYmopO1xuXG4gICAgICBmb3IgKCB2YXIgaSA9IDA7IGkgPCBhcnJheS5sZW5ndGg7IGk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lzLiR5ZWFyKSB7XG4gICAgICAgIHZhciBtb250aCA9IHBhcnNlSW50KHRoaXMuJG1vbnRoLnZhbCgpLCAxMCk7XG4gICAgICAgIHZhciB5ZWFyID0gcGFyc2VJbnQodGhpcy4keWVhci52YWwoKSwgMTApO1xuXG4gICAgICAgIGlmICghaXNOYU4obW9udGgpICYmICFpc05hTih5ZWFyKSkge1xuICAgICAgICAgIGRheXNDb3VudCA9IG1vbWVudChbeWVhciwgbW9udGhdKS5kYXlzSW5Nb250aCgpO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGZvciAoaSA9IDE7IGkgPD0gZGF5c0NvdW50OyBpKyspIHtcbiAgICAgICAgbmFtZSA9IHR3b0RpZ2l0ID8gdGhpcy5sZWFkWmVybyhpKSA6IGk7XG4gICAgICAgIGl0ZW1zLnB1c2goW2ksIG5hbWVdKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBpdGVtcztcbiAgICB9LFxuICAgIFxuICAgIC8qXG4gICAgZmlsbCBtb250aFxuICAgICovXG4gICAgZmlsbE1vbnRoOiBmdW5jdGlvbigpIHtcbiAgICAgIHZhciBpdGVtcyA9IHRoaXMuZmlsbENvbW1vbignTScpLCBuYW1lLCBpLCBcbiAgICAgIGxvbmdOYW1lcyA9IHRoaXMub3B0aW9ucy50ZW1wbGF0ZS5pbmRleE9mKCdNTU1NJykgIT09IC0xLFxuICAgICAgc2hvcnROYW1lcyA9IHRoaXMub3B0aW9ucy50ZW1wbGF0ZS5pbmRleE9mKCdNTU0nKSAhPT0gLTEsXG4gICAgICB0d29EaWdpdCA9IHRoaXMub3B0aW9ucy50ZW1wbGF0ZS5pbmRleE9mKCdNTScpICE9PSAtMTtcblxuICAgICAgZm9yKGk9MDsgaTw9MTE7IGkrKykge1xuICAgICAgICBpZihsb25nTmFtZXMpIHtcbiAgICAgICAgICAvL3NlZSBodHRwczovL2dpdGh1Yi5jb20vdGltcndvb2QvbW9tZW50anMuY29tL3B1bGwvMzZcbiAgIC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IHJldHVybjsgXG4gICAgICAgICAgfVxuICAgICAgICAgIHZhbHVlc1trXSA9IGR0W3ZbMV1dKCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmKHRoaXMuJGFtcG0pIHtcbiAgICAgICAgICAvLzEyOjAwIHBtIC0tPiAxMjowMCAoMjQtaCBmb3JtYXQsIG1pZGRheSksIDEyOjAwIGFtIC0tPiAwMDowMCAoMjQtaCBmb3JtYXQsIG1pZG5pZ2h0LCBzdGFydCBvZiBkYXkpXG4gICAgICAgICAgaWYodmFsdWVzLmhvdXIgPj0gMTIpIHtcbiAgICAgICAgICAgIHZhbHVlcy5hbXBtID0gJ3BtJztcbiAgICAgICAgICAgIGlmKHZhbHVlcy5ob3VyID4gMTIpIHtcbiAgICAgICAgICAgICAgdmFsdWVzLmhvdXIgLT0gMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlcy5hbXBtID0gJ2FtJztcbiAgICAgICAgICAgIGlmKHZhbHVlcy5ob3VyID09PSAwKSB7XG4gICAgICAgICAgICAgIHZhbHVlcy5ob3VyID0gMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgYW5ndWxhci5mb3JFYWNoKHZhbHVlcywgZnVuY3Rpb24odiwgaykge1xuICAgICAgICAgIC8vY2FsbCB2YWwoKSBmb3IgZWFjaCBleGlzdGluZyBjb21ibywgZS5nLiB0aGlzLiRob3VyLnZhbCgpXG4gICAgICAgICAgaWYodGhhdFsnJCcra10pIHtcblxuICAgICAgICAgICAgaWYoayA9PT0gJ21pbnV0ZScgJiYgdGhhdC5vcHRpb25zLm1pbnV0ZVN0ZXAgPiAxICYmIHRoYXQub3B0aW9ucy5yb3VuZFRpbWUpIHtcbiAgICAgICAgICAgICB2ID0gZ2V0TmVhcmVzdCh0aGF0WyckJytrXSwgdik7XG4gICAgICAgICAgIH1cbiAgICAgICAgICAgXG4gICAgICAgICAgIGlmKGsgPT09ICdzZWNvbmQnICYmIHRoYXQub3B0aW9ucy5zZWNvbmRTdGVwID4gMSAmJiB0aGF0Lm9wdGlvbnMucm91bmRUaW1lKSB7XG4gICAgICAgICAgICAgdiA9IGdldE5lYXJlc3QodGhhdFsnJCcra10sIHYpO1xuICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgXG4gICAgICAgICAgIHRoYXRbJyQnK2tdLnZhbCh2KTtcbiAgICAgICAgIH1cbiAgICAgICB9KTtcblxuICAgICAgICAvLyB1cGRhdGUgZGF5cyBjb3VudFxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLnNtYXJ0RGF5cykge1xuICAgICAgICAgIHRoaXMuZmlsbENvbWJvKCdkYXknKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuJGVsZW1lbnQudmFsKGR0LmZvcm1hdCh0aGlzLm9wdGlvbnMuZm9ybWF0KSkudHJpZ2dlckhhbmRsZXIoJ2NoYW5nZScpO1xuICAgICAgfVxuICAgIH0sXG4gICAgXG4gICAgLypcbiAgICAgaGlnaGxpZ2h0IGNvbWJvcyBpZiBkYXRlIGlzIGludmFsaWRcbiAgICAgKi9cbiAgICAgaGlnaGxpZ2h0OiBmdW5jdGlvbihkdCkge1xuICAgICAgaWYoIWR0LmlzVmFsaWQoKSkge1xuICAgICAgICBpZih0aGlzLm9wdGlvbnMuZXJyb3JDbGFzcykge1xuICAgICAgICAgIHRoaXMuJHdpZGdldC5hZGRDbGFzcyh0aGlzLm9wdGlvbnMuZXJyb3JDbGFzcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy9zdG9yZSBvcmlnaW5hbCBib3JkZXIgY29sb3JcbiAgICAgICAgICBpZighdGhpcy5ib3JkZXJDb2xvcikge1xuICAgICAgICAgICAgdGhpcy5ib3JkZXJDb2xvciA9IHRoaXMuJHdpZGdldC5maW5kKCdzZWxlY3QnKS5jc3MoJ2JvcmRlci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dCc6XG4gICAgICAgICAgICAgIGNhc2UgJ2VkaXRhYmxlU2VsZWN0JzpcbiAgICAgICAgICAgICAgY2FzZSAnZWRpdGFibGVUZXh0YXJlYSc6XG4gICAgICAgICAgICAgIGNhc2UgJ2VkaXRhYmxlRW1haWwnOlxuICAgICAgICAgICAgICBjYXNlICdlZGl0YWJsZVRlbCc6XG4gICAgICAgICAgICAgIGNhc2UgJ2VkaXRhYmxlTnVtYmVyJzpcbiAgICAgICAgICAgICAgY2FzZSAnZWRpdGFibGVVcmwnOlxuICAgICAgICAgICAgICBjYXNlICdlZGl0YWJsZVNlYXJjaCc6XG4gICAgICAgICAgICAgIGNhc2UgJ2VkaXRhYmxlRGF0ZSc6XG4gICAgICAgICAgICAgIGNhc2UgJ2VkaXRhYmxlRGF0ZXRpbWUnOlxuICAgICAgICAgICAgICBjYXNlICdlZGl0YWJsZUJzZGF0ZSc6XG4gICAgICAgICAgICAgIGNhc2UgJ2VkaXRhYmxlVGltZSc6XG4gICAgICAgICAgICAgIGNhc2UgJ2VkaXRhYmxlTW9udGgnOlxuICAgICAgICAgICAgICBjYXNlICdlZGl0YWJsZVdlZWsnOlxuICAgICAgICAgICAgICBjYXNlICdlZGl0YWJsZVBhc3N3b3JkJzpcbiAgICAgICAgICAgICAgY2FzZSAnZWRpdGFibGVEYXRldGltZUxvY2FsJzpcbiAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hZGRDbGFzcygnZm9ybS1jb250cm9sJyk7XG4gICAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwuYXR0cignbmctY2xhc3MnLCBcInsnaXMtaW52YWxpZCc6ICRlcnJvcn1cIik7XG4gICAgICAgICAgICAgICAgICBpZiAodGhpcy50aGVtZS5pbnB1dENsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgLy8gZG9uYHQgYXBwbHkgYGZvcm0tY29udHJvbC1zbWAgYW5kIGBmb3JtLWNvbnRyb2wtbGdgIHRvIHNlbGVjdCBtdWx0aXBsZVxuICAgICAgICAgICAgICAgICAgICAgIC8vIHNob3VsZCBiZSBmaXhlZCBpbiBicyBpdHNlbGYhXG4gICAgICAgICAgICAgICAgICAgICAgaWYodGhpcy5pbnB1dEVsLmF0dHIoJ211bHRpcGxlJykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgKHRoaXMudGhlbWUuaW5wdXRDbGFzcyA9PT0gJ2Zvcm0tY29udHJvbC1zbScgfHwgdGhpcy50aGVtZS5pbnB1dENsYXNzID09PSAnZm9ybS1jb250cm9sLWxnJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hZGRDbGFzcyh0aGlzLnRoZW1lLmlucHV0Q2xhc3MpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGNhc2UgJ2VkaXRhYmxlQ2hlY2tib3gnOlxuICAgICAgICAgICAgICAgICAgdGhpcy5lZGl0b3JFbC5hZGRDbGFzcygnZm9ybS1jaGVjaycpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vYXBwbHkgYnV0dG9uc0NsYXNzIChiczQgc3BlY2lmaWMhKVxuICAgICAgICAgIGlmKHRoaXMuYnV0dG9uc0VsICYmIHRoaXMudGhlbWUuYnV0dG9uc0NsYXNzKSB7XG4gICAgICAgICAgICAgIHRoaXMuYnV0dG9uc0VsLmZpbmQoJ2J1dHRvbicpLmFkZENsYXNzKHRoaXMudGhlbWUuYnV0dG9uc0NsYXNzKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgLy9zZW1hbnRpYy11aVxuICAgICdzZW1hbnRpYyc6IHtcbiAgICAgIGZvcm1UcGw6ICAgICAnPGZvcm0gY2xhc3M9XCJlZGl0YWJsZS13cmFwIHVpIGZvcm1cIiBuZy1jb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ICovXG4gICAgICAgIHZhciBpbnZva2VRdWV1ZSA9IFtdO1xuXG4gICAgICAgIC8qKiBAdHlwZSB7IUFycmF5LjxGdW5jdGlvbj59ICovXG4gICAgICAgIHZhciBjb25maWdCbG9ja3MgPSBbXTtcblxuICAgICAgICAvKiogQHR5cGUgeyFBcnJheS48RnVuY3Rpb24+fSAqL1xuICAgICAgICB2YXIgcnVuQmxvY2tzID0gW107XG5cbiAgICAgICAgdmFyIGNvbmZpZyA9IGludm9rZUxhdGVyKCckaW5qZWN0b3InLCAnaW52b2tlJywgJ3B1c2gnLCBjb25maWdCbG9ja3MpO1xuXG4gICAgICAgIC8qKiBAdHlwZSB7YW5ndWxhci5Nb2R1bGV9ICovXG4gICAgICAgIHZhciBtb2R1bGVJbnN0YW5jZSA9IHtcbiAgICAgICAgICAvLyBQcml2YXRlIHN0YXRlXG4gICAgICAgICAgX2ludm9rZVF1ZXVlOiBpbnZva2VRdWV1ZSxcbiAgICAgICAgICBfY29uZmlnQmxvY2tzOiBjb25maWdCbG9ja3MsXG4gICAgICAgICAgX3J1bkJsb2NrczogcnVuQmxvY2tzLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI2luZm9cbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdD19IGluZm8gSW5mb3JtYXRpb24gYWJvdXQgdGhlIG1vZHVsZVxuICAgICAgICAgICAqIEByZXR1cm5zIHtPYmplY3R8TW9kdWxlfSBUaGUgY3VycmVudCBpbmZvIG9iamVjdCBmb3IgdGhpcyBtb2R1bGUgaWYgY2FsbGVkIGFzIGEgZ2V0dGVyLFxuICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICBvciBgdGhpc2AgaWYgY2FsbGVkIGFzIGEgc2V0dGVyLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogUmVhZCBhbmQgd3JpdGUgY3VzdG9tIGluZm9ybWF0aW9uIGFib3V0IHRoaXMgbW9kdWxlLlxuICAgICAgICAgICAqIEZvciBleGFtcGxlIHlvdSBjb3VsZCBwdXQgdGhlIHZlcnNpb24gb2YgdGhlIG1vZHVsZSBpbiBoZXJlLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogYGBganNcbiAgICAgICAgICAgKiBhbmd1bGFyLm1vZHVsZSgnbXlNb2R1bGUnLCBbXSkuaW5mbyh7IHZlcnNpb246ICcxLjAuMCcgfSk7XG4gICAgICAgICAgICogYGBgXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBUaGUgdmVyc2lvbiBjb3VsZCB0aGVuIGJlIHJlYWQgYmFjayBvdXQgYnkgYWNjZXNzaW5nIHRoZSBtb2R1bGUgZWxzZXdoZXJlOlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogYGBgXG4gICAgICAgICAgICogdmFyIHZlcnNpb24gPSBhbmd1bGFyLm1vZHVsZSgnbXlNb2R1bGUnKS5pbmZvKCkudmVyc2lvbjtcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIFlvdSBjYW4gYWxzbyByZXRyaWV2ZSB0aGlzIGluZm9ybWF0aW9uIGR1cmluZyBydW50aW1lIHZpYSB0aGVcbiAgICAgICAgICAgKiB7QGxpbmsgJGluamVjdG9yI21vZHVsZXMgYCRpbmplY3Rvci5tb2R1bGVzYH0gcHJvcGVydHk6XG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBgYGBqc1xuICAgICAgICAgICAqIHZhciB2ZXJzaW9uID0gJGluamVjdG9yLm1vZHVsZXNbJ215TW9kdWxlJ10uaW5mbygpLnZlcnNpb247XG4gICAgICAgICAgICogYGBgXG4gICAgICAgICAgICovXG4gICAgICAgICAgaW5mbzogZnVuY3Rpb24odmFsdWUpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQodmFsdWUpKSB7XG4gICAgICAgICAgICAgIGlmICghaXNPYmplY3QodmFsdWUpKSB0aHJvdyBuZ01pbkVycignYW9iaicsICdBcmd1bWVudCBcXCd7MH1cXCcgbXVzdCBiZSBhbiBvYmplY3QnLCAndmFsdWUnKTtcbiAgICAgICAgICAgICAgaW5mbyA9IHZhbHVlO1xuICAgICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbmZvO1xuICAgICAgICAgIH0sXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgcHJvcGVydHlcbiAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNyZXF1aXJlc1xuICAgICAgICAgICAqIEBtb2R1bGUgbmdcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIEhvbGRzIHRoZSBsaXN0IG9mIG1vZHVsZXMgd2hpY2ggdGhlIGluamVjdG9yIHdpbGwgbG9hZCBiZWZvcmUgdGhlIGN1cnJlbnQgbW9kdWxlIGlzXG4gICAgICAgICAgICogbG9hZGVkLlxuICAgICAgICAgICAqL1xuICAgICAgICAgIHJlcXVpcmVzOiByZXF1aXJlcyxcblxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEBuZ2RvYyBwcm9wZXJ0eVxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI25hbWVcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBOYW1lIG9mIHRoZSBtb2R1bGUuXG4gICAgICAgICAgICovXG4gICAgICAgICAgbmFtZTogbmFtZSxcblxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAq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k6IGludm9rZUxhdGVyQW5kU2V0TW9kdWxlTmFtZSgnJHByb3ZpZGUnLCAnZmFjdG9yeScpLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI3NlcnZpY2VcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgc2VydmljZSBuYW1lXG4gICAgICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gY29uc3RydWN0b3IgQSBjb25zdHJ1Y3RvciBmdW5jdGlvbiB0aGF0IHdpbGwgYmUgaW5zdGFudGlhdGVkLlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIFNlZSB7QGxpbmsgYXV0by4kcHJvdmlkZSNzZXJ2aWNlICRwcm92aWRlLnNlcnZpY2UoKX0uXG4gICAgICAgICAgICovXG4gICAgICAgICAgc2VydmljZTogaW52b2tlTGF0ZXJBbmRTZXRNb2R1bGVOYW1lKCckcHJvdmlkZScsICdzZXJ2aWNlJyksXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjdmFsdWVcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgc2VydmljZSBuYW1lXG4gICAgICAgICAgICogQHBhcmFtIHsqfSBvYmplY3QgU2VydmljZSBpbnN0YW5jZSBvYmplY3QuXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogU2VlIHtAbGluayBhdXRvLiRwcm92aWRlI3ZhbHVlICRwcm92aWRlLnZhbHVlKCl9LlxuICAgICAgICAgICAqL1xuICAgICAgICAgIHZhbHVlOiBpbnZva2VMYXRlcignJHByb3ZpZGUnLCAndmFsdWUnKSxcblxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNjb25zdGFudFxuICAgICAgICAgICAqIEBtb2R1bGUgbmdcbiAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBjb25zdGFudCBuYW1lXG4gICAgICAgICAgICogQHBhcmFtIHsqfSBvYmplY3QgQ29uc3RhbnQgdmFsdWUuXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogQmVjYXVzZSB0aGUgY29uc3RhbnRzIGFyZSBmaXhlZCwgdGhleSBnZXQgYXBwbGllZCBiZWZvcmUgb3RoZXIgcHJvdmlkZSBtZXRob2RzLlxuICAgICAgICAgICAqIFNlZSB7QGxpbmsgYXV0by4kcHJvdmlkZSNjb25zdGFudCAkcHJvdmlkZS5jb25zdGFudCgpfS5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBjb25zdGFudDogaW52b2tlTGF0ZXIoJyRwcm92aWRlJywgJ2NvbnN0YW50JywgJ3Vuc2hpZnQnKSxcblxuICAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjZGVjb3JhdG9yXG4gICAgICAgICAgICogQG1vZHVsZSBuZ1xuICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBuYW1lIFRoZSBuYW1lIG9mIHRoZSBzZXJ2aWNlIHRvIGRlY29yYXRlLlxuICAgICAgICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IGRlY29yRm4gVGhpcyBmdW5jdGlvbiB3aWxsIGJlIGludm9rZWQgd2hlbiB0aGUgc2VydmljZSBuZWVkcyB0byBiZVxuICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5zdGFudGlhdGVkIGFuZCBzaG91bGQgc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QgZGlyZWN0aXZlcyB0aGF0IHVzZSB0aGlzIHNlcnZpY2UuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBgYGBqc1xuICAgICAgICAgICAqIG1vZHVsZS5hbmltYXRpb24oJy5hbmltYXRpb24tbmFtZScsIGZ1bmN0aW9uKCRpbmplY3QxLCAkaW5qZWN0Mikge1xuICAgICAgICAgICAqICAgcmV0dXJuIHtcbiAgICAgICAgICAgKiAgICAgZXZlbnROYW1lIDogZnVuY3Rpb24oZWxlbWVudCwgZG9uZSkge1xuICAgICAgICAgICAqICAgICAgIC8vY29kZSB0byBydW4gdGhlIGFuaW1hdGlvblxuICAgICAgICAgICAqICAgICAgIC8vb25jZSBjb21wbGV0ZSwgdGhlbiBydW4gZG9uZSgpXG4gICAgICAgICAgICogICAgICAgcmV0dXJuIGZ1bmN0aW9uIGNhbmNlbGxhdGlvbkZ1bmN0aW9uKGVsZW1lbnQpIHtcbiAgICAgICAgICAgKiAgICAgICAgIC8vY29kZSB0byBjYW5jZWwgdGhlIGFuaW1hdGlvblxuICAgICAgICAgICAqICAgICAgIH1cbiAgICAgICAgICAgKiAgICAgfVxuICAgICAgICAgICAqICAgfVxuICAgICAgICAgICAqIH0pXG4gICAgICAgICAgICogYGBgXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBTZWUge0BsaW5rIG5nLiRhbmltYXRlUHJvdmlkZXIjcmVnaXN0ZXIgJGFuaW1hdGVQcm92aWRlci5yZWdpc3RlcigpfSBhbmRcbiAgICAgICAgICAgKiB7QGxpbmsgbmdBbmltYXRlIG5nQW5pbWF0ZSBtb2R1bGV9IGZvciBtb3JlIGluZm9ybWF0aW9uLlxuICAgICAgICAgICAqL1xuICAgICAgICAgIGFuaW1hdGlvbjogaW52b2tlTGF0ZXJBbmRTZXRNb2R1bGVOYW1lKCckYW5pbWF0ZVByb3ZpZGVyJywgJ3JlZ2lzdGVyJyksXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2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MgZG9uZVxuICAgICAgICAgICAqIGxvYWRpbmcgYWxsIG1vZHVsZXMuXG4gICAgICAgICAgICovXG4gICAgICAgICAgcnVuOiBmdW5jdGlvbihibG9jaykge1xuICAgICAgICAgICAgcnVuQmxvY2tzLnB1c2goYmxvY2spO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChjb25maWdGbikge1xuICAgICAgICAgIGNvbmZpZyhjb25maWdGbik7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbW9kdWxlSW5zdGFuY2U7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBwcm92aWRlclxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbWV0aG9kXG4gICAgICAgICAqIEBwYXJhbSB7U3RyaW5nPX0gaW5zZXJ0TWV0aG9kXG4gICAgICAgICAqIEByZXR1cm5zIHthbmd1bGFyLk1vZHVsZX1cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGludm9rZUxhdGVyKHByb3ZpZGVyLCBtZXRob2QsIGluc2VydE1ldGhvZCwgcXVldWUpIHtcbiAgICAgICAgICBpZiAoIXF1ZXVlKSBxdWV1ZSA9IGludm9rZVF1ZXVlO1xuICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHF1ZXVlW2luc2VydE1ldGhvZCB8fCAncHVzaCddKFtwcm92aWRlciwgbWV0aG9kLCBhcmd1bWVudHNdKTtcbiAgICAgICAgICAgIHJldHVybiBtb2R1bGVJbnN0YW5jZTtcbiAgICAgICAgICB9O1xuICAgICAgICB9XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBwcm92aWRlclxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbWV0aG9kXG4gICAgICAgICAqIEByZXR1cm5zIHthbmd1bGFyLk1vZHV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WRlcixcbiAgICAgICAgJHRpbWVvdXQ6ICRUaW1lb3V0UHJvdmlkZXIsXG4gICAgICAgICR3aW5kb3c6ICRXaW5kb3dQcm92aWRlcixcbiAgICAgICAgJCRyQUY6ICQkUkFGUHJvdmlkZXIsXG4gICAgICAgICQkanFMaXRlOiAkJGpxTGl0ZVByb3ZpZGVyLFxuICAgICAgICAkJE1hcDogJCRNYXBQcm92aWRlcixcbiAgICAgICAgJCRjb29raWVSZWFkZXI6ICQkQ29va2llUmVhZGVyUHJvdmlkZXJcbiAgICAgIH0pO1xuICAgIH1cbiAgXSlcbiAgLmluZm8oeyBhbmd1bGFyVmVyc2lvbjogJzEuOC4wJyB9KTtcbn1cblxuLyogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKlxuICogICAgIEFueSBjb21taXRzIHRvIHRoaXMgZmlsZSBzaG91bGQgYmUgcmV2aWV3ZWQgd2l0aCBzZWN1cml0eSBpbiBtaW5kLiAgKlxuICogICBDaGFuZ2VzIHRvIHRoaXMgZmlsZSBjYW4gcG90ZW50aWFsbHkgY3JlYXRlIHNlY3VyaXR5IHZ1bG5lcmFiaWxpdGllcy4gKlxuICogICAgICAgICAgQW4gYXBwcm92YWwgZnJvbSAyIENvcmUgbWVtYmVycyB3aXRoIGhpc3Rvcnkgb2YgbW9kaWZ5aW5nICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBmaWxlIGlzIHJlcXVpcmVkLiAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogIERvZXMgdGhlIGNoYW5nZSBzb21laG93IGFsbG93IGZvciBhcmJpdHJhcnkgamF2YXNjcmlwdCB0byBiZSBleGVjdXRlZD8gKlxuICogICAgT3IgYWxsb3dzIGZvciBzb21lb25lIH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GVyKSxcbiAgICAgICAgICAgIGZhY3Rvcnk6IHN1cHBvcnRPYmplY3QoZmFjdG9yeSksXG4gICAgICAgICAgICBzZXJ2aWNlOiBzdXBwb3J0T2JqZWN0KHNlcnZpY2UpLFxuICAgICAgICAgICAgdmFsdWU6IHN1cHBvcnRPYmplY3QodmFsdWUpLFxuICAgICAgICAgICAgY29uc3RhbnQ6IHN1cHBvcnRPYmplY3QoY29uc3RhbnQpLFxuICAgICAgICAgICAgZGVjb3JhdG9yOiBkZWNvcmF0b3JcbiAgICAgICAgICB9XG4gICAgICB9LFxuICAgICAgcHJvdmlkZXJJbmplY3RvciA9IChwcm92aWRlckNhY2hlLiRpbmplY3RvciA9XG4gICAgICAgICAgY3JlYXRlSW50ZXJuYWxJbmplY3Rvcihwcm92aWRlckNhY2hlLCBmdW5jdGlvbihzZXJ2aWNlTmFtZSwgY2FsbGVyKSB7XG4gICAgICAgICAgICBpZiAoYW5ndWxhci5pc1N0cmluZyhjYWxsZXIpKSB7XG4gICAgICAgICAgICAgIHBhdGgucHVzaChjYWxsZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgJGluamVjdG9yTWluRXJyKCd1bnByJywgJ1Vua25vd24gcHJvdmlkZXI6IHswfScsIHBhdGguam9pbignIDwtICcpKTtcbiAgICAgICAgICB9KSksXG4gICAgICBpbnN0YW5jZUNhY2hlID0ge30sXG4gICAgICBwcm90b0luc3RhbmNlSW5qZWN0b3IgPVxuICAgICAgICAgIGNyZWF0ZUludGVybmFsSW5qZWN0b3IoaW5zdGFuY2VDYWNoZSwgZnVuY3Rpb24oc2VydmljZU5hbWUsIGNhbGxlcikge1xuICAgICAgICAgICAgdmFyIHByb3ZpZGVyID0gcHJvdmlkZXJJbmplY3Rvci5nZXQoc2VydmljZU5hbWUgKyBwcm92aWRlclN1ZmZpeCwgY2FsbGVyKTtcbiAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZUluamVjdG9yLmludm9rZShcbiAgICAgICA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yJyArIHg7XG4gICAgICAgICAgICAgICAgIGlmICgkbG9jYXRpb24uaGFzaCgpICE9PSBuZXdIYXNoKSB7XG4gICAgICAgICAgICAgICAgICAgLy8gc2V0IHRoZSAkbG9jYXRpb24uaGFzaCB0byBgbmV3SGFzaGAgYW5kXG4gICAgICAgICAgICAgICAgICAgLy8gJGFuY2hvclNjcm9sbCB3aWxsIGF1dG9tYXRpY2FsbHkgc2Nyb2xsIHRvIGl0XG4gICAgICAgICAgICAgICAgICAgJGxvY2F0aW9uLmhhc2goJ2FuY2hvcicgKyB4KTtcbiAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAvLyBjYWxsICRhbmNob3JTY3JvbGwoKSBleHBsaWNpdGx5LFxuICAgICAgICAgICAgICAgICAgIC8vIHNpbmNlICRsb2NhdGlvbi5oYXNoIGhhc24ndCBjaGFuZ2VkXG4gICAgICAgICAgICAgICAgICAgJGFuY2hvclNjcm9sbCgpO1xuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgIH1cbiAgICAgICAgICAgXSk7XG4gICAgICAgPC9maWxlPlxuICAgICAgIDxmaWxlIG5hbWU9XCJzdHlsZS5jc3NcIj5cbiAgICAgICAgIGJvZHkge1xuICAgICAgICAgICBwYWRkaW5nLXRvcDogNTBweDtcbiAgICAgICAgIH1cblxuICAgICAgICAgLmFuY2hvciB7XG4gICAgICAgICAgIGJvcmRlcjogMnB4IGRhc2hlZCBEYXJrT3JjaGlkO1xuICAgICAgICAgICBwYWRkaW5nOiAxMHB4IDEwcHggMjAwcHggMTBweDtcbiAgICAgICAgIH1cblxuICAgICAgICAgLmZpeGVkLWhlYWRlciB7XG4gICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMCwgMCwgMCwgMC4yKTtcbiAgICAgICAgICAgaGVpZ2h0OiA1MHB4O1xuICAgICAgICAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgICAg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gICAgICAgIGN0cmwucnVubmVyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZUNsYXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICB0aGlzLnJ1bm5lciA9ICRhbmltYXRlLnJlbW92ZUNsYXNzKCRlbGVtZW50LmZpbmQoJ2RpdicpLCAncmVkJyk7XG4gICAgICAgICAgICAgICAgICB2YXIgY3RybCA9IHRoaXM7XG4gICAgICAgICAgICAgICAgICB0aGlzLnJ1bm5lci5maW5hbGx5KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBjdHJsLnJ1bm5lciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgdGhpcy5jYW5jZWwgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICRhbmltYXRlLmNhbmNlbCh0aGlzLnJ1bm5lcik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgPC9maWxlPlxuICAgICAgICAgIDxmaWxlIG5hbWU9XCJ0ZW1wbGF0ZS5odG1sXCI+XG4gICAgICAgICAgICA8cD5cbiAgICAgICAgICAgICAgPGJ1dHRvbiBpZD1cImFkZFwiIG5nLWNsaWNrPVwiJGN0cmwuYWRkQ2xhc3MoKVwiPkFkZDwvYnV0dG9uPlxuICAgICAgICAgICAgICA8YnV0dG9uIG5nLWNsaWNrPVwiJGN0cmwucmVtb3ZlQ2xhc3MoKVwiPlJlbW92ZTwvYnV0dG9uPlxuICAgICAgICAgICAgICA8YnI+XG4gICAgICAgICAgICAgIDxidXR0b24gaWQ9XCJjYW5jZWxcIiBuZy1jbGljaz1cIiRjdHJsLmNhbmNlbCgpXCIgbmctZGlzYWJsZWQ9XCIhJGN0cmwucnVubmVyXCI+Q2FuY2VsPC9idXR0b24+XG4gICAgICAgICAgICAgIDxicj5cbiAgICAgICAgICAgICAgPGRpdiBpZD1cInRhcmdldFwiPkNTUy1BbmltYXRlZCBUZXh0PC9kaXY+XG4gICAgICAgICAgICA8L3A+XG4gICAgICAgICAgPC9maWxlPlxuICAgICAgICAgIDxmaWxlIG5hbWU9XCJpbmRleC5odG1sXCI+XG4gICAgICAgICAgICA8Y2FuY2VsLWV4YW1wbGU+PC9jYW5jZWwtZXhhbXBsZT5cbiAgICAgICAgICA8L2ZpbGU+XG4gICAgICAgICAgPGZpbGUgbmFtZT1cInN0eWxlLmNzc1wiPlxuICAgICAgICAgICAgLnJlZC1hZGQsIC5yZWQtcmVtb3ZlIHtcbiAgICAgICAgICAgICAgdHJhbnNpdGlvbjogYWxsIDRzIGN1YmljLWJlemllcigwLjI1MCwgMC40NjAsIDAuNDUwLCAwLjk0MCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5yZWQsXG4gICAgICAgICAgICAucmVkLWFkZC5yZWQtYWRkLWFjdGl2ZSB7XG4gICAgICAgICAgICAgIGNvbG9yOiAjRkYwMDAwO1xuICAgICAgICAgICAgICBmb250LXNpemU6IDQwcHg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC5yZWQtcmVtb3ZlLnJlZC1yZW1vdmUtYWN0aXZlIHtcbiAgICAgICAgICAgICAgZm9udC1zaXplOiAxMHB4O1xuICAgICAgICAgICAgICBjb2xvcjogYmxhY2s7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICA8L2ZpbGU+XG4gICAgICAgIDwvZXhhbXBsZT5cbiAgICAgICAqL1xuICAgICAgY2FuY2VsOiBmdW5jdGlvbihydW5uZXIpIHtcbiAgICAgICAgaWYgKHJ1bm5lci5jYW5jZWwpIHtcbiAgICAgICAgICBydW5uZXIuY2FuY2VsKCk7XG4gICAgICAgIH1cbiAgICAgIH0sXG5cbiAgICAgIC8qKlxuICAg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uKSB7XG4gICAgICAgIGlmICgkJGlzRG9jdW1lbnRIaWRkZW4oKSkge1xuICAgICAgICAgIHRpbWVvdXRUaWNrKGZuKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByYWZUaWNrKGZuKTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICAgIHRoaXMuX3N0YXRlID0gMDtcbiAgICB9XG5cbiAgICBBbmltYXRlUnVubmVyLnByb3RvdHlwZSA9IHtcbiAgICAgIHNldEhvc3Q6IGZ1bmN0aW9uKGhvc3QpIHtcbiAgICAgICAgdGhpcy5ob3N0ID0gaG9zdCB8fCB7fTtcbiAgICAgIH0sXG5cbiAgICAgIGRvbmU6IGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgIGlmICh0aGlzLl9zdGF0ZSA9PT0gRE9ORV9DT01QTEVURV9TVEFURSkge1xuICAgICAgICAgIGZuKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdGhpcy5fZG9uZUNhbGxiYWNrcy5wdXNoKGZuKTtcbiAgICAgICAgfVxuICAgICAgfSxcblxuICAgICAgcHJvZ3Jlc3M6IG5vb3AsXG5cbiAgICAgIGdldFByb21pc2U6IGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAoIXRoaXMucHJvbWlzZSkge1xuICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICB0aGlzLnByb21pc2UgPSAkcShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgIHNlbGYuZG9uZShmdW5jdGlvbihzdGF0dXMpIHtcbiAgICAgICAgICAgICAgaWYgKHN0YXR1cyA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICByZWplY3QoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4g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2YWx1ZScpO1xuICAgICAgICogICAgc3VwZXJDYWNoZS5wdXQoJ2Fub3RoZXIga2V5JywgJ2Fub3RoZXIgdmFsdWUnKTtcbiAgICAgICAqXG4gICAgICAgKiAgICBleHBlY3Qoc3VwZXJDYWNoZS5pbmZvKCkpLnRvRXF1YWwoe1xuICAgICAgICogICAgICBpZDogJ3N1cGVyLWNhY2hlJyxcbiAgICAgICAqICAgICAgc2l6ZTogMlxuICAgICAgICogICAgfSk7XG4gICAgICAgKlxuICAgICAgICogICAgc3VwZXJDYWNoZS5yZW1vdmUoJ2Fub3RoZXIga2V5Jyk7XG4gICAgICAgKiAgICBleHBlY3Qoc3VwZXJDYWNoZS5nZXQoJ2Fub3RoZXIga2V5JykpLnRvQmVVbmRlZmluZWQoKTtcbiAgICAgICAqXG4gICAgICAgKiAgICBzdXBlckNhY2hlLnJlbW92ZUFsbCgpO1xuICAgICAgICogICAgZXhwZWN0KHN1cGVyQ2FjaGUuaW5mbygpKS50b0VxdWFsKHtcbiAgICAgICAqICAgICAgaWQ6ICdzdXBlci1jYWNoZScsXG4gICAgICAgKiAgICAgIHNpemU6IDBcbiAgICAgICAqICAgIH0pO1xuICAgICAgICogIH0pKTtcbiAgICAgICAqIGBgYFxuICAgICAgICovXG4gICAgICByZXR1cm4gKGNhY2hlc1tjYWNoZUlkXSA9IHtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI3B1dFxuICAgICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICAgKlxuICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICogSW5zZXJ0cyBhIG5hbWVkIGVudHJ5IGludG8gdGhlIHtAbGluayAkY2FjaGVGYWN0b3J5LkNhY2hlIENhY2hlfSBvYmplY3QgdG8gYmVcbiAgICAgICAgICogcmV0cmlldmVkIGxhdGVyLCBhbmQgaW5jcmVtZW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5XSA9IHZhbHVlO1xuXG4gICAgICAgICAgaWYgKHNpemUgPiBjYXBhY2l0eSkge1xuICAgICAgICAgICAgdGhpcy5yZW1vdmUoc3RhbGVFbmQua2V5KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICogQG5hbWUgJGNhY2hlRmFjdG9yeS5DYWNoZSNnZXRcbiAgICAgICAgICogQGtpbmQgZnVuY3Rpb25cbiAgICAgICAgICpcbiAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAqIFJldHJpZXZlcyBuYW1lZCBkYXRhIHN0b3JlZCBpbiB0aGUge0BsaW5rICRjYWNoZUZhY3RvcnkuQ2FjaGUgQ2FjaGV9IG9iamVjdC5cbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGtleSB0aGUga2V5IG9mIHRoZSBkYXRhIHRvIGJlIHJldHJpZXZlZFxuICAgICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHZhbHVlIHN0b3JlZC5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgaWYgKGNhcGFjaXR5IDwgTnVtYmVyLk1BWF9WQUxVRSkge1xuICAgICAgICAgICAgdmFyIGxydUVudHJ5ID0gbHJ1SGFzaFtrZXldO1xuXG4gICAgICAgICAgICBpZiAoIWxydUVudHJ5KSByZXR1cm47XG5cbiAgICAgICAgICAgIHJlZnJlc2gobHJ1RW50cnkpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBkYXRhW2tleV07XG4gICAgICAgIH0sXG5cblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI3JlbW92ZVxuICAgICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICAgKlxuICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICogUmVtb3ZlcyBhbiBlbnRyeSBmcm9tIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0gb2JqZWN0LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30ga2V5IHRoZSBrZXkgb2YgdGhlIGVudHJ5IHRvIGJlIHJlbW92ZWRcbiAgICAgICAgICovXG4gICAgICAgIHJlbW92ZTogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgaWYgKGNhcGFjaXR5IDwgTnVtYmVyLk1BWF9WQUxVRSkge1xuICAgICAgICAgICAgdmFyIGxydUVudHJ5ID0gbHJ1SGFzaFtrZXldO1xuXG4gICAgICAgICAgICBpZiAoIWxydUVudHJ5KSByZXR1cm47XG5cbiAgICAgICAgICAgIGlmIChscnVFbnRyeSA9PT0gZnJlc2hFbmQpIGZyZXNoRW5kID0gbHJ1RW50cnkucDtcbiAgICAgICAgICAgIGlmIChscnVFbnRyeSA9PT0gc3RhbGVFbmQpIHN0YWxlRW5kID0gbHJ1RW50cnkubjtcbiAgICAgICAgICAgIGxpbmsobHJ1RW50cnkubixscnVFbnRyeS5wKTtcblxuICAgICAgICAgICAgZGVsZXRlIGxydUhhc2hba2V5XTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoIShrZXkgaW4gZGF0YSkpIHJldHVybjtcblxuICAgICAgICAgIGRlbGV0ZSBkYXRhW2tleV07XG4gICAgICAgICAgc2l6ZS0tO1xuICAgICAgICB9LFxuXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICogQG5hbWUgJGNhY2hlRmFjdG9yeS5DYWNoZSNyZW1vdmVBbGxcbiAgICAgICAgICogQGtpbmQgZnVuY3Rpb25cbiAgICAgICAgICpcbiAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAqIENsZWFycyB0aGUgY2FjaGUgb2JqZWN0IG9mIGFueSBlbnRyaWVzLlxuICAgICAgICAgKi9cbiAgICAgICAgcmVtb3ZlQWxsOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBkYXRhID0gY3JlYXRlTWFwKCk7XG4gICAgICAgICAgc2l6ZSA9IDA7XG4gICAgICAgICAgbHJ1SGFzaCA9IGNyZWF0ZU1hcCgpO1xuICAgICAgICAgIGZyZXNoRW5kID0gc3RhbGVFbmQgPSBudWxsO1xuICAgICAgICB9LFxuXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICogQG5hbWUgJGNhY2hlRmFjdG9yeS5DYWNoZSNkZXN0cm95XG4gICAgICAgICAqIEBraW5kIGZ1bmN0aW9uXG4gICAgICAgICAqXG4gICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgKiBEZXN0cm95cyB0aGUge0BsaW5rICRjYWNoZUZhY3RvcnkuQ2FjaGUgQ2FjaGV9IG9iamVjdCBlbnRpcmVseSxcbiAgICAgICAgICogcmVtb3ZpbmcgaXQgZnJvbSB0aGUge0BsaW5rICRjYWNoZUZhY3RvcnkgJGNhY2hlRmFjdG9yeX0gc2V0LlxuICAgICAgICAgKi9cbiAgICAgICAgZGVzdHJveTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgZGF0YSA9IG51bGw7XG4gICAgICAgICAgc3RhdHMgPSBudWxsO1xuICAgICAgICAgIGxydUhhc2ggPSBudWxsO1xuICAgICAgICAgIGRlbGV0ZSBjYWNoZXNbY2FjaGVJZF07XG4gICAgICAgIH0sXG5cblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI2luZm9cbiAgICAgICAgICogQGtpbmQgZnVuY3Rpb25cbiAgICAgICAgICpcbiAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAqIFJldHJpZXZlIGluZm9ybWF0aW9uIHJlZ2FyZGluZyBhIHBhcnRpY3VsYXIge0BsaW5rICRjYWNoZUZhY3RvcnkuQ2FjaGUgQ2FjaGV9LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcmV0dXJucyB7b2JqZWN0fSBhbiBvYmplY3Qgd2l0aCB0aGUgZm9sbG93aW5nIHByb3BlcnRpZXM6XG4gICAgICAgICAqICAgPHVsPlxuICAgICAgICAgKiAgICAgPGxpPioqaWQqKjogdGhlIGlkIG9mIHRoZSBjYWNoZSBpbnN0YW5jZTwvbGk+XG4gICAgICAgICAqICAgICA8bGk+KipzaXplKio6IHRoZSBudW1iZXIgb2YgZW50cmllcyBrZXB0IGluIHRoZSBjYWNoZSBpbnN0YW5jZTwvbGk+XG4gICAgICAgICAqICAgICA8bGk+KiouLi4qKjogYW55IGFkZGl0aW9uYWwgcHJvcGVydGllcyBmcm9tIHRoZSBvcHRpb25zIG9iamVjdCB3aGVuIGNyZWF0aW5nIHRoZVxuICAgICAgICAgKiAgICAgICBjYWNoZS48L2xpPlxuICAgICAgICAgKiAgIDwvdWw+XG4gICAgICAgICAqL1xuICAgICAgICBpbmZvOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICByZXR1cm4gZXh0ZW5kKHt9LCBzdGF0cywge3NpemU6IHNpemV9KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cblxuICAgICAgLyoqXG4gICAgICAgKiBtYWtlcyB0aGUgYGVudHJ5YCB0aGUgZnJlc2hFbmQgb2YgdGhlIExSVSBsaW5rZWQgbGlzdFxuICAgICAgICovXG4gICAgICBmdW5jdGlvbiByZWZyZXNoKGVudHJ5KSB7XG4gICAgICAgIGlmIChlbnRyeSAhPT0gZnJlc2hFbmQpIHtcbiAgICAgICAgICBpZiAoIXN0YWxlRW5kKSB7XG4gICAgICAgICAgICBzdGFsZUVuZCA9IGVudHJ5O1xuIC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ogKiAqICogKiAqICogKiAqICpcbiAqICAgICBBbnkgY29tbWl0cyB0byB0aGlzIGZpbGUgc2hvdWxkIGJlIHJldmlld2VkIHdpdGggc2VjdXJpdHkgaW4gbWluZC4gICpcbiAqICAgQ2hhbmdlcyB0byB0aGlzIGZpbGUgY2FuIHBvdGVudGlhbGx5IGNyZWF0ZSBzZWN1cml0eSB2dWxuZXJhYmlsaXRpZXMuICpcbiAqICAgICAgICAgIEFuIGFwcHJvdmFsIGZyb20gMiBDb3JlIG1lbWJlcnMgd2l0aCBoaXN0b3J5IG9mIG1vZGlmeWluZyAgICAgICpcbiAqICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgZmlsZSBpcyByZXF1aXJlZC4gICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAqICBEb2VzIHRoZSBjaGFuZ2Ugc29tZWhvdyBhbGxvdyBmb3IgYXJiaXRyYXJ5IGphdmFzY3JpcHQgdG8gYmUgZXhlY3V0ZWQ/ICpcbiAqICAgIE9yIGFsbG93cyBmb3Igc29tZW9uZSB0byBjaGFuZ2UgdGhlIHByb3RvdHlwZSBvZiBidWlsdC1pbiBvYmplY3RzPyAgICpcbiAqICAgICBPciBnaXZlcyB1bmRlc2lyZWQgYWNjZXNzIHRvIHZhcmlhYmxlcyBsaWtlIGRvY3VtZW50IG9yIHdpbmRvdz8gICAgKlxuICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKi9cblxuLyogISBWQVJJQUJMRS9GVU5DVElPTiBOQU1JTkcgQ09OVkVOVElPTlMgVEhBVCBBUFBMWSBUTyBUSElTIEZJTEUhXG4gKlxuICogRE9NLXJlbGF0ZWQgdmFyaWFibGVzOlxuICpcbiAqIC0gXCJub2RlXCIgLSBET00gTm9kZVxuICog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24oKSB7XG4gKiAgICAgICAgICAgdGhpcy5kYXRlID0gbmV3IERhdGUoKTtcbiAqICAgICAgICAgICB0aGlzLm1vbnRoID0gdGhpcy5kYXRlLmdldE1vbnRoKCk7XG4gKiAgICAgICAgICAgdGhpcy51cGRhdGVEYXRlID0gZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICAgICB0aGlzLmRhdGUuc2V0TW9udGgodGhpcy5tb250aCk7XG4gKiAgICAgICAgICAgfTtcbiAqICAgICAgICAgfVxuICogICAgICAgfSlcbiAqICAgICAgIC5jb21wb25lbnQoJ3Rlc3QnLCB7XG4gKiAgICAgICAgIGJpbmRpbmdzOiB7IGRhdGU6ICc8JyB9LFxuICogICAgICAgICB0ZW1wbGF0ZTpcbiAqICAgICAgICAgICAnPHByZT57eyAkY3RybC5sb2cgfCBqc29uIH19PC9wcmU+JyxcbiAqICAgICAgICAgY29udHJvbGxlcjogZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICAgdmFyIHByZXZpb3VzVmFsdWU7XG4gKiAgICAgICAgICAgdGhpcy5sb2cgPSBbXTtcbiAqICAgICAgICAgICB0aGlzLiRkb0NoZWNrID0gZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICAgICB2YXIgY3VycmVudFZhbHVlID0gdGhpcy5kYXRlICYmIHRoaXMuZGF0ZS52YWx1ZU9mKCk7XG4gKiAgICAgICAgICAgICBpZiAocHJldmlvdXNWYWx1ZSAhPT0gY3VycmVudFZhbHVlKSB7XG4gKiAgICAgICAgICAgICAgIHRoaXMubG9nLnB1c2goJ2RvQ2hlY2s6IGRhdGUgbXV0YXRlZDogJyArIHRoaXMuZGF0ZSk7XG4gKiAgICAgICAgICAgICAgIHByZXZpb3VzVmFsdWUgPSBjdXJyZW50VmFsdWU7XG4gKiAgICAgICAgICAgICB9XG4gKiAgICAgICAgICAgfTtcbiAqICAgICAgICAgfVxuICogICAgICAgfSk7XG4gKiAgIDwvZmlsZT5cbiAqICAgPGZpbGUgbmFtZT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VsZSgnZG8tY2hlY2stbW9kdWxlJywgW10pXG4gKiAgICAgICAgLmNvbXBvbmVudCgndGVzdCcsIHtcbiAqICAgICAgICAgIGJpbmRpbmdzOiB7IGl0ZW1zOiAnPCcgfSxcbiAqICAgICAgICAgIHRlbXBsYXRlOlxuICogICAgICAgICAgICAnPHByZT57eyAkY3RybC5sb2cgfCBqc29uIH19PC9wcmU+JyxcbiAqICAgICAgICAgIGNvbnRyb2xsZXI6IGZ1bmN0aW9uKCkge1xuICogICAgICAgICAgICB0aGlzLmxvZyA9IFtdO1xuICpcbiAqICAgICAgICAgICAgdGhpcy4kZG9DaGVjayA9IGZ1bmN0aW9uKCkge1xuICogICAgICAgICAgICAgIGlmICh0aGlzLml0ZW1zX3JlZiAhPT0gdGhpcy5pdGVtcykge1xuICogICAgICAgICAgICAgICAgdGhpcy5sb2cucHVzaCgnZG9DaGVjazogaXRlbXMgY2hhbmdlZCcpO1xuICogICAgICAgICAgICAgICAgdGhpcy5pdGVtc19yZWYgPSB0aGlzLml0ZW1zO1xuICogICAgICAgICAgICAgIH1cbiAqICAgICAgICAgICAgICBpZiAoIWFuZ3VsYXIuZXF1YWxzKHRoaXMuaXRlbXNfY2xvbmUsIHRoaXMuaXRlbXMpKSB7XG4gKiAgICAgICAgICAgICAgICB0aGlzLmxvZy5wdXNoKCdkb0NoZWNrOiBpdGVtcyBtdXRhdGVkJyk7XG4gKiAgICAgICAgICAgICAgICB0aGlzLml0ZW1zX2Nsb25lID0gYW5ndWxhci5jb3B5KHRoaXMuaXRlbXMpO1xuICogICAgICAgICAgICAgIH1cbiAqICAgICAgICAgICAgfTtcbiAqICAgICAgICAgIH1cbiAqICAgICAgICB9KTtcbiAqICAgPC9maWxlPlxuICogPC9leGFtcGxlPlxuICpcbiAqXG4gKiAjIyMgRGlyZWN0aXZlIERlZmluaXRpb24gT2JqZWN0XG4gKlxuICogVGhlIGRpcmVjdGl2ZSBkZWZpbml0aW9uIG9iamVjdCBwcm92aWRlcyBpbn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xuICAgICAgJGVsZW1lbnQuZGF0YShkYXRhTmFtZSwgc2NvcGUpO1xuICAgIH0gOiBub29wO1xuXG4gICAgY29tcGlsZS4kJGFkZFNjb3BlQ2xhc3MgPSBkZWJ1Z0luZm9FbmFibGVkID8gZnVuY3Rpb24gJCRhZGRTY29wZUNsYXNzKCRlbGVtZW50LCBpc29sYXRlZCkge1xuICAgICAgc2FmZUFkZENsYXNzKCRlbGVtZW50LCBpc29sYXRlZCA/ICduZy1pc29sYXRlLXNjb3BlJyA6ICduZy1zY29wZScpO1xuICAgIH0gOiBub29wO1xuXG4gICAgY29tcGlsZS4kJGNyZWF0ZUNvbW1lbnQgPSBmdW5jdGlvbihkaXJlY3RpdmVOYW1lLCBjb21tZW50KSB7XG4gICAgICB2YXIgY29udGVudCA9ICcnO1xuICAgICAgaWYgKGRlYnVnSW5mb0VuYWJsZWQpIHtcbiAgICAgICAgY29udGVudCA9ICcgJyArIChkaXJlY3RpdmVOYW1lIHx8ICcnKSArICc6ICc7XG4gICAgICAgIGlmIChjb21tZW50KSBjb250ZW50ICs9IGNvbW1lbnQgKyAnICc7XG4gICAgICB9XG4gICAgICByZXR1cm4gd2luZG93LmRvY3VtZW50LmNyZWF0ZUNvbW1lbnQoY29udGVudCk7XG4gICAgfTtcblxuICAgIHJldHVybiBjb21waWxlO1xuXG4gICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gICAgZnVuY3Rpb24gY29tcGlsZSgkY29tcGlsZU5vZGVzLCB0cmFuc2NsdWRlRm4sIG1heFByaW9yaXR5LCBpZ25vcmVEaXJlY3RpdmUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91c0NvbXBpbGVDb250ZXh0KSB7XG4gICAgICBpZiAoISgkY29tcGlsZU5vZGVzIGluc3RhbmNlb2YganFMaXRlKSkge1xuICAgICAgICAvLyBqcXVlcnkgYWx3YXlzIHJld3JhcHMsIHdoZXJlYXMgd2UgbmVlZCB0byBwcmVzZXJ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aXJlY3RpdmUpO1xuXG4gICAgICAgIG5vZGVMaW5rRm4gPSAoZGlyZWN0aXZlcy5sZW5ndGgpXG4gICAgICAgICAgICA/IGFwcGx5RGlyZWN0aXZlc1RvTm9kZShkaXJlY3RpdmVzLCBub2RlTGlzdFtpXSwgYXR0cnMsIHRyYW5zY2x1ZGVGbiwgJHJvb3RFbGVtZW50LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBbXSwgW10sIHByZXZpb3VzQ29tcGlsZUNvbnRleHQpXG4gICAgICAgICAgICA6IG51bGw7XG5cbiAgICAgICAgaWYgKG5vZGVMaW5rRm4gJiYgbm9kZUxpbmtGbi5zY29wZSkge1xuICAgICAgICAgIGNvbXBpbGUuJCRhZGRTY29wZUNsYXNzKGF0dHJzLiQkZWxlbWVudCk7XG4gICAgICAgIH1cblxuICAgICAgICBjaGlsZExpbmtGbiA9IChub2RlTGlua0ZuICYmIG5vZGVMaW5rRm4udGVybWluYWwgfHxcbiAgICAgICAgICAgICAgICAgICAgICAhKGNoaWxkTm9kZXMgPSBub2RlTGlzdFtpXS5jaGlsZE5vZGVzKSB8fFxuICAgICAgICAgICAgICAgICAgICAgICFjaGlsZE5vZGVzLmxlbmd0aClcbiAgICAgICAgICAgID8gbnVsbFxuICAgICAgICAgICAgOiBjb21waWxlTm9kZXMoY2hpbGROb2RlcyxcbiAgICAgICAgICAgICAgICAgbm9kZUxpbmtGbiA/IChcbiAgICAgICAgICAgICAgICAgIChub2RlTGlua0ZuLnRyYW5zY2x1ZGVPblRoaXNFbGVtZW50IHx8ICFub2RlTGlua0ZuLnRlbXBsYXRlT25UaGlzRWxlbWVudClcbiAgICAgICAgICAgICAgICAgICAgICYmIG5vZGVMaW5rRm4udHJhbnNjbHVkZSkgOiB0cmFuc2NsdWRlRm4pO1xuXG4gICAgICAgIGlmIChub2RlTGlua0ZuIHx8IGNoaWxkTGlua0ZuKSB7XG4gICAgICAgICAgbGlua0Zucy5wdXNoKG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XNcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uIGl0LlxuICAgICAqIEBwYXJhbSB7T2JqZWN0PX0gb3JpZ2luYWxSZXBsYWNlRGlyZWN0aXZlIEFuIG9wdGlvbmFsIGRpcmVjdGl2ZSB0aGF0IHdpbGwgYmUgaWdub3JlZCB3aGVuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcGlsaW5nIHRoZSB0cmFuc2NsdXNpb24uXG4gICAgICogQHBhcmFtIHtBcnJheS48RnVuY3Rpb24+fSBwcmVMaW5rRm5zXG4gICAgICogQHBhcmFtIHtBcnJheS48RnVuY3Rpb24+fSBwb3N0TGlua0Zuc1xuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBwcmV2aW91c0NvbXBpbGVDb250ZXh0IENvbnRleHQgdXNlZCBmb3IgcHJldmlvdXMgY29tcGlsYXRpb24gb2YgdGhlIGN1cnJlbnRcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlXG4gICAgICogQHJldHVybnMge0Z1bmN0aW9ufSBsaW5rRm5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBhcHBseURpcmVjdGl2ZXNUb05vZGUoZGlyZWN0aXZlcywgY29tcGlsZU5vZGUsIHRlbXBsYXRlQXR0cnMsIHRyYW5zY2x1ZGVGbixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganFDb2xsZWN0aW9uLCBvcmlnaW5hbFJlcGxhY2VEaXJlY3RpdmUsIHByZUxpbmtGbnMsIHBvc3RMaW5rRm5zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91c0NvbXBpbGVDb250ZXh0KSB7XG4gICAgICBwcmV2aW91c0NvbXBpbGVDb250ZXh0ID0gcHJldmlvdXNDb21waWxlQ29udGV4dCB8fCB7fTtcblxuICAgICAgdmFyIHRlcm1pbmFsUHJpb3JpdHkg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UgPT09ICdlbGVtZW50Jykge1xuICAgICAgICAgICAgaGFzRWxlbWVudFRyYW5zY2x1ZGVEaXJlY3RpdmUgPSB0cnVlO1xuICAgICAgICAgICAgdGVybWluYWxQcmlvcml0eSA9IGRpcmVjdGl2ZS5wcmlvcml0eTtcbiAgICAgICAgICAgICR0ZW1wbGF0ZSA9ICRjb21waWxlTm9kZTtcbiAgICAgICAgICAgICRjb21waWxlTm9kZSA9IHRlbXBsYXRlQXR0cnMuJCRlbGVtZW50ID1cbiAgICAgICAgICAgICAgICBqcUxpdGUoY29tcGlsZS4kJGNyZWF0ZUNvbW1lbnQoZGlyZWN0aXZlTmFtZSwgdGVtcGxhdGVBdHRyc1tkaXJlY3RpdmVOYW1lXSkpO1xuICAgICAgICAgICAgY29tcGlsZU5vZGUgPSAkY29tcGlsZU5vZGVbMF07XG4gICAgICAgICAgICByZXBsYWNlV2l0aChqcUNvbGxlY3Rpb24sIHNsaWNlQXJncygkdGVtcGxhdGUpLCBjb21waWxlTm9kZSk7XG5cbiAgICAgICAgICAgIGNoaWxkVHJhbnNjbHVkZUZuID0gY29tcGlsYXRpb25HZW5lcmF0b3IobWlnaHRIYXZlTXVsdGlwbGVUcmFuc2NsdXNpb25FcnJvciwgJHRlbXBsYXRlLCB0cmFuc2NsdWRlRm4sIHRlcm1pbmFsUHJpb3JpdHksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGFjZURpcmVjdGl2ZSAmJiByZXBsYWNlRGlyZWN0aXZlLm5hbWUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IHBhc3MgaW46XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAtIGNvbnRyb2xsZXJEaXJlY3RpdmVzIC0gb3RoZXJ3aXNlIHdlJ2xsIGNyZWF0ZSBkdXBsaWNhdGVzIGNvbnRyb2xsZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAtIG5ld0lzb2xhdGVTY29wZURpcmVjdGl2ZSBvciB0ZW1wbGF0ZURpcmVjdGl2ZSAtIGNvbWJpbmluZyB0ZW1wbGF0ZXMgd2l0aFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICBlbGVtZW50IHRyYW5zY2x1c2lvbiBkb2Vzbid0IG1ha2Ugc2Vuc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgbmVlZCBvbmx5IG5vblRsYlRyYW5zY2x1ZGVEaXJlY3RpdmUgc28gdGhhdCB3ZSBwcmV2ZW50IHB1dHRpbmcgdHJhbnNjbHVzaW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiB0aGUgc2FtZSBlbGVtZW50IG1vcmUgdGhhbiBvbmNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9uVGxiVHJhbnNjbHVkZURpcmVjdGl2ZTogbm9uVGxiVHJhbnNjbHVkZURpcmVjdGl2ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgIHZhciBzbG90cyA9IGNyZWF0ZU1hcCgpO1xuXG4gICAgICAgICAgICBpZiAoIWlzT2JqZWN0KGRpcmVjdGl2ZVZhbHVlKSkge1xuICAgICAgICAgICAgICAkdGVtcGxhdGUgPSBqcUxpdGUoanFMaXRlQ2xvbmUoY29tcGlsZU5vZGUpKS5jb250ZW50cygpO1xuICAgICAgICAgICAgfSBlbHNlIHtcblxuICAgICAgICAgICAgICAvLyBXZSBoYXZlIHRyYW5zY2x1c2lvbiBzbG90cyxcbiAgICAgICAgICAgICAgLy8gY29sbGVjdCB0aG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GVEaXJlY3RpdmUpO1xuICAgICAgICAgIGlmIChzY29wZUJpbmRpbmdJbmZvLnJlbW92ZVdhdGNoZXMpIHtcbiAgICAgICAgICAgIGlzb2xhdGVTY29wZS4kb24oJyRkZXN0cm95Jywgc2NvcGVCaW5kaW5nSW5mby5yZW1vdmVXYXRjaGVzKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBJbml0aWFsaXplIGJpbmRUb0NvbnRyb2xsZXIgYmluZGluZ3NcbiAgICAgICAgZm9yICh2YXIgbmFtZSBpbiBlbGVtZW50Q29udHJvbGxlcnMpIHtcbiAgICAgICAgICB2YXIgY29udHJvbGxlckRpcmVjdGl2ZSA9IGNvbnRyb2xsZXJEaXJlY3RpdmVzW25hbWVdO1xuICAgICAgICAgIHZhciBjb250cm9sbGVyID0gZWxlbWVudENvbnRyb2xsZXJzW25hbWVdO1xuICAgICAgICAgIHZhciBiaW5kaW5ncyA9IGNvbnRyb2xsZXJEaXJlY3RpdmUuJCRiaW5kaW5ncy5iaW5kVG9Db250cm9sbGVyO1xuXG4gICAgICAgICAgY29udHJvbGxlci5pbnN0YW5jZSA9IGNvbnRyb2xsZXIoKTtcbiAgICAgICAgICAkZWxlbWVudC5kYXRhKCckJyArIGNvbnRyb2xsZXJEaXJlY3RpdmUubmFtZSArICdDb250cm9sbGVyJywgY29udHJvbGxlci5pbnN0YW5jZSk7XG4gICAgICAgICAgY29udHJvbGxlci5iaW5kaW5nSW5mbyA9XG4gICAgICAgICAgICBpbml0aWFsaXplRGlyZWN0aXZlQmluZGluZ3MoY29udHJvbGxlclNjb3BlLCBhdHRycywgY29udHJvbGxlci5pbnN0YW5jZSwgYmluZGluZ3MsIGNvbnRyb2xsZXJEaXJlY3RpdmUpO1xuICAgICAgICAgIH1cblxuICAgICAgICAvLyBCaW5kIHRoZSByZXF1aXJlZCBjb250cm9sbGVycyB0byB0aGUgY29udHJvbGxlciwgaWYgYHJlcXVpcmVgIGlzIGFuIG9iamV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ZGxlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzRnVuY3Rpb24oY29udHJvbGxlckluc3RhbmNlLiRvbkluaXQpKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBjb250cm9sbGVySW5zdGFuY2UuJG9uSW5pdCgpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzRnVuY3Rpb24oY29udHJvbGxlckluc3RhbmNlLiRkb0NoZWNrKSkge1xuICAgICAgICAgICAgY29udHJvbGxlclNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHsgY29udHJvbGxlckluc3RhbmNlLiRkb0NoZWNrKCk7IH0pO1xuICAgICAgICAgICAgY29udHJvbGxlckluc3RhbmNlLiRkb0NoZWNrKCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc0Z1bmN0aW9uKGNvbnRyb2xsZXJJbnN0YW5jZS4kb25EZXN0cm95KSkge1xuICAgICAgICAgICAgY29udHJvbGxlclNjb3BlLiRvbignJGRlc3Ryb3knLCBmdW5jdGlvbiBjYWxsT25EZXN0cm95SG9vaygpIHtcbiAgICAgICAgICAgICAgY29udHJvbGxlckluc3RhbmNlLiRvbkRlc3Ryb3koKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gUFJFTElOS0lOR1xuICAgICAgICBmb3IgKGkgPSAwLCBpaSA9IHByZUxpbmtGbnMubGVuZ3RoOyBpIDwgaWk7IGkrKykge1xuICAgICAgICAgIGxpbmtGbiA9IHByZUxpbmtGbnNbaV07XG4gICAgICAgICAgaW52b2tlTGlua0ZuKGxpbmtGbixcbiAgICAgICAgICAgICAgbGlua0ZuLmlzb2xhdGVTY29wZSA/IGlzb2x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zLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7XG4gICAgICAgICAgbGlua0ZuID0gcG9zdExpbmtGbnNbaV07XG4gICAgICAgICAgaW52b2tlTGlua0ZuKGxpbmtGbixcbiAgICAgICAgICAgICAgbGlua0ZuLmlzb2xhdGVTY29wZSA/IGlzb2xhdGVTY29wZSA6IHNjb3BlLFxuICAgICAgICAgICAgICAkZWxlbWVudCxcbiAgICAgICAgICAgICAgYXR0cnMsXG4gICAgICAgICAgICAgIGxpbmtGbi5yZXF1aXJlICYmIGdldENvbnRyb2xsZXJzKGxpbmtGbi5kaXJlY3RpdmVOYW1lLCBsaW5rRm4ucmVxdWlyZSwgJGVsZW1lbnQsIGVsZW1lbnRDb250cm9sbGVycyksXG4gICAgICAgICAgICAgIHRyYW5zY2x1ZGVGblxuICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBUcmlnZ2VyICRwb3N0TGluayBsaWZlY3ljbGUgaG9va3NcbiAgICAgICAgZm9yRWFjaChlbGVtZW50Q29udHJvbGxlcnMsIGZ1bmN0aW9uKGNvbnRyb2xsZXIpIHtcbiAgICAgICAgICB2YXIgY29udHJvbGxlckluc3RhbmNlID0gY29udHJvbGxlci5pbnN0YW5jZTtcbiAgICAgICAgICBpZiAoaXNGdW5jdGlvbihjb250cm9sbGVySW5zdGFuY2UuJHBvc3RMaW5rKSkge1xuICAgICAgICAgICAgY29udHJvbGxlckluc3RhbmNlLiRwb3N0TGluaygpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gVGhpcyBpcyB0aGUgZnVuY3Rpb24gdGhhdCBpcyBpbmplY3RlZCBhcyBgJHRyYW5zY2x1ZGVgLlxuICAgICAgICAvLyBOb3RlOiBhbGwgYXJndW1lbnRzIGFyZSBvcHRpb25hbCFcbiAgICAgICAgZnVuY3Rpb24gY29udHJvbGxlcnNCb3VuZFRyYW5zY2x1ZGUoc2NvcGUsIGNsb25lQXR0YWN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ZSwgbmV3Tm9kZSkge1xuICAgICAgdmFyIGZpcnN0RWxlbWVudFRvUmVtb3ZlID0gZWxlbWVudHNUb1JlbW92ZVswXSxcbiAgICAgICAgICByZW1vdmVDb3VudCA9IGVsZW1lbnRzVG9SZW1vdmUubGVuZ3RoLFxuICAgICAgICAgIHBhcmVudCA9IGZpcnN0RWxlbWVudFRvUmVtb3ZlLnBhcmVudE5vZGUsXG4gICAgICAgICAgaSwgaWk7XG5cbiAgICAgIGlmICgkcm9vdEVsZW1lbnQpIHtcbiAgICAgICAgZm9yIChpID0gMCwgaWkgPSAkcm9vdEVsZW1lbnQubGVuZ3RoOyBpIDwgaWk7IGkrKykge1xuICAgICAgICAgIGlmICgkcm9vdEVsZW1lbnRbaV0gPT09IGZpcnN0RWxlbWVudFRvUmVtb3ZlKSB7XG4gICAgICAgICAgICAkcm9vdEVsZW1lbnRbaSsrXSA9IG5ld05vZGU7XG4gICAgICAgICAgICBmb3IgKHZhciBqID0gaSwgajIgPSBqICsgcmVtb3ZlQ291bnQgLSAxLFxuICAgICAgICAgICAgICAgICAgICAgamogPSAkcm9vdEVsZW1lbnQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICBqIDwgamo7IGorKywgajIrKykge1xuICAgICAgICAgICAgICBpZiAoajIgPCBqaikge1xuICAgICAgICAgICAgICAgICRyb290RWxlbWVudFtqXSA9ICRyb290RWxlbWVudFtqMl07XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlICRyb290RWxlbWVudFtqXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJHJvb3RFbGVtZW50Lmxlbmd0aCAtPSByZW1vdmVDb3VudCAtIDE7XG5cbiAgICAgICAgICAgIC8vIElmIHRoZSByZXBsYWNlZCBlbGVtZW50IGlzIGFsc28gdGhlIGpRdWVyeSAuY29udGV4dCB0aGVuIHJlcGxhY2UgaXRcbiAgICAgICAgICAgIC8vIC5jb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ICAgICAgICAgICAgLy8gcGFyZW50IGNoYW5nZWQgYW5kIGl0IGhhcyBwcmVjZWRlbmNlXG4gICAgICAgICAgICAgICAgICBkZXN0aW5hdGlvbltzY29wZU5hbWVdID0gcGFyZW50VmFsdWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBwYXJlbnQgY2FuIGJlIGFzc2lnbmVkIHRoZW4gZG8gc29cbiAgICAgICAgICAgICAgICAgIHBhcmVudFNldChzY29wZSwgcGFyZW50VmFsdWUgPSBkZXN0aW5hdGlvbltzY29wZU5hbWVdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbGFzdFZhbHVlID0gcGFyZW50VmFsdWU7XG4gICAgICAgICAgICAgIHJldHVybiBsYXN0VmFsdWU7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcGFyZW50VmFsdWVXYXRjaC4kc3RhdGVmdWwgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKGRlZmluaXRpb24uY29sbGVjdGlvbikge1xuICAgICAgICAgICAgICByZW1vdmVXYXRjaCA9IHNjb3BlLiR3YXRjaENvbGxlY3Rpb24oYXR0cnNbYXR0ck5hbWVdLCBwYXJlbnRWYWx1ZVdhdGNoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJlbW92ZVdhdGNoID0gc2NvcGUuJHdhdGNoKCRwYXJzZShhdHRyc1thdHRyTmFtZV0sIHBhcmVudFZhbHVlV2F0Y2gpLCBudWxsLCBwYXJlbnRHZXQubGl0ZXJhbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZW1vdmVXYXRjaENvbGxlY3Rpb24ucHVzaChyZW1vdmVXYXRjaCk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJzwnOlxuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wZXJ0eS5jYW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W9uLm5hbWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGV4dGVuZChmdW5jdGlvbiAkY29udHJvbGxlckluaXQoKSB7XG4gICAgICAgICAgdmFyIHJlc3VsdCA9ICRpbmplY3Rvci5pbnZva2UoZXhwcmVzc2lvbiwgaW5zdGFuY2UsIGxvY2FscywgY29uc3RydWN0b3IpO1xuICAgICAgICAgIGlmIChyZXN1bHQgIT09IGluc3RhbmNlICYmIChpc09iamVjdChyZXN1bHQpIHx8IGlzRnVuY3Rpb24ocmVzdWx0KSkpIHtcbiAgICAgICAgICAgIGluc3RhbmNlID0gcmVzdWx0O1xuICAgICAgICAgICAgaWYgKGlkZW50aWZpZXIpIHtcbiAgICAgICAgICAgICAgLy8gSWYgcmVzdWx0IGNoYW5nZWQsIHJlLWFzc2lnbiBjb250cm9sbGVyQXMgdmFsdWUgdG8gc2NvcGUuXG4gICAgICAgICAgICAgIGFkZElkZW50aWZpZXIobG9jYWxzLCBpZGVudGlmaWVyLCBpbnN0YW5jZSwgY29uc3RydWN0b3IgfHwgZXhwcmVzc2lvbi5uYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGluc3RhbmNlO1xuICAgICAgICB9LCB7XG4gICAgICAgICAgaW5zdGFuY2U6IGluc3RhbmNlLFxuICAgICAgICAgIGlkZW50aWZpZXI6IGlkZW50aWZpZXJcbiAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIGluc3RhbmNlID0gJGluamVjdG9yLmluc3RhbnRpYXRlKGV4cHJlc3Npb24sIGxvY2FscywgY29uc3RydWN0b3IpO1xuXG4gICAgICBpZiAoaWRlbnRpZmllcikge1xuICAgICAgICBhZGRJZGVudGlmaWVyKGxvY2FscywgaWRlbnRpZmllciwgaW5zdGFuY2UsIGNvbnN0cnVjdG9yIHx8IGV4cHJlc3Npb24ubmFtZSk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBpbnN0YW5jZ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KHRvU2VyaWFsaXplKSkge1xuICAgICAgICAgIGZvckVhY2godG9TZXJpYWxpemUsIGZ1bmN0aW9uKHZhbHVlLCBpbmRleCkge1xuICAgICAgICAgICAgc2VyaWFsaXplKHZhbHVlLCBwcmVmaXggKyAnWycgKyAoaXNPYmplY3QodmFsdWUpID8gaW5kZXggOiAnJykgKyAnXScpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2UgaWYgKGlzT2JqZWN0KHRvU2VyaWFsaXplKSAmJiAhaXNEYXRlKHRvU2VyaWFsaXplKSkge1xuICAgICAgICAgIGZvckVhY2hTb3J0ZWQodG9TZXJpYWxpemUsIGZ1bmN0aW9uKHZhbHVlLCBrZXkpIHtcbiAgICAgICAgICAgIHNlcmlhbGl6ZSh2YWx1ZSwgcHJlZml4ICtcbiAgICAgICAgICAgICAgICAodG9wTGV2ZWwgPyAnJyA6ICdbJykgK1xuICAgICAgICAgICAgICAgIGtleSArXG4gICAgICAgICAgICAgICAgKHRvcExldmVsID8gJycgOiAnXScpKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoaXNGdW5jdGlvbih0b1NlcmlhbGl6ZSkpIHtcbiAgICAgICAgICAgIHRvU2VyaWFsaXplID0gdG9TZXJpYWxpemUoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcGFydHMucHVzaChlbmNvZGVVcmlRdWVyeShwcmVmaXgpICsgJz0nICtcbiAgICAgICAgICAgICAgKHRvU2VyaWFsaXplID09IG51bGwgPyAnJyA6IGVuY29kZVVyaVF1ZXJ5KHNlcmlhbGl6ZVZhbHVlKHRvU2VyaWFsaXplKSkpKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH07XG4gIH07XG59XG5cbmZ1bmN0aW9uIGRlZmF1bHRIdHRwUmVzcG9uc2VUcmFuc2Zvcm0oZGF0YSwgaGVhZGVycykge1xuICBpZiAoaXNTdHJpbmcoZGF0YSkpIHtcbiAgICAvL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hlIGZ1bmN0aW9uIG5lZWRzIHRvIHJldHVybiB0aGUgYHJlc3BvbnNlYFxuICAgICAqICAgICBvYmplY3QgZGlyZWN0bHksIG9yIGFzIGEgcHJvbWlzZSBjb250YWluaW5nIHRoZSBgcmVzcG9uc2VgIG9yIGEgbmV3IGByZXNwb25zZWAgb2JqZWN0LlxuICAgICAqICAgKiBgcmVzcG9uc2VFcnJvcmA6IGludGVyY2VwdG9yIGdldHMgY2FsbGVkIHdoZW4gYSBwcmV2aW91cyBpbnRlcmNlcHRvciB0aHJldyBhbiBlcnJvciBvclxuICAgICAqICAgICByZXNvbHZlZCB3aXRoIGEgcmVqZWN0aW9uLlxuICAgICAqXG4gICAgICpcbiAgICAgKiBgYGBqc1xuICAgICAqICAgLy8gcmVnaXN0ZXIgdGhlIGludGVyY2VwdG9yIGFzIGEgc2VydmljZVxuICAgICAqICAgJHByb3ZpZGUuZmFjdG9yeSgnbXlIdHRwSW50ZXJjZXB0b3InLCBmdW5jdGlvbigkcSwgZGVwZW5kZW5jeTEsIGRlcGVuZGVuY3kyKSB7XG4gICAgICogICAgIHJldHVybiB7XG4gICAgICogICAgICAgLy8gb3B0aW9uYWwgbWV0aG9kXG4gICAgICogICAgICAgJ3JlcXVlc3QnOiBmdW5jdGlvbihjb25maWcpIHtcbiAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBzdWNjZXNzXG4gICAgICogICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgICAqICAgICAgIH0sXG4gICAgICpcbiAgICAgKiAgICAgICAvLyBvcHRpb25hbCBtZXRob2RcbiAgICAgKiAgICAgICdyZXF1ZXN0RXJyb3InOiBmdW5jdGlvbihyZWplY3Rpb24pIHtcbiAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBlcnJvclxuICAgICAqICAgICAgICAgaWYgKGNhblJlY292ZXIocmVqZWN0aW9uKSkge1xuICAgICAqICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VPck5ld1Byb21pc2VcbiAgICAgKiAgICAgICAgIH1cbiAgICAgKiAgICAgICAgIHJldHVybiAkcS5yZWplY3QocmVqZWN0aW9uKTtcbiAgICAgKiAgICAgICB9LFxuICAgICAqXG4gICAgICpcbiAgICAgKlxuICAgICAqICAgICAgIC8vIG9wdGlvbmFsIG1ldGhvZFxuICAgICAqICAgICAgICdyZXNwb25zZSc6IGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICogICAgICAgICAvLyBkbyBzb21ldGhpbmcgb24gc3VjY2Vzc1xuICAgICAqICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAqICAgICAgIH0sXG4gICAgICpcbiAgICAgKiAgICAgICAvLyBvcHRpb25hbCBtZXRob2RcbiAgICAgKiAgICAgICdyZXNwb25zZUVycm9yJzogZnVuY3Rpb24ocmVqZWN0aW9uKSB7XG4gICAgICogICAgICAgICAvLyBkbyBzb21ldGhpbmcgb24gZXJyb3JcbiAgICAgKiAgICAgICAgIGlmIChjYW5SZWNvdmVyKHJlamVjdGlvbikpIHtcbiAgICAgKiAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlT3JOZXdQcm9taXNlXG4gICAgICogICAgICAgICB9XG4gICAgICogICAgICAgICByZXR1cm4gJHEucmVqZWN0KHJlamVjdGlvbik7XG4gICAgICogICAgICAgfVxuICAgICAqICAgICB9O1xuICAgICAqICAgfSk7XG4gICAgICpcbiAgICAgKiAgICRodHRwUHJvdmlkZXIuaW50ZXJjZXB0b3JzLnB1c2goJ215SHR0cEludGVyY2VwdG9yJyk7XG4gICAgICpcbiAgICAgKlxuICAgICAqICAgLy8gYWx0ZXJuYXRpdmVseSwgcmVnaXN0ZXIgdGhlIGludGVyY2VwdG9yIHZpYSBhbiBhbm9ueW1vdXMgZmFjdG9yeVxuICAgICAqICAgJGh0dHBQcm92aWRlci5pbnRlcmNlcHRvcnMucHVzaChmdW5jdGlvbigkcSwgZGVwZW5kZW5jeTEsIGRlcGVuZGVuY3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3V0ZSBpZiBoZWFkZXIgdmFsdWUgaXMgYSBmdW5jdGlvbiBmb3IgbWVyZ2VkIGhlYWRlcnNcbiAgICAgICAgcmV0dXJuIGV4ZWN1dGVIZWFkZXJGbnMocmVxSGVhZGVycywgc2hhbGxvd0NvcHkoY29uZmlnKSk7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIHNlcnZlclJlcXVlc3QoY29uZmlnKSB7XG4gICAgICAgIHZhciBoZWFkZXJzID0gY29uZmlnLmhlYWRlcnM7XG4gICAgICAgIHZhciByZXFEYXRhID0gdHJhbnNmb3JtRGF0YShjb25maWcuZGF0YSwgaGVhZGVyc0dldHRlcihoZWFkZXJzKSwgdW5kZWZpbmVkLCBjb25maWcudHJhbnNmb3JtUmVxdWVzdCk7XG5cbiAgICAgICAgLy8gc3RyaXAgY29udGVudC10eXBlIGlmIGRhdGEgaXMgdW5kZWZpbmVkXG4gICAgICAgIGlmIChpc1VuZGVmaW5lZChyZXFEYXRhKSkge1xuICAgICAgICAgIGZvckVhY2goaGVhZGVycywgZnVuY3Rpb24odmFsdWUsIGhlYWRlcikge1xuICAgICAgICAgICAgaWYgKGxvd2VyY2FzZShoZWFkZXIpID09PSAnY29udGVudC10eXBlJykge1xuICAgICAgICAgICAgICBkZWxldGUgaGVhZGVyc1toZWFkZXJdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGNvbmZpZy53aXRoQ3JlZGVudGlhbHMpICYmICFpc1VuZGVmaW5lZChkZWZhdWx0cy53aXRoQ3JlZGVudGlhbHMpKSB7XG4gICAgICAgICAgY29uZmlnLndpdGhDcmVkZW50aWFscyA9IGRlZmF1bHRzLndpdGhDcmVkZW50aWFscztcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHNlbmQgcmVxdWVzdFxuICAgICAgICByZXR1cm4gc2VuZFJlcShjb25maWcsIHJlcURhdGEpLnRoZW4odHJh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biAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH1cblxuXG4gICAgZnVuY3Rpb24gY3JlYXRlU2hvcnRNZXRob2RzV2l0aERhdGEobmFtZSkge1xuICAgICAgZm9yRWFjaChhcmd1bWVudHMsIGZ1bmN0aW9uKG5hbWUpIHtcbiAgICAgICAgJGh0dHBbbmFtZV0gPSBmdW5jdGlvbih1cmwsIGRhdGEsIGNvbmZpZykge1xuICAgICAgICAgIHJldHVybiAkaHR0cChleHRlbmQoe30sIGNvbmZpZyB8fCB7fSwge1xuICAgICAgICAgICAgbWV0aG9kOiBuYW1lLFxuICAgICAgICAgICAgdXJsOiB1cmwsXG4gICAgICAgICAgICBkYXRhOiBkYXRhXG4gICAgICAgICAgfSkpO1xuICAgICAgICB9O1xuICAgICAgfSk7XG4gICAgfVxuXG5cbiAgICAvKipcbiAgICAgKiBNYWtlcyB0aGUgcmVxdWVzdC5cbiAgICAgKlxuICAgICAqICEhISBBQ0NFU1NFUyBDTE9TVVJFIFZBUlM6XG4gICAgICogJGh0dHBCYWNrZW5kLCBkZWZhdWx0cywgJGxvZywgJHJvb3RTY29wZSwgZGVmYXVsdENhY2hlLCAkaHR0cC5wZW5kaW5nUmVxdWVzdHNcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzZW5kUmVxKGNvbmZpZywgcmVxRGF0YSkge1xuICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKSxcbiAgICAgICAgICBwcm9taXNlID0gZGVmZXJyZWQucHJvbWlzZSxcbiAgICAgICAgICBjYWNoZSxcbiAgICAgICAgICBjYWNoZWRSZXNwLFxuICAgICAgICAgIHJlcUhlYWRlcnMgPSBjb25maWcuaGVhZGVycyxcbiAgICAgICAgICBpc0pzb25wID0gbG93ZXJjYXNlKGNvbmZpZy5tZXRob2QpID09PSAnanNvbnAnLFxuICAgICAgICAgIHVybCA9IGNvbmZpZy51cmw7XG5cbiAgICAgIGlmIChpc0pzb25wKSB7XG4gICAgICAgIC8vIEp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QXBwbHlIYW5kbGVycyhjb25maWcuZXZlbnRIYW5kbGVycyksXG4gICAgICAgICAgICBjcmVhdGVBcHBseUhhbmRsZXJzKGNvbmZpZy51cGxvYWRFdmVudEhhbmRsZXJzKSk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBwcm9taXNlO1xuXG4gICAgICBmdW5jdGlvbiBjcmVhdGVBcHBseUhhbmRsZXJzKGV2ZW50SGFuZGxlcnMpIHtcbiAgICAgICAgaWYgKGV2ZW50SGFuZGxlcnMpIHtcbiAgICAgICAgICB2YXIgYXBwbHlIYW5kbGVycyA9IHt9O1xuICAgICAgICAgIGZvckVhY2goZXZlbnRIYW5kbGVycywgZnVuY3Rpb24oZXZlbnRIYW5kbGVyLCBrZXkpIHtcbiAgICAgICAgICAgIGFwcGx5SGFuZGxlcnNba2V5XSA9IGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAgIGlmICh1c2VBcHBseUFzeW5jKSB7XG4gICAgICAgICAgICAgICAgJHJvb3RTY29wZS4kYXBwbHlBc3luYyhjYWxsRXZlbnRIYW5kbGVyKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmICgkcm9vdFNjb3BlLiQkcGhhc2UpIHtcbiAgICAgICAgICAgICAgICBjYWxsRXZlbnRIYW5kbGVyKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJHJvb3RTY29wZS4kYXBwbHkoY2FsbEV2ZW50SGFuZGxlcik7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBmdW5jdGlvbiBjYWxsRXZlbnRIYW5kbGVyKCkge1xuICAgICAgICAgICAgICAgIGV2ZW50SGFuZGxlcihldmVudCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcmV0dXJuIGFwcGx5SGFuZGxlcnM7XG4gICAgICAgIH1cbiAgICAgIH1cblxuXG4gICAgICAvKipcbiAgICAg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JpdmlsZWdlZCBjb250ZXh0IG9yIG9ubHkgb25lIHBhcnQ6IGp1c3QgY29uY2F0ZW5hdGUgYW5kIHJldHVybi5cbiAgICAgICAgICByZXR1cm4gY29uY2F0LmpvaW4oJycpO1xuICAgICAgICB9O1xuXG4gICAgICAgIHJldHVybiBleHRlbmQoZnVuY3Rpb24gaW50ZXJwb2xhdGlvbkZuKGNvbnRleHQpIHtcbiAgICAgICAgICAgIHZhciBpID0gMDtcbiAgICAgICAgICAgIHZhciBpaSA9IGV4cHJlc3Npb25zLmxlbmd0aDtcbiAgICAgICAgICAgIHZhciB2YWx1ZXMgPSBuZXcgQXJyYXkoaWkpO1xuXG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBmb3IgKDsgaSA8IGlpOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YWx1ZXNbaV0gPSBwYXJzZUZuc1tpXShjb250ZXh0KTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiBjb21wdXRlKHZhbHVlcyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgJGV4Y2VwdGlvbkhhbmRsZXIoJGludGVycG9sYXRlTWluRXJyLmludGVycih0ZXh0LCBlcnIpKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH0sIHtcbiAgICAgICAgICAvLyBhbGwgb2YgdGhlc2UgcHJvcGVydGllcyBhcmUgdW5kb2N1bWVudGVkIGZvciBub3dcbiAgICAgICAgICBleHA6IHRleHQsIC8vanVzdCBmb3IgY29tcGF0aWJpbGl0eSB3aXRoIHJlZ3VsYXIgd2F0Y2hlcnMgY3JlYXRlZCB2aWEgJHdhdGNoXG4gICAgICAgICAgZXhwcmVzc2lvbnM6IGV4cHJlc3Npb25zLFxuICAgICAgICAgICQkd2F0Y2hEZWxlZ2F0ZTogZnVuY3Rpb24oc2NvcGUsIGxpc3RlbmVyKSB7XG4gICAgICAgICAgICB2YXIgbGFzdF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sZUNvbnRyb2xsZXInLCBbJyRzY29wZScsICckaW50ZXJ2YWwnLFxuICAgICAqICAgICAgICAgZnVuY3Rpb24oJHNjb3BlLCAkaW50ZXJ2YWwpIHtcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLmZvcm1hdCA9ICdNL2QveXkgaDptbTpzcyBhJztcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLmJsb29kXzEgPSAxMDA7XG4gICAgICogICAgICAgICAgICRzY29wZS5ibG9vZF8yID0gMTIwO1xuICAgICAqXG4gICAgICogICAgICAgICAgIHZhciBzdG9wO1xuICAgICAqICAgICAgICAgICAkc2NvcGUuZmlnaHQgPSBmdW5jdGlvbigpIHtcbiAgICAgKiAgICAgICAgICAgICAvLyBEb24ndCBzdGFydCBhIG5ldyBmaWdodCBpZiB3ZSBhcmUgYWxyZWFkeSBmaWdodGluZ1xuICAgICAqICAgICAgICAgICAgIGlmICggYW5ndWxhci5pc0RlZmluZWQoc3RvcCkgKSByZXR1cm47XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgICBzdG9wID0gJGludGVydmFsKGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgICAgICAgICAgaWYgKCRzY29wZS5ibG9vZF8xID4gMCAmJiAkc2NvcGUuYmxvb2RfMiA+IDApIHtcbiAgICAgKiAgICAgICAgICAgICAgICAgJHNjb3BlLmJsb29kXzEgPSAkc2NvcGUuYmxvb2RfMSAtIDM7XG4gICAgICogICAgICAgICAgICAgICAgICRzY29wZS5ibG9vZF8yID0gJHNjb3BlLmJsb29kXzIgLSA0O1xuICAgICAqICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgKiAgICAgICAgICAgICAgICAgJHNjb3BlLnN0b3BGaWdodCgpO1xuICAgICAqICAgICAgICAgICAgICAgfVxuICAgICAqICAgICAgICAgICAgIH0sIDEwMCk7XG4gICAgICogICAgICAgICAgIH07XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLnN0b3BGaWdodCA9IGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChzdG9wKSkge1xuICAgICAqICAgICAgICAgICAgICAgJGludGVydmFsLmNhbmNlbChzdG9wKTtcbiAgICAgKiAgICAgICAgICAgICAgIHN0b3AgPSB1bmRlZmluZWQ7XG4gICAgICogICAgICAgICAgICAgfVxuICAgICAqICAgICAgICAgICB9O1xuICAgICAqXG4gICAgICogICAgICAgICAgICRzY29wZS5yZXNldEZpZ2h0ID0gZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgICAgICAgJHNjb3BlLmJsb29kXzEgPSAxMDA7XG4gICAgICogICAgICAgICAgICAgJHNjb3BlLmJsb29kXzIgPSAxMjA7XG4gICAgICogICAgICAgICAgIH07XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLiRvbignJGRlc3Ryb3knLCBmdW5jdGlvbigpIHtcbiAgICAgKiAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdGhhdCB0aGUgaW50ZXJ2YWwgaXMgZGVzdHJveWVkIHRvb1xuICAgICAqICAgICAgICAgICAgICRzY29wZS5zdG9wRmlnaHQoKTtcbiAgICAgKiAgICAgICAgICAgfSk7XG4gICAgICogICAgICAgICB9XSlcbiAgICAgKiAgICAgICAvLyBSZWdpc3RlciB0aGUgJ215Q3VycmVudFRpbWUnIGRpcmVjdGl2ZSBmYWN0b3J5IG1ldGhvZC5cbiAgICAgKiAgICAgICAvLyBXZSBpbmplY3QgJGludGVydmFsIGFuZCBkYXRlRmlsdGVyIHNlcnZpY2Ugc2luY2UgdGhlIGZhY3RvcnkgbWV0aG9kIGlzIERJLlxuICAgICAqICAgICAgIC5kaXJlY3RpdmUoJ215Q3VycmVudFRpbWUnLCBbJyRpbnRlcnZhbCcsICdkYXRlRmlsdGVyJyxcbiAgICAgKiAgICAgICAgIGZ1bmN0aW9uKCRpbnRlcnZhbCwgZGF0ZUZpbHRlcikge1xuICAgICAqICAgICAgICAgICAvLyByZXR1cm4gdGhlIGRpcmVjdGl2ZSBsaW5rIGZ1bmN0aW9uLiAoY29tcGlsZSBmdW5jdGlvbiBub3QgbmVlZGVkKVxuICAgICAqICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7XG4gICAgICogICAgICAgICAgICAgdmFyIGZvcm1hdCwgIC8vIGRhdGUgZm9ybWF0XG4gICAgICogICAgICAgICAgICAgICAgIHN0b3BUaW1lOyAvLyBzbyB0aGF0IHdlIGNhbiBjYW5jZWwgdGhlIHRpbWUgdXBkYXRlc1xuICAgICAqXG4gICAgICogICAgICAgICAgICAgLy8gdXNlZCB0byB1cGRhdGUgdGhlIFVJXG4gICAgICogICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlVGltZSgpIHtcbiAgICAgKiAgICAgICAgICAgICAgIGVsZW1lbnQudGV4dChkYXRlRmlsdGVyKG5ldyBEYXRlKCksIGZvcm1hdCkpO1xuICAgICAqICAgICAgICAgICAgIH1cbiAgICAgKlxuICAgICAqICAgICAgICAgICAgIC8vIHdhdGNoIHRoZSBleHByZXNzaW9uLCBhbmQgdXBkYXRlIHRoZSBVSSBvbiBjaGFuZ2UuXG4gICAgICogICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGF0dHJzLm15Q3VycmVudFRpbWUsIGZ1bmN0aW9uKHZhbHVlKSB7XG4gICAgICogICAgICAgICAgICAgICBmb3JtYXQgPSB2YWx1ZTtcbiAgICAgKiAgICAgICAgICAgICAgIHVwZGF0ZVRpbWUoKTtcbiAgICAgKiAgICAgICAgICAgICB9KTtcbiAgICAgKlxuICAgICAqICAgICAgICAgICAgIHN0b3BUaW1lID0gJGludGVydmFsKHVwZGF0ZVRpbWUsIDEwMDApO1xuICAgICAqXG4gICAgICogICAgICAgICAgICAgLy8gbGlzdGVuIG9uIERPTSBkZXN0cm95IChyZW1vdmFsKSBldmVudCwgYW5kIGNhbmNlbCB0aGUgbmV4dCBVSSB1cGRhdGVcbiAgICAgKiAgICAgICAgICAgICAvLyB0byBwcmV2ZW50IHVwZGF0aW5nIHRpbWUgYWZ0ZXIgdGhlIERPTSBlbGVtZW50IHdhcyByZW1vdmVkLlxuICAgICAqICAgICAgICAgICAgIGVsZW1lbnQub24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgICAgICAgICAkaW50ZXJ2YWwuY2FuY2VsKHN0b3BUaW1lKTtcbiAgICAgKiAgICAgICAgICAgICB9KTtcbiAgICAgKiAgICAgICAgICAgfVxuICAgICAqICAgICAgICAgfV0pO1xuICAgICAqICAgPC9zY3JpcHQ+XG4gICAgICpcbiAgICAgKiAgIDxkaXY+XG4gICAgICogICAgIDxkaXYgbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICogICAgICAgPGxhYmVsPkRhdGUgZm9ybWF0OiA8aW5wdXQgbmctbW9kZWw9XCJmb3JtYXRcIj48L2xhYmVsPiA8aHIvPlxuICAgICAqICAgICAgIEN1cnJlbnQgdGltZSBpczogPHNwYW4gbXktY3VycmVudC10aW1lPVwiZm9ybWF0XCI+PC9zcGFuPlxuICAgICAqICAgICAgIDxoci8+XG4gICAgICogICAgICAgQmxvb2QgMSA6IDxmb250IGNvbG9yPSdyZWQnPnt7Ymxvb2RfMX19PC9mb250PlxuICAgICAqICAgICAgIEJsb29kIDIgOiA8Zm9udCBjb2xvcj0ncmVkJz57e2Jsb29kXzJ9fTwvZm9udD5cbiAgICAgKiAgICAgICA8YnV0dG9uIHR5cGU9XCJidXR0b25cIiBkYXRhLW5nLWNsaWNrPVwiZmlnaHQoKVwiPkZpZ2h0PC9idXR0b24+XG4gICAgICogICAgICAgPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCIgZGF0YS1uZy1jbGljaz1cInN0b3BGaWdodCgpXCI+U3RvcEZpZ2h0PC9idXR0b24+XG4gICAgICogICAgICAgPGJ1dHRvbiB0eXBlPVwiY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gICAgaXRlcmF0aW9uID0gMCxcbiAgICAgICAgICAgIHNraXBBcHBseSA9IGlzRGVmaW5lZChpbnZva2VBcHBseSkgJiYgIWludm9rZUFwcGx5LFxuICAgICAgICAgICAgZGVmZXJyZWQgPSAoc2tpcEFwcGx5ID8gJCRxIDogJHEpLmRlZmVyKCksXG4gICAgICAgICAgICBwcm9taXNlID0gZGVmZXJyZWQucHJvbWlzZTtcblxuICAgICAgICBjb3VudCA9IGlzRGVmaW5lZChjb3VudCkgPyBjb3VudCA6IDA7XG5cbiAgICAgICAgZnVuY3Rpb24gY2FsbGJhY2soKSB7XG4gICAgICAgICAgaWYgKCFoYXNQYXJhbXMpIHtcbiAgICAgICAgICAgIGZuKGl0ZXJhdGlvbik7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZuLmFwcGx5KG51bGwsIGFyZ3MpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHRpY2soKSB7XG4gICAgICAgICAgaWYgKHNraXBBcHBseSkge1xuICAgICAgICAgICAgJGJyb3dzZXIuZGVmZXIoY2FsbGJhY2spO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAkcm9vdFNjb3BlLiRldmFsQXN5bmMoY2FsbGJhY2spO1xuICAgICAgICAgIH1cbiAgICAgICAgICBkZWZlcnJlZC5ub3RpZnkoaXRlcmF0aW9uKyspO1xuXG4gICAgICAgICAgaWYgKGNvdW50ID4gMCAmJiBpdGVyYXRpb24gPj0gY291bnQpIHtcbiAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUoaXRlcmF0aW9uKTtcbiAgICAgICAgICAgIGNsZWFySW50ZXJ2YWxGbihwcm9taXNlLiQkaW50ZXJ2YWxJZCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCFza2lwQXBwbHkpICRyb290U2NvcGUuJGFwcGx5KCk7XG4gICAgICAgIH1cblxuICAgICAgICBwcm9taXNlLi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4gICAgICAvKipcbiAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAqIEBuYW1lICRsb2cjbG9nXG4gICAgICAgKlxuICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgKiBXcml0ZSBhIGxvZyBtZXNzYWdlXG4gICAgICAgKi9cbiAgICAgIGxvZzogY29uc29sZUxvZygnbG9nJyksXG5cbiAgICAgIC8qKlxuICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICogQG5hbWUgJGxvZyNpbmZvXG4gICAgICAgKlxuICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgKiBXcml0ZSBhbiBpbmZvcm1hdGlvbiBtZXNzYWdlXG4gICAgICAgKi9cbiAgICAgIGluZm86IGNvbnNvbGVMb2coJ2luZm8nKSxcblxuICAgICAgLyoqXG4gICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgKiBAbmFtZSAkbG9nI3dhcm5cbiAgICAgICAqXG4gICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAqIFdyaXRlIGEgd2FybmluZyBtZXNzYWdlXG4gICAgICAgKi9cbiAgICAgIHdhcm46IGNvbnNvbGVMb2coJ3dhcm4nKSxcblxuICAgICAgLyoqXG4gICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgKiBAbmFtZSAkbG9nI2Vycm9yXG4gICAgICAgKlxuICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgKiBXcml0ZSBhbiBlcnJvciBtZXNzYWdlXG4gICAgICAgKi9cbiAgICAgIGVycm9yOiBjb25zb2xlTG9nKCdlcnJvcicpLFxuXG4gICAgICAvKipcbiAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAqIEBuYW1lICRsb2cjZGVidWdcbiAgICAgICAqXG4gICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAqIFdyaXRlIGEgZGVidWcgbWVzc2FnZVxuICAgICAgICovXG4gICAgICBkZWJ1ZzogKGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgZm4gPSBjb25zb2xlTG9nKCdkZWJ1ZycpO1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBpZiAoZGVidWcpIHtcbiAgICAgICAgICAgIGZuLmFwcGx5KHNlbGYsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgfSkoKVxuICAgIH07XG5cbiAgICBmdW5jdGlvbiBmb3JtYXRFcnJvcihhcmcpIHtcbiAgICAgIGlmIChpc0Vycm9yKGFyZykpIHtcbiAgICAgICAgaWYgKGFyZy5zdGFjayAmJiBmb3JtYXRTdGFja1RyYWNlKSB7XG4gICAgICAgICAgYXJnID0gKGFyZy5tZXNzYWdlICYmIGFyZy5zdGFjay5pbmRleE9mKGFyZy5tZXNzYWdlKSA9PT0gLTEpXG4gICAgICAgICAgICAgID8gJ0Vycm9yOiAnICsgYXJnLm1lc3NhZ2UgKyAnXFxuJyArIGFyZy5zdGFja1xuICAgICAgICAgICAgICA6IGFyZy5zdGFjaztcbiAgICAgICAgfSBlbHNlIGlmIChhcmcuc291cmNlVVJMKSB7XG4gICAgICAgICAgYXJnID0gYXJnLm1lc3NhZ2UgKyAnXFxuJyArIGFyZy5zb3VyY2VVUkwgKyAnOicgKyBhcmcubGluZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIGFyZztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjb25zb2xlTG9nKHR5cGUpIHtcbiAgICAgIHZhciBjb25zb2xlID0gJHdpbmRvdy5jb25zb2xlIHx8IHt9LFxuICAgICAgICAgIGxvZ0ZuID0gY29uc29sZVt0eXBlXSB8fCBjb25zb2xlLmxvZyB8fCBub29wO1xuXG4gICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBhcmdzID0gW107XG4gICAgICAgIGZvckVhY2goYXJndW1lbnRzLCBmdW5jdGlvbihhcmcpIHtcbiAgICAgICAgICBhcmdzLnB1c2goZm9ybWF0RXJyb3IoYXJnKSk7XG4gICAgICAgIH0pO1xuICAgICAgICAvLyBTdXBwb3J0OiBJRSA5IG9ubHlcbiAgICAgICAgLy8gY29uc29sZSBtZXRob2RzIGRvbid0IGluaGVyaXQgZnJvbSBGdW5jdGlvbi5wcm90b3R5cGUgaW4gSUUgOSBzbyB3ZSBjYW4ndFxuICAgICAgICAvLyBjYWxsIGBsb2dGbi5hcHBseShjb25zb2xlLCBhcmdzKWAgZGlyZWN0bHkuXG4gICAgICAgIHJldHVybiBGdW5jdGlvbi5wcm90b3R5cGUuYXBwbHkuY2FsbChsb2dGbiwgY29uc29sZSwgYXJncyk7XG4gICAgICB9O1xuICAgIH1cbiAgfV07XG59XG5cbi8qICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICpcbiAqICAgICBBbnkgY29tbWl0cyB0byB0aGlzIGZpbGUgc2hvdWxkIGJlIHJldmlld2VkIHdpdGggc2VjdXJpdHkgaW4gbWluZC4gICpcbiAqICAgQ2hhbmdlcyB0byB0aGlzIGZpbGUgY2FuIHBvdGVudGlhbGx5IGNyZWF0ZSBzZWN1cml0eSB2dWxuZXJhYmlsaXRpZXMuICpcbiAqICAgICAgICAgIEFuIGFwcHJvdmFsIGZyb20gMiBDb3JlIG1lbWJlcnMgd2l0aCBoaXN0b3J5IG9mIG1vZGlmeWluZyAgICAgICpcbiAqICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgZmlsZSBpcyByZXF1aXJlZC4gICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAqICBEb2VzIHRoZSBjaGFuZ2Ugc29tZWhvdyBhbGxvdyBmb3IgYXJiaXRyYXJ5IGphdmFzY3JpcHQgdG8gYmUgZX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bXSwgcHJvcGVydHk7XG4gICAgaWYgKHRoaXMucGVla1Rva2VuKCkudGV4dCAhPT0gJ30nKSB7XG4gICAgICBkbyB7XG4gICAgICAgIGlmICh0aGlzLnBlZWsoJ30nKSkge1xuICAgICAgICAgIC8vIFN1cHBvcnQgdHJhaWxpbmcgY29tbWFzIHBlciBFUzUuMS5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBwcm9wZXJ0eSA9IHt0eXBlOiBBU1QuUHJvcGVydHksIGtpbmQ6ICdpbml0J307XG4gICAgICAgIGlmICh0aGlzLnBlZWsoKS5jb25zdGFudCkge1xuICAgICAgICAgIHByb3BlcnR5LmtleSA9IHRoaXMuY29uc3RhbnQoKTtcbiAgICAgICAgICBwcm9wZXJ0eS5jb21wdXRlZCA9IGZhbHNlO1xuICAgICAgICAgIHRoaXMuY29uc3VtZSgnOicpO1xuICAgICAgICAgIHByb3BlcnR5LnZhbHVlID0gdGhpcy5leHByZXNzaW9uKCk7XG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5wZWVrKCkuaWRlbnRpZmllcikge1xuICAgICAgICAgIHByb3BlcnR5LmtleSA9IHRoaXMuaWRlbnRpZmllcigpO1xuICAgICAgICAgIHByb3BlcnR5LmNvbXB1dGVkID0gZmFsc2U7XG4gICAgICAgICAgaWYgKHRoaXMucGVlaygnOicpKSB7XG4gICAgICAgICAgICB0aGlzLmNvbnN1bWUoJzonKTtcbiAgICAgICAgICAgIHByb3BlcnR5LnZhbHVlID0gdGhpcy5leHByZXNzaW9uKCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHByb3BlcnR5LnZhbHVlID0gcHJvcGVydHkua2V5O1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLnBlZWsoJ1snKSkge1xuICAgICAgICAgIHRoaXMuY29uc3VtZSgnWycpO1xuICAgICAgICAgIHByb3BlcnR5LmtleSA9IHRoaXMuZXhwcmVzc2lvbig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ICAgfVxuICAgICAgICAgICAgZXhwcmVzc2lvbiA9IHNlbGYuY29tcHV0ZWRNZW1iZXIobGVmdCwgcmlnaHQpO1xuICAgICAgICAgICAgc2VsZi5hc3NpZ24oaW50b0lkLCBleHByZXNzaW9uKTtcbiAgICAgICAgICAgIGlmIChuYW1lSWQpIHtcbiAgICAgICAgICAgICAgbmFtZUlkLmNvbXB1dGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgbmFtZUlkLm5hbWUgPSByaWdodDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGNyZWF0ZSAmJiBjcmVhdGUgIT09IDEpIHtcbiAgICAgICAgICAgICAgc2VsZi5pZl8oc2VsZi5pc051bGwoc2VsZi5ub25Db21wdXRlZE1lbWJlcihsZWZ0LCBhc3QucHJvcGVydHkubmFtZSkpLCBzZWxmLmxhenlBc3NpZ24oc2VsZi5ub25Db21wdXRlZE1lbWJlcihsZWZ0LCBhc3QucHJvcGVydHkubmFtZSksICd7fScpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGV4cHJlc3Npb24gPSBzZWxmLm5vbkNvbXB1dGVkTWVtYmVyKGxlZnQsIGFzdC5wcm9wZXJ0eS5uYW1lKTtcbiAgICAgICAgICAgIHNlbGYuYXNzaWduKGludG9JZCwgZXhwcmVzc2lvbik7XG4gICAgICAgICAgICBpZiAobmFtZUlkKSB7XG4gICAgICAgICAgICAgIG5hbWVJZC5jb21wdXRlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICBuYW1lSWQubmFtZSA9IGFzdC5wcm9wZXJ0eS5uYW1lO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgc2VsZi5hc3NpZ24oaW50b0lkLCAndW5kZWZpbmVkJyk7XG4gICAgICAgIH0pO1xuICAgICAgICByZWN1cnNpb25GbihpbnRvSWQpO1xuICAgICAg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VkLCBmdW5jdGlvbihhcmd1bWVudCkge1xuICAgICAgICAgICAgICAgIGFyZ3MucHVzaChhcmd1bWVudCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAobGVmdC5uYW1lKSB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24gPSBzZWxmLm1lbWJlcihsZWZ0LmNvbnRleHQsIGxlZnQubmFtZSwgbGVmdC5jb21wdXRlZCkgKyAnKCcgKyBhcmdzLmpvaW4oJywnKSArICcpJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24gPSByaWdodCArICcoJyArIGFyZ3Muam9pbignLCcpICsgJyknO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2VsZi5hc3NpZ24oaW50b0lkLCBleHByZXNzaW9uKTtcbiAgICAgICAgICB9LCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHNlbGYuYXNzaWduKGludG9JZCwgJ3VuZGVmaW5lZCcpO1xuICAgICAgICAgIH0pO1xuICAgICAgICAgIHJlY3Vyc2lvbkZuKGludG9JZCk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgYnJlYWs7XG4gICAgY2FzZSBBU1QuQXNzaWdubWVudEV4cHJlc3Npb246XG4gICAgICByaWdodCA9IHRoaXMubmV4dElkKCk7XG4gICAgICBsZWZ0ID0ge307XG4gICAgICB0aGlzLnJlY3Vyc2UoYXN0LmxlZnQsIHVuZGVmaW5lZCwgbGVmdCwgZnVuY3Rpb24oKSB7XG4gICAgICAgIHNlbGYuaWZfKHNlbGYubm90TnVsbChsZWZ0LmNvbnRleHQpLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICBzZWxmLnJlY3Vyc2UoYXN0LnJpZ2h0LCByaWdodCk7XG4gICAgICAgICAgZXhwcmVzc2lvbiA9IHNlbGYubWVtYmVyKGxlZnQuY29udGV4dCwgbGVmdC5uYW1lLCBsZWZ0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0eS5rZXkubmFtZSA6XG4gICAgICAgICAgICAgICAgICAoJycgKyBwcm9wZXJ0eS5rZXkudmFsdWUpKSArXG4gICAgICAgICAgICAgICAgJzonICsgZXhwcik7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgICBleHByZXNzaW9uID0gJ3snICsgYXJncy5qb2luKCcsJykgKyAnfSc7XG4gICAgICAgIHRoaXMuYXNzaWduKGludG9JZCwgZXhwcmVzc2lvbik7XG4gICAgICB9XG4gICAgICByZWN1cnNpb25GbihpbnRvSWQgfHwgZXhwcmVzc2lvbik7XG4gICAgICBicmVhaztcbiAgICBjYXNlIEFTVC5UaGlzRXhwcmVzc2lvbjpcbiAgICAgIHRoaXMuYXNzaWduKGludG9JZCwgJ3MnKTtcbiAgICAgIHJlY3Vyc2lvbkZuKGludG9JZCB8fCAncycpO1xuICAgICAgYnJlYWs7XG4gICAgY2FzZSBBU1QuTG9jYWxzRXhwcmVzc2lvbjpcbiAgICAgIHRoaXMuYXNzaWduKGludG9JZCwgJ2wnKTtcbiAgICAgIHJlY3Vyc2lvbkZuKGludG9JZCB8fCAnbCcpO1xuICAgICAgYnJlYWs7XG4gICAgY2FzZSBBU1QuTkdWYWx1ZVBhcmFtZXRlcjpcbiAgICAgIHRoaXMuYXNzaWduKGludG9JZCwgJ3YnKTtcbiAgICAgIHJlY3Vyc2lvbkZuKGludG9JZCB8fCAndicpO1xuICAgICAgYnJlYWs7XG4gICAgfVxuICB9LFxuXG4gIGdldEhhc093blByb3BlcnR5OiBmdW5jdGlvbihlbGVtZW50LCBwcm9wZXJ0eSkge1xuICAgIHZhciBrZXkgPSBlbGVtZW50ICsgJy4nICsgcHJvcGVydHk7XG4gICAgdmFyIG93biA9IHRoaXMuY3VycmVudCgpLm93bjtcbiAgICBpZiAoIW93bi5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICBvd25ba2V5XSA9IHRoaXMubmV4dElkKGZhbHNlLCBlbGVtZW50ICsgJyYm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YWx1ZSlcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBhcmdzLnB1c2goe2tleTogcHJvcGVydHkua2V5LnR5cGUgPT09IEFTVC5JZGVudGlmaWVyID9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHkua2V5Lm5hbWUgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAoJycgKyBwcm9wZXJ0eS5rZXkudmFsdWUpLFxuICAgICAgICAgICAgICAgICAgICAgY29tcHV0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHNlbGYucmVjdXJzZShwcm9wZXJ0eS52YWx1ZSlcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICByZXR1cm4gZnVuY3Rpb24oc2NvcGUsIGxvY2FscywgYXNzaWduLCBpbnB1dHMpIHtcbiAgICAgICAgdmFyIHZhbHVlID0ge307XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJncy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgIGlmIChhcmdzW2ldLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB2YWx1ZVthcmdzW2ldLmtleShzY29wZSwgbG9jYWxzLCBhc3NpZ24sIGlucHV0cyldID0gYXJnc1tpXS52YWx1ZShzY29wZSwgbG9jYWxzLCBhc3NpZ24sIGlucHV0cyk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlW2FyZ3NbaV0ua2V5XSA9IGFyZ3NbaV0udmFsdWUoc2NvcGUsIGxvY2FscywgYXNzaWduLCBpbnB1dHMpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gY29udGV4dCA/IHt2YWx1ZTogdmFsdWV9IDogdmFsdWU7XG4gICAgICB9O1xuICAgIGNhc2UgQVNULlRoaXNFeHByZXNzaW9uOlxuICAgICAgcmV0dXJuIGZ1bmN0aW9uKHNj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yIGNhbmNlbEFuaW1hdGlvbkZyYW1lID0gJHdpbmRvdy5jYW5jZWxBbmltYXRpb25GcmFtZSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR3aW5kb3cud2Via2l0Q2FuY2VsQW5pbWF0aW9uRnJhbWUgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkd2luZG93LndlYmtpdENhbmNlbFJlcXVlc3RBbmltYXRpb25GcmFtZTtcblxuICAgIHZhciByYWZTdXBwb3J0ZWQgPSAhIXJlcXVlc3RBbmltYXRpb25GcmFtZTtcbiAgICB2YXIgcmFmID0gcmFmU3VwcG9ydGVkXG4gICAgICA/IGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgdmFyIGlkID0gcmVxdWVzdEFuaW1hdGlvbkZyYW1lKGZuKTtcbiAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBjYW5jZWxBbmltYXRpb25GcmFtZShpZCk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgOiBmdW5jdGlvbihmbikge1xuICAgICAgICAgIHZhciB0aW1lciA9ICR0aW1lb3V0KGZuLCAxNi42NiwgZmFsc2UpOyAvLyAxMDAwIC8gNjAgPSAxNi42NjZcbiAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAkdGltZW91dC5jYW5jZWwodGltZXIpO1xuICAgICAgICAgIH07XG4gICAgICAgIH07XG5cbiAgICByYWYuc3VwcG9ydGVkID0gcmFmU3VwcG9ydGVkO1xuXG4gICAgcmV0dXJuIHJhZjtcbiAgfV07XG59XG5cbi8qKlxuICogREVTSUdOIE5PVEVTXG4gKlxuICogVGhlIGRlc2lnbiBkZWNpc2lvbnMgYmVoaW5kIHRoZSBzY29wZSBhcmUgaGVhdmlseSBmYXZvcmVkIGZvciBzcGVlZCBhbmQgbWVtb3J5IGNvbnN1bXB0aW9uLlxuICpcbiAqIFRoZSB0eXBpY2Fs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mluZywgZnVuY3Rpb24oKT49fSBwcm92aWRlcnMgTWFwIG9mIHNlcnZpY2UgZmFjdG9yeSB3aGljaCBuZWVkIHRvIGJlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm92aWRlZCBmb3IgdGhlIGN1cnJlbnQgc2NvcGUuIERlZmF1bHRzIHRvIHtAbGluayBuZ30uXG4gICAgICogQHBhcmFtIHtPYmplY3QuPHN0cmluZywgKj49fSBpbnN0YW5jZUNhY2hlIFByb3ZpZGVzIHByZS1pbnN0YW50aWF0ZWQgc2VydmljZXMgd2hpY2ggc2hvdWxkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmQvb3ZlcnJpZGUgc2VydmljZXMgcHJvdmlkZWQgYnkgYHByb3ZpZGVyc2AuIFRoaXMgaXMgaGFuZHlcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZW4gdW5pdC10ZXN0aW5nIGFuZCBoYXZpbmcgdGhlIG5lZWQgdG8gb3ZlcnJpZGUgYSBkZWZhdWx0XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXJ2aWNlLlxuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IE5ld2x5IGNyZWF0ZWQgc2NvcGUuXG4gICAgICpcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBTY29wZSgpIHtcbiAgICAgIHRoaXMuJGlkID0gbmV4dFVpZCgpO1xuICAgICAgdGhpcy4kJHBoYXNlID0gdGhpcy4kcGFyZW50ID0gdGhpcy4kJHdhdGNoZXJzID1cbiAgICAgICAgICAgICAgICAgICAgIHRoaXMuJCRuZXh0U2libGluZyA9IHRoaXMuJCRwcmV2U2libGluZyA9XG4gICAgICAgICAgICAgICAgICAgICB0aGlzLiQkY2hpbGRIZWFkID0gdGhpcy4kJGNoaWxkVGFpbCA9IG51bGw7XG4gICAgICB0aGlzLiRyb290ID0gdGhpcztcbiAgICAgIHRoa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lIHBhcmVudCBzY29wZSBwcm9wZXJ0aWVzLlxuICAgICAgICogICAgICAgICBXaGVuIGNyZWF0aW5nIHdpZGdldHMsIGl0IGlzIHVzZWZ1bCBmb3IgdGhlIHdpZGdldCB0byBub3QgYWNjaWRlbnRhbGx5IHJlYWQgcGFyZW50XG4gICAgICAgKiAgICAgICAgIHN0YXRlLlxuICAgICAgICpcbiAgICAgICAqIEBwYXJhbSB7U2NvcGV9IFtwYXJlbnQ9dGhpc10gVGhlIHtAbGluayBuZy4kcm9vdFNjb3BlLlNjb3BlIGBTY29wZWB9IHRoYXQgd2lsbCBiZSB0aGUgYCRwYXJlbnRgXG4gICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mIHRoZSBuZXdseSBjcmVhdGVkIHNjb3BlLiBEZWZhdWx0cyB0byBgdGhpc2Agc2NvcGUgaWYgbm90IHByb3ZpZGVkLlxuICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGlzIGlzIHVzZWQgd2hlbiBjcmVhdGluZyBhIHRyYW5zY2x1ZGUgc2NvcGUgdG8gY29ycmVjdGx5IHBsYWNlIGl0XG4gICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBzY29wZSBoaWVyYXJjaHkgd2hpbGUgbWFpbnRhaW5pbmcgdGhlIGNvcnJlY3QgcHJvdG90eXBpY2FsXG4gICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRhbmNlLlxuICAgICAgICpcbiAgICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFRoZSBuZXdseSBjcmVhdGVkIGNoaWxkIHNjb3BlLlxuICAgICAgICpcbiAgICAgICAqL1xuICAgICAgJG5ldzogZnVuY3Rpb24oaXNvbGF0ZSwgcGFyZW50KSB7XG4gICAgICAgIHZhciBjaGlsZDtcblxuICAgICAgICBwYXJlbnQgPSBwYXJlbnQgfHwgdGhpcztcblxuICAgICAgICBpZiAoaXNvbG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gPSAwOyBpIDwgbmV3TGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgb2xkSXRlbSA9IG9sZFZhbHVlW2ldO1xuICAgICAgICAgICAgICBuZXdJdGVtID0gbmV3VmFsdWVbaV07XG5cbiAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXNlbGYtY29tcGFyZVxuICAgICAgICAgICAgICBib3RoTmFOID0gKG9sZEl0ZW0gIT09IG9sZEl0ZW0pICYmIChuZXdJdGVtICE9PSBuZXdJdGVtKTtcbiAgICAgICAgICAgICAgaWYgKCFib3RoTmFOICYmIChvbGRJdGVtICE9PSBuZXdJdGVtKSkge1xuICAgICAgICAgICAgICAgIGNoYW5nZURldGVjdGVkKys7XG4gICAgICAgICAgICAgICAgb2xkVmFsdWVbaV0gPSBuZXdJdGVtO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChvbGRWYWx1ZSAhPT0gaW50ZXJuYWxPYmplY3QpIHtcbiAgICAgICAgICAgICAgLy8gd2UgYXJlIHRyYW5zaXRpb25pbmcgZnJvbSBzb21ldGhpbmcgd2hpY2ggd2FzIG5vdCBhbiBvYmplY3QgaW50byBvYmplY3QuXG4gICAgICAgICAgICAgIG9sZFZhbHVlID0gaW50ZXJuYWxPYmplY3QgPSB7fTtcbiAgICAgICAgICAgICAgb2xkTGVuZ3RoID0gMDtcbiAgICAgICAgICAgICAgY2hhbmdlRGV0ZWN0ZWQrKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGNvcHkgdGhlIGl0ZW1zIHRvIG9sZFZhbHVlIGFuZCBsb29rIGZvciBjaGFuZ2VzLlxuICAgICAgICAgICAgbmV3TGVuZ3RoID0gMDtcbiAgICAgICAgICAgIGZvciAoa2V5IGluIG5ld1ZhbHVlKSB7XG4gICAgICAgICAgICAgIGlmIChoYXNPd25Qcm9wZXJ0eS5jYWxsKG5ld1ZhbHVlLCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgbmV3TGVuZ3RoKys7XG4gICAgICAgICAgICAgICAgbmV3SXRlbSA9IG5ld1ZhbHVlW2tleV07XG4gICAgICAgICAgICAgICAgb2xkSXRlbSA9IG9sZFZhbHVlW2tleV07XG5cbiAgICAgICAgICAgICAgICBpZiAoa2V5IGluIG9sZFZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tc2VsZi1jb21wYXJlXG4gICAgICAgICAgICAgICAgICBib3RoTmFOID0gKG9sZEl0ZW0gIT09IG9sZEl0ZW0pICYmIChuZXdJdGVtICE9PSBuZXdJdGVtKTtcbiAgICAgICAgICAgICAgICAgIGlmICghYm90aE5hTiAmJiAob2xkSXRlbSAhPT0gbmV3SXRlbSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2hhbmdlRGV0ZWN0ZWQrKztcbiAgICAgICAgICAgICAgICAgICAgb2xkVmFsdWVba2V5XSA9IG5ld0l0ZW07XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIG9sZExlbmd0aCsrO1xuICAgICAgICAgICAgICAgICAgb2xkVmFsdWVba2V5XSA9IG5ld0l0ZW07XG4gICAgICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG9sZExlbmd0aCA+IG5ld0xlbmd0aCkge1xuICAgICAgICAgICAgICAvLyB3ZSB1c2VkIHRvIGhhdmUgbW9yZSBrZXlzLCBuZWVkIHRvIGZpbmQgdGhlbSBhbmQgZGVzdHJveSB0aGVtLlxuICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrO1xuICAgICAgICAgICAgICBmb3IgKGtleSBpbiBvbGRWYWx1ZSkge1xuICAgICAgICAgICAgICAgIGlmICghaGFzT3duUHJvcGVydHkuY2FsbChuZXdWYWx1ZSwga2V5KSkge1xuICAgICAgICAgICAgICAgICAgb2xkTGVuZ3RoLS07XG4gICAgICAgICAgICAgICAgICBkZWxldGUgb2xkVmFsdWVba2V5XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYW5nZURldGVjdGVkO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gJHdhdGNoQ29sbGVjdGlvbkFjdGlvbigpIHtcbiAgICAgICAgICBpZiAoaW5pdFJ1bikge1xuICAgICAgICAgICAgaW5pdFJ1biA9IGZhbHNlO1xuICAgICAgICAgICAgbGlzdGVuZXIobmV3VmFsdWUsIG5ld1ZhbHVlLCBzZWxmKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGlzdGVuZXIobmV3VmFsdWUsIHZlcnlPbGRWYWx1ZSwgc2VsZik7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gbWFrZSBhIGNvcHkgZm9yIHRoZSBuZXh0IHRpbWUgYSBjb2xsZWN0aW9uIGlzIGNoYW5nZWRcbiAgICAgICAgICBpZiAodHJhY2tWZXJ5T2xkVmFsdWUpIHtcbiAgICAgICAgICAgIGlmICghaXNPYmplY3QobmV3VmFsdWUpKSB7XG4gICAgICAgICAgICAgIC8vcHJpbWl0aXZlXG4gICAgICAgICAgICAgIHZlcnlPbGRWYWx1ZSA9IG5ld1ZhbHVlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChpc0FycmF5TGlrZShuZXdWYWx1ZSkpIHtcbiAgICAgICAgICAgICAgdmVyeU9sZFZhbHVlID0gbmV3IEFycmF5KG5ld1ZhbHVlLmxlbmd0aCk7XG4gICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbmV3VmFs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aCAoZSkge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxhc3REaXJ0eVdhdGNoID0gbnVsbDtcbiAgICAgICAgICB9XG4gICAgICAgICAgYXN5bmNRdWV1ZS5sZW5ndGggPSAwO1xuXG4gICAgICAgICAgdHJhdmVyc2VTY29wZXNMb29wOlxuICAgICAgICAgIGRvIHsgLy8gXCJ0cmF2ZXJzZSB0aGUgc2NvcGVzXCIgbG9vcFxuICAgICAgICAgICAgaWYgKCh3YXRjaGVycyA9ICFjdXJyZW50LiQkc3VzcGVuZGVkICYmIGN1cnJlbnQuJCR3YXRjaGVycykpIHtcbiAgICAgICAgICAgICAgLy8gcHJvY2VzcyBvdXIgd2F0Y2hlc1xuICAgICAgICAgICAgICB3YXRjaGVycy4kJGRpZ2VzdFdhdGNoSW5kZXggPSB3YXRjaGVycy5sZW5ndGg7XG4gICAgICAgICAgICAgIHdoaWxlICh3YXRjaGVycy4kJGRpZ2VzdFdhdGNoSW5kZXgtLSkge1xuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICB3YXRjaCA9IHdhdGNoZXJzW3dhdGNoZXJzLiQkZGlnZXN0V2F0Y2hJbmRleF07XG4gICAgICAgICAgICAgICAgICAvLyBNb3N0IGNvbW1vbiB3YXRjaGVzIGFyZSBvbiBwcmltaXRpdmVzLCBpbiB3aGljaCBjYXNlIHdlIGNhbiBzaG9ydFxuICAgICAgICAgICAgICAgICAgLy8gY2lyY3VpdCBpdCB3aXRoID09PSBvcGVyYXRvciwgb25seSB3aGVuID09PSBmYWlscyBkbyB3ZSB1c2UgLmVxdWFsc1xuICAgICAgICAgICAgICAgICAgaWYgKHdhdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIGdldCA9IHdhdGNoLmdldDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh2YWx1ZSA9IGdldChjdXJyZW50KSkgIT09IChsYXN0ID0gd2F0Y2gubGFzdCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICEod2F0Y2guZXFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVxdWFscyh2YWx1ZSwgbGFzdClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChpc051bWJlck5hTih2YWx1ZSkgJiYgaXNOdW1iZXJOYU4obGFzdCkpKSkge1xuICAgICAgICAgICAgICAgICAgICAgIGRpcnR5ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICBsYXN0RGlydHlXYXRjaCA9IHdhdGNoO1xuICAgICAgICAgICAgICAgICAgICAgIHdhdGNoLmxhc3QgPSB3YXRjaC5lcSA/IGNvcHkodmFsdWUsIG51bGwpIDogdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgZm4gPSB3YXRjaC5mbjtcbiAgICAgICAgICAgICAgICAgICAgICBmbih2YWx1ZSwgKChsYXN0ID09PSBpbml0V2F0Y2hWYWwpID8gdmFsdWUgOiBsYXN0KSwgY3VycmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgaWYgKHR0bCA8IDUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZ0lkeCA9IDQgLSB0dGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXdhdGNoTG9nW2xvZ0lkeF0pIHdhdGNoTG9nW2xvZ0lkeF0gPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhdGNoTG9nW2xvZ0lkeF0ucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIG1zZzogaXNGdW5jdGlvbih3YXRjaC5leHApID8gJ2ZuOiAnICsgKHdhdGNoLmV4cC5uYW1lIHx8IHdhdGNoLmV4cC50b1N0cmluZygpKSA6IHdhdGNoLmV4cCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3VmFsOiB2YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkVmFsOiBsYXN0XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2F0Y2ggPT09IGxhc3REaXJ0eVdhdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIG1vc3QgcmVjZW50bHkgZGlydHkgd2F0Y2hlciBpcyBub3cgY2xlYW4sIHNob3J0IGNpcmN1aXQgc2luY2UgdGhlIHJlbWFpbmluZyB3YXRjaGVyc1xuICAgICAgICAgICAgICAgICAgICAgIC8vIGhhdmUgYWxyZWFkeSBiZWVuIHRlc3RlZC5cbiAgICAgICAgICAgICAgICAgICAgICBkaXJ0eSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHRyYXZlcnNlU2NvcGVzTG9vcDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBJbnNhbml0eSBXYXJuaW5nOiBzY29wZSBkZXB0aC1maXJzdCB0cmF2ZXJzYWxcbiAgICAgICAgICAgIC8vIHllcywgdGhpcyBjb2RlIGlzIGEgYml0IGNyYXp5LCBidXQgaXQgd29ya3MgYW5kIHdlIGhhdmUgdGVzdHMgdG8gcHJvdmUgaXQhXG4gICAgICAgICAgICAvLyB0aGlzIHBpZWNlIHNob3VsZCBiZSBrZXB0IGluIHN5bmMgd2l0aCB0aGUgdHJhdmVyc2FsIGluICRicm9hZGNhc3RcbiAgICAgICAgICAgIC8vICh0aG91Z2ggaXQgZGlmZmVycyBkdWUgdG8gaGF2aW5nIHRoZSBleHRyYSBjaGVjayBmb3IgJCRzdXNwZW5kZWQgYW5kIGRvZXMgbm90XG4gICAgICAgICAgICAvLyBjaGVjayAkJGxpc3RlbmVyQ291bnQpXG4gICAgICAgICAgICBpZiAoIShuZXh0ID0gKCghY3VycmVudC4kJHN1c3BlbmRlZCAmJiBjdXJyZW50LiQkd2F0Y2hlcnNDb3VudCAmJiBjdXJyZW50LiQkY2hpbGRIZWFkKSB8fFxuICAgICAgICAgICAgICAgIChjdXJyZW50ICE9PSB0YXJnZXQgJiYgY3VycmVudC4kJG5leHRTaWJsaW5nKSkpKSB7XG4gICAgICAgICAgICAgIHdoaWxlIChjdXJyZW50ICE9PSB0YXJnZXQgJiYgIShuZXh0ID0gY3VycmVudC4kJG5leHRTaWJsaW5nKSkge1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50LiRwYXJlbnQ7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IHdoaWxlICgoY3VycmVudCA9IG5leHQpKTtcblxuICAgICAgICAgIC8vIGBicmVhayB0cmF2ZXJzZVNjb3Blc0xvb3A7YCB0YWtlcyB1cyB0byBoZXJlXG5cbiAgICAgICAgICBpZiAoKGRpcnR5IHx8IGFzeW5jUXVldWUubGVuZ3RoKSAmJiAhKHR0bC0tKSkge1xuICAgICAgICAgICAgY2xlYXJQaGFzZSgpO1xuICAgICAgICAgICAgdGhyb3cgJHJvb3RTY29wZU1pbkVycignaW5mZGlnJyxcbiAgICAgICAgICAgICAgICAnezB9ICRkaWdlc3QoKSBpdGVyYXRpb25zIHJlYWNoZWQuIEFib3J0aW5nIVxcbicgK1xuICAgICAgICAgICAgICAgICdXYXRjaGVycyBmaXJlZCBpbiB0aGUgbGFzdCA1IGl0ZXJhdGlvbnM6IHsxfScsXG4gICAgICAgICAgICAgICAgVFRMLCB3YXRjaExvZyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgIH0gd2hpbGUgKGRpcnR5IHx8IGFzeW5jUXVldWUubGVuZ3RoKTtcblxuICAgICAgICBjbGVhcl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Y29wZSlgOiBleGVjdXRlIHRoZSBmdW5jdGlvbiB3aXRoIGN1cnJlbnQgYHNjb3BlYCBwYXJhbWV0ZXIuXG4gICAgICAgKlxuICAgICAgICogQHJldHVybnMgeyp9IFRoZSByZXN1bHQgb2YgZXZhbHVhdGluZyB0aGUgZXhwcmVzc2lvbi5cbiAgICAgICAqL1xuICAgICAgJGFwcGx5OiBmdW5jdGlvbihleHByKSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgYmVnaW5QaGFzZSgnJGFwcGx5Jyk7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLiRldmFsKGV4cHIpO1xuICAgICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgICBjbGVhclBoYXNlKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgJGV4Y2VwdGlvbkhhbmRsZXIoZSk7XG4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICRyb290U2NvcGUuJGRpZ2VzdCgpO1xuICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpO1xuICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXVuc2FmZS1maW5hbGx5XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSxcblxuICAgICAgLyoqXG4gICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgKiBAbmFtZSAkcm9vdFNjb3BlLlNjb3BlIyRhcHBseUFzeW5jXG4gICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICpcbiAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICogU2NoZWR1bGUgdGhlIGludm9jYXRpb24gb2YgJGFwcGx5IHRvIG9jY3VyIGF0IGEgbGF0ZXI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ZXJBcmdzID0gY29uY2F0KFtldmVudF0sIGFyZ3VtZW50cywgMSksXG4gICAgICAgICAgICBpLCBsZW5ndGg7XG5cbiAgICAgICAgZG8ge1xuICAgICAgICAgIG5hbWVkTGlzdGVuZXJzID0gc2NvcGUuJCRsaXN0ZW5lcnNbbmFtZV0gfHwgZW1wdHk7XG4gICAgICAgICAgZXZlbnQuY3VycmVudFNjb3BlID0gc2NvcGU7XG4gICAgICAgICAgZm9yIChpID0gMCwgbGVuZ3RoID0gbmFtZWRMaXN0ZW5lcnMubGVuZ3RoOyBpIDwgbGVuZ3RoOyBpKyspIHtcblxuICAgICAgICAgICAgLy8gaWYgbGlzdGVuZXJzIHdlcmUgZGVyZWdpc3RlcmVkLCBkZWZyYWdtZW50IHRoZSBhcnJheVxuICAgICAgICAgICAgaWYgKCFuYW1lZExpc3RlbmVyc1tpXSkge1xuICAgICAgICAgICAgICBuYW1lZExpc3RlbmVycy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgIGktLTtcbiAgICAgICAgICAgICAgbGVuZ3RoLS07XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgLy9hbGxvdyBhbGwgbGlzdGVuZXJzIGF0dGFjaGVkIHRvIHRoZSBjdXJyZW50IHNjb3BlIHRvIHJ1blxuICAgICAgICAgICAgICBuYW1lZExpc3RlbmVyc1tpXS5hcHBseShudWxsLCBsaXN0ZW5lckFyZ3MpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgLy9pZiBhbnkgbGlzdGVuZXIgb24gdGhlIGN1cnJlbnQgc2NvcGUgc3RvcHMgcHJvcGFnYXRpb24sIHByZXZlbnQgYnViYmxpbmdcbiAgICAgICAgICBpZiAoc3RvcFByb3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lO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBkZWZhdWx0UHJldmVudGVkOiBmYWxzZVxuICAgICAgICAgICAgfTtcblxuICAgICAgICBpZiAoIXRhcmdldC4kJGxpc3RlbmVyQ291bnRbbmFtZV0pIHJldHVybiBldmVudDtcblxuICAgICAgICB2YXIgbGlzdGVuZXJBcmdzID0gY29uY2F0KFtldmVudF0sIGFyZ3VtZW50cywgMSksXG4gICAgICAgICAgICBsaXN0ZW5lcnMsIGksIGxlbmd0aDtcblxuICAgICAgICAvL2Rvd24gd2hpbGUgeW91IGNhbiwgdGhlbiB1cCBhbmQgbmV4dCBzaWJsaW5nIG9yIHVwIGFuZCBuZXh0IHNpYmxpbmcgdW50aWwgYmFjayBhdCByb290XG4gICAgICAgIHdoaWxlICgoY3VycmVudCA9IG5leHQpKSB7XG4gICAgICAgICAgZXZlbnQuY3VycmVudFNjb3BlID0gY3VycmVudDtcbiAgICAgICAgICBsaXN0ZW5lcnMgPSBjdXJyZW50LiQkbGlzdGVuZXJzW25hbWVdIHx8IFtdO1xuICAgICAgICAgIGZvciAoaSA9IDAsIGxlbmd0aCA9IGxpc3RlbmVycy5sZW5ndGg7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgLy8gaWYgbGlzdGVuZXJzIHdlcmUgZGVyZWdpc3RlcmVkLCBkZWZyYWdtZW50IHRoZSBhcnJheVxuICAgICAgICAgICAgaWYgKCFsaXN0ZW5lcnNbaV0pIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgaS0tO1xuICAgICAgICAgICAgICBsZW5ndGgtLTtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGxpc3RlbmVyc1tpXS5hcHBseShudWxsLCBsaXN0ZW5lckFyZ3MpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSk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iAqICogKiAqICogKiAqICpcbiAqICAgICBBbnkgY29tbWl0cyB0byB0aGlzIGZpbGUgc2hvdWxkIGJlIHJldmlld2VkIHdpdGggc2VjdXJpdHkgaW4gbWluZC4gICpcbiAqICAgQ2hhbmdlcyB0byB0aGlzIGZpbGUgY2FuIHBvdGVudGlhbGx5IGNyZWF0ZSBzZWN1cml0eSB2dWxuZXJhYmlsaXRpZXMuICpcbiAqICAgICAgICAgIEFuIGFwcHJvdmFsIGZyb20gMiBDb3JlIG1lbWJlcnMgd2l0aCBoaXN0b3J5IG9mIG1vZGlmeWluZyAgICAgICpcbiAqICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgZmlsZSBpcyByZXF1aXJlZC4gICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAqICBEb2VzIHRoZSBjaGFuZ2Ugc29tZWhvdyBhbGxvdyBmb3IgYXJiaXRyYXJ5IGphdmFzY3JpcHQgdG8gYmUgZXhlY3V0ZWQ/ICpcbiAqICAgIE9yIGFsbG93cyBmb3Igc29tZW9uZSB0byBjaGFuZ2UgdGhlIHByb3RvdHlwZSBvZiBidWlsdC1pbiBvYmplY3RzPyAgICpcbiAqICAgICBPciBnaXZlcyB1bmRlc2lyZWQgYWNjZXNzIHRvIHZhcmlhYmxlcyBsaWtlcyBkb2N1bWVudCBvciB3aW5kb3c/ICAgICpcbiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICovXG5cbi8qIGV4cG9ydGVkICRTY2VQcm92aWRlciwgJFNjZURlbGVnYXRlUHJvdmlkZXIgKi9cblxudmFyICRzY2VNaW5FcnIgPSBtaW5FcnIoJyRzY2UnKTtcblxudmFyIFNDRV9DT05URVhUUyA9IHtcbiAgLy8gSFRNTCBpcyB1c2VkIHdo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QoYmluZGluZykuZGF0YSgnJGJpbmRpbmcnKTtcbiAgICAgICAgaWYgKGRhdGFCaW5kaW5nKSB7XG4gICAgICAgICAgZm9yRWFjaChkYXRhQmluZGluZywgZnVuY3Rpb24oYmluZGluZ05hbWUpIHtcbiAgICAgICAgICAgIGlmIChvcHRfZXhhY3RNYXRjaCkge1xuICAgICAgICAgICAgICB2YXIgbWF0Y2hlciA9IG5ldyBSZWdFeHAoJyhefFxcXFxzKScgKyBlc2NhcGVGb3JSZWdleHAoZXhwcmVzc2lvbikgKyAnKFxcXFxzfFxcXFx8fCQpJyk7XG4gICAgICAgICAgICAgIGlmIChtYXRjaGVyLnRlc3QoYmluZGluZ05hbWUpKSB7XG4gICAgICAgICAgICAgICAgbWF0Y2hlcy5wdXNoKGJpbmRpbmcpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYmluZGluZ05hbWUuaW5kZXhPZihleHByZXNzaW9uKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBtYXRjaGVzLnB1c2goYmluZGluZyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICByZXR1cm4gbWF0Y2hlcztcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogQG5hbWUgJCR0ZXN0YWJpbGl0eSNmaW5kTW9kZWxzXG4gICAgICpcbiAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgKiBSZXR1cm5zIGFuIGFycmF5IG9mIGVsZW1lbnRzIHRoYXQgYXJlIHR3by13YXkgZm91bmQgdmlhIG5nLW1vZGVsIHRvXG4gICAgICogZXhwcmVzc2lvbnMgbWF0Y2hpbmcgdGhlIGlucHV0LlxuICAgICAqXG4gICAgICogQHBhcmFtIHtFbGVtZW50fSBlbGVtZW50IFRoZSBlbGVtZW50IHJvb3QgdG8gc2VhcmNoIGZyb20uXG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AgICAgfCBBIG5vcm1hbGl6ZWQgdmVyc2lvbiBvZiB0aGUgcHJvdmlkZWQgVVJMIGlmIGl0IHdhcyBub3QgYW4gYWJzb2x1dGUgVVJMIHxcbiAqICAgfCBwcm90b2NvbCAgICAgIHwgVGhlIHByb3RvY29sIHdpdGhvdXQgdGhlIHRyYWlsaW5nIGNvbG9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgIHwgaG9zdCAgICAgICAgICB8IFRoZSBob3N0IGFuZCBwb3J0IChpZiB0aGUgcG9ydCBpcyBub24tZGVmYXVsdCkgb2YgdGhlIG5vcm1hbGl6ZWRVcmwgICAgfFxuICogICB8IHNlYXJjaCAgICAgICAgfCBUaGUgc2VhcmNoIHBhcmFtcywgbWludXMgdGhlIHF1ZXN0aW9uIG1hcmsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICAgfCBoYXNoICAgICAgICAgIHwgVGhlIGhhc2ggc3RyaW5nLCBtaW51cyB0aGUgaGFzaCBzeW1ib2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgIHwgaG9zdG5hbWUgICAgICB8IFRoZSBob3N0bmFtZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogICB8IHBvcnQgICAgICAgICAgfCBUaGUgcG9ydCwgd2l0aG91dCBcIjpcIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogICB8IHBhdGhuYW1lICAgICAgfCBUaGUgcGF0aG5hbWUsIGJlZ2lubmluZyB3aXRoIFwiL1wiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICpcbiAqL1xuZnVuY3Rpb24gdXJsUmVzb2x2ZSh1cmwpIHtcbiAgaWYgKCFpc1N0cmluZyh1cmwpKSByZXR1cm4gdXJsO1xuXG4gIHZhciBocmVmID0gdXJsO1xuXG4gIC8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AqXG4gKlxuICogICBEZWZhdWx0cyB0byBgZmFsc2VgLlxuICpcbiAqIEBwYXJhbSB7c3RyaW5nfSBbYW55UHJvcGVydHlLZXldIFRoZSBzcGVjaWFsIHByb3BlcnR5IG5hbWUgdGhhdCBtYXRjaGVzIGFnYWluc3QgYW55IHByb3BlcnR5LlxuICogICAgIEJ5IGRlZmF1bHQgYCRgLlxuICpcbiAqIEBleGFtcGxlXG4gICA8ZXhhbXBsZSBuYW1lPVwiZmlsdGVyLWZpbHRlclwiPlxuICAgICA8ZmlsZSBuYW1lPVwiaW5kZXguaHRtbFwiPlxuICAgICAgIDxkaXYgbmctaW5pdD1cImZyaWVuZHMgPSBbe25hbWU6J0pvaG4nLCBwaG9uZTonNTU1LTEyNzYnfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge25hbWU6J01hcnknLCBwaG9uZTonODAwLUJJRy1NQVJZJ30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtuYW1lOidNaWtlJywgcGhvbmU6JzU1NS00MzIxJ30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtuYW1lOidBZGFtJywgcGhvbmU6JzU1NS01Njc4J30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtuYW1lOidKdWxpZScsIHBob25lOic1NTUtODc2NSd9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bmFtZTonSnVsaWV0dGUnLCBwaG9uZTonNTU1LTU2NzgnfV1cIj48L2Rpdj5cblxuICAgICAgIDxsYWJlbD5TZWFyY2g6IDxpbnB1dCBuZy1tb2RlbD1cInNlYXJjaFRleHRcIj48L2xhYmVsPlxuICAgICAgIDx0YWJsZSBpZD1cInNlYXJjaFRleHRSZXN1bHRzXCI+XG4gICAgICAgICA8dHI+PHRoPk5hbWU8L3RoPjx0aD5QaG9uZTwvdGg+PC90cj5cbiAgICAgICAgIDx0ciBuZy1yZXBlYXQ9XCJmcmllbmQgaW4gZnJ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ID0gMztcbiAgICAgICAgICAgICAkc2NvcGUubGV0dGVyTGltaXQgPSAzO1xuICAgICAgICAgICAgICRzY29wZS5sb25nTnVtYmVyTGltaXQgPSAzO1xuICAgICAgICAgICB9XSk7XG4gICAgICAgPC9zY3JpcHQ+XG4gICAgICAgPGRpdiBuZy1jb250cm9sbGVyPVwiRXhhbXBsZUNvbnRyb2xsZXJcIj5cbiAgICAgICAgIDxsYWJlbD5cbiAgICAgICAgICAgIExpbWl0IHt7bnVtYmVyc319IHRvOlxuICAgICAgICAgICAgPGlucHV0IHR5cGU9XCJudW1iZXJcIiBzdGVwPVwiMVwiIG5nLW1vZGVsPVwibnVtTGltaXRcIj5cbiAgICAgICAgIDwvbGFiZWw+XG4gICAgICAgICA8cD5PdXRwdXQgbnVtYmVyczoge3sgbnVtYmVycyB8IGxpbWl0VG86bnVtTGltaXQgfX08L3A+XG4gICAgICAgICA8bGFiZWw+XG4gICAgICAgICAgICBMaW1pdCB7e2xldHRlcnN9fSB0bzpcbiAgICAgICAgICAgIDxpbnB1dCB0eXBlPVwibnVtYmVyXCIgc3RlcD1cIjFcIiBuZy1tb2RlbD1cImxldHRlckxpbWl0XCI+XG4gICAgICAgICA8L2xhYmVsPlxuICAgICAgICAgPHA+T3V0cHV0IGxldHRlcnM6IHt7IGxldHRlcnMgfCBsaW1pdFRvOmxldHRlckxpbWl0IH19PC9wPlxuICAgICAgICAgPGxhYmVsPlxuICAgICAgICAgICAgTGltaXQge3tsb25nTnVtYmVyfX0gdG86XG4gICAgICAgICAgICA8aW5wdXQgdHlwZT1cIm51bWJlclwiIHN0ZXA9XCIxXCIgbmctbW9kZWw9XCJsb25nTnVtYmVyTGltaXRcIj5cbiAgICAgICAgIDwvbGFiZWw+XG4gICAgICAgICA8cD5PdXRwdXQgbG9uZyBudW1iZXI6IHt7IGxvbmdOdW1iZXIgfCBsaW1pdFRvOmxvbmdOdW1iZXJMaW1pdCB9fTwvcD5cbiAgICAgICA8L2Rpdj5cbiAgICAgP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JvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7XG4gICAgICAgICAgICRzY29wZS5mcmllbmRzID0gW1xuICAgICAgICAgICAgIHtuYW1lOiAnSm9obicsICAgcGhvbmU6ICc1NTUtMTIxMicsICBhZ2U6IDEwfSxcbiAgICAgICAgICAgICB7bmFtZTogJ01hcnknLCAgIHBob25lOiAnNTU1LTk4NzYnLCAgYWdlOiAxOX0sXG4gICAgICAgICAgICAge25hbWU6ICdNaWtlJywgICBwaG9uZTogJzU1NS00MzIxJywgIGFnZTogMjF9LFxuICAgICAgICAgICAgIHtuYW1lOiAnQWRhbScsICAgcGhvbmU6ICc1NTUtNTY3OCcsICBhZ2U6IDM1fSxcbiAgICAgICAgICAgICB7bmFtZTogJ0p1bGllJywgIHBob25lOiAnNTU1LTg3NjUnLCAgYWdlOiAyOX1cbiAgICAgICAgICAgXTtcbiAgICAgICAgIH1dKTtcbiAgICAgPC9maWxlPlxuICAgICA8ZmlsZSBuYW1lPVwic3R5bGUuY3NzXCI+XG4gICAgICAgLmZyaWVuZHMge1xuICAgICAgICAgYm9yZGVyLWNvbGxhcHNlOiBjb2xsYXBzZTtcbiAgICAgICB9XG5cbiAgICAgICAuZnJpZW5kcyB0aCB7XG4gICAgICAgICBib3JkZXItYm90dG9tOiAxcHggc29saWQ7XG4gICAgICAgfVxuICAgICAgIC5mcmllbmRzIHRkLCAuZnJpZW5kcyB0aCB7XG4gICAgICAgICBib3JkZXItbGVmdDogMXB4IHNvbGlkO1xuICAgICAgICAgcGFkZGluZzogNXB4IDEwcHg7XG4gICAgICAgfVxuICAgICAgIC5mcmllbmRzIHRkOmZpcnN0LWNoaWxkLCAuZnJpZW5kcyB0aDpmaXJzdC1jaGlsZCB7XG4gICAgICAgICBib3JkZXItbGVmdDogbm9uZTtcbiAgICAgICB9XG4gICAgIDwvZmlsZT5cbiAgICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJ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iAnSm9obicsICAgcGhvbmU6ICc1NTUtMTIxMicsICBhZ2U6IDEwfSxcbiAgICAgICAgICAgICB7bmFtZTogJ01hcnknLCAgIHBob25lOiAnNTU1LTk4NzYnLCAgYWdlOiAxOX0sXG4gICAgICAgICAgICAge25hbWU6ICdNaWtlJywgICBwaG9uZTogJzU1NS00MzIxJywgIGFnZTogMjF9LFxuICAgICAgICAgICAgIHtuYW1lOiAnQWRhbScsICAgcGhvbmU6ICc1NTUtNTY3OCcsICBhZ2U6IDM1fSxcbiAgICAgICAgICAgICB7bmFtZTogJ0p1bGllJywgIHBob25lOiAnNTU1LTg3NjUnLCAgYWdlOiAyOX1cbiAgICAgICAgICAgXTtcblxuICAgICAgICAgICAkc2NvcGUucHJvcGVydHlOYW1lID0gJ2FnZSc7XG4gICAgICAgICAgICRzY29wZS5yZXZlcnNlID0gdHJ1ZTtcbiAgICAgICAgICAgJHNjb3BlLmZyaWVuZHMgPSBvcmRlckJ5KGZyaWVuZHMsICRzY29wZS5wcm9wZXJ0eU5hbWUsICRzY29wZS5yZXZlcnNlKTtcblxuICAgICAgICAgICAkc2NvcGUuc29ydEJ5ID0gZnVuY3Rpb24ocHJvcGVydHlOYW1lKSB7XG4gICAgICAgICAgICAgJHNjb3BlLnJldmVyc2UgPSAocHJvcGVydHlOYW1lICE9PSBudWxsICYmICRzY29wZS5wcm9wZXJ0eU5hbWUgPT09IHByb3BlcnR5TmFtZSlcbiAgICAgICAgICAgICAgICAgPyAhJHNjb3BlLnJldmVyc2UgOiBmYWxzZTtcbiAgICAgICAgICAgICAkc2NvcGUucHJvcGVydHlOYW1lID0gcHJvcGVydHlOYW1lO1xuICAgICAgICAgICAgICRzY29wZS5mcmllbmRzID0gb3JkZXJCeShmcmllbmRzLCAkc2NvcGUucHJvcGVydHlOYW1lLCAkc2NvcGUucmV2ZXJzZSk7XG4gICAgICAgICAgIH07XG4gICAgICAgICB9XSk7XG4gICAgIDwvZmlsZT5cbiAgICAgPGZpbGUgbmFtZ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LyB3YXkgdGhhdCB3aWxsIGFjaGlldmUgdGhlIHByZXZlbnRpb24gb2YgdGhlIGRlZmF1bHQgYWN0aW9uLlxuICAgICAgICAgICAgICBmb3JtRWxlbWVudC5vbignJGRlc3Ryb3knLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIGZvcm1FbGVtZW50WzBdLnJlbW92ZUV2ZW50TGlzdGVuZXIoJ3N1Ym1pdCcsIGhhbmRsZUZvcm1TdWJtaXNzaW9uKTtcbiAgICAgICAgICAgICAgICB9LCAwLCBmYWxzZSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgcGFyZW50Rm9ybUN0cmwgPSBjdHJsc1sxXSB8fCBjb250cm9sbGVyLiQkcGFyZW50Rm9ybTtcbiAgICAgICAgICAgIHBhcmVudEZvcm1DdHJsLiRhZGRDb250cm9sKGNvbnRyb2xsZXIpO1xuXG4gICAgICAgICAgICB2YXIgc2V0dGVyID0gbmFtZUF0dHIgPyBnZXRTZXR0ZXIoY29udHJvbGxlci4kbmFtZSkgOiBub29wO1xuXG4gICAgICAgICAgICBpZiAobmFtZUF0dHIpIHtcbiAgICAgICAgICAgICAgc2V0dGVyKHNjb3BlLCBjb250cm9sbGVyKTtcbiAgICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZShuYW1lQXR0ciwgZnVuY3Rpb24obmV3VmFsdWUpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29udHJvbGxlci4kbmFtZSA9PT0gbmV3VmFsdWUpIHJldHVybjtcbiAgICAgICAgICAgICAgICBzZXR0ZXIoc2NvcGUsIHVuZGVmaW5lZCk7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci4kJHBhcmVudEZvcm0uJCRyZW5hbWVDb250cm9sKGNvbnRyb2xsZXIsIG5ld1ZhbHVlKTtcbiAgICAgICAgICAgICAgICBzZXR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Zvcm0uaW5wdXQuJHZhbGlkJykpO1xuICAgICAgICAgIHZhciBpbnB1dCA9IGVsZW1lbnQoYnkubW9kZWwoJ2VtYWlsLnRleHQnKSk7XG5cbiAgICAgICAgICBpdCgnc2hvdWxkIGluaXRpYWxpemUgdG8gbW9kZWwnLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGV4cGVjdCh0ZXh0LmdldFRleHQoKSkudG9Db250YWluKCdtZUBleGFtcGxlLmNvbScpO1xuICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBpdCgnc2hvdWxkIGJlIGludmFsaWQgaWYgZW1wdHknLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGlucHV0LmNsZWFyKCk7XG4gICAgICAgICAgICBpbnB1dC5zZW5kS2V5cygnJyk7XG4gICAgICAgICAgICBleHBlY3QodGV4dC5nZXRUZXh0KCkpLnRvRXF1YWwoJ3RleHQgPScpO1xuICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIG5vdCBlbWFpbCcsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgaW5wdXQuY2xlYXIoKTtcbiAgICAgICAgICAgIGlucHV0LnNlbmRLZXlzKCd4eHgnKTtcblxuICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICAgIH0pO1xuICAgICAgICA8L2ZpbGU+XG4gICAgICA8L2V4YW1wbGU+XG4gICAqL1xuICAnZW1haWwnOiBlbWFpbElucHV0VHlwZSxcblxuXG4gIC8qKlxuICAgKiBAbmdkb2MgaW5wdXRcbiAgICogQG5hbWUgaW5wdXRbcmFkaW9dXG4gICAqX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c2NyaXB0PlxuICAgICAgICAgICBhbmd1bGFyLm1vZHVsZSgncmFkaW9FeGFtcGxlJywgW10pXG4gICAgICAgICAgICAgLmNvbnRyb2xsZXIoJ0V4YW1wbGVDb250cm9sbGVyJywgWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpIHtcbiAgICAgICAgICAgICAgICRzY29wZS5jb2xvciA9IHtcbiAgICAgICAgICAgICAgICAgbmFtZTogJ2JsdWUnXG4gICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgJHNjb3BlLnNwZWNpYWxWYWx1ZSA9IHtcbiAgICAgICAgICAgICAgICAgXCJpZFwiOiBcIjEyMzQ1XCIsXG4gICAgICAgICAgICAgICAgIFwidmFsdWVcIjogXCJncmVlblwiXG4gICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgIH1dKTtcbiAgICAgICAgIDwvc2NyaXB0PlxuICAgICAgICAgPGZvcm0gbmFtZT1cIm15Rm9ybVwiIG5nLWNvbnRyb2xsZXI9XCJFeGFtcGxlQ29udHJvbGxlclwiPlxuICAgICAgICAgICA8bGFiZWw+XG4gICAgICAgICAgICAgPGlucHV0IHR5cGU9XCJyYWRpb1wiIG5nLW1vZGVsPVwiY29sb3IubmFtZVwiIHZhbHVlPVwicmVkXCI+XG4gICAgICAgICAgICAgUmVkXG4gICAgICAgICAgIDwvbGFiZWw+PGJyLz5cbiAgICAgICAgICAgPGxhYmVsPlxuICAgICAgICAgICAgIDxpbnB1dCB0eXBlPVwicmFkaW9cIiBuZy1tb2RlbD1cImNvbG9yLm5hbWVcIiBuZy12YWx1ZT1cInNwZWNpYWxWYWx1ZVwiPlxuICAgICAgICAgICAgIEdyZWVuXG4gICAgICAgICAgIDwvbGFiZWw+PGJyLz5cbiAgICAgICAgICAgPGxhYmVsPlxuICAgICAgICAgICAgIDxpbnB1dCB0eXBlPVwicmFkaW9cIiBuZy1tb2RlbD1cImNvbG9yLm5hbWVcIiB2YWx1ZT1cImJsdWVcIj5cbiAgIC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lxuICAgICAgICAgICAgdmFsdWUgPSA8Y29kZT57e3ZhbHVlfX08L2NvZGU+PGJyLz5cbiAgICAgICAgICAgIG15Rm9ybS5yYW5nZS4kdmFsaWQgPSA8Y29kZT57e215Rm9ybS5yYW5nZS4kdmFsaWR9fTwvY29kZT48YnIvPlxuICAgICAgICAgICAgbXlGb3JtLnJhbmdlLiRlcnJvciA9IDxjb2RlPnt7bXlGb3JtLnJhbmdlLiRlcnJvcn19PC9jb2RlPlxuICAgICAgICAgIDwvZm9ybT5cbiAgICAgICAgPC9maWxlPlxuICAgICAgPC9leGFtcGxlPlxuXG4gICAqICMjIFJhbmdlIElucHV0IHdpdGggbmdNaW4gJiBuZ01heCBhdHRyaWJ1dGVzXG5cbiAgICogQGV4YW1wbGVcbiAgICAgIDxleGFtcGxlIG5hbWU9XCJyYW5nZS1pbnB1dC1kaXJlY3RpdmUtbmdcIiBtb2R1bGU9XCJyYW5nZUV4YW1wbGVcIj5cbiAgICAgICAgPGZpbGUgbmFtZT1cImluZGV4Lmh0bWxcIj5cbiAgICAgICAgICA8c2NyaXB0PlxuICAgICAgICAgICAgYW5ndWxhci5tb2R1bGUoJ3JhbmdlRXhhbXBsZScsIFtdKVxuICAgICAgICAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkge1xuICAgICAgICAgICAgICAgICRzY29wZS52YWx1ZSA9IDc1O1xuICAgICAgICAgICAgICAgICRzY29wZS5taW4gPSAxMDtcbiAgICAgICAgICAgICAgICAkc2NvcGUubWF4ID0gOTA7XG4gICAgICAgICAgICAgIH1dKTtcbiAgICAgICAgICA8L3NjcmlwdD5cbiAgICAgICAgICA8Zm9ybSBuYW1lPVwibXlGb3JtXCIgbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICAgICAgICBNb2RlbCBhcyByYW5nZTogPGlucHV0IHR5cGU9XCJyYW5nZVwi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4gICAgICB9XG4gICAgICByZWdleHAubGFzdEluZGV4ID0gMDtcbiAgICAgIHBhcnRzID0gcmVnZXhwLmV4ZWMoaXNvKTtcblxuICAgICAgaWYgKHBhcnRzKSB7XG4gICAgICAgIHBhcnRzLnNoaWZ0KCk7XG4gICAgICAgIGlmIChwcmV2aW91c0RhdGUpIHtcbiAgICAgICAgICBtYXAgPSB7XG4gICAgICAgICAgICB5eXl5OiBwcmV2aW91c0RhdGUuZ2V0RnVsbFllYXIoKSxcbiAgICAgICAgICAgIE1NOiBwcmV2aW91c0RhdGUuZ2V0TW9udGgoKSArIDEsXG4gICAgICAgICAgICBkZDogcHJldmlvdXNEYXRlLmdldERhdGUoKSxcbiAgICAgICAgICAgIEhIOiBwcmV2aW91c0RhdGUuZ2V0SG91cnMoKSxcbiAgICAgICAgICAgIG1tOiBwcmV2aW91c0RhdGUuZ2V0TWludXRlcygpLFxuICAgICAgICAgICAgc3M6IHByZXZpb3VzRGF0ZS5nZXRTZWNvbmRzKCksXG4gICAgICAgICAgICBzc3M6IHByZXZpb3VzRGF0ZS5nZXRNaWxsaXNlY29uZHMoKSAvIDEwMDBcbiAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIG1hcCA9IHsgeXl5eTogMTk3MCwgTU06IDEsIGRkOiAxLCBISDogMCwgbW06IDAsIHNzOiAwLCBzc3M6IDAgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvckVhY2gocGFydHMsIGZ1bmN0aW9uKHBhcnQsIGluZGV4KSB7XG4gICAgICAgICAgaWYgKGluZGV4IDwgbWFwcGluZy5sZW5ndGgpIHtcbiAgICAgICAgICAgIG1hcFttYXBwaW5nW2luZGV4XV0gPSArcGFydDtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHZhciBkYXRlID0gbmV3IERhdGUobWFwLnl5eXksIG1hcC5NTSAtIDEsIG1hcC5kZCwgbWFwLkhILCBtYXAubW0sIG1hcC5zcyB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gICAgICAgIGlmIChjdHJsc1swXSkge1xuICAgICAgICAgIChpbnB1dFR5cGVbbG93ZXJjYXNlKGF0dHIudHlwZSldIHx8IGlucHV0VHlwZS50ZXh0KShzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybHNbMF0sICRzbmlmZmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYnJvd3NlciwgJGZpbHRlciwgJHBhcnNlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfTtcbn1dO1xuXG5cbnZhciBoaWRkZW5JbnB1dEJyb3dzZXJDYWNoZURpcmVjdGl2ZSA9IGZ1bmN0aW9uKCkge1xuICB2YXIgdmFsdWVQcm9wZXJ0eSA9IHtcbiAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgZW51bWVyYWJsZTogZmFsc2UsXG4gICAgZ2V0OiBmdW5jdGlvbigpIHtcbiAgICAgIHJldHVybiB0aGlzLmdldEF0dHJpYnV0ZSgndmFsdWUnKSB8fCAnJztcbiAgICB9LFxuICAgIHNldDogZnVuY3Rpb24odmFsKSB7XG4gICAgICB0aGlzLnNldEF0dHJpYnV0ZSgndmFsdWUnLCB2YWwpO1xuICAgIH1cbiAgfTtcblxuICByZXR1cm4ge1xuICAgIHJlc3RyaWN0OiAnRScsXG4gICAgcHJpb3JpdHk6IDIwMCxcbiAgICBjb21waWxlOiBmdW5jdGlvbihfLCBhdHRyKSB7XG4gICAgICBpZiAobG93ZXJjYXNlKGF0dHIudHlwZSkgIT09ICdoaWRkZW4nKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgcHJlOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybHMpIHtcbiAgICAgICAgICB2YXIgbm9kZSA9IGVsZW1lbnRbMF07XG5cbiAgICAgICAgICAvLyBTdXBwb3J0OiBFZGdlXG4g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AgICAkc2NvcGUubmFtZXMgPSBbJ3BpenphJywgJ3VuaWNvcm5zJywgJ3JvYm90cyddO1xuICAgICAgICAgICAgICAkc2NvcGUubXkgPSB7IGZhdm9yaXRlOiAndW5pY29ybnMnIH07XG4gICAgICAgICAgICB9XSk7XG4gICAgICAgPC9zY3JpcHQ+XG4gICAgICAgIDxmb3JtIG5nLWNvbnRyb2xsZXI9XCJFeGFtcGxlQ29udHJvbGxlclwiPlxuICAgICAgICAgIDxoMj5XaGljaCBpcyB5b3VyIGZhdm9yaXRlPzwvaDI+XG4gICAgICAgICAgICA8bGFiZWwgbmctcmVwZWF0PVwibmFtZSBpbiBuYW1lc1wiIGZvcj1cInt7bmFtZX19XCI+XG4gICAgICAgICAgICAgIHt7bmFtZX19XG4gICAgICAgICAgICAgIDxpbnB1dCB0eXBlPVwicmFkaW9cIlxuICAgICAgICAgICAgICAgICAgICAgbmctbW9kZWw9XCJteS5mYXZvcml0ZVwiXG4gICAgICAgICAgICAgICAgICAgICBuZy12YWx1ZT1cIm5hbWVcIlxuICAgICAgICAgICAgICAgICAgICAgaWQ9XCJ7e25hbWV9fVwiXG4gICAgICAgICAgICAgICAgICAgICBuYW1lPVwiZmF2b3JpdGVcIj5cbiAgICAgICAgICAgIDwvbGFiZWw+XG4gICAgICAgICAgPGRpdj5Zb3UgY2hvc2Uge3tteS5mYXZvcml0ZX19PC9kaXY+XG4gICAgICAgIDwvZm9ybT5cbiAgICAgIDwvZmlsZT5cbiAgICAgIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb3RyYWN0b3JcIj5cbiAgICAgICAgdmFyIGZhdm9yaXRlID0gZWxlbWVudChieS5iaW5kaW5nKCdteS5mYXZvcml0ZScpKTtcblxuICAgICAgICBpdCgnc2hvdWxkIGluaXRpYWxpemUgdG8gbW9kZWwnLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICBleHBlY3QoZmF2b3JpdGUuZ2V0VGV4dCgpKS50b0Nvb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jaGFuZ2UtZXhhbXBsZTJcIj5Db25maXJtZWQ8L2xhYmVsPjxiciAvPlxuICogICAgICAgPHR0PmRlYnVnID0ge3tjb25maXJtZWR9fTwvdHQ+PGJyLz5cbiAqICAgICAgIDx0dD5jb3VudGVyID0ge3tjb3VudGVyfX08L3R0Pjxici8+XG4gKiAgICAgPC9kaXY+XG4gKiAgIDwvZmlsZT5cbiAqICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJhY3RvclwiPlxuICogICAgIHZhciBjb3VudGVyID0gZWxlbWVudChieS5iaW5kaW5nKCdjb3VudGVyJykpO1xuICogICAgIHZhciBkZWJ1ZyA9IGVsZW1lbnQoYnkuYmluZGluZygnY29uZmlybWVkJykpO1xuICpcbiAqICAgICBpdCgnc2hvdWxkIGV2YWx1YXRlIHRoZSBleHByZXNzaW9uIGlmIGNoYW5naW5nIGZyb20gdmlldycsIGZ1bmN0aW9uKCkge1xuICogICAgICAgZXhwZWN0KGNvdW50ZXIuZ2V0VGV4dCgpKS50b0NvbnRhaW4oJzAnKTtcbiAqXG4gKiAgICAgICBlbGVtZW50KGJ5LmlkKCduZy1jaGFuZ2UtZXhhbXBsZTEnKSkuY2xpY2soKTtcbiAqXG4gKiAgICAgICBleHBlY3QoY291bnRlci5nZXRUZXh0KCkpLnRvQ29udGFpbignMScpO1xuICogICAgICAgZXhwZWN0KGRlYnVnLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7XG4gKiAgICAgfSk7XG4gKlxuICogICAgIGl0KCdzaG91bGQgbm90IGV2YWx1YXRlIHRoZSBleHByZXNzaW9uIGlmIGNoYW5naW5nIGZyb20gbW9kZWwnLCBmdW5jdGlvbigpIHtcbiAqICAgICAgIGVsZW1lbnQoYnkuaWQoJ25nLWNoYW5nZS1leGFtcGxlMicpKS5jbGljaygpO1xuXG4gKiAgICAgICBleHBlY3QoY291bnRlci5nZXRUZXh0KCkpLnRvQ29udGFpbignMCcpO1xuIC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cIj5cbiAqICAgICBpdCgnc2hvdWxkIGNoZWNrIGNvbnRyb2xsZXIgYXMnLCBmdW5jdGlvbigpIHtcbiAqICAgICAgIHZhciBjb250YWluZXIgPSBlbGVtZW50KGJ5LmlkKCdjdHJsLWFzLWV4bXBsJykpO1xuICogICAgICAgICBleHBlY3QoY29udGFpbmVyLmVsZW1lbnQoYnkubW9kZWwoJ3NldHRpbmdzLm5hbWUnKSlcbiAqICAgICAgICAgICAuZ2V0QXR0cmlidXRlKCd2YWx1ZScpKS50b0JlKCdKb2huIFNtaXRoJyk7XG4gKlxuICogICAgICAgdmFyIGZpcnN0UmVwZWF0ID1cbiAqICAgICAgICAgICBjb250YWluZXIuZWxlbWVudChieS5yZXBlYXRlcignY29udGFjdCBpbiBzZXR0aW5ncy5jb250YWN0cycpLnJvdygwKSk7XG4gKiAgICAgICB2YXIgc2Vjb25kUmVwZWF0ID1cbiAqICAgICAgICAgICBjb250YWluZXIuZWxlbWVudChieS5yZXBlYXRlcignY29udGFjdCBpbiBzZXR0aW5ncy5jb250YWN0cycpLnJvdygxKSk7XG4gKlxuICogICAgICAgZXhwZWN0KGZpcnN0UmVwZWF0LmVsZW1lbnQoYnkubW9kZWwoJ2NvbnRhY3QudmFsdWUnKSkuZ2V0QXR0cmlidXRlKCd2YWx1ZScpKVxuICogICAgICAgICAgIC50b0JlKCc0MDggNTU1IDEyMTInKTtcbiAqXG4gKiAgICAgICBleHBlY3Qoc2Vjb25kUmVwZWF0LmVsZW1lbnQoYnkubW9kZWwoJ2NvbnRhY3QudmFsdWUnKSkuZ2V0QXR0cmlidXRlKCd2YWx1ZScpKVxuICogICAgICAgICAgIC50b0JlKCdqb2huLnNtaXRoQGV4YW1wbGUub3JnJyk7XG4gKlxuICogICAgICAgZmlyc3RSZXBlYXQuZWxlbWVudChieS5idXR0b25UZXh0KCdjbGVhcicpKS5jbGljaygpO1xuICpcbiAqICAgICAgIGV4cGVjdChmaXJzdFJlcGVhdC5lbGVtZW50KGJ5L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R5cGU6J3Bob25lJywgdmFsdWU6JzQwOCA1NTUgMTIxMid9LFxuICogICAgICAge3R5cGU6J2VtYWlsJywgdmFsdWU6J2pvaG4uc21pdGhAZXhhbXBsZS5vcmcnfVxuICogICAgIF07XG4gKlxuICogICAgICRzY29wZS5ncmVldCA9IGZ1bmN0aW9uKCkge1xuICogICAgICAgYWxlcnQoJHNjb3BlLm5hbWUpO1xuICogICAgIH07XG4gKlxuICogICAgICRzY29wZS5hZGRDb250YWN0ID0gZnVuY3Rpb24oKSB7XG4gKiAgICAgICAkc2NvcGUuY29udGFjdHMucHVzaCh7dHlwZTonZW1haWwnLCB2YWx1ZToneW91cm5hbWVAZXhhbXBsZS5vcmcnfSk7XG4gKiAgICAgfTtcbiAqXG4gKiAgICAgJHNjb3BlLnJlbW92ZUNvbnRhY3QgPSBmdW5jdGlvbihjb250YWN0VG9SZW1vdmUpIHtcbiAqICAgICAgIHZhciBpbmRleCA9ICRzY29wZS5jb250YWN0cy5pbmRleE9mKGNvbnRhY3RUb1JlbW92ZSk7XG4gKiAgICAgICAkc2NvcGUuY29udGFjdHMuc3BsaWNlKGluZGV4LCAxKTtcbiAqICAgICB9O1xuICpcbiAqICAgICAkc2NvcGUuY2xlYXJDb250YWN0ID0gZnVuY3Rpb24oY29udGFjdCkge1xuICogICAgICAgY29udGFjdC50eXBlID0gJ3Bob25lJztcbiAqICAgICAgIGNvbnRhY3QudmFsdWUgPSAnJztcbiAqICAgICB9O1xuICogICB9XG4gKiAgPC9maWxlPlxuICogIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb3RyYWN0b3JcIj5cbiAqICAgIGl0KCdzaG91bGQgY2hlY2sgY29udHJvbGxlcicsIGZ1bmN0aW9uKCkge1xuICogICAgICB2YXIgY29udGFpbmVyID0gZWxlbWVudChieS5pZCgnY3RybC1leG1wbCcpKTtcbiAqXG4gKiAgICAgIGV4cGVjdChjb250YWluZXIuZWxlbWVudChieS5tb2RlbCgnbmFtZScpKVxuICogICAgICAgICAgLmdldEF0dHJpYnV0ZSgndmFsdWUnKSkudG9CZSgnSm9obiBTbWl0aCcpO1xuICpcbiAqICAgICAgdmFyIGZpcnN0UmVwZWF0ID1cbiAqICAgICAgICAgIGNvbnRhaW5lci5lbGVtZW50KGJ5LnJlcGVhdGVyKCdjb250YWN0IGluIGNvbnRhY3RzJykucm93KDApKTtcbiAqICAgICAgdmFyIHNlY29uZFJlcGVhdCA9XG4gKiAgICAgICAgICBjb250YWluZXIuZWxlbWVudChieS5yZXBlYXRlcignY29udGFjdCBpbiBjb250YWN0cycpLnJvdygxKSk7XG4gKlxuICogICAgICBleHBlY3QoZmlyc3RSZXBlYXQuZWxlbWVudChieS5tb2RlbCgnY29udGFjdC52YWx1ZScpKS5nZXRBdHRyaWJ1dGUoJ3ZhbHVlJykpXG4gKiAgICAgICAgICAudG9CZSgnNDA4IDU1NSAxMjEyJyk7XG4gKiAgICAgIGV4cGVjdChzZWNvbmRSZXBlYXQuZWxlbWVudChieS5tb2RlbCgnY29udGFjdC52YWx1ZScpKS5nZXRBdHRyaWJ1dGUoJ3ZhbHVlJykpXG4gKiAgICAgICAgICAudG9CZSgnam9obi5zbWl0aEBleGFtcGxlLm9yZycpO1xuICpcbiAqICAgICAgZmlyc3RSZXBlYXQuZWxlbWVudChieS5idXR0b25UZXh0KCdjbGVhcicpKS5jbGljaygpO1xuICpcbiAqICAgICAgZXhwZWN0KGZpcnN0UmVwZWF0LmVsZW1lbnQoYnkubW9kZWwoJ2NvbnRhY3QudmFsdWUnKSkuZ2V0QXR0cmlidXRlKCd2YWx1ZScpKVxuICogICAgICAgICAgLnRvQmUoJycpO1xuICpcbiAqICAgICAgY29udGFpbmVyLmVsZW1lbnQoYnkuYnV0dG9uVGV4dCgnYWRkJykpLmNsaWNrKCk7XG4gKlxuICogICAgICBleHBlY3QoY29udGFpbmVyLmVsZW1lbnQoYnkucmVwZWF0ZXIoJ2NvbnRhY3QgaW4gY29udGFjdHMn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d2l0aCB0ZW1wbGF0ZVVybCB3aGVuIGl0cyB0ZW1wbGF0ZSBhcnJpdmVzLlxuICAgICAgICAgICAgICAgIGJsb2NrID0ge1xuICAgICAgICAgICAgICAgICAgY2xvbmU6IGNsb25lXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZS5lbnRlcihjbG9uZSwgJGVsZW1lbnQucGFyZW50KCksICRlbGVtZW50KTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChwcmV2aW91c0VsZW1lbnRzKSB7XG4gICAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudHMucmVtb3ZlKCk7XG4gICAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudHMgPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGNoaWxkU2NvcGUpIHtcbiAgICAgICAgICAgICAgY2hpbGRTY29wZS4kZGVzdHJveSgpO1xuICAgICAgICAgICAgICBjaGlsZFNjb3BlID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChibG9jaykge1xuICAgICAgICAgICAgICBwcmV2aW91c0VsZW1lbnRzID0gZ2V0QmxvY2tOb2RlcyhibG9jay5jbG9uZSk7XG4gICAgICAgICAgICAgICRhbmltYXRlLmxlYXZlKHByZXZpb3VzRWxlbWVudHMpLmRvbmUoZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UgIT09IGZhbHNlKSBwcmV2aW91c0VsZW1lbnRzID0gbnVsbDtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGJsb2NrID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cbiAgfTtcbn1dO1xuXG4vKipcbiAqIEBuZ2RvYyBkaXJlY3RpdmVcbiA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0cmwsICR0cmFuc2NsdWRlKSB7XG4gICAgICAgIHZhciBjaGFuZ2VDb3VudGVyID0gMCxcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZSxcbiAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudCxcbiAgICAgICAgICAgIGN1cnJlbnRFbGVtZW50O1xuXG4gICAgICAgIHZhciBjbGVhbnVwTGFzdEluY2x1ZGVDb250ZW50ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgaWYgKHByZXZpb3VzRWxlbWVudCkge1xuICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50LnJlbW92ZSgpO1xuICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGN1cnJlbnRTY29wZSkge1xuICAgICAgICAgICAgY3VycmVudFNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUgPSBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoY3VycmVudEVsZW1lbnQpIHtcbiAgICAgICAgICAgICRhbmltYXRlLmxlYXZlKGN1cnJlbnRFbGVtZW50KS5kb25lKGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgIGlmIChyZXNwb25zZSAhPT0gZmFsc2UpIHByZXZpb3VzRWxlbWVudCA9IG51bGw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudCA9IGN1cnJlbnRFbGVtZW50O1xuICAgICAgICAgICAgY3VycmVudEVsZW1lbnQgPSBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS4kd2F0Y2goc3JjRXhwLCBmdW5jdGlvbiBuZ0luY2x1ZGVXYXRjaEFjdGlvbihzcmMpIHtcbiAgICAgICAgICB2YXIgYWZ0ZXJBbmltYXRpb24gPSBmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAga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iAgIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb3RyYWN0b3JcIj5cbiAqICAgICB2YXIgbGlzdElucHV0ID0gZWxlbWVudChieS5tb2RlbCgnbmFtZXMnKSk7XG4gKiAgICAgdmFyIG5hbWVzID0gZWxlbWVudChieS5leGFjdEJpbmRpbmcoJ25hbWVzJykpO1xuICogICAgIHZhciB2YWxpZCA9IGVsZW1lbnQoYnkuYmluZGluZygnbXlGb3JtLm5hbWVzSW5wdXQuJHZhbGlkJykpO1xuICogICAgIHZhciBlcnJvciA9IGVsZW1lbnQoYnkuY3NzKCdzcGFuLmVycm9yJykpO1xuICpcbiAqICAgICBpdCgnc2hvdWxkIGluaXRpYWxpemUgdG8gbW9kZWwnLCBmdW5jdGlvbigpIHtcbiAqICAgICAgIGV4cGVjdChuYW1lcy5nZXRUZXh0KCkpLnRvQ29udGFpbignW1wibW9ycGhldXNcIixcIm5lb1wiLFwidHJpbml0eVwiXScpO1xuICogICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7XG4gKiAgICAgICBleHBlY3QoZXJyb3IuZ2V0Q3NzVmFsdWUoJ2Rpc3BsYXknKSkudG9CZSgnbm9uZScpO1xuICogICAgIH0pO1xuICpcbiAqICAgICBpdCgnc2hvdWxkIGJlIGludmFsaWQgaWYgZW1wdHknLCBmdW5jdGlvbigpIHtcbiAqICAgICAgIGxpc3RJbnB1dC5jbGVhcigpO1xuICogICAgICAgbGlzdElucHV0LnNlbmRLZXlzKCcnKTtcbiAqXG4gKiAgICAgICBleHBlY3QobmFtZXMuZ2V0VGV4dCgpKS50b0NvbnRhaW4oJycpO1xuICogICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICogICAgICAgZXhwZWN0KGVycm9yLmdldENzc1ZhbHVlKCdkaXNwbGF5JykpLm5vdC50b0JlKCdub25lJyk7XG4gKiAgICAgf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yZWN0aXZlKCdjb250ZW50ZWRpdGFibGUnLCBbJyRzY2UnLCBmdW5jdGlvbigkc2NlKSB7XG4gICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsIC8vIG9ubHkgYWN0aXZhdGUgb24gZWxlbWVudCBhdHRyaWJ1dGVcbiAgICAgICAgICAgIHJlcXVpcmU6ICc/bmdNb2RlbCcsIC8vIGdldCBhIGhvbGQgb2YgTmdNb2RlbENvbnRyb2xsZXJcbiAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgbmdNb2RlbCkge1xuICAgICAgICAgICAgICBpZiAoIW5nTW9kZWwpIHJldHVybjsgLy8gZG8gbm90aGluZyBpZiBubyBuZy1tb2RlbFxuXG4gICAgICAgICAgICAgIC8vIFNwZWNpZnkgaG93IFVJIHNob3VsZCBiZSB1cGRhdGVkXG4gICAgICAgICAgICAgIG5nTW9kZWwuJHJlbmRlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGVsZW1lbnQuaHRtbCgkc2NlLmdldFRydXN0ZWRIdG1sKG5nTW9kZWwuJHZpZXdWYWx1ZSB8fCAnJykpO1xuICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgIC8vIExpc3RlbiBmb3IgY2hhbmdlIGV2ZW50cyB0byBlbmFibGUgYmluZGluZ1xuICAgICAgICAgICAgICBlbGVtZW50Lm9uKCdibHVyIGtleXVwIGNoYW5nZScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHNjb3BlLiRldmFsQXN5bmMocmVhZCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICByZWFkKCk7IC8vIGluaXRpYWxpemVcblxuICAgICAgICAgICAgICAvLyBXcml0ZSBkYXRhIHRvIHRoZSBtb2RlbFxuICAgICAgICAgICAgICBmdW5jdGlvbiByZWFkKCkge1xuICAgICAgICAgICAgICAgIHZhciBod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gICAgICAgICAge25hbWU6ICdDbGVtZW50aW5lJywgaWQ6IDk3Mn0sXG4gICAgICAgICAgICB7bmFtZTogJ0R1cmlhbicsIGlkOiAxNjl9LFxuICAgICAgICAgICAge25hbWU6ICdKYWNrZnJ1aXQnLCBpZDogOTgyfSxcbiAgICAgICAgICAgIHtuYW1lOiAnU3RyYXdiZXJyeScsIGlkOiA4NjN9XG4gICAgICAgICAgXTtcbiAgICAgICAgfSlcbiAgICAgICAgLmNvbXBvbmVudCgnYmFzaWNBdXRvY29tcGxldGUnLCB7XG4gICAgICAgICAgYmluZGluZ3M6IHtcbiAgICAgICAgICAgIGl0ZW1zOiAnPCcsXG4gICAgICAgICAgICBvblNlbGVjdDogJyYnXG4gICAgICAgICAgfSxcbiAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2F1dG9jb21wbGV0ZS5odG1sJyxcbiAgICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigkZWxlbWVudCwgJHNjb3BlKSB7XG4gICAgICAgICAgICB2YXIgdGhhdCA9IHRoaXM7XG4gICAgICAgICAgICB2YXIgbmdNb2RlbDtcblxuICAgICAgICAgICAgdGhhdC4kcG9zdExpbmsgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgbmdNb2RlbCA9ICRlbGVtZW50LmZpbmQoJ2lucHV0JykuY29udHJvbGxlcignbmdNb2RlbCcpO1xuXG4gICAgICAgICAgICAgIG5nTW9kZWwuJGZvcm1hdHRlcnMucHVzaChmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAodmFsdWUgJiYgdmFsdWUubmFtZSkgfHwgdmFsdWU7XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIG5nTW9kZWwuJHBhcnNlcnMucHVzaChmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHZhciBtYXRjaCA9IHZhbHVlO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhhdC5pdGVtcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgaWYgKHRoYXQuaXRlbXNbaV0ubmFtZSA9PT0gdmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2ggPSB0aGF0Lml0ZW1zW2ldO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2g7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgdGhhdC5zZWxlY3RJdGVtID0gZnVuY3Rpb24oaXRlbSkge1xuICAgICAgICAgICAgICBuZ01vZGVsLiRzZXRWaWV3VmFsdWUoaXRlbSk7XG4gICAgICAgICAgICAgIG5nTW9kZWwuJHByb2Nlc3NNb2RlbFZhbHVlKCk7XG4gICAgICAgICAgICAgIHRoYXQub25TZWxlY3Qoe2l0ZW06IGl0ZW19KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgPC9maWxlPlxuICAgICA8ZmlsZSBuYW1lPVwiYXV0b2NvbXBsZXRlLmh0bWxcIj5cbiAgICAgICA8ZGl2PlxuICAgICAgICAgPGlucHV0IHR5cGU9XCJzZWFyY2hcIiBuZy1tb2RlbD1cIiRjdHJsLnNlYXJjaFRlcm1cIiAvPlxuICAgICAgICAgPHVsPlxuICAgICAgICAgICA8bGkgbmctcmVwZWF0PVwiaXRlbSBpbiAkY3RybC5pdGVtcyB8IGZpbHRlcjokY3RybC5zZWFyY2hUZXJtXCI+XG4gICAgICAgICAgICAgPGJ1dHRvbiBuZy1jbGljaz1cIiRjdHJsLnNlbGVjdEl0ZW0oaXRlbSlcIj57eyBpdGVtLm5hbWUgfX08L2J1dHRvbj5cbiAgICAgICAgICAgPC9saT5cbiAgICAgICAgIDwvdWw+XG4gICAgICAgPC9kaXY+XG4gICA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GlvbihuZXdWYWx1ZSkge1xuICAgICAgICAgICAgaWYgKG1vZGVsQ3RybC4kbmFtZSAhPT0gbmV3VmFsdWUpIHtcbiAgICAgICAgICAgICAgbW9kZWxDdHJsLiQkcGFyZW50Rm9ybS4kJHJlbmFtZUNvbnRyb2wobW9kZWxDdHJsLCBuZXdWYWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBzY29wZS4kb24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBtb2RlbEN0cmwuJCRwYXJlbnRGb3JtLiRyZW1vdmVDb250cm9sKG1vZGVsQ3RybCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Q6IGZ1bmN0aW9uIG5nTW9kZWxQb3N0TGluayhzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybHMpIHtcbiAgICAgICAgICB2YXIgbW9kZWxDdHJsID0gY3RybHNbMF07XG4gICAgICAgICAgbW9kZWxDdHJsLiQkc2V0VXBkYXRlT25FdmVudHMoKTtcblxuICAgICAgICAgIGZ1bmN0aW9uIHNldFRvdWNoZWQoKSB7XG4gICAgICAgICAgICBtb2RlbEN0cmwuJHNldFRvdWNoZWQoKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBlbGVtZW50Lm9uKCdibHVyJywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBpZiAobW9kZWxDdHJsLiR0b3VjaGVkKSByZXR1cm47XG5cbiAgICAgICAgICAgIGlmICgkcm9vdFNjb3BlLiQkcGhhc2UpIHtcbiAgICAgICAgICAgICAgc2NvcGUuJGV2YWxBc3luYyhzZXRUb3VjaGVkKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHNjb3BlLiRhcHBseShzZXRUb3VjaGVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICB9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ciMkb3ZlcnJpZGVNb2RlbE9wdGlvbnMgJG92ZXJyaWRlTW9kZWxPcHRpb25zfS5cbiAqXG4gIDxleGFtcGxlIG5hbWU9XCJuZ01vZGVsT3B0aW9ucy1hZHZhbmNlZFwiIG1vZHVsZT1cIm9wdGlvbnNFeGFtcGxlXCI+XG4gICAgPGZpbGUgbmFtZT1cImluZGV4Lmh0bWxcIj5cbiAgICAgICA8bW9kZWwtdXBkYXRlLWRlbW8+PC9tb2RlbC11cGRhdGUtZGVtbz5cbiAgICA8L2ZpbGU+XG4gICAgPGZpbGUgbmFtZT1cImFwcC5qc1wiPlxuICAgICAgYW5ndWxhci5tb2R1bGUoJ29wdGlvbnNFeGFtcGxlJywgW10pXG4gICAgICAgIC5jb21wb25lbnQoJ21vZGVsVXBkYXRlRGVtbycsIHtcbiAgICAgICAgICB0ZW1wbGF0ZVVybDogJ3RlbXBsYXRlLmh0bWwnLFxuICAgICAgICAgIGNvbnRyb2xsZXI6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdGhpcy5uYW1lID0gJ0NoaW51YSc7XG5cbiAgICAgICAgICAgIHRoaXMub3B0aW9ucyA9IHtcbiAgICAgICAgICAgICAgdXBkYXRlT246ICdkZWZhdWx0IGJsdXIgY2xpY2snLFxuICAgICAgICAgICAgICBkZWJvdW5jZToge1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6IDIwMDAsXG4gICAgICAgICAgICAgICAgYmx1cjogMCxcbiAgICAgICAgICAgICAgICAnKic6IDEwMDBcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgdGhpcy51cGRhdGVFdmVudHMgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIGV2ZW50TGlzdCA9IHRoaXMub3B0aW9ucy51cGRhdGVPbi5zcGxpdCgnICcpO1xuICAgICAgICAgICAgICBldmVudExpc3QucHVzaCgnKicpO1xuICAgICAgICAgICAgICB2YXIgZXZlbnRzID0ge307XG5cbiAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBldmVudExpc3QubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBldmVudHNbZXZlbnRMaXN0W2ldXSA9IHRoaXMub3B0aW9ucy5kZWJvdW5jZVtldmVudExpc3RbaV1dO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdGhpcy5ldmVudHMgPSBldmVudHM7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB0aGlzLnVwZGF0ZU9wdGlvbnMgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSBhbmd1bGFyLmV4dGVuZCh0aGlzLm9wdGlvbnMsIHtcbiAgICAgICAgICAgICAgICB1cGRhdGVPbjogT2JqZWN0LmtleXModGhpcy5ldmVudHMpLmpvaW4oJyAnKS5yZXBsYWNlKCcqJywgJycpLFxuICAgICAgICAgICAgICAgIGRlYm91bmNlOiB0aGlzLmV2ZW50c1xuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICB0aGlzLmZvcm0uaW5wdXQuJG92ZXJyaWRlTW9kZWxPcHRpb25zKG9wdGlvbnMpO1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZSB0aGUgZXZlbnQgZm9ybVxuICAgICAgICAgICAgdGhpcy51cGRhdGVFdmVudHMoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIDwvZmlsZT5cbiAgICA8ZmlsZSBuYW1lPVwidGVtcGxhdGUuaHRtbFwiPlxuICAgICAgPGZvcm0gbmFtZT1cIiRjdHJsLmZvcm1cIj5cbiAgICAgICAgSW5wdXQ6IDxpbnB1dCB0eXBlPVwidGV4dFwiIG5hbWU9XCJpbnB1dFwiIG5nLW1vZGVsPVwiJGN0cmwubmFtZVwiIG5nLW1vZGVsLW9wdGlvbnM9XCIkY3RybC5vcHRpb25zXCIgLz5cbiAgICA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8ZXhhbXBsZSBtb2R1bGU9XCJzZWxlY3RFeGFtcGxlXCIgbmFtZT1cInNlbGVjdFwiPlxuICAgICAgPGZpbGUgbmFtZT1cImluZGV4Lmh0bWxcIj5cbiAgICAgICAgPHNjcmlwdD5cbiAgICAgICAgYW5ndWxhci5tb2R1bGUoJ3NlbGVjdEV4YW1wbGUnLCBbXSlcbiAgICAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkge1xuICAgICAgICAgICAgJHNjb3BlLmNvbG9ycyA9IFtcbiAgICAgICAgICAgICAge25hbWU6J2JsYWNrJywgc2hhZGU6J2RhcmsnfSxcbiAgICAgICAgICAgICAge25hbWU6J3doaXRlJywgc2hhZGU6J2xpZ2h0Jywgbm90QW5PcHRpb246IHRydWV9LFxuICAgICAgICAgICAgICB7bmFtZToncmVkJywgc2hhZGU6J2RhcmsnfSxcbiAgICAgICAgICAgICAge25hbWU6J2JsdWUnLCBzaGFkZTonZGFyaycsIG5vdEFuT3B0aW9uOiB0cnVlfSxcbiAgICAgICAgICAgICAge25hbWU6J3llbGxvdycsIHNoYWRlOidsaWdodCcsIG5vdEFuT3B0aW9uOiBmYWxzZX1cbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICAkc2NvcGUubXlDb2xvciA9ICRzY29wZS5jb2xvcnNbMl07IC8vIHJlZFxuICAgICAgICAgIH1dKTtcbiAgICAgICAgPC9zY3JpcHQ+XG4gICAgICAgIDxkaXYgbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICAgICAgPHVsPlxuICAgICAgICAgICAgPGxpIG5nLXJlcGVhdD1cImNvbG9yIGluIGNvbG9yc1wiPlxuICAgICAgICAgICAgICA8bGFiZWw+TmFtZTogPGlucHV0IG5nLW1vZGVsPVwiY29sb3IubmFtZVwiPjwvbGFiZWw+XG4gICAgICAgICAgICAgIDxsYWJlbD48aW5wdXQ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Zy1wbHVyYWxpemUgY291bnQ9XCJwZXJzb25Db3VudFwiIG9mZnNldD0yXG4gICAgICAgICAgICAgICAgICAgICAgICB3aGVuPVwieycwJzogJ05vYm9keSBpcyB2aWV3aW5nLicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJzEnOiAne3twZXJzb24xfX0gaXMgdmlld2luZy4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcyJzogJ3t7cGVyc29uMX19IGFuZCB7e3BlcnNvbjJ9fSBhcmUgdmlld2luZy4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdvbmUnOiAne3twZXJzb24xfX0sIHt7cGVyc29uMn19IGFuZCBvbmUgb3RoZXIgcGVyc29uIGFyZSB2aWV3aW5nLicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ290aGVyJzogJ3t7cGVyc29uMX19LCB7e3BlcnNvbjJ9fSBhbmQge30gb3RoZXIgcGVvcGxlIGFyZSB2aWV3aW5nLid9XCI+XG4gICAgICAgICAgPC9uZy1wbHVyYWxpemU+XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9maWxlPlxuICAgICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJhY3RvclwiPlxuICAgICAgICBpdCgnc2hvdWxkIHNob3cgY29ycmVjdCBwbHVyYWxpemVkIHN0cmluZycsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciB3aXRob3V0T2Zmc2V0ID0gZWxlbWVudC5hbGwoYnkuY3NzKCduZy1wbHVyYWxpemUnKSkuZ2V0KDApO1xuICAgICAgICAgIHZhciB3aXRoT2Zmc2V0ID0gZWxlbWVudC5hbGwoYnkuY3NzKCduZy1wbHVyYWxpemUnKSkuZ2V0KDEpO1xuICAgICAgICAgIHZhciBjb3VudElucHV0ID0gZWxlbWVudChieS5tb2RlbCgncGVyc29uQ291bnQnKSk7XG5cbiAgICAgICAgICBleHBlY3Qod2l0a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gICAgfVxuICpcbiAqICAgICBbbmctaWZdIHtcbiAqICAgICAgIGJhY2tncm91bmQ6IGxpZ2h0Z3JleTtcbiAqICAgICAgIHBhZGRpbmc6IDhweDtcbiAqICAgICB9XG4gKlxuICogICAgIG15LXJvb3Qge1xuICogICAgICAgYmFja2dyb3VuZDogbGlnaHRnb2xkZW5yb2R5ZWxsb3c7XG4gKiAgICAgICBwYWRkaW5nOiA4cHg7XG4gKiAgICAgICBkaXNwbGF5OiBibG9jaztcbiAqICAgICB9XG4gKlxuICogICAgIG15LXdyYXBwZXIge1xuICogICAgICAgYmFja2dyb3VuZDogbGlnaHRzYWxtb247XG4gKiAgICAgICBwYWRkaW5nOiA4cHg7XG4gKiAgICAgICBkaXNwbGF5OiBibG9jaztcbiAqICAgICB9XG4gKlxuICogICAgIG15LXRvZ2dsZSB7XG4gKiAgICAgICBiYWNrZ3JvdW5kOiBsaWdodGJsdWU7XG4gKiAgICAgICBwYWRkaW5nOiA4cHg7XG4gKiAgICAgICBkaXNwbGF5OiBibG9jaztcbiAqICAgICB9XG4gKiAgIDwvZmlsZT5cbiAqICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJhY3RvclwiPlxuICogICAgICB2YXIgT3V0ZXJUb2dnbGUgPSBmdW5jdGlvbigpIHtcbiAqICAgICAgICB0aGlzLnRvZ2dsZSA9IGZ1bmN0aW9uKCkge1xuICogICAgICAgICAgZWxlbWVudChieS5idXR0b25UZXh0KCdPdXRlciBUb2dnbGUnKSkuY2xpY2soKTtcbiAqICAgICAgICB9O1xuICogICAgICAgIHRoaXMuaXNPcGVuID0gZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICByZXR1cm4gZWxlbWVudC5hbGwoYnkuYmluZGluZygnb3V0ZXJUb2dnbGUuaXNPcGVuKCknKSkuZmlyc3QoKS5nZXRUZXh0KCk7XG4gKiAgICAgICAgfTtcbiAqICAgICAgfTtcbiAqICAgICAgdmFyIE5nUmVw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ICByZXR1cm4gZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7XG4gICAgICAgIHZhciByZWZWYWx1ZTtcblxuICAgICAgICBpZiAoYXR0cnMuaGFzT3duUHJvcGVydHkoJ25nUmVmUmVhZCcpKSB7XG4gICAgICAgICAgaWYgKGF0dHJzLm5nUmVmUmVhZCA9PT0gJyRlbGVtZW50Jykge1xuICAgICAgICAgICAgcmVmVmFsdWUgPSBlbGVtZW50O1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZWZWYWx1ZSA9IGVsZW1lbnQuZGF0YSgnJCcgKyBhdHRycy5uZ1JlZlJlYWQgKyAnQ29udHJvbGxlcicpO1xuXG4gICAgICAgICAgICBpZiAoIXJlZlZhbHVlKSB7XG4gICAgICAgICAgICAgIHRocm93IG5nUmVmTWluRXJyKFxuICAgICAgICAgICAgICAgICdub2N0cmwnLFxuICAgICAgICAgICAgICAgICdUaGUgY29udHJvbGxlciBmb3IgbmdSZWZSZWFkPVwiezB9XCIgY291bGQgbm90IGJlIGZvdW5kIG9uIG5nUmVmPVwiezF9XCInLFxuICAgICAgICAgICAgICAgIGF0dHJzLm5nUmVmUmVhZCxcbiAgICAgICAgICAgICAgICB0QXR0cnMubmdSZWZcbiAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmVmVmFsdWUgPSBlbGVtZW50LmRhdGEoJyQnICsgY29udHJvbGxlck5hbWUgKyAnQ29udHJvbGxlcicpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmVmVmFsdWUgPSByZWZWYWx1ZSB8fCBlbGVtZW50O1xuXG4gICAgICAgIHNldHRlcihzY29wZSwgcmVmVmFsdWUpO1xuXG4gICAgICAgIC8vIHdoZW4gdGhlIGVsZW1lbnQgaXMgcmVtb3ZlZCwgcmVtb3ZlIGl0IChudWxsaWZ5IGl0KVxuICAgICAgICBlbGV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B3ZSBhcmUgbm90IHVzaW5nIGZvckVhY2ggZm9yIHBlcmYgcmVhc29ucyAodHJ5aW5nIHRvIGF2b2lkICNjYWxsKVxuICAgICAgICAgIGZvciAoaW5kZXggPSAwOyBpbmRleCA8IGNvbGxlY3Rpb25MZW5ndGg7IGluZGV4KyspIHtcbiAgICAgICAgICAgIGtleSA9IChjb2xsZWN0aW9uID09PSBjb2xsZWN0aW9uS2V5cykgPyBpbmRleCA6IGNvbGxlY3Rpb25LZXlzW2luZGV4XTtcbiAgICAgICAgICAgIHZhbHVlID0gY29sbGVjdGlvbltrZXldO1xuICAgICAgICAgICAgYmxvY2sgPSBuZXh0QmxvY2tPcmRlcltpbmRleF07XG5cbiAgICAgICAgICAgIGlmIChibG9jay5zY29wZSkge1xuICAgICAgICAgICAgICAvLyBpZiB3ZSBoYXZlIGFscmVhZHkgc2VlbiB0aGlzIG9iamVjdCwgdGhlbiB3ZSBuZWVkIHRvIHJldXNlIHRoZVxuICAgICAgICAgICAgICAvLyBhc3NvY2lhdGVkIHNjb3BlL2VsZW1lbnRcblxuICAgICAgICAgICAgICBuZXh0Tm9kZSA9IHByZXZpb3VzTm9kZTtcblxuICAgICAgICAgICAgICAvLyBza2lwIG5vZGVzIHRoYXQgYXJlIGFscmVhZHkgcGVuZGluZyByZW1vdmFsIHZpYSBsZWF2ZSBhbmltYXRpb25cbiAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIG5leHROb2RlID0gbmV4dE5vZGUubmV4dFNpYmxpbmc7XG4gICAgICAgICAgICAgIH0gd2hpbGUgKG5leHROb2RlICYmIG5leHROb2RlW05HX1JFTU9WRURdKTtcblxuICAgICAgICAgICAgICBpZiAoZ2V0QmxvY2tTdGFydChibG9jaykgIT09IG5leHROb2RlKSB7XG4gICAgICAgICAgICAgICAgLy8gZXhpc3RpbmcgaXRlbSB3aGljaCBnb3QgbW92ZWRcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZS5tb3ZlKGdldEJsb2N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jbHVkZUZhbGxiYWNrQ29udGVudEV4YW1wbGUnLCBbXSlcbiAqIC5kaXJlY3RpdmUoJ215QnV0dG9uJywgZnVuY3Rpb24oKXtcbiAqICAgICAgICAgICAgIHJldHVybiB7XG4gKiAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRScsXG4gKiAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsXG4gKiAgICAgICAgICAgICAgIHNjb3BlOiB0cnVlLFxuICogICAgICAgICAgICAgICB0ZW1wbGF0ZTogJzxidXR0b24gc3R5bGU9XCJjdXJzb3I6IHBvaW50ZXI7XCI+JyArXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICc8bmctdHJhbnNjbHVkZT4nICtcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnPGIgc3R5bGU9XCJjb2xvcjogcmVkO1wiPkJ1dHRvbjE8L2I+JyArXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICc8L25nLXRyYW5zY2x1ZGU+JyArXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAnPC9idXR0b24+J1xuICogICAgICAgICAgICAgfTtcbiAqICAgICAgICAgfSk7XG4gKiA8L3NjcmlwdD5cbiAqIDwhLS0gZmFsbGJhY2sgYnV0dG9uIGNvbnRlbnQgLS0+XG4gKiA8bXktYnV0dG9uIGlkPVwiZmFsbGJhY2tcIj48L215LWJ1dHRvbj5cbiAqIDwhLS0gbW9kaWZpZWQgYnV0dG9uIGNvbnRlbnQgLS0+XG4gKiA8bXktYnV0dG9uIGlkPVwibW9kaWZpZWRcIj5cbiAqICAgPGkgc3R5bGU9XCJjb2xvcjogZ3JlZW47XCI+QnV0dG9uMjwvaT5cbiAqIDwvbXktYnV0dG9uPlxuICogPC9maWxlPlxuICogPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJhY3RvclwiPlxuICogaXQoJ3Nob3VsZCBoYXZlIGRpZmZlcmVudCB0cmFuc2NsdW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W1lPVwiYXBwLmpzXCI+XG4gKiAgICAgYW5ndWxhci5tb2R1bGUoJ25vblN0cmluZ1NlbGVjdCcsIFtdKVxuICogICAgICAgLnJ1bihmdW5jdGlvbigkcm9vdFNjb3BlKSB7XG4gKiAgICAgICAgICRyb290U2NvcGUubW9kZWwgPSB7IGlkOiAyIH07XG4gKiAgICAgICB9KVxuICogICAgICAgLmRpcmVjdGl2ZSgnY29udmVydFRvTnVtYmVyJywgZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgIHJldHVybiB7XG4gKiAgICAgICAgICAgcmVxdWlyZTogJ25nTW9kZWwnLFxuICogICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgbmdNb2RlbCkge1xuICogICAgICAgICAgICAgbmdNb2RlbC4kcGFyc2Vycy5wdXNoKGZ1bmN0aW9uKHZhbCkge1xuICogICAgICAgICAgICAgICByZXR1cm4gcGFyc2VJbnQodmFsLCAxMCk7XG4gKiAgICAgICAgICAgICB9KTtcbiAqICAgICAgICAgICAgIG5nTW9kZWwuJGZvcm1hdHRlcnMucHVzaChmdW5jdGlvbih2YWwpIHtcbiAqICAgICAgICAgICAgICAgcmV0dXJuICcnICsgdmFsO1xuICogICAgICAgICAgICAgfSk7XG4gKiAgICAgICAgICAgfVxuICogICAgICAgICB9O1xuICogICAgICAgfSk7XG4gKiAgIDwvZmlsZT5cbiAqICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJhY3RvclwiPlxuICogICAgIGl0KCdzaG91bGQgaW5pdGlhbGl6ZSB0byBtb2RlbCcsIGZ1bmN0aW9uKCkge1xuICogICAgICAgZXhwZWN0KGVsZW1lbnQoYnkubW9kZWwoJ21vZGVsLmlkJykpLiQoJ29wdGlvbjpjaGVja2VkJykuZ2V0VGV4dCgpKS50b0VxdWFsKCdUd28nKTtcbiAqICAgICB9KTtcbiAqICAgPC9maWxlPlxuICogPC9leGFtcGx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anMvcG9wb3Zlci5qcycpXG5yZXF1aXJlKCcuLi8uLi9qcy9zY3JvbGxzcHkuanMnKVxucmVxdWlyZSgnLi4vLi4vanMvdGFiLmpzJylcbnJlcXVpcmUoJy4uLy4uL2pzL2FmZml4LmpzJykiLCIvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEJvb3RzdHJhcDogYWZmaXguanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jYWZmaXhcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weXJpZ2h0IDIwMTEtMjAxOSBUd2l0dGVyLCBJbmMuXG4gKiBMaWNlbnNlZCB1bmRlciBNSVQgKGh0dHBzOi8vZ2l0aHViLmNvbS90d2JzL2Jvb3RzdHJhcC9ibG9iL21hc3Rlci9MSUNFTlNFKVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovXG5cblxuK2Z1bmN0aW9uICgkKSB7XG4gICd1c2Ugc3RyaWN0JztcblxuICAvLyBBRkZJWCBDTEFTUyBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT1cblxuICB2YXIgQWZmaXggPSBmdW5jdGlvbiAoZWxlbWVudCwgb3B0aW9ucykge1xuICAgIHRoaXMub3B0aW9ucyA9ICQuZXh0ZW5kKHt9LCBBZmZpeC5ERUZBVUxUUywgb3B0aW9ucylcblxuICAgIHZhciB0YXJnZXQgPSB0aGlzLm9wdGlvbnMudGFyZ2V0ID09PSBBZmZpeC5ERUZBVUxUUy50YXJnZXQgPyAkKHRoaXMub3B0aW9ucy50YXJnZXQpIDogJChkb2N1bWVudCkuZmluZCh0aGlzLm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9ICRzcHkuZGF0YSgpXG5cbiAgICAgIGRhdGEub2Zmc2V0ID0gZGF0YS5vZmZzZXQgfHwge31cblxuICAgICAgaWYgKGRhdGEub2Zmc2V0Qm90dG9tICE9IG51bGwpIGRhdGEub2Zmc2V0LmJvdHRvbSA9IGRhdGEub2Zmc2V0Qm90dG9tXG4gICAgICBpZiAoZGF0YS5vZmZzZXRUb3AgICAgIT0gbnVsbCkgZGF0YS5vZmZzZXQudG9wICAgID0gZGF0YS5vZmZzZXRUb3BcblxuICAgICAgUGx1Z2luLmNhbGwoJHNweSwgZGF0YSlcbiAgICB9KVxuICB9KVxuXG59KGpRdWVyeSk7XG4iLCIvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEJvb3RzdHJhcDogYWxlcnQuanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jYWxlcnRzXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLy8gQUxFUlQgQ0xBU1MgREVGSU5JVElPTlxuICAvLyA9PT09PT09PT09PT09PT09PT09PT09XG5cbiAgdmFyIGRpc21pc3MgPSAnW2RhdGEtZGlzbWlzcz1cImFsZXJ0XCJdJ1xuICB2YXIgQWxl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0NvbmZsaWN0ID0gZnVuY3Rpb24gKCkge1xuICAgICQuZm4uYWxlcnQgPSBvbGRcbiAgICByZXR1cm4gdGhpc1xuICB9XG5cblxuICAvLyBBTEVSVCBEQVRBLUFQSVxuICAvLyA9PT09PT09PT09PT09PVxuXG4gICQoZG9jdW1lbnQpLm9uKCdjbGljay5icy5hbGVydC5kYXRhLWFwaScsIGRpc21pc3MsIEFsZXJ0LnByb3RvdHlwZS5jbG9zZSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGJ1dHRvbi5qcyB2My40LjFcbiAqIGh0dHBzOi8vZ2V0Ym9vdHN0cmFwLmNvbS9kb2NzLzMuNC9qYXZhc2NyaXB0LyNidXR0b25zXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLy8gQlVUVE9OIFBVQkxJQyBDTEFTUyBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gIHZhciBCdXR0b24gPSBmdW5jdGlvbiAoZWxlbWVudCwgb3B0aW9ucykge1xuICAgIHRoaXMuJGVsZW1lbnQgID0gJChlbGVtZW50KVxuICAgIHRoaXMub3B0aW9ucyAgID0gJC5leHRlb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cygnZm9jdXMnLCAvXmZvY3VzKGluKT8kLy50ZXN0KGUudHlwZSkpXG4gICAgfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGNhcm91c2VsLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI2Nhcm91c2VsXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLy8gQ0FST1VTRUwgQ0xBU1MgREVGSU5JVElPTlxuICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09XG5cbiAgdmFyIENhcm91c2VsID0gZnVuY3Rpb24gKGVsZW1lbnQsIG9wdGlvbnMpIHtcbiAgICB0aGlzLiRlbGVtZW50ICAgID0gJChlbGVtZW50KVxuICAgIHRoaXMuJGluZGljYXRvcnMgPSB0aGlzLiRlbGVtZW50LmZpbmQoJy5jYXJvdXNlbC1pbmRpY2F0b3JzJylcbiAgICB0aGlzLm9wdGlvbnMgICAgID0gb3B0aW9uc1xuICAgIHRoaXMucGF1c2VkICAgICAgPSBudWxsXG4gICAgdGhpcy5zbGlkaW5nICAgICA9IG51bGxcbiAgICB0aGlzLmludGVydmFsICAgID0gbn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KS5vbignbG9hZCcsIGZ1bmN0aW9uICgpIHtcbiAgICAkKCdbZGF0YS1yaWRlPVwiY2Fyb3VzZWxcIl0nKS5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgIHZhciAkY2Fyb3VzZWwgPSAkKHRoaXMpXG4gICAgICBQbHVnaW4uY2FsbCgkY2Fyb3VzZWwsICRjYXJvdXNlbC5kYXRhKCkpXG4gICAgfSlcbiAgfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGNvbGxhcHNlLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI2NvbGxhcHNlXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG4vKiBqc2hpbnQgbGF0ZWRlZjogZmFsc2UgKi9cblxuK2Z1bmN0aW9uICgkKSB7XG4gICd1c2Ugc3RyaWN0JztcblxuICAvLyBDT0xMQVBTRSBQVUJMSUMgQ0xBU1MgREVGSU5JVElPTlxuICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gIHZhciBDb2xsYXBzZSA9IGZ1bmN0aW9uIChlbGVtZW50LCBvcHRpb25zKSB7XG4gICAgdGhpcy4kZWxlbWVudCAgICAgID0gJChlbGVtZ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1RcbiAgLy8gPT09PT09PT09PT09PT09PT09PT1cblxuICAkLmZuLmRyb3Bkb3duLm5vQ29uZmxpY3QgPSBmdW5jdGlvbiAoKSB7XG4gICAgJC5mbi5kcm9wZG93biA9IG9sZFxuICAgIHJldHVybiB0aGlzXG4gIH1cblxuXG4gIC8vIEFQUExZIFRPIFNUQU5EQVJEIERST1BET1dOIEVMRU1FTlRTXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbiAgJChkb2N1bWVudClcbiAgICAub24oJ2NsaWNrLmJzLmRyb3Bkb3duLmRhdGEtYXBpJywgY2xlYXJNZW51cylcbiAgICAub24oJ2NsaWNrLmJzLmRyb3Bkb3duLmRhdGEtYXBpJywgJy5kcm9wZG93biBmb3JtJywgZnVuY3Rpb24gKGUpIHsgZS5zdG9wUHJvcGFnYXRpb24oKSB9KVxuICAgIC5vbignY2xpY2suYnMuZHJvcGRvd24uZGF0YS1hcGknLCB0b2dnbGUsIERyb3Bkb3duLnByb3RvdHlwZS50b2dnbGUpXG4gICAgLm9uKCdrZXlkb3duLmJzLmRyb3Bkb3duLmRhdGEtYXBpJywgdG9nZ2xlLCBEcm9wZG93bi5wcm90b3R5cGUua2V5ZG93bilcbiAgICAub24oJ2tleWRvd24uYnMuZHJvcGRvd24uZGF0YS1hcGknLCAnLmRyb3Bkb3duLW1lbnUnLCBEcm9wZG93bi5wcm90b3R5cGUua2V5ZG93bilcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IG1vZGFsLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI21vZGFsc1xuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09X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XMnKVxuICAgICAgfSlcbiAgICB9KVxuICAgIFBsdWdpbi5jYWxsKCR0YXJnZXQsIG9wdGlvbiwgdGhpcylcbiAgfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IHBvcG92ZXIuanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jcG9wb3ZlcnNcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weXJpZ2h0IDIwMTEtMjAxOSBUd2l0dGVyLCBJbmMuXG4gKiBMaWNlbnNlZCB1bmRlciBNSVQgKGh0dHBzOi8vZ2l0aHViLmNvbS90d2JzL2Jvb3RzdHJhcC9ibG9iL21hc3Rlci9MSUNFTlNFKVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovXG5cblxuK2Z1bmN0aW9uICgkKSB7XG4gICd1c2Ugc3RyaWN0JztcblxuICAvLyBQT1BPVkVSIFBVQkxJQyBDTEFTUyBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuICB2YXIgUG9wb3ZlciA9IGZ1bmN0aW9uIChlbGVtZW50LCBvcHRpb25zKSB7XG4gICAgdGhpcy5pbml0KCdwb3BvdmVyJywgZWxlbWVudCwgb3B0aW9ucylcbiAgfVxuXG4gIGlmICghJC5mbi50b29sdGlwKSB0aHJvdyBuZXcgRXJyb3IoJ1BvcG92ZXIgcmVxdWlyZXMgdG9vbHRpcC5qcycpXG5cbiAgUG9wb3Zlci5WRVJTSU9OICA9ICczLjQuMSdcblxuICBQb3BvdmVyLkRFRkFVTFRT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gKHR5cGVvZiBvcHRpb24gPT0gJ3N0cmluZycpIGRhdGFbb3B0aW9uXSgpXG4gICAgfSlcbiAgfVxuXG4gIHZhciBvbGQgPSAkLmZuLnBvcG92ZXJcblxuICAkLmZuLnBvcG92ZXIgICAgICAgICAgICAgPSBQbHVnaW5cbiAgJC5mbi5wb3BvdmVyLkNvbnN0cnVjdG9yID0gUG9wb3ZlclxuXG5cbiAgLy8gUE9QT1ZFUiBOTyBDT05GTElDVFxuICAvLyA9PT09PT09PT09PT09PT09PT09XG5cbiAgJC5mbi5wb3BvdmVyLm5vQ29uZmxpY3QgPSBmdW5jdGlvbiAoKSB7XG4gICAgJC5mbi5wb3BvdmVyID0gb2xkXG4gICAgcmV0dXJuIHRoaXNcbiAgfVxuXG59KGpRdWVyeSk7XG4iLCIvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEJvb3RzdHJhcDogc2Nyb2xsc3B5LmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI3Njcm9sbHNweVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5cmlnaHQgMjAxMS0yMDE5IFR3aXR0ZXIsIEluYy5cbiAqIExpY2Vuc2VkIHVuZGVyIE1JVCAoaHR0cHM6Ly9naXRodWIuY29tL3R3YnMvYm9vdHN0cmFwL2Jsb2IvbWFzdGVyL0xJQ0VOU0UpXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi9cblxuXG4rZnVuY3Rpb24gKCQpIHtcbiAgJ3VzZSBzdHJpY3QnO1xuXG4gIC8vIFNDUk9MTFNQWSBDTEFTUyBERUZJTklUSU9OXG4g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ICAgcmV0dXJuIHRoaXNcbiAgfVxuXG5cbiAgLy8gU0NST0xMU1BZIERBVEEtQVBJXG4gIC8vID09PT09PT09PT09PT09PT09PVxuXG4gICQod2luZG93KS5vbignbG9hZC5icy5zY3JvbGxzcHkuZGF0YS1hcGknLCBmdW5jdGlvbiAoKSB7XG4gICAgJCgnW2RhdGEtc3B5PVwic2Nyb2xsXCJdJykuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICB2YXIgJHNweSA9ICQodGhpcylcbiAgICAgIFBsdWdpbi5jYWxsKCRzcHksICRzcHkuZGF0YSgpKVxuICAgIH0pXG4gIH0pXG5cbn0oalF1ZXJ5KTtcbiIsIi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQm9vdHN0cmFwOiB0YWIuanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jdGFic1xuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5cmlnaHQgMjAxMS0yMDE5IFR3aXR0ZXIsIEluYy5cbiAqIExpY2Vuc2VkIHVuZGVyIE1JVCAoaHR0cHM6Ly9naXRodWIuY29tL3R3YnMvYm9vdHN0cmFwL2Jsb2IvbWFzdGVyL0xJQ0VOU0UpXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi9cblxuXG4rZnVuY3Rpb24gKCQpIHtcbiAgJ3VzZSBzdHJpY3QnO1xuXG4gIC8vIFRBQiBDTEFTUyBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09XG5cbiAgdmFyIFRhYiA9IGZ1bmN0aW9uIChlbGVtZW50KSB7XG4gICAgLy8ganNjczpkaXN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cbiAgfVxuXG4gICQoZG9jdW1lbnQpXG4gICAgLm9uKCdjbGljay5icy50YWIuZGF0YS1hcGknLCAnW2RhdGEtdG9nZ2xlPVwidGFiXCJdJywgY2xpY2tIYW5kbGVyKVxuICAgIC5vbignY2xpY2suYnMudGFiLmRhdGEtYXBpJywgJ1tkYXRhLXRvZ2dsZT1cInBpbGxcIl0nLCBjbGlja0hhbmRsZXIpXG5cbn0oalF1ZXJ5KTtcbiIsIi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQm9vdHN0cmFwOiB0b29sdGlwLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI3Rvb2x0aXBcbiAqIEluc3BpcmVkIGJ5IHRoZSBvcmlnaW5hbCBqUXVlcnkudGlwc3kgYnkgSmFzb24gRnJhbWVcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weXJpZ2h0IDIwMTEtMjAxOSBUd2l0dGVyLCBJbmMuXG4gKiBMaWNlbnNlZCB1bmRlciBNSVQgKGh0dHBzOi8vZ2l0aHViLmNvbS90d2JzL2Jvb3RzdHJhcC9ibG9iL21hc3Rlci9MSUNFTlNFKVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgdmFyIERJU0FMTE9XRURfQVRUUklCVVRFUyA9IFsnc2FuaXRpemUnLCAnd2hpdGVMaXN0JywgJ3Nhbml0aXplRm4nXVxuXG4gIHZhciB1cmlBdHRycyA9IFtcbiAgICAnYmFja2dyb3VuZCcsXG4gICAgJ2NpdGUnLFxuICAgICdocmVmJ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BMVUdJTiBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT1cblxuICBmdW5jdGlvbiBQbHVnaW4ob3B0aW9uKSB7XG4gICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICB2YXIgJHRoaXMgICA9ICQodGhpcylcbiAgICAgIHZhciBkYXRhICAgID0gJHRoaXMuZGF0YSgnYnMudG9vbHRpcCcpXG4gICAgICB2YXIgb3B0aW9ucyA9IHR5cGVvZiBvcHRpb24gPT0gJ29iamVjdCcgJiYgb3B0aW9uXG5cbiAgICAgIGlmICghZGF0YSAmJiAvZGVzdHJveXxoaWRlLy50ZXN0KG9wdGlvbikpIHJldHVyblxuICAgICAgaWYgKCFkYXRhKSAkdGhpcy5kYXRhKCdicy50b29sdGlwJywgKGRhdGEgPSBuZXcgVG9vbHRpcCh0aGlzLCBvcHRpb25zKSkpXG4gICAgICBpZiAodHlwZW9mIG9wdGlvbiA9PSAnc3RyaW5nJykgZGF0YVtvcHRpb25dKClcbiAgICB9KVxuICB9XG5cbiAgdmFyIG9sZCA9ICQuZm4udG9vbHRpcFxuXG4gICQuZm4udG9vbHRpcCAgICAgICAgICAgICA9IFBsdWdpblxuICAkLmZuLnRvb2x0aXAuQ29uc3RydWN0b3IgPSBUb29sdGlwXG5cblxuICAvLyBUT09MVElQIE5PIENPTkZMSUNUXG4gIC8vID09PT09PT09PT09PT09PT09PT1cblxuICAkLmZuLnRvb2x0aXAubm9Db25mbGljdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAkLmZuLnRvb2x0aXAgPSBvbGRcbiAgICByZXR1cm4gdGhpc1xuICB9XG5cbn0oalF1ZXJ5KTtcbiIsIi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQm9vdHN0cmFwOiB0cmFuc2l0aW9uLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI3RyYW5zaXRpb25zXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLy8gQ1NTIFRSQU5TSVRJT04gU1VQUE9SVCAoU2hvdXRvdXQ6IGh0dHBzOi8vbW9kZXJuaXpyLmNvbS8pXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gIGZ1bmN0aW9uIHRyYW5zaXRpb25FbmQoKSB7XG4gICAgdmFyIGVsID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYm9vdHN0cmFwJylcblxuICAgIHZhciB0cmFuc0VuZEV2ZW50TmFtZXMgPSB7XG4gICAgICBXZWJraXRUcmFuc2l0aW9uIDogJ3dlYmtpdFRyYW5zaXRpb25FbmQnLFxuICAgICAgTW96VHJhbnNpdGlvbiAgICA6ICd0cmFuc2l0aW9uZW5kJyxcbiAgICAgIE9UcmFuc2l0aW9uICAgICAgOiAnb1RyYW5zaXRpb25FbmQgb3RyYW5zaXRpb25lbmQnLFxuICAgICAgdHJhbnNpdGlvbiAgICAgICA6ICd0cmFuc2l0aW9uZW5kJ1xuICAgIH1cblxuICAgIGZvciAodmFyIG5hbWUgaW4gdHJhbnNFbmRFdmVudE5hbWVzKSB7XG4gICAgICBpZ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BmaXJzdEJ5dGVcbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAyOlxuICAgICAgICAgIHNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4gICAgICAgICAgaWYgKChzZWNvbmRCeXRlICYgMHhDMCkgPT09IDB4ODApIHtcbiAgICAgICAgICAgIHRlbXBDb2RlUG9pbnQgPSAoZmlyc3RCeXRlICYgMHgxRikgPDwgMHg2IHwgKHNlY29uZEJ5dGUgJiAweDNGKVxuICAgICAgICAgICAgaWYgKHRlbXBDb2RlUG9pbnQgPiAweDdGKSB7XG4gICAgICAgICAgICAgIGNvZGVQb2ludCA9IHRlbXBDb2RlUG9pbnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAzOlxuICAgICAgICAgIHNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4gICAgICAgICAgdGhpcmRCeXRlID0gYnVmW2kgKyAyXVxuICAgICAgICAgIGlmICgoc2Vjb25kQnl0ZSAmIDB4QzApID09PSAweDgwICYmICh0aGlyZEJ5dGUgJiAweEMwKSA9PT0gMHg4MCkge1xuICAgICAgICAgICAgdGVtcENvZGVQb2ludCA9IChmaXJzdEJ5dGUgJiAweEYpIDw8IDB4QyB8IChzZWNvbmRCeXRlICYgMHgzRikgPDwgMHg2IHwgKHRoaXJkQnl0ZSAmIDB4M0YpXG4gICAgICAgICAgICBpZiAodGVtcENvZGVQb2ludCA+IDB4N0ZGICYmICh0ZW1wQ29kZVBvaW50IDwgMHhEODAwIHx8IHRlbXBDb2RlUG9pbnQgPiAweERGRkYpKSB7XG4gICAgICAgICAgICAgIGNvZGVQb2ludCA9IHRlbXBDb2RlUG9pbnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgIHNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4g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m4gdGhlIGZ1bmN0aW9uIHRvIGN1cnJ5XHJcbiAgICogQHBhcmFtIGFyaXR5IHRoZSBsZW5ndGggb2YgdGhlIGZ1bmN0aW9uIHRvIGN1cnJ5IHVudGlsXHJcbiAgICogQHBhcmFtIGFyZ3MgdGhlIGV4aXN0aW5nIGFyZ3VtZW50c1xyXG4gICAqIEByZXR1cm5zIHRoZSByZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGxcclxuICAgKi9cclxuICBmdW5jdGlvbiBnZXRDdXJyaWVkKGZuLCBhcml0eSkge1xyXG4gICAgICBmdW5jdGlvbiBfY3VycmllZChhcmdzKSB7XHJcbiAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgIHZhciBsZW5ndGggPSBhcmdzLmxlbmd0aDtcclxuICAgICAgICAgICAgICB2YXIgbmV3QXJncyA9IGFyZ3VtZW50cztcclxuICAgICAgICAgICAgICB2YXIgbmV3QXJnc0xlbmd0aCA9IG5ld0FyZ3MubGVuZ3RoO1xyXG4gICAgICAgICAgICAgIHZhciBjb21iaW5lZCA9IFtdO1xyXG4gICAgICAgICAgICAgIHZhciBuZXdBcmdzSW5kZXggPSAwO1xyXG4gICAgICAgICAgICAgIHZhciByZW1haW5pbmcgPSBhcml0eTtcclxuICAgICAgICAgICAgICB2YXIgdmFsdWU7XHJcbiAgICAgICAgICAgICAgaWYgKGxlbmd0aCkge1xyXG4gICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSAtMTtcclxuICAgICAgICAgICAgICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgIGNvbWJpbmVkW2luZGV4XSA9IHZhbHVlID1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdzW2luZGV4XSA9PT0gX18gJiYgbmV3QXJnc0luZGV4IDwgbmV3QXJnc0xlbmd0aFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG5ld0FyZ3NbbmV3QXJnc0luZGV4KytdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYXJnc1tpbmRleF07XHJcbiAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT09IF9fKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgLS1yZW1haW5pbmc7XHJcbiAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgaWYgKG5ld0FyZ3NJbmRleCA8IG5ld0FyZ3NMZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgd2hpbGUgKG5ld0FyZ3NJbmRleCA8IG5ld0FyZ3NMZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgIGNvbWJpbmVkW2NvbWJpbmVkLmxlbmd0aF0gPSB2YWx1ZSA9IG5ld0FyZ3NbbmV3QXJnc0luZGV4XTtcclxuICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPT0gX18gJiYgbmV3QXJnc0luZGV4IDwgYXJpdHkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAtLXJlbWFpbmluZztcclxuICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICsrbmV3QXJnc0luZGV4O1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIHJldHVybiByZW1haW5pbmcgPiAwID8gX2N1cnJpZWQoY29tYmluZWQpIDogZm4uYXBwbHkodGhpcywgY29tYmluZWQpO1xyXG4gICAgICAgICAgfTtcclxuICAgICAgfVxyXG4gICAgICByZXR1cm4gX2N1cnJpZWQoW10pO1xyXG4gIH1cblxuICAvLyB1dGlsc1xyXG4gIGZ1bmN0aW9uIGN1cnJ5KGZuLCBhcml0eU92ZXJyaWRlKSB7XHJcbiAgICAgIHZhciBhcml0eSA9IHR5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duS2V5cy5wdXNoKGtleU51bSk7XG4gICAgfSBlbHNlIGlmICghZXZlbnRba2V5TmFtZV0gJiYgX2Rvd25LZXlzLmluZGV4T2Yoa2V5TnVtKSA+IC0xKSB7XG4gICAgICBfZG93bktleXMuc3BsaWNlKF9kb3duS2V5cy5pbmRleE9mKGtleU51bSksIDEpO1xuICAgIH0gZWxzZSBpZiAoa2V5TmFtZSA9PT0gJ21ldGFLZXknICYmIGV2ZW50W2tleU5hbWVdICYmIF9kb3duS2V5cy5sZW5ndGggPT09IDMpIHtcbiAgICAgIC8qKlxuICAgICAgICogRml4IGlmIENvbW1hbmQgaXMgcHJlc3NlZDpcbiAgICAgICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgICAgICAqL1xuICAgICAgaWYgKCEoZXZlbnQuY3RybEtleSB8fCBldmVudC5zaGlmdEtleSB8fCBldmVudC5hbHRLZXkpKSB7XG4gICAgICAgIF9kb3duS2V5cyA9IF9kb3duS2V5cy5zbGljZShfZG93bktleXMuaW5kZXhPZihrZXlOdW0pKTtcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xuICAvKipcbiAgICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuICAgKi9cblxuICBpZiAoa2V5IGluIF9tb2RzKSB7XG4gICAgX21vZHNba2V5XSA9IHRydWU7IC8vIOWwhueJueauiuWtl+espueahGtleeazqOWGjOWIsCBob3RrZXlzIOS4ilxuXG4gICAgZm9yICh2YXIgayBpbiBfbW9kaWZpZXIpIHtcbiAgICAgIGlmIChfbW9kaWZpZXJba10gPT09IGtleSkgaG90a2V5c1trXSA9IHRydWU7XG4gICAgfVxuXG4gICAgaWYgKCFhc3RlcmlzaykgcmV0dXJuO1xuICB9IC8vIOWwhiBtb2RpZmllck1hcCDph4zpnaLnmoTkv67ppbDplK7nu5HlrprliLAgZXZlbnQg5LitXG5cblxuICBmb3IgKHZhciBlIGluIF9tb2RzKSB7XG4gICAgaWYgKE9iam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gICAgICogQG5hbWUgZGVsZXRlXG4gICAgICogQG1lbWJlck9mIE1hcENhY2hlXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSB2YWx1ZSB0byByZW1vdmUuXG4gICAgICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIHRoZSBlbnRyeSB3YXMgcmVtb3ZlZCwgZWxzZSBgZmFsc2VgLlxuICAgICAqL1xuICAgIGZ1bmN0aW9uIG1hcENhY2hlRGVsZXRlKGtleSkge1xuICAgICAgdmFyIHJlc3VsdCA9IGdldE1hcERhdGEodGhpcywga2V5KVsnZGVsZXRlJ10oa2V5KTtcbiAgICAgIHRoaXMuc2l6ZSAtPSByZXN1bHQgPyAxIDogMDtcbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogR2V0cyB0aGUgbWFwIHZhbHVlIGZvciBga2V5YC5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQG5hbWUgZ2V0XG4gICAgICogQG1lbWJlck9mIE1hcENhY2hlXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSB2YWx1ZSB0byBnZXQuXG4gICAgICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIGVudHJ5IHZhbHVlLlxuICAgICAqL1xuICAgIGZ1bmN0aW9uIG1hcENhY2hlR2V0KGtleSkge1xuICAgICAgcmV0dXJuIGdldE1hcERhdGEodGhpcywga2V5KS5nZXQoa2V5KTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDaGVja3MgaWYgYSBtYXAgdmFsdWUgZm9yIGBrZXlgIGV4aXN0cy5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQG5hbWUgaGFzXG4gICAgICogQG1lbWJlck9mIE1hcENhY2hlXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZS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RlcjpcbiAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoICYmIHJlc3VsdC5sZW5ndGggPCBtYXhMZW5ndGgpIHtcbiAgICAgICAgdmFyIHZhbHVlID0gYXJyYXlbaW5kZXhdLFxuICAgICAgICAgICAgY29tcHV0ZWQgPSBpdGVyYXRlZSA/IGl0ZXJhdGVlKHZhbHVlKSA6IHZhbHVlO1xuXG4gICAgICAgIHZhbHVlID0gKGNvbXBhcmF0b3IgfHwgdmFsdWUgIT09IDApID8gdmFsdWUgOiAwO1xuICAgICAgICBpZiAoIShzZWVuXG4gICAgICAgICAgICAgID8gY2FjaGVIYXMoc2VlbiwgY29tcHV0ZWQpXG4gICAgICAgICAgICAgIDogaW5jbHVkZXMocmVzdWx0LCBjb21wdXRlZCwgY29tcGFyYXRvcilcbiAgICAgICAgICAgICkpIHtcbiAgICAgICAgICBvdGhJbmRleCA9IG90aExlbmd0aDtcbiAgICAgICAgICB3aGlsZSAoLS1vdGhJbmRleCkge1xuICAgICAgICAgICAgdmFyIGNhY2hlID0gY2FjaGVzW290aEluZGV4XTtcbiAgICAgICAgICAgIGlmICghKGNhY2hlXG4gICAgICAgICAgICAgICAgICA/IGNhY2hlSGFzKGNhY2hlLCBjb21wdXRlZClcbiAgICAgICAgICAgICAgICAgIDogaW5jbHVkZXMoYXJyYXlzW290aEluZGV4XSwgY29tcHV0ZWQsIGNvbXBhcmF0b3IpKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICBjb250aW51ZSBvdXRlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNlZW4pIHtcbiAgICAgICAgICAgIHNlZW4ucHVzaChjb21wdXRlZCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdC5wdXNoKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUa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ICBvYmpJc0FyciA9IHRydWU7XG4gICAgICAgIG9iaklzT2JqID0gZmFsc2U7XG4gICAgICB9XG4gICAgICBpZiAoaXNTYW1lVGFnICYmICFvYmpJc09iaikge1xuICAgICAgICBzdGFjayB8fCAoc3RhY2sgPSBuZXcgU3RhY2spO1xuICAgICAgICByZXR1cm4gKG9iaklzQXJyIHx8IGlzVHlwZWRBcnJheShvYmplY3QpKVxuICAgICAgICAgID8gZXF1YWxBcnJheXMob2JqZWN0LCBvdGhlciwgYml0bWFzaywgY3VzdG9taXplciwgZXF1YWxGdW5jLCBzdGFjaylcbiAgICAgICAgICA6IGVxdWFsQnlUYWcob2JqZWN0LCBvdGhlciwgb2JqVGFnLCBiaXRtYXNrLCBjdXN0b21pemVyLCBlcXVhbEZ1bmMsIHN0YWNrKTtcbiAgICAgIH1cbiAgICAgIGlmICghKGJpdG1hc2sgJiBDT01QQVJFX1BBUlRJQUxfRkxBRykpIHtcbiAgICAgICAgdmFyIG9iaklzV3JhcHBlZCA9IG9iaklzT2JqICYmIGhhc093blByb3BlcnR5LmNhbGwob2JqZWN0LCAnX193cmFwcGVkX18nKSxcbiAgICAgICAgICAgIG90aElzV3JhcHBlZCA9IG90aElzT2JqICYmIGhhc093blByb3BlcnR5LmNhbGwob3RoZXIsICdfX3dyYXBwZWRfXycpO1xuXG4gICAgICAgIGlmIChvYmpJc1dyYXBwZWQgfHwgb3RoSXNXcmFwcGVkKSB7XG4gICAgICAgICAgdmFyIG9ialVud3JhcHBlZCA9IG9iaklzV3JhcHBlZCA/IG9iamVjdC52YWx1ZSgpIDogb2JqZWN0LFxuICAgICAgICAgICAgICBvdGhVbndyYXBwZWQgPSBvdGhJc1dyYXBwZWQgPyBvdGhlci52YWx1ZSgpIDogb3RoZXI7XG5cbiAgICAgICAgICBzdGFjayB8fCAoc3RhY2sgPSBuZXcgU3RhY2spO1xuICAgICAgICAgIHJldHVybiBlcXVhbEZ1bmMob2JqVW53cmFwcGVkLCBvdGhVbndyYXBwZ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gICAgICAgIH1cbiAgICAgICAgICBzcGxpY2UuY2FsbChhcnJheSwgZnJvbUluZGV4LCAxKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIGFycmF5O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLnB1bGxBdGAgd2l0aG91dCBzdXBwb3J0IGZvciBpbmRpdmlkdWFsXG4gICAgICogaW5kZXhlcyBvciBjYXB0dXJpbmcgdGhlIHJlbW92ZWQgZWxlbWVudHMuXG4gICAgICpcbiAgICAgKiBAcHJpdmF0ZVxuICAgICAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBtb2RpZnkuXG4gICAgICogQHBhcmFtIHtudW1iZXJbXX0gaW5kZXhlcyBUaGUgaW5kZXhlcyBvZiBlbGVtZW50cyB0byByZW1vdmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIGBhcnJheWAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gYmFzZVB1bGxBdChhcnJheSwgaW5kZXhlcykge1xuICAgICAgdmFyIGxlbmd0aCA9IGFycmF5ID8gaW5kZXhlcy5sZW5ndGggOiAwLFxuICAgICAgICAgIGxhc3RJbmRleCA9IGxlbmd0aCAtIDE7XG5cbiAgICAgIHdoaWxlIChsZW5ndGgtLSkge1xuICAgICAgICB2YXIgaW5kZXggPSBpbmRleGVzW2xlbmd0aF07XG4gICAgICAgIGlmIChsZW5ndGggPT0gbGFzdEluZGV4IHx8IGluZGV4ICE9PSBwcmV2aW91cykge1xuICAgICAgICAgIHZhciBwcmV2aW91cyA9IGluZGV4O1xuICAgICAgICAgIGlmIChpc0luZGV4KGluZGV4KSkge1xuICAgICAgICAgICAgc3BsaWNlLmNhbGwoYXJyYXksIGluZGV4LCAxKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYmFzZVVuc2V0KGFycmF5LCBpbmRleCk7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gPT0gb3RoZXI7XG4gICAgICB9XG4gICAgICB2YXIgaW5kZXggPSAtMSxcbiAgICAgICAgICByZXN1bHQgPSB0cnVlLFxuICAgICAgICAgIHNlZW4gPSAoYml0bWFzayAmIENPTVBBUkVfVU5PUkRFUkVEX0ZMQUcpID8gbmV3IFNldENhY2hlIDogdW5kZWZpbmVkO1xuXG4gICAgICBzdGFjay5zZXQoYXJyYXksIG90aGVyKTtcbiAgICAgIHN0YWNrLnNldChvdGhlciwgYXJyYXkpO1xuXG4gICAgICAvLyBJZ25vcmUgbm9uLWluZGV4IHByb3BlcnRpZXMuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGFyckxlbmd0aCkge1xuICAgICAgICB2YXIgYXJyVmFsdWUgPSBhcnJheVtpbmRleF0sXG4gICAgICAgICAgICBvdGhWYWx1ZSA9IG90aGVyW2luZGV4XTtcblxuICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgIHZhciBjb21wYXJlZCA9IGlzUGFydGlhbFxuICAgICAgICAgICAgPyBjdXN0b21pemVyKG90aFZhbHVlLCBhcnJWYWx1ZSwgaW5kZXgsIG90aGVyLCBhcnJheSwgc3RhY2spXG4gICAgICAgICAgICA6IGN1c3RvbWl6ZXIoYXJyVmFsdWUsIG90aFZhbHVlLCBpbmRleCwgYXJyYXksIG90aGVyLCBzdGFjayk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbXBhcmVkICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBpZiAoY29tcGFyZWQpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIGFycmF5cyAoc3VzY2VwdGlibGUgdG8gY2FsbCBzdGFjayBsaW1pdHMpLlxuICAgICAgICBpZiAoc2Vlbikge1xuICAgICAgICA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gY3VzdG9taXplciwgZXF1YWxGdW5jLCBzdGFjaykge1xuICAgICAgc3dpdGNoICh0YWcpIHtcbiAgICAgICAgY2FzZSBkYXRhVmlld1RhZzpcbiAgICAgICAgICBpZiAoKG9iamVjdC5ieXRlTGVuZ3RoICE9IG90aGVyLmJ5dGVMZW5ndGgpIHx8XG4gICAgICAgICAgICAgIChvYmplY3QuYnl0ZU9mZnNldCAhPSBvdGhlci5ieXRlT2Zmc2V0KSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBvYmplY3QgPSBvYmplY3QuYnVmZmVyO1xuICAgICAgICAgIG90aGVyID0gb3RoZXIuYnVmZmVyO1xuXG4gICAgICAgIGNhc2UgYXJyYXlCdWZmZXJUYWc6XG4gICAgICAgICAgaWYgKChvYmplY3QuYnl0ZUxlbmd0aCAhPSBvdGhlci5ieXRlTGVuZ3RoKSB8fFxuICAgICAgICAgICAgICAhZXF1YWxGdW5jKG5ldyBVaW50OEFycmF5KG9iamVjdCksIG5ldyBVaW50OEFycmF5KG90aGVyKSkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHRydWU7XG5cbiAgICAgICAgY2FzZSBib29sVGFnOlxuICAgICAgICBjYXNlIGRhdGVUYWc6XG4gICAgICAgIGNhc2UgbnVtYmVyVGFnOlxuICAgICAgICAgIC8vIENvZXJjZSBib29sZWFucyB0byBgMWAgb3IgYDBgIGFuZCBkYXRlcyB0byBtaWxsaXNlY29uZHMuXG4gICAgICAgICAgLy8gSW52YWxpZCBkYXRlcyBhcmUgY29lcmNlZCB0byBgTmFOYC5cbiAgICAgICAgICByZXR1cm4gZXEoK29iamVjdCwgK290aGVyKTtcblxuICAgICAgICBjYXNlIGVycm9yVGFnOlxuICAgICAgICAgIHJldHVybiBvYmplY3QubmFtZSA9PSBvdGhlci5uYW1lICYmIG9iamVjdC5tZXNzYWdl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gICAgICAgaWYgKCEoY29tcGFyZWQgPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgICA/IChvYmpWYWx1ZSA9PT0gb3RoVmFsdWUgfHwgZXF1YWxGdW5jKG9ialZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spKVxuICAgICAgICAgICAgICA6IGNvbXBhcmVkXG4gICAgICAgICAgICApKSB7XG4gICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgc2tpcEN0b3IgfHwgKHNraXBDdG9yID0ga2V5ID09ICdjb25zdHJ1Y3RvcicpO1xuICAgICAgfVxuICAgICAgaWYgKHJlc3VsdCAmJiAhc2tpcEN0b3IpIHtcbiAgICAgICAgdmFyIG9iakN0b3IgPSBvYmplY3QuY29uc3RydWN0b3IsXG4gICAgICAgICAgICBvdGhDdG9yID0gb3RoZXIuY29uc3RydWN0b3I7XG5cbiAgICAgICAgLy8gTm9uIGBPYmplY3RgIG9iamVjdCBpbnN0YW5jZXMgd2l0aCBkaWZmZXJlbnQgY29uc3RydWN0b3JzIGFyZSBub3QgZXF1YWwuXG4gICAgICAgIGlmIChvYmpDdG9yICE9IG90aEN0b3IgJiZcbiAgICAgICAgICAgICgnY29uc3RydWN0b3InIGluIG9iamVjdCAmJiAnY29uc3RydWN0b3InIGluIG90aGVyKSAmJlxuICAgICAgICAgICAgISh0eXBlb2Ygb2JqQ3RvciA9PSAnZnVuY3Rpb24nICYmIG9iakN0b3IgaW5zdGFuY2VvZiBvYmpDdG9yICYmXG4gICAgICAgICAgICAgIHR5cGVvZiBvdGhDdG9yID09ICdmdW5jdGlvbicgJiYgb3RoQ3RvciBpbnN0YW5jZW9mIG90aEN0b3IpKSB7XG4gICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHN0YWNrWydkZWxldGUnXShvYmplY3QpO1xuICA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HVybiByZXN1bHQ7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGNhbmNlbCgpIHtcbiAgICAgICAgaWYgKHRpbWVySWQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGNsZWFyVGltZW91dCh0aW1lcklkKTtcbiAgICAgICAgfVxuICAgICAgICBsYXN0SW52b2tlVGltZSA9IDA7XG4gICAgICAgIGxhc3RBcmdzID0gbGFzdENhbGxUaW1lID0gbGFzdFRoaXMgPSB0aW1lcklkID0gdW5kZWZpbmVkO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBmbHVzaCgpIHtcbiAgICAgICAgcmV0dXJuIHRpbWVySWQgPT09IHVuZGVmaW5lZCA/IHJlc3VsdCA6IHRyYWlsaW5nRWRnZShub3coKSk7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGRlYm91bmNlZCgpIHtcbiAgICAgICAgdmFyIHRpbWUgPSBub3coKSxcbiAgICAgICAgICAgIGlzSW52b2tpbmcgPSBzaG91bGRJbnZva2UodGltZSk7XG5cbiAgICAgICAgbGFzdEFyZ3MgPSBhcmd1bWVudHM7XG4gICAgICAgIGxhc3RUaGlzID0gdGhpcztcbiAgICAgICAgbGFzdENhbGxUaW1lID0gdGltZTtcblxuICAgICAgICBpZiAoaXNJbnZva2luZykge1xuICAgICAgICAgIGlmICh0aW1lcklkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBsZWFkaW5nRWRnZShsYXN0Q2FsbFRpbWUpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAobWF4aW5nKSB7XG4gICAgICAgICAgICAvLyBIYW5kbGUgaW52b2NhdGlvbnMgaW4gYSB0aWdodCBsb29wLlxuICAgICAgICAgICAgdGltZXJJZCA9IHNldFRpbWVvdXQodGltZXJFeHBpcmVkLCB3YWl0KTtcbiAgICAgICAgICAgIHJldHVybiBpbnZva2VGdW5jKGxhc3RDYWxsVGltZSk7XG4gICAgICAgICA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amVjdCwgZWxzZSBgZmFsc2VgLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBmdW5jdGlvbiBGb28oKSB7XG4gICAgICogICB0aGlzLmEgPSAxO1xuICAgICAqIH1cbiAgICAgKlxuICAgICAqIF8uaXNQbGFpbk9iamVjdChuZXcgRm9vKTtcbiAgICAgKiAvLyA9PiBmYWxzZVxuICAgICAqXG4gICAgICogXy5pc1BsYWluT2JqZWN0KFsxLCAyLCAzXSk7XG4gICAgICogLy8gPT4gZmFsc2VcbiAgICAgKlxuICAgICAqIF8uaXNQbGFpbk9iamVjdCh7ICd4JzogMCwgJ3knOiAwIH0pO1xuICAgICAqIC8vID0+IHRydWVcbiAgICAgKlxuICAgICAqIF8uaXNQbGFpbk9iamVjdChPYmplY3QuY3JlYXRlKG51bGwpKTtcbiAgICAgKiAvLyA9PiB0cnVlXG4gICAgICovXG4gICAgZnVuY3Rpb24gaXNQbGFpbk9iamVjdCh2YWx1ZSkge1xuICAgICAgaWYgKCFpc09iamVjdExpa2UodmFsdWUpIHx8IGJhc2VHZXRUYWcodmFsdWUpICE9IG9iamVjdFRhZykge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9XG4gICAgICB2YXIgcHJvdG8gPSBnZXRQcm90b3R5cGUodmFsdWUpO1xuICAgICAgaWYgKHByb3RvID09PSBudWxsKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgICAgdmFyIEN0b3IgPSBoYXNPd25Qcm9wZXJ0eS5jYWxsKHByb3RvLCAnY29uc3RydWN0b3InKSAmJiBwcm90by5jb25zdHJ1Y3RvcjtcbiAgICAgIHJldHVybiB0eXBlb2YgQ3RvciA9PSAnZnVuY3Rpb24nICYmIEN0b3IgaW5zdGFuY2VvZiBDdG9yICYmXG4gICAgICAgIGZ1bmNUb1N0cmluZy5jYWxsKEN0b3IpID09IG9iamVjdEN0b3JTdHJpbmc7XG4gICAgfVxuXG4gICAgLyoqXG4gICA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qXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMC4wXG4gICAgICogQGNhdGVnb3J5IExhbmdcbiAgICAgKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBwcm9jZXNzLlxuICAgICAqIEByZXR1cm5zIHtudW1iZXJ9IFJldHVybnMgdGhlIG51bWJlci5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogXy50b051bWJlcigzLjIpO1xuICAgICAqIC8vID0+IDMuMlxuICAgICAqXG4gICAgICogXy50b051bWJlcihOdW1iZXIuTUlOX1ZBTFVFKTtcbiAgICAgKiAvLyA9PiA1ZS0zMjRcbiAgICAgKlxuICAgICAqIF8udG9OdW1iZXIoSW5maW5pdHkpO1xuICAgICAqIC8vID0+IEluZmluaXR5XG4gICAgICpcbiAgICAgKiBfLnRvTnVtYmVyKCczLjInKTtcbiAgICAgKiAvLyA9PiAzLjJcbiAgICAgKi9cbiAgICBmdW5jdGlvbiB0b051bWJlcih2YWx1ZSkge1xuICAgICAgaWYgKHR5cGVvZiB2YWx1ZSA9PSAnbnVtYmVyJykge1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICB9XG4gICAgICBpZiAoaXNTeW1ib2wodmFsdWUpKSB7XG4gICAgICAgIHJldHVybiBOQU47XG4gICAgICB9XG4gICAgICBpZiAoaXNPYmplY3QodmFsdWUpKSB7XG4gICAgICAgIHZhciBvdGhlciA9IHR5cGVvZiB2YWx1ZS52YWx1ZU9mID09ICdmdW5jdGlvbicgPyB2YWx1ZS52YWx1ZU9mKCkgOiB2YWx1ZTtcbiAgICAgICAgdmFsdWUgPSBpc09iamVjdChvdGhlcikgPyAob3RoZXIgKyAnJykgOiBvdGhlcjtcbiAgICAgIH1cbiAgICAgIGlmICh0eXBlb2YgdmFsdWUgIT0gJ3N0cmluZycpIHtcbiAgICAgICAgcmV0dXJuIHZhbHVlID09PSAwID8gdmFsdW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gICAgICAgICAgOiAnb2JqIHx8IChvYmogPSB7fSk7XFxuJ1xuICAgICAgICApICtcbiAgICAgICAgXCJ2YXIgX190LCBfX3AgPSAnJ1wiICtcbiAgICAgICAgKGlzRXNjYXBpbmdcbiAgICAgICAgICAgPyAnLCBfX2UgPSBfLmVzY2FwZSdcbiAgICAgICAgICAgOiAnJ1xuICAgICAgICApICtcbiAgICAgICAgKGlzRXZhbHVhdGluZ1xuICAgICAgICAgID8gJywgX19qID0gQXJyYXkucHJvdG90eXBlLmpvaW47XFxuJyArXG4gICAgICAgICAgICBcImZ1bmN0aW9uIHByaW50KCkgeyBfX3AgKz0gX19qLmNhbGwoYXJndW1lbnRzLCAnJykgfVxcblwiXG4gICAgICAgICAgOiAnO1xcbidcbiAgICAgICAgKSArXG4gICAgICAgIHNvdXJjZSArXG4gICAgICAgICdyZXR1cm4gX19wXFxufSc7XG5cbiAgICAgIHZhciByZXN1bHQgPSBhdHRlbXB0KGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gRnVuY3Rpb24oaW1wb3J0c0tleXMsIHNvdXJjZVVSTCArICdyZXR1cm4gJyArIHNvdXJjZSlcbiAgICAgICAgICAuYXBwbHkodW5kZWZpbmVkLCBpbXBvcnRzVmFsdWVzKTtcbiAgICAgIH0pO1xuXG4gICAgICAvLyBQcm92aWRlIHRoZSBjb21waWxlZCBmdW5jdGlvbidzIHNvdXJjZSBieSBpdHMgYHRvU3RyaW5nYCBtZXRob2Qgb3JcbiAgICAgIC8vIHRoZSBgc291cmNlYCBwcm9wZXJ0eSBhcyBhIGNvbnZlbmllbmNlIGZvciBpbmxpbmluZyBjb21waWxlZCB0ZW1wbGF0ZXMuXG4gICAgICByZXN1bHQuc291cmNlID0gc291cmNlO1xuICAgICAgaWYgKGlzRXJyb3IocmVzdWx0KSkge1xuICAgICAgICB0aHJvdyByZXN1bHQ7XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxu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IGBfLm1hcGAuXG4gICAgICogQHJldHVybnMge3N0cmluZ30gUmV0dXJucyB0aGUgdHJpbW1lZCBzdHJpbmcuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udHJpbSgnICBhYmMgICcpO1xuICAgICAqIC8vID0+ICdhYmMnXG4gICAgICpcbiAgICAgKiBfLnRyaW0oJy1fLWFiYy1fLScsICdfLScpO1xuICAgICAqIC8vID0+ICdhYmMnXG4gICAgICpcbiAgICAgKiBfLm1hcChbJyAgZm9vICAnLCAnICBiYXIgICddLCBfLnRyaW0pO1xuICAgICAqIC8vID0+IFsnZm9vJywgJ2JhciddXG4gICAgICovXG4gICAgZnVuY3Rpb24gdHJpbShzdHJpbmcsIGNoYXJzLCBndWFyZCkge1xuICAgICAgc3RyaW5nID0gdG9TdHJpbmcoc3RyaW5nKTtcbiAgICAgIGlmIChzdHJpbmcgJiYgKGd1YXJkIHx8IGNoYXJzID09PSB1bmRlZmluZWQpKSB7XG4gICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZShyZVRyaW0sICcnKTtcbiAgICAgIH1cbiAgICAgIGlmICghc3RyaW5nIHx8ICEoY2hhcnMgPSBiYXNlVG9TdHJpbmcoY2hhcnMpKSkge1xuICAgICAgICByZXR1cm4gc3RyaW5nO1xuICAgICAgfVxuICAgICAgdmFyIHN0clN5bWJvbHMgPSBzdHJpbmdUb0FycmF5KHN0cmluZyksXG4gICAgICAgICAgY2hyU3ltYm9scyA9IHN0cmluZ1RvQXJyYXkoY2hhcnMpLFxuICAgICAgICAgIHN0YXJ0ID0gY2hhcnNTdGFydEluZGV4KHN0clN5bWJvbHMsIGNoclN5bWJvbHMpLFxuICAgICAgICAgIGVuZCA9IGNoYXJzRW5kSW5kZXgoc3RyU3ltYm9scywgY2hyU3ltYm9scykgKyAxO1xuXG4gICAgICByZXR1cm4gY2FzdFNsaWNlKHN0clN5bWJvbHMsIHN0YXJ0LCBlbmQpLmpvaW4oJycpO1xuICAgIH1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ufE9iamVjdH0gW29iamVjdD1sb2Rhc2hdIFRoZSBkZXN0aW5hdGlvbiBvYmplY3QuXG4gICAgICogQHBhcmFtIHtPYmplY3R9IHNvdXJjZSBUaGUgb2JqZWN0IG9mIGZ1bmN0aW9ucyB0byBhZGQuXG4gICAgICogQHBhcmFtIHtPYmplY3R9IFtvcHRpb25zPXt9XSBUaGUgb3B0aW9ucyBvYmplY3QuXG4gICAgICogQHBhcmFtIHtib29sZWFufSBbb3B0aW9ucy5jaGFpbj10cnVlXSBTcGVjaWZ5IHdoZXRoZXIgbWl4aW5zIGFyZSBjaGFpbmFibGUuXG4gICAgICogQHJldHVybnMge0Z1bmN0aW9ufE9iamVjdH0gUmV0dXJucyBgb2JqZWN0YC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogZnVuY3Rpb24gdm93ZWxzKHN0cmluZykge1xuICAgICAqICAgcmV0dXJuIF8uZmlsdGVyKHN0cmluZywgZnVuY3Rpb24odikge1xuICAgICAqICAgICByZXR1cm4gL1thZWlvdV0vaS50ZXN0KHYpO1xuICAgICAqICAgfSk7XG4gICAgICogfVxuICAgICAqXG4gICAgICogXy5taXhpbih7ICd2b3dlbHMnOiB2b3dlbHMgfSk7XG4gICAgICogXy52b3dlbHMoJ2ZyZWQnKTtcbiAgICAgKiAvLyA9PiBbJ2UnXVxuICAgICAqXG4gICAgICogXygnZnJlZCcpLnZvd2VscygpLnZhbHVlKCk7XG4gICAgICogLy8gPT4gWydlJ11cbiAgICAgKlxuICAgICAqIF8ubWl4aW4oeyAndm93ZWxzJzogdm93ZWxzIH0sIHsgJ2NoYWluJzogZmFsc2UgfSk7XG4gICAgICogXygnZnJlZCcpLnZvd2VscygpO1xuICAgICAqIC8vID0+IFsnZSddXG4gICAgICovXG4gICAgZnVuY3Rpb24gbWl4aW4ob2JqZWN0LCBzb3VyY2UsIG9wdGlvbnMpIHtcbiAgICAgIHZhciBwcm9wcyA9IGtleXMoc291cmNlKSxcbiAgICAgICAgICBtZXRob2ROYW1lcyA9IGJhc2VGdW5jdGlvbnMoc291cmNlLCBwcm9wcyk7XG5cbiAgICAgIGlmIChvcHRpb25zID09IG51bGwgJiZcbiAgICAgICAgICAhKGlzT2JqZWN0KHNvdXJjZSkgJiYgKG1ldGhvZE5hbWVzLmxlbmd0aCB8fCAhcHJvcHMubGVuZ3RoKSkpIHtcbiAgICAgICAgb3B0aW9ucyA9IHNvdXJjZTtcbiAgICAgICAgc291cmNlID0gb2JqZWN0O1xuICAgICAgICBvYmplY3QgPSB0aGlzO1xuICAgICAgICBtZXRob2ROYW1lcyA9IGJhc2VGdW5jdGlvbnMoc291cmNlLCBrZXlzKHNvdXJjZSkpO1xuICAgICAgfVxuICAgICAgdmFyIGNoYWluID0gIShpc09iamVjdChvcHRpb25zKSAmJiAnY2hhaW4nIGluIG9wdGlvbnMpIHx8ICEhb3B0aW9ucy5jaGFpbixcbiAgICAgICAgICBpc0Z1bmMgPSBpc0Z1bmN0aW9uKG9iamVjdCk7XG5cbiAgICAgIGFycmF5RWFjaChtZXRob2ROYW1lcywgZnVuY3Rpb24obWV0aG9kTmFtZSkge1xuICAgICAgICB2YXIgZnVuYyA9IHNvdXJjZVttZXRob2ROYW1lXTtcbiAgICAgICAgb2JqZWN0W21ldGhvZE5hbWVdID0gZnVuYztcbiAgICAgICAgaWYgKGlzRnVuYykge1xuICAgICAgICAgIG9iamVjdC5wcm90b3R5cGVbbWV0aG9kTmFtZV0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBjaGFpbkFsbCA9IHRoaXMuX19jaGFpbl9fO1xuICAgICAgICAgICAgaWYgKGNoYWluIHx8IGNoYWluQWxsKSB7XG4gICAgICAgICAgICAgIHZhciByZXN1bHQgPSBvYmplY3QodGhpcy5fX3dyYXBwZWRfXyksXG4gICAgICAgICAgICAgICAgICBhY3Rpb25zID0gcmVzdWx0Ll9fYWN0aW9uc19fID0gY29weUFycmF5KHRoaXMuX19hY3Rpb25zX18pO1xuX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cmVhdGVSYW5nZSh0cnVlKTtcblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYSBuZXcgZW1wdHkgYXJyYXkuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgNC4xMy4wXG4gICAgICogQGNhdGVnb3J5IFV0aWxcbiAgICAgKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIG5ldyBlbXB0eSBhcnJheS5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIGFycmF5cyA9IF8udGltZXMoMiwgXy5zdHViQXJyYXkpO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzKTtcbiAgICAgKiAvLyA9PiBbW10sIFtdXVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzWzBdID09PSBhcnJheXNbMV0pO1xuICAgICAqIC8vID0+IGZhbHNlXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkFycmF5KCkge1xuICAgICAgcmV0dXJuIFtdO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYGZhbHNlYC5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjEzLjBcbiAgICAgKiBAY2F0ZWdvcnkgVXRpbFxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGBmYWxzZWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udGltZXMoMiwgXy5zdHViRmFsc2UpO1xuICAgICAqIC8vID0+IFtmYWxzZSwgZmFsc2VdXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkZhbHNlKCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYSBuZXcgZW1wdHkgb2JqZWN0LlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgbmV3IGVtcHR5IG9iamVjdC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIG9iamVjdHMgPSBfLnRpbWVzKDIsIF8uc3R1Yk9iamVjdCk7XG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhvYmplY3RzKTtcbiAgICAgKiAvLyA9PiBbe30sIHt9XVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2cob2JqZWN0c1swXSA9PT0gb2JqZWN0c1sxXSk7XG4gICAgICogLy8gPT4gZmFsc2VcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViT2JqZWN0KCkge1xuICAgICAgcmV0dXJuIHt9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYW4gZW1wdHkgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge3N0cmluZ30gUmV0dXJucyB0aGUgZW1wdHkgc3RyaW5nLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBfLnRpbWVzKDIsIF8uc3R1YlN0cmluZyk7XG4gICAgICogLy8gPT4gWycnLCAnJ11cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViU3RyaW5nKCkge1xuICAgICAgcmV0dXJuICcnO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYHRydWVgLlxuICAgICAqXG4gICAgICogQHN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WzBdIDogdHJ1ZTtcblxuICAgICAgdmFyIHByb3BzID0ge307XG4gICAgICBpZiAodGhpcy5wcmlvcml0eSkge1xuICAgICAgICBwcm9wcy5wcmlvcml0eSA9IHRoaXMucHJpb3JpdHk7XG4gICAgICB9XG4gICAgICB2YXIgb3BlciA9IENvbmRpdGlvbi5ib29sZWFuT3BlcmF0b3IodGhpcyk7XG4gICAgICBpZiAob3Blcikge1xuICAgICAgICBwcm9wc1tvcGVyXSA9IHRoaXNbb3Blcl0ubWFwKGZ1bmN0aW9uIChjKSB7XG4gICAgICAgICAgcmV0dXJuIGMudG9KU09OKHN0cmluZ2lmeSk7XG4gICAgICAgIH0pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcHJvcHMub3BlcmF0b3IgPSB0aGlzLm9wZXJhdG9yO1xuICAgICAgICBwcm9wcy52YWx1ZSA9IHRoaXMudmFsdWU7XG4gICAgICAgIHByb3BzLmZhY3QgPSB0aGlzLmZhY3Q7XG4gICAgICAgIGlmICh0aGlzLmZhY3RSZXN1bHQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIHByb3BzLmZhY3RSZXN1bHQgPSB0aGlzLmZhY3RSZXN1bHQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMucmVzdWx0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBwcm9wcy5yZXN1bHQgPSB0aGlzLnJlc3VsdDtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5wYXJhbXMpIHtcbiAgICAgICAgICBwcm9wcy5wYXJhbXMgPSB0aGlzLnBhcmFtcztcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5wYXRoKSB7XG4gICAgICAgICAgcHJvcHMucGF0aCA9IHRoaXMucGF0aDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHN0cmluZ2lmeSkge1xuICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocHJvcHMpO1xuICAgICAgfVxuICA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VudCBvYmplY3Qgd2l0aCBcInR5cGVcIiBwcm9wZXJ0eScpO1xuICAgICAgdGhpcy5ldmVudCA9IHtcbiAgICAgICAgdHlwZTogZXZlbnQudHlwZVxuICAgICAgfTtcbiAgICAgIGlmIChldmVudC5wYXJhbXMpIHRoaXMuZXZlbnQucGFyYW1zID0gZXZlbnQucGFyYW1zO1xuICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogU2V0cyB0aGUgZW5naW5lIHRvIHJ1biB0aGUgcnVsZXMgdW5kZXJcbiAgICAgKiBAcGFyYW0ge29iamVjdH0gZW5naW5lXG4gICAgICogQHJldHVybnMge1J1bGV9XG4gICAgICovXG5cbiAgfSwge1xuICAgIGtleTogJ3NldEVuZ2luZScsXG4gICAgdmFsdWU6IGZ1bmN0aW9uIHNldEVuZ2luZShlbmdpbmUpIHtcbiAgICAgIHRoaXMuZW5naW5lID0gZW5naW5lO1xuICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICB9LCB7XG4gICAga2V5OiAndG9KU09OJyxcbiAgICB2YWx1ZTogZnVuY3Rpb24gdG9KU09OKCkge1xuICAgICAgdmFyIHN0cmluZ2lmeSA9IGFyZ3VtZW50cy5sZW5ndGggPiAwICYmIGFyZ3VtZW50c1swXSAhPT0gdW5kZWZpbmVkID8gYXJndW1lbnRzWzBdIDogdHJ1ZTtcblxuICAgICAgdmFyIHByb3BzID0ge1xuICAgICAgICBjb25kaXRpb25zOiB0aGlzLmNvbmRpdGlvbnMudG9KU09OKGZhbHNlKSxcbiAgICAgICAgcHJpb3JpdHk6IHRoaXMucHJpb3JpdHksXG4gICAgICAgIGV2ZW50OiB0aGlzLmV2ZW50LFxuICAgICAgICBuYW1lOiB0aGlzLm5hbWVcbiAgICAgIH07XG4gICAgICBpZiAoc3RyaW5naWZ5KSB7XG4gICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShwcm9wcyk7XG4gICAgICB9XG4gICAgICByZXR1c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ICAgICAgICAgICAgc3RvcCA9IHRydWU7XG4gICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGFsbCBjb25kaXRpb25zIHBhc3NlZDsgcHJvY2VlZCB3aXRoIHJ1bm5pbmcgbmV4dCBzZXQgaW4gcGFyYWxsZWxcbiAgICAgICAgICAgIHJldHVybiBldmFsdWF0ZUNvbmRpdGlvbnMoc2V0LCBtZXRob2QpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb3JkZXJlZFNldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICBfbG9vcChpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gY3Vyc29yO1xuICAgICAgfTtcblxuICAgICAgLyoqXG4gICAgICAgKiBSdW5zIGFuICdhbnknIGJvb2xlYW4gb3BlcmF0b3Igb24gYW4gYXJyYXkgb2YgY29uZGl0aW9uc1xuICAgICAgICogQHBhcmFtICB7Q29uZGl0aW9uW119IGNvbmRpdGlvbnMgdG8gYmUgZXZhbHVhdGVkXG4gICAgICAgKiBAcmV0dXJuIHtQcm9taXNlKGJvb2xlYW4pfSBjb25kaXRpb24gZXZhbHVhdGlvbiByZXN1bHRcbiAgICAgICAqL1xuICAgICAgdmFyIGFueSA9IGZ1bmN0aW9uIGFueShjb25kaXRpb25zKSB7XG4gICAgICAgIHJldHVybiBwcmlvcml0aXplQW5kUnVuKGNvbmRpdGlvbnMsICdhbnknKTtcbiAgICAgIH07XG5cbiAgICAgIC8qKlxuICAgICAgICogUnVucyBhbiAnYWxsJyBib29sZWFuIG9wZXJhdG9yIG9uIGFuIGFycmF5IG9mIGNvbmRpdGlvbnNcbiAgICAgICAqIEBwYXJhbSAge0NvbmRpdGlvbltdfSBjb25kaXRpb25zIHRvIGJlIGV2YWx1YXRlZFxuICAgICAgICogQHJldHVybiB7UHJvbWlzZShib29sZWFuKX0g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Byc1N1cnJQYWlyLCByc0FzdHJhbF0uam9pbignfCcpICsgJyknO1xuXG4gIC8qKiBVc2VkIHRvIG1hdGNoIGFwb3N0cm9waGVzLiAqL1xuICB2YXIgcmVBcG9zID0gUmVnRXhwKHJzQXBvcywgJ2cnKTtcblxuICAvKipcbiAgICogVXNlZCB0byBtYXRjaCBbY29tYmluaW5nIGRpYWNyaXRpY2FsIG1hcmtzXShodHRwczovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Db21iaW5pbmdfRGlhY3JpdGljYWxfTWFya3MpIGFuZFxuICAgKiBbY29tYmluaW5nIGRpYWNyaXRpY2FsIG1hcmtzIGZvciBzeW1ib2xzXShodHRwczovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Db21iaW5pbmdfRGlhY3JpdGljYWxfTWFya3NfZm9yX1N5bWJvbHMpLlxuICAgKi9cbiAgdmFyIHJlQ29tYm9NYXJrID0gUmVnRXhwKHJzQ29tYm8sICdnJyk7XG5cbiAgLyoqIFVzZWQgdG8gbWF0Y2ggW3N0cmluZyBzeW1ib2xzXShodHRwczovL21hdGhpYXNieW5lbnMuYmUvbm90ZXMvamF2YXNjcmlwdC11bmljb2RlKS4gKi9cbiAgdmFyIHJlVW5pY29kZSA9IFJlZ0V4cChyc0ZpdHogKyAnKD89JyArIHJzRml0eiArICcpfCcgKyByc1N5bWJvbCArIHJzU2VxLCAnZycpO1xuXG4gIC8qKiBVc2VkIHRvIG1hdGNoIGNvbXBsZXggb3IgY29tcG91bmQgd29yZHMuICovXG4gIHZhciByZVVuaWNvZGVXb3JkID0gUmVnRXhwKFtcbiAgICByc1VwcGVyICsgJz8nICsgcnNMb3dlciArICcrJyArIHJzT3B0Q29udHJMb3dlciArICcoPz0nICsgW3JzQnJlYWssIHJzVXBwZXIsICckJ10uam9pbignfCcpICsgJyknLFxuICAgIHJzTWlzY1VwcGVyICsgJysnICsgcnNPcHRDb250clVwcGVyICsgJyg/PScgKyBbcnNCcmVhaywgcnNVcHBlciArI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lsZSAoKytpbmRleCA8IGxlbmd0aCAmJiByZXN1bHQubGVuZ3RoIDwgbWF4TGVuZ3RoKSB7XG4gICAgICAgIHZhciB2YWx1ZSA9IGFycmF5W2luZGV4XSxcbiAgICAgICAgICAgIGNvbXB1dGVkID0gaXRlcmF0ZWUgPyBpdGVyYXRlZSh2YWx1ZSkgOiB2YWx1ZTtcblxuICAgICAgICB2YWx1ZSA9IChjb21wYXJhdG9yIHx8IHZhbHVlICE9PSAwKSA/IHZhbHVlIDogMDtcbiAgICAgICAgaWYgKCEoc2VlblxuICAgICAgICAgICAgICA/IGNhY2hlSGFzKHNlZW4sIGNvbXB1dGVkKVxuICAgICAgICAgICAgICA6IGluY2x1ZGVzKHJlc3VsdCwgY29tcHV0ZWQsIGNvbXBhcmF0b3IpXG4gICAgICAgICAgICApKSB7XG4gICAgICAgICAgb3RoSW5kZXggPSBvdGhMZW5ndGg7XG4gICAgICAgICAgd2hpbGUgKC0tb3RoSW5kZXgpIHtcbiAgICAgICAgICAgIHZhciBjYWNoZSA9IGNhY2hlc1tvdGhJbmRleF07XG4gICAgICAgICAgICBpZiAoIShjYWNoZVxuICAgICAgICAgICAgICAgICAgPyBjYWNoZUhhcyhjYWNoZSwgY29tcHV0ZWQpXG4gICAgICAgICAgICAgICAgICA6IGluY2x1ZGVzKGFycmF5c1tvdGhJbmRleF0sIGNvbXB1dGVkLCBjb21wYXJhdG9yKSlcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgY29udGludWUgb3V0ZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzZWVuKSB7XG4gICAgICAgICAgICBzZWVuLnB1c2goY29tcHV0ZWQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQucHVzaCh2YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2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G5hbWVzLCB2YWx1ZXMsIGFuZCBjb21wYXJlIGZsYWdzIHRvIG1hdGNoLlxuICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IFtjdXN0b21pemVyXSBUaGUgZnVuY3Rpb24gdG8gY3VzdG9taXplIGNvbXBhcmlzb25zLlxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBgb2JqZWN0YCBpcyBhIG1hdGNoLCBlbHNlIGBmYWxzZWAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gYmFzZUlzTWF0Y2gob2JqZWN0LCBzb3VyY2UsIG1hdGNoRGF0YSwgY3VzdG9taXplcikge1xuICAgICAgdmFyIGluZGV4ID0gbWF0Y2hEYXRhLmxlbmd0aCxcbiAgICAgICAgICBsZW5ndGggPSBpbmRleCxcbiAgICAgICAgICBub0N1c3RvbWl6ZXIgPSAhY3VzdG9taXplcjtcblxuICAgICAgaWYgKG9iamVjdCA9PSBudWxsKSB7XG4gICAgICAgIHJldHVybiAhbGVuZ3RoO1xuICAgICAgfVxuICAgICAgb2JqZWN0ID0gT2JqZWN0KG9iamVjdCk7XG4gICAgICB3aGlsZSAoaW5kZXgtLSkge1xuICAgICAgICB2YXIgZGF0YSA9IG1hdGNoRGF0YVtpbmRleF07XG4gICAgICAgIGlmICgobm9DdXN0b21pemVyICYmIGRhdGFbMl0pXG4gICAgICAgICAgICAgID8gZGF0YVsxXSAhPT0gb2JqZWN0W2RhdGFbMF1dXG4gICAgICAgICAgICAgIDogIShkYXRhWzBdIGluIG9iamVjdClcbiAgICAgICAgICAgICkge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgZGF0YSA9IG1hdGNoRGF0YVtpbmRleF07XG4gICAgICAgIHZhciBrZXkgPSBkYXRhWzBdLFxuICAgICAgICAgICAgb2JqVmFsdWUgPSBvYmplY3Rba2V5XSxcbiAgICAgICAgICAgIHNyY1ZhbHVlID0gZGF0YVsxXTtcblxuICAgICAgICBpZiAobm9DdXN0b21pemVyICYmIGRhdGFbMl0pIHtcbiAgICAgICAgICBpZiAob2JqVmFsdWUgPT09IHVuZGVmaW5lZCAmJiAhKGtleSBpbiBvYmplY3QpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhciBzdGFjayA9IG5ldyBTdGFjaztcbiAgICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGN1c3RvbWl6ZXIob2JqVmFsdWUsIHNyY1ZhbHVlLCBrZXksIG9iamVjdCwgc291cmNlLCBzdGFjayk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICghKHJlc3VsdCA9PT0gdW5kZWZpbmVkXG4gICAgICAgICAgICAgICAgPyBiYXNlSXNFcXVhbChzcmNWYWx1ZSwgb2JqVmFsdWUsIENPTVBBUkVfUEFSVElBTF9GTEFHIHwgQ09NUEFSRV9VTk9SREVSRURfRkxBRywgY3VzdG9taXplciwgc3RhY2spXG4gICAgICAgICAgICAgICAgOiByZXN1bHRcbiAgICAgICAgICAgICAgKSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uaXNOYXRpdmVgIHdpdGhvdXQgYmFkIHNoaW0gY2hlY2tzLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBjaGVjay5cbiAgICAgKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYg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KSB7XG4gICAgICBpZiAoIWlzUHJvdG90eXBlKG9iamVjdCkpIHtcbiAgICAgICAgcmV0dXJuIG5hdGl2ZUtleXMob2JqZWN0KTtcbiAgICAgIH1cbiAgICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICAgIGZvciAodmFyIGtleSBpbiBPYmplY3Qob2JqZWN0KSkge1xuICAgICAgICBpZiAoaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkgJiYga2V5ICE9ICdjb25zdHJ1Y3RvcicpIHtcbiAgICAgICAgICByZXN1bHQucHVzaChrZXkpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmtleXNJbmAgd2hpY2ggZG9lc24ndCB0cmVhdCBzcGFyc2UgYXJyYXlzIGFzIGRlbnNlLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gcXVlcnkuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBhcnJheSBvZiBwcm9wZXJ0eSBuYW1lcy5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBiYXNlS2V5c0luKG9iamVjdCkge1xuICAgICAgaWYgKCFpc09iamVjdChvYmplY3QpKSB7XG4gICAgICAgIHJldHVybiBuYXRpdmVLZXlzSW4ob2JqZWN0KTtcbiAgICAgIH1cbiAgICAgIHZhciBpc1Byb3RvID0gaXNQcm90b3R5cGUob2JqZWN0KSxcbiAgICAgICAgICByZXN1bHQgPSBbXTtcblxuICAgICAgZm9yICh2YXIga2V5IGluIG9iamVjdCkge1xuICAgICAgICBpZiAoIShrZXkgPT0gJ2NvbnN0cnVjdG9yJyAmJiAoaXNQcm90byB8fCAhaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkpK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ciBpbmRleCA9IC0xLFxuICAgICAgICAgIGxlbmd0aCA9IHBhdGgubGVuZ3RoLFxuICAgICAgICAgIGxhc3RJbmRleCA9IGxlbmd0aCAtIDEsXG4gICAgICAgICAgbmVzdGVkID0gb2JqZWN0O1xuXG4gICAgICB3aGlsZSAobmVzdGVkICE9IG51bGwgJiYgKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIga2V5ID0gdG9LZXkocGF0aFtpbmRleF0pLFxuICAgICAgICAgICAgbmV3VmFsdWUgPSB2YWx1ZTtcblxuICAgICAgICBpZiAoa2V5ID09PSAnX19wcm90b19fJyB8fCBrZXkgPT09ICdjb25zdHJ1Y3RvcicgfHwga2V5ID09PSAncHJvdG90eXBlJykge1xuICAgICAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaW5kZXggIT0gbGFzdEluZGV4KSB7XG4gICAgICAgICAgdmFyIG9ialZhbHVlID0gbmVzdGVkW2tleV07XG4gICAgICAgICAgbmV3VmFsdWUgPSBjdXN0b21pemVyID8gY3VzdG9taXplcihvYmpWYWx1ZSwga2V5LCBuZXN0ZWQpIDogdW5kZWZpbmVkO1xuICAgICAgICAgIGlmIChuZXdWYWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBuZXdWYWx1ZSA9IGlzT2JqZWN0KG9ialZhbHVlKVxuICAgICAgICAgICAgICA/IG9ialZhbHVlXG4gICAgICAgICAgICAgIDogKGlzSW5kZXgocGF0aFtpbmRleCArIDFdKSA/IFtdIDoge30pO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBhc3NpZ25WYWx1ZShuZXN0ZWQsIGtleSwgbmV3VmFsdWUpO1xuICAgICAgICBuZXN0ZWQgPSBuZXN0ZWRba2V5XTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50Y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0byBjdXN0b21pemUgY29waWVkIHZhbHVlcy5cbiAgICAgKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIGBvYmplY3RgLlxuICAgICAqL1xuICAgIGZ1bmN0aW9uIGNvcHlPYmplY3Qoc291cmNlLCBwcm9wcywgb2JqZWN0LCBjdXN0b21pemVyKSB7XG4gICAgICB2YXIgaXNOZXcgPSAhb2JqZWN0O1xuICAgICAgb2JqZWN0IHx8IChvYmplY3QgPSB7fSk7XG5cbiAgICAgIHZhciBpbmRleCA9IC0xLFxuICAgICAgICAgIGxlbmd0aCA9IHByb3BzLmxlbmd0aDtcblxuICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgdmFyIGtleSA9IHByb3BzW2luZGV4XTtcblxuICAgICAgICB2YXIgbmV3VmFsdWUgPSBjdXN0b21pemVyXG4gICAgICAgICAgPyBjdXN0b21pemVyKG9iamVjdFtrZXldLCBzb3VyY2Vba2V5XSwga2V5LCBvYmplY3QsIHNvdXJjZSlcbiAgICAgICAgICA6IHVuZGVmaW5lZDtcblxuICAgICAgICBpZiAobmV3VmFsdWUgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIG5ld1ZhbHVlID0gc291cmNlW2tleV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzTmV3KSB7XG4gICAgICAgICAgYmFzZUFzc2lnblZhbHVlKG9iamVjdCwga2V5LCBuZXdWYWx1ZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYXNzaWduVmFsdWUob2JqZWN0LCBrZXksIG5ld1ZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIG9iamVjdDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDb3BpZXMgb3duIHN5bWJvbHMgb2YgYHNvdXJjZWAgdG8gYG9iamVjdGAuXG4gICAgICpcbiAgICAgKiBAcHJpdmF0ZVxuICAgICAqIEBwYXJhbSB7T2JqZW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ycmF5W2luZGV4XSxcbiAgICAgICAgICAgIG90aFZhbHVlID0gb3RoZXJbaW5kZXhdO1xuXG4gICAgICAgIGlmIChjdXN0b21pemVyKSB7XG4gICAgICAgICAgdmFyIGNvbXBhcmVkID0gaXNQYXJ0aWFsXG4gICAgICAgICAgICA/IGN1c3RvbWl6ZXIob3RoVmFsdWUsIGFyclZhbHVlLCBpbmRleCwgb3RoZXIsIGFycmF5LCBzdGFjaylcbiAgICAgICAgICAgIDogY3VzdG9taXplcihhcnJWYWx1ZSwgb3RoVmFsdWUsIGluZGV4LCBhcnJheSwgb3RoZXIsIHN0YWNrKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29tcGFyZWQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGlmIChjb21wYXJlZCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vIFJlY3Vyc2l2ZWx5IGNvbXBhcmUgYXJyYXlzIChzdXNjZXB0aWJsZSB0byBjYWxsIHN0YWNrIGxpbWl0cykuXG4gICAgICAgIGlmIChzZWVuKSB7XG4gICAgICAgICAgaWYgKCFhcnJheVNvbWUob3RoZXIsIGZ1bmN0aW9uKG90aFZhbHVlLCBvdGhJbmRleCkge1xuICAgICAgICAgICAgICAgIGlmICghY2FjaGVIYXMoc2Vlbiwgb3RoSW5kZXgpICYmXG4gICAgICAgICAgICAgICAgICAgIChhcnJWYWx1ZSA9PT0gb3RoVmFsdWUgfHwgZXF1YWxGdW5jKGFyclZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spKSkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlZW4ucHVzaChvdGhJbmRleCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KSkge1xuICAgICAgICAgICAgcmVzdWx0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WNrZWQgPT0gb2JqZWN0O1xuICAgICAgfVxuICAgICAgdmFyIHJlc3VsdCA9IHRydWU7XG4gICAgICBzdGFjay5zZXQob2JqZWN0LCBvdGhlcik7XG4gICAgICBzdGFjay5zZXQob3RoZXIsIG9iamVjdCk7XG5cbiAgICAgIHZhciBza2lwQ3RvciA9IGlzUGFydGlhbDtcbiAgICAgIHdoaWxlICgrK2luZGV4IDwgb2JqTGVuZ3RoKSB7XG4gICAgICAgIGtleSA9IG9ialByb3BzW2luZGV4XTtcbiAgICAgICAgdmFyIG9ialZhbHVlID0gb2JqZWN0W2tleV0sXG4gICAgICAgICAgICBvdGhWYWx1ZSA9IG90aGVyW2tleV07XG5cbiAgICAgICAgaWYgKGN1c3RvbWl6ZXIpIHtcbiAgICAgICAgICB2YXIgY29tcGFyZWQgPSBpc1BhcnRpYWxcbiAgICAgICAgICAgID8gY3VzdG9taXplcihvdGhWYWx1ZSwgb2JqVmFsdWUsIGtleSwgb3RoZXIsIG9iamVjdCwgc3RhY2spXG4gICAgICAgICAgICA6IGN1c3RvbWl6ZXIob2JqVmFsdWUsIG90aFZhbHVlLCBrZXksIG9iamVjdCwgb3RoZXIsIHN0YWNrKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIG9iamVjdHMgKHN1c2NlcHRpYmxlIHRvIGNhbGwgc3RhY2sgbGltaXRzKS5cbiAgICAgICAgaWYgKCEoY29tcGFyZWQgPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgICA/IChvYmpWYWx1ZSA9PT0gb3RoVmFsdWUgfHwgZXF1YWxGdW5jKG9ialZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spKVxuICAgICAgICAgICAgICA6IGNvbXBhcmVkXG4gICAgICAgICAgICApKSB7XG4gICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgc2tp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BpbmRleCA9IC0xLFxuICAgICAgICAgIGxlbmd0aCA9IHBhdGgubGVuZ3RoLFxuICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIga2V5ID0gdG9LZXkocGF0aFtpbmRleF0pO1xuICAgICAgICBpZiAoIShyZXN1bHQgPSBvYmplY3QgIT0gbnVsbCAmJiBoYXNGdW5jKG9iamVjdCwga2V5KSkpIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBvYmplY3QgPSBvYmplY3Rba2V5XTtcbiAgICAgIH1cbiAgICAgIGlmIChyZXN1bHQgfHwgKytpbmRleCAhPSBsZW5ndGgpIHtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH1cbiAgICAgIGxlbmd0aCA9IG9iamVjdCA9PSBudWxsID8gMCA6IG9iamVjdC5sZW5ndGg7XG4gICAgICByZXR1cm4gISFsZW5ndGggJiYgaXNMZW5ndGgobGVuZ3RoKSAmJiBpc0luZGV4KGtleSwgbGVuZ3RoKSAmJlxuICAgICAgICAoaXNBcnJheShvYmplY3QpIHx8IGlzQXJndW1lbnRzKG9iamVjdCkpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEluaXRpYWxpemVzIGFuIGFycmF5IGNsb25lLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge0FycmF5fSBhcnJheSBUaGUgYXJyYXkgdG8gY2xvbmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBpbml0aWFsaXplZCBjbG9uZS5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBpbml0Q2xvbmVBcnJheShhcnJheSkge1xuICAgICAgdmFyIGxlbmd0aCA9IGFycmF5Lmxlbmd0aCxcbiAgICAgICAgICByZXN1bHQgPSBuZXcgYXJyYXkuY29uc3RydWN0b3IobGVuZ3RoKTt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HVlcyB0byByZW1vdmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIGBhcnJheWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBhcnJheSA9IFsnYScsICdiJywgJ2MnLCAnYScsICdiJywgJ2MnXTtcbiAgICAgKlxuICAgICAqIF8ucHVsbChhcnJheSwgJ2EnLCAnYycpO1xuICAgICAqIGNvbnNvbGUubG9nKGFycmF5KTtcbiAgICAgKiAvLyA9PiBbJ2InLCAnYiddXG4gICAgICovXG4gICAgdmFyIHB1bGwgPSBiYXNlUmVzdChwdWxsQWxsKTtcblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIGlzIGxpa2UgYF8ucHVsbGAgZXhjZXB0IHRoYXQgaXQgYWNjZXB0cyBhbiBhcnJheSBvZiB2YWx1ZXMgdG8gcmVtb3ZlLlxuICAgICAqXG4gICAgICogKipOb3RlOioqIFVubGlrZSBgXy5kaWZmZXJlbmNlYCwgdGhpcyBtZXRob2QgbXV0YXRlcyBgYXJyYXlgLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMC4wXG4gICAgICogQGNhdGVnb3J5IEFycmF5XG4gICAgICogQHBhcmFtIHtBcnJheX0gYXJyYXkgVGhlIGFycmF5IHRvIG1vZGlmeS5cbiAgICAgKiBAcGFyYW0ge0FycmF5fSB2YWx1ZXMgVGhlIHZhbHVlcyB0byByZW1vdmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIGBhcnJheWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBhcnJheSA9IFsnYScsICdiJywgJ2MnLCAnYScsICdiJywgJ2MnXTtcbiAgICAgKlxuICAgICAqIF8ucHVsbEFsbChhcnJheSwgWydhJywgJ2MnXSk7XG4gICAgICogY29uc29sZS5sb2coYXJyYXkpO1xuICAgICAqIC8vID0+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KlxuICAgICAqIF8udGFrZShbMSwgMiwgM10sIDApO1xuICAgICAqIC8vID0+IFtdXG4gICAgICovXG4gICAgZnVuY3Rpb24gdGFrZShhcnJheSwgbiwgZ3VhcmQpIHtcbiAgICAgIGlmICghKGFycmF5ICYmIGFycmF5Lmxlbmd0aCkpIHtcbiAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgfVxuICAgICAgbiA9IChndWFyZCB8fCBuID09PSB1bmRlZmluZWQpID8gMSA6IHRvSW50ZWdlcihuKTtcbiAgICAgIHJldHVybiBiYXNlU2xpY2UoYXJyYXksIDAsIG4gPCAwID8gMCA6IG4pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENyZWF0ZXMgYSBzbGljZSBvZiBgYXJyYXlgIHdpdGggYG5gIGVsZW1lbnRzIHRha2VuIGZyb20gdGhlIGVuZC5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSAzLjAuMFxuICAgICAqIEBjYXRlZ29yeSBBcnJheVxuICAgICAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBxdWVyeS5cbiAgICAgKiBAcGFyYW0ge251bWJlcn0gW249MV0gVGhlIG51bWJlciBvZiBlbGVtZW50cyB0byB0YWtlLlxuICAgICAqIEBwYXJhbS0ge09iamVjdH0gW2d1YXJkXSBFbmFibGVzIHVzZSBhcyBhbiBpdGVyYXRlZSBmb3IgbWV0aG9kcyBsaWtlIGBfLm1hcGAuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBzbGljZSBvZiBgYXJyYXlgLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBfLnRha2VSaWdodChbMSwgMiwgM10pO1xuICAgICAqIC8vID0+IFszXVxuICAgICAqXG4gICAgICogXy50YWtlUmlnaHQoWzEsIDIsIDNdLCAyKTtcbiAgICAgKiAvLyA9PiBbMiwgM11cbiA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kIHRvIGNvbXBhcmUgZWxlbWVudHMgb2YgYGFycmF5c2AuIFRoZSBvcmRlciBvZiByZXN1bHQgdmFsdWVzIGlzXG4gICAgICogZGV0ZXJtaW5lZCBieSB0aGUgb3JkZXIgdGhleSBvY2N1ciBpbiB0aGUgYXJyYXlzLiBUaGUgY29tcGFyYXRvciBpcyBpbnZva2VkXG4gICAgICogd2l0aCB0d28gYXJndW1lbnRzOiAoYXJyVmFsLCBvdGhWYWwpLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMC4wXG4gICAgICogQGNhdGVnb3J5IEFycmF5XG4gICAgICogQHBhcmFtIHsuLi5BcnJheX0gW2FycmF5c10gVGhlIGFycmF5cyB0byBpbnNwZWN0LlxuICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IFtjb21wYXJhdG9yXSBUaGUgY29tcGFyYXRvciBpbnZva2VkIHBlciBlbGVtZW50LlxuICAgICAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyB0aGUgbmV3IGFycmF5IG9mIGZpbHRlcmVkIHZhbHVlcy5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIG9iamVjdHMgPSBbeyAneCc6IDEsICd5JzogMiB9LCB7ICd4JzogMiwgJ3knOiAxIH1dO1xuICAgICAqIHZhciBvdGhlcnMgPSBbeyAneCc6IDEsICd5JzogMSB9LCB7ICd4JzogMSwgJ3knOiAyIH1dO1xuICAgICAqXG4gICAgICogXy54b3JXaXRoKG9iamVjdHMsIG90aGVycywgXy5pc0VxdWFsKTtcbiAgICAgKiAvLyA9PiBbeyAneCc6IDIsICd5JzogMSB9LCB7ICd4JzogMSwgJ3knOiAxIH1dXG4gICAgICovXG4gICAgdmFyIHhvcldpdGggPSBiYXNlUmVzdChmdW5jdGlvbihhcnJheXMpIHtcbiAgICAgIHZhciBjb21wYXJhdG9yID0gbGFzdChhcnJheXMpO1xuICAgIC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ICAgIGxhc3RJbnZva2VUaW1lID0gMDtcbiAgICAgICAgbGFzdEFyZ3MgPSBsYXN0Q2FsbFRpbWUgPSBsYXN0VGhpcyA9IHRpbWVySWQgPSB1bmRlZmluZWQ7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGZsdXNoKCkge1xuICAgICAgICByZXR1cm4gdGltZXJJZCA9PT0gdW5kZWZpbmVkID8gcmVzdWx0IDogdHJhaWxpbmdFZGdlKG5vdygpKTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gZGVib3VuY2VkKCkge1xuICAgICAgICB2YXIgdGltZSA9IG5vdygpLFxuICAgICAgICAgICAgaXNJbnZva2luZyA9IHNob3VsZEludm9rZSh0aW1lKTtcblxuICAgICAgICBsYXN0QXJncyA9IGFyZ3VtZW50cztcbiAgICAgICAgbGFzdFRoaXMgPSB0aGlzO1xuICAgICAgICBsYXN0Q2FsbFRpbWUgPSB0aW1lO1xuXG4gICAgICAgIGlmIChpc0ludm9raW5nKSB7XG4gICAgICAgICAgaWYgKHRpbWVySWQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcmV0dXJuIGxlYWRpbmdFZGdlKGxhc3RDYWxsVGltZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChtYXhpbmcpIHtcbiAgICAgICAgICAgIC8vIEhhbmRsZSBpbnZvY2F0aW9ucyBpbiBhIHRpZ2h0IGxvb3AuXG4gICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZXJJZCk7XG4gICAgICAgICAgICB0aW1lcklkID0gc2V0VGltZW91dCh0aW1lckV4cGlyZWQsIHdhaXQpO1xuICAgICAgICAgICAgcmV0dXJuIGludm9rZUZ1bmMobGFzdENhbGxUaW1lKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRpbWVySWQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIHRpbWVySWQgPSBzZXRUaW1lb3V0KHRpbWVyRXhwaXJ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9vc2VseSBiYXNlZCBvblxuICAgICAqIFtgVG9JbnRlZ2VyYF0oaHR0cDovL3d3dy5lY21hLWludGVybmF0aW9uYWwub3JnL2VjbWEtMjYyLzcuMC8jc2VjLXRvaW50ZWdlcikuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgNC4wLjBcbiAgICAgKiBAY2F0ZWdvcnkgTGFuZ1xuICAgICAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGNvbnZlcnQuXG4gICAgICogQHJldHVybnMge251bWJlcn0gUmV0dXJucyB0aGUgY29udmVydGVkIGludGVnZXIuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udG9JbnRlZ2VyKDMuMik7XG4gICAgICogLy8gPT4gM1xuICAgICAqXG4gICAgICogXy50b0ludGVnZXIoTnVtYmVyLk1JTl9WQUxVRSk7XG4gICAgICogLy8gPT4gMFxuICAgICAqXG4gICAgICogXy50b0ludGVnZXIoSW5maW5pdHkpO1xuICAgICAqIC8vID0+IDEuNzk3NjkzMTM0ODYyMzE1N2UrMzA4XG4gICAgICpcbiAgICAgKiBfLnRvSW50ZWdlcignMy4yJyk7XG4gICAgICogLy8gPT4gM1xuICAgICAqL1xuICAgIGZ1bmN0aW9uIHRvSW50ZWdlcih2YWx1ZSkge1xuICAgICAgdmFyIHJlc3VsdCA9IHRvRmluaXRlKHZhbHVlKSxcbiAgICAgICAgICByZW1haW5kZXIgPSByZXN1bHQgJSAxO1xuXG4gICAgICByZXR1cm4gcmVzdWx0ID09PSByZXN1bHQgPyAocmVtYWluZGVyID8gcmVzdWx0IC0gcmVtYWluZGVyIDogcmVzdWx0KSA6IDA7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ29udmVydHMgYHZhbHVlYCB0byBhbiBpbnRlZ2VyIHN1aXRhYmxlIGZvciB1c2UgYXMgdGhlIGxlbmd0aCBvZiBhblxuICA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xuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIgc291cmNlID0gc291cmNlc1tpbmRleF07XG4gICAgICAgIHZhciBwcm9wcyA9IGtleXNJbihzb3VyY2UpO1xuICAgICAgICB2YXIgcHJvcHNJbmRleCA9IC0xO1xuICAgICAgICB2YXIgcHJvcHNMZW5ndGggPSBwcm9wcy5sZW5ndGg7XG5cbiAgICAgICAgd2hpbGUgKCsrcHJvcHNJbmRleCA8IHByb3BzTGVuZ3RoKSB7XG4gICAgICAgICAgdmFyIGtleSA9IHByb3BzW3Byb3BzSW5kZXhdO1xuICAgICAgICAgIHZhciB2YWx1ZSA9IG9iamVjdFtrZXldO1xuXG4gICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHxcbiAgICAgICAgICAgICAgKGVxKHZhbHVlLCBvYmplY3RQcm90b1trZXldKSAmJiAhaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkpKSB7XG4gICAgICAgICAgICBvYmplY3Rba2V5XSA9IHNvdXJjZVtrZXldO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICByZXR1cm4gb2JqZWN0O1xuICAgIH0pO1xuXG4gICAgLyoqXG4gICAgICogVGhpcyBtZXRob2QgaXMgbGlrZSBgXy5kZWZhdWx0c2AgZXhjZXB0IHRoYXQgaXQgcmVjdXJzaXZlbHkgYXNzaWduc1xuICAgICAqIGRlZmF1bHQgcHJvcGVydGllcy5cbiAgICAgKlxuICAgICAqICoqTm90ZToqKiBUaGlzIG1ldGhvZCBtdXRhdGVzIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDMuMTAuMFxuICAgICAqIEBjYXRlZ29yeSBPYmplY3RcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBkZXN0aW5hdGlvbiBvYmpl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ZUVtcHR5U3RyaW5nTGVhZGluZywgJycpIDogc291cmNlKVxuICAgICAgICAucmVwbGFjZShyZUVtcHR5U3RyaW5nTWlkZGxlLCAnJDEnKVxuICAgICAgICAucmVwbGFjZShyZUVtcHR5U3RyaW5nVHJhaWxpbmcsICckMTsnKTtcblxuICAgICAgLy8gRnJhbWUgY29kZSBhcyB0aGUgZnVuY3Rpb24gYm9keS5cbiAgICAgIHNvdXJjZSA9ICdmdW5jdGlvbignICsgKHZhcmlhYmxlIHx8ICdvYmonKSArICcpIHtcXG4nICtcbiAgICAgICAgKHZhcmlhYmxlXG4gICAgICAgICAgPyAnJ1xuICAgICAgICAgIDogJ29iaiB8fCAob2JqID0ge30pO1xcbidcbiAgICAgICAgKSArXG4gICAgICAgIFwidmFyIF9fdCwgX19wID0gJydcIiArXG4gICAgICAgIChpc0VzY2FwaW5nXG4gICAgICAgICAgID8gJywgX19lID0gXy5lc2NhcGUnXG4gICAgICAgICAgIDogJydcbiAgICAgICAgKSArXG4gICAgICAgIChpc0V2YWx1YXRpbmdcbiAgICAgICAgICA/ICcsIF9faiA9IEFycmF5LnByb3RvdHlwZS5qb2luO1xcbicgK1xuICAgICAgICAgICAgXCJmdW5jdGlvbiBwcmludCgpIHsgX19wICs9IF9fai5jYWxsKGFyZ3VtZW50cywgJycpIH1cXG5cIlxuICAgICAgICAgIDogJztcXG4nXG4gICAgICAgICkgK1xuICAgICAgICBzb3VyY2UgK1xuICAgICAgICAncmV0dXJuIF9fcFxcbn0nO1xuXG4gICAgICB2YXIgcmVzdWx0ID0gYXR0ZW1wdChmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIEZ1bmN0aW9uKGltcG9ydHNLZXlzLCBzb3VyY2VVUkwgKyAncmV0dXJuICcgKyBzb3VyY2UpXG4gICAgICAgICAgLmFwcGx5KHVuZGVmaW5lZCwgaW1wb3J0c1ZhbHVlcyk7XG4gICAgICB9KTtcblxuICAgICAgLy8gUHJvdmlkZSB0aGUgY29tcGl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lckNvbnRyb2xsZXInO1xuICAgICAqICAgICAgICAgICRzY29wZS5wYXJhbXMgPSAkcm91dGVQYXJhbXM7XG4gICAgICogICAgICB9KVxuICAgICAqXG4gICAgICogICAgIC5jb25maWcoZnVuY3Rpb24oJHJvdXRlUHJvdmlkZXIsICRsb2NhdGlvblByb3ZpZGVyKSB7XG4gICAgICogICAgICAgJHJvdXRlUHJvdmlkZXJcbiAgICAgKiAgICAgICAgLndoZW4oJy9Cb29rLzpib29rSWQnLCB7XG4gICAgICogICAgICAgICB0ZW1wbGF0ZVVybDogJ2Jvb2suaHRtbCcsXG4gICAgICogICAgICAgICBjb250cm9sbGVyOiAnQm9va0NvbnRyb2xsZXInLFxuICAgICAqICAgICAgICAgcmVzb2x2ZToge1xuICAgICAqICAgICAgICAgICAvLyBJIHdpbGwgY2F1c2UgYSAxIHNlY29uZCBkZWxheVxuICAgICAqICAgICAgICAgICBkZWxheTogZnVuY3Rpb24oJHEsICR0aW1lb3V0KSB7XG4gICAgICogICAgICAgICAgICAgdmFyIGRlbGF5ID0gJHEuZGVmZXIoKTtcbiAgICAgKiAgICAgICAgICAgICAkdGltZW91dChkZWxheS5yZXNvbHZlLCAxMDAwKTtcbiAgICAgKiAgICAgICAgICAgICByZXR1cm4gZGVsYXkucHJvbWlzZTtcbiAgICAgKiAgICAgICAgICAgfVxuICAgICAqICAgICAgICAgfVxuICAgICAqICAgICAgIH0pXG4gICAgICogICAgICAgLndoZW4oJy9Cb29rLzpib29rSWQvY2gvOmNoYXB0ZXJJZCcsIHtcbiAgICAgKiAgICAgICAgIHRlbXBsYXRlVXJsOiAnY2hhcHRlci5odG1sJyxcbiAgICAgKiAgICAgICAgIGNvbnRyb2xsZXI6ICdDaGFwdGVyQ29udHJvbGxlcidcbiAgICAgKiAgICAgICB9KTtcbiAgICAgKlxuICAgICAqICAgICAgIC8vIGNvbmZpZ3VyZSBodG1sNSB0byBnZXQgbGlua3Mgd29ya2luZyBvbiBqc2ZpZGRsZVxuICAgICAqICAgICAgICRsb2NhdGlvblByb3ZpZGVyLmh0bWw1TW9kZSh0cnVlKTtcbiAgICAgKiAgICAgfSk7XG4gICAgICpcbiAgICAgKiAgIDwvZmlsZT5cbiAgICAgKlxuICAgICAqICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJhY3RvclwiPlxuICAgICAqICAgICBpdCgnc2hvdWxkIGxvYWQgYW5kIGNvbXBpbGUgY29ycmVjdCB0ZW1wbGF0ZScsIGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgIGVsZW1lbnQoYnkubGlua1RleHQoJ01vYnk6IENoMScpKS5jbGljaygpO1xuICAgICAqICAgICAgIHZhciBjb250ZW50ID0gZWxlbWVudChieS5jc3MoJ1tuZy12aWV3XScpKS5nZXRUZXh0KCk7XG4gICAgICogICAgICAgZXhwZWN0KGNvbnRlbnQpLnRvTWF0Y2goL2NvbnRyb2xsZXI6IENoYXB0ZXJDb250cm9sbGVyLyk7XG4gICAgICogICAgICAgZXhwZWN0KGNvbnRlbnQpLnRvTWF0Y2goL0Jvb2sgSWQ6IE1vYnkvKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvQ2hhcHRlciBJZDogMS8pO1xuICAgICAqXG4gICAgICogICAgICAgZWxlbWVudChieS5wYXJ0aWFsTGlua1RleHQoJ1NjYXJsZXQnKSkuY2xpY2soKTtcbiAgICAgKlxuICAgICAqICAgICAgIGNvbnRlbnQgPSBlbGVtZW50KGJ5LmNzcygnW25nLXZpZXddJykpLmdldFRleHQoKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvY29udHJvbGxlcjogQm9va0NvbnRyb2xsZXIvKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvQm9vayBJZDogU2NhcmxldC8pO1xuICAgICAqICAgICB9KTtcbiAgICAgKiAgIDwvZmlsZT5cbiAgICAgKiA8L2V4YW1w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uICAgICAgICAgICAqIGNyZWF0ZXMgbmV3IHNjb3BlIGFuZCByZWluc3RhbnRpYXRlcyB0aGUgY29udHJvbGxlci5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICByZWxvYWQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgZm9yY2VSZWxvYWQgPSB0cnVlO1xuXG4gICAgICAgICAgICB2YXIgZmFrZUxvY2F0aW9uRXZlbnQgPSB7XG4gICAgICAgICAgICAgIGRlZmF1bHRQcmV2ZW50ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgICBwcmV2ZW50RGVmYXVsdDogZnVuY3Rpb24gZmFrZVByZXZlbnREZWZhdWx0KCkge1xuICAgICAgICAgICAgICAgIHRoaXMuZGVmYXVsdFByZXZlbnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgZm9yY2VSZWxvYWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgJHJvb3RTY29wZS4kZXZhbEFzeW5jKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBwcmVwYXJlUm91dGUoZmFrZUxvY2F0aW9uRXZlbnQpO1xuICAgICAgICAgICAgICBpZiAoIWZha2VMb2NhdGlvbkV2ZW50LmRlZmF1bHRQcmV2ZW50ZWQpIGNvbW1pdFJvdXRlKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lICRyb3V0ZSN1cGRhdGVQYXJhbXNcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIENhdXNlcyBgJHJvdXRlYCBzZXJ2aWNlIHRvIHVwZGF0ZSB0aGUgY3VycmVudCBVUkwsIHJlcGxhY2luZ1xuICAgICAgICAgICAqIGN1cnJlbnQgcm91dGUgcGFyYW1ldGVycyB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GFzUmVkaXJlY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChyb3V0ZS5yZXNvbHZlUmVkaXJlY3RUbykge1xuICAgICAgICAgIHJldHVybiAkcS5cbiAgICAgICAgICAgIHJlc29sdmUoJGluamVjdG9yLmludm9rZShyb3V0ZS5yZXNvbHZlUmVkaXJlY3RUbykpLlxuICAgICAgICAgICAgdGhlbihmdW5jdGlvbihuZXdVcmwpIHtcbiAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKG5ld1VybCkpIHtcbiAgICAgICAgICAgICAgICBkYXRhLnVybCA9IG5ld1VybDtcbiAgICAgICAgICAgICAgICBkYXRhLmhhc1JlZGlyZWN0aW9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiBkYXRhO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGRhdGE7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaGFuZGxlUG9zc2libGVSZWRpcmVjdGlvbihkYXRhKSB7XG4gICAgICB2YXIga2VlcFByb2Nlc3NpbmdSb3V0ZSA9IHRydWU7XG5cbiAgICAgIGlmIChkYXRhLnJvdXRlICE9PSAkcm91dGUuY3VycmVudCkge1xuICAgICAgICBrZWVwUHJvY2Vzc2luZ1JvdXRlID0gZmFsc2U7XG4gICAgICB9IGVsc2UgaWYgKGRhdGEuaGFzUmVkaXJlY3Rpb24pIHtcbiAgICAgICAgdmFyIG9sZFVybCA9ICRsb2NhdGlvbi51cmwoKTtcbiAgICAgICAgdmFyIG5ld1VybCA9IGRhdGEudXJsO1xuXG4gICAgICAgIGlmIChuZXdVcmwpIHtcbiAgICAgICAgICAkbG9jYXRpb24uXG4gICAgICAgICAgICB1cmwobmV3VXJsKS5cbiAgICAgICAgICAgIHJlcGxhY2UoKTtcbiAgICA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lbnQucGFyYW1zID0ge3ttYWluLiRyb3V0ZS5jdXJyZW50LnBhcmFtc319PC9wcmU+XG4gICAgICAgICAgPHByZT4kcm91dGVQYXJhbXMgPSB7e21haW4uJHJvdXRlUGFyYW1zfX08L3ByZT5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L2ZpbGU+XG5cbiAgICAgIDxmaWxlIG5hbWU9XCJib29rLmh0bWxcIj5cbiAgICAgICAgPGRpdj5cbiAgICAgICAgICBjb250cm9sbGVyOiB7e2Jvb2submFtZX19PGJyIC8+XG4gICAgICAgICAgQm9vayBJZDoge3tib29rLnBhcmFtcy5ib29rSWR9fTxiciAvPlxuICAgICAgICA8L2Rpdj5cbiAgICAgIDwvZmlsZT5cblxuICAgICAgPGZpbGUgbmFtZT1cImNoYXB0ZXIuaHRtbFwiPlxuICAgICAgICA8ZGl2PlxuICAgICAgICAgIGNvbnRyb2xsZXI6IHt7Y2hhcHRlci5uYW1lfX08YnIgLz5cbiAgICAgICAgICBCb29rIElkOiB7e2NoYXB0ZXIucGFyYW1zLmJvb2tJZH19PGJyIC8+XG4gICAgICAgICAgQ2hhcHRlciBJZDoge3tjaGFwdGVyLnBhcmFtcy5jaGFwdGVySWR9fVxuICAgICAgICA8L2Rpdj5cbiAgICAgIDwvZmlsZT5cblxuICAgICAgPGZpbGUgbmFtZT1cImFuaW1hdGlvbnMuY3NzXCI+XG4gICAgICAgIC52aWV3LWFuaW1hdGUtY29udGFpbmVyIHtcbiAgICAgICAgICBwb3NpdGlvbjpyZWxhdGl2ZTtcbiAgICAgICAgICBoZWlnaHQ6MTAwcHghaW1wb3J0YW50O1xuICAgICAgICAgIGJhY2tncm91bmQ6d2hpdGU7XG4gICAgICAgICAgYm9yZGVyOjFweCBzb2xpZCBibGFjaztcbiAgICAgICAgICBoZWlnaHQ6NDBweDtcbiAgICAgICAgICBvdmVyZmxvdzpoaWRkZW47XG4gICAgICAgIH1cblxuICAgICAgICAudmlldy1hbmltYXRlIHtcbiAgICAgIC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ZXIsICRsb2NhdGlvblByb3ZpZGVyKSB7XG4gICAgICAgICAgICAgICRyb3V0ZVByb3ZpZGVyXG4gICAgICAgICAgICAgICAgLndoZW4oJy9Cb29rLzpib29rSWQnLCB7XG4gICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2Jvb2suaHRtbCcsXG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnQm9va0N0cmwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlckFzOiAnYm9vaydcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkL2NoLzpjaGFwdGVySWQnLCB7XG4gICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2NoYXB0ZXIuaHRtbCcsXG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnQ2hhcHRlckN0cmwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlckFzOiAnY2hhcHRlcidcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAkbG9jYXRpb25Qcm92aWRlci5odG1sNU1vZGUodHJ1ZSk7XG4gICAgICAgICAgfV0pXG4gICAgICAgICAgLmNvbnRyb2xsZXIoJ01haW5DdHJsJywgWyckcm91dGUnLCAnJHJvdXRlUGFyYW1zJywgJyRsb2NhdGlvbicsXG4gICAgICAgICAgICBmdW5jdGlvbiBNYWluQ3RybCgkcm91dGUsICRyb3V0ZVBhcmFtcywgJGxvY2F0aW9uKSB7XG4gICAgICAgICAgICAgIHRoaXMuJHJvdXRlID0gJHJvdXRlO1xuICAgICAgICAgICAgICB0aGlzLiRsb2NhdGlvbiA9ICRsb2NhdGlvbjtcbiAgICAgICAgICAgICAgdGhpcy4kcm91dGVQYXJhbXMgPSAkcm91dGVQYXJhbXM7XG4gICAgICAgICAgfV0pXG4gICAgICAgICAgLmNvbnRyb2xsZXIoJ0Jvb2tDdHJsJywgWyckcm91dGVQYXJhbXMnLCBmdW5jdGlvbiBCb29rQ3RybCgkcm91dGVQYXJhbXMpIHtcbiAgICAgICAgICAgIHRoaXMubmFtZSA9ICdCb29rQ3RybCc7XG4gICAgICAgICAgICB0aGlzLnBhcmFtcyA9ICRyb3V0ZVBhcmFtcztcbiAgICAgICAgICB9XSlcbiAgICAgICAgICAuY29udHJvbGxlcignQ2hhcHRlckN0cmwnLCBbJyRyb3V0ZVBhcmFtcycsIGZ1bmN0aW9uIENoYXB0ZXJDdHJsKCRyb3V0ZVBhcmFtcykge1xuICAgICAgICAgICAgdGhpcy5uYW1lID0gJ0NoYXB0ZXJDdHJsJztcbiAgICAgICAgICAgIHRoaXMucGFyYW1zID0gJHJvdXRlUGFyYW1zO1xuICAgICAgICAgIH1dKTtcblxuICAgICAgPC9maWxlPlxuXG4gICAgICA8ZmlsZSBuYW1lPVwicHJvdHJhY3Rvci5qc1wiIHR5cGU9XCJwcm90cmFjdG9yXCI+XG4gICAgICAgIGl0KCdzaG91bGQgbG9hZCBhbmQgY29tcGlsZSBjb3JyZWN0IHRlbXBsYXRlJywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgZWxlbWVudChieS5saW5rVGV4dCgnTW9ieTogQ2gxJykpLmNsaWNrKCk7XG4gICAgICAgICAgdmFyIGNvbnRlbnQgPSBlbGVtZW50KGJ5LmNzcygnW25nLXZpZXddJykpLmdldFRleHQoKTtcbiAgICAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvY29udHJvbGxlcjogQ2hhcHRlckN0cmwvKTtcbiAgICAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvQm9vayBJZDogTW9ieS8pO1xuICAgICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9DaGFwdGVyIElkOiAxLyk7XG5cbiAgICAgICAgICBlbGVtZW50KGJ5LnBhcnRpYWxMaW5rVGV4dCgnU2NhcmxldCcpKS5jbGljaygpO1xuXG4gICAgICAgICAgY29udGVudCA9IGVsZW1lbnQoYnkuY3NzK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gICAgb25sb2FkRXhwID0gYXR0ci5vbmxvYWQgfHwgJyc7XG5cbiAgICAgICAgc2NvcGUuJG9uKCckcm91dGVDaGFuZ2VTdWNjZXNzJywgdXBkYXRlKTtcbiAgICAgICAgdXBkYXRlKCk7XG5cbiAgICAgICAgZnVuY3Rpb24gY2xlYW51cExhc3RWaWV3KCkge1xuICAgICAgICAgIGlmIChwcmV2aW91c0xlYXZlQW5pbWF0aW9uKSB7XG4gICAgICAgICAgICAkYW5pbWF0ZS5jYW5jZWwocHJldmlvdXNMZWF2ZUFuaW1hdGlvbik7XG4gICAgICAgICAgICBwcmV2aW91c0xlYXZlQW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoY3VycmVudFNjb3BlKSB7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUuJGRlc3Ryb3koKTtcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZSA9IG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChjdXJyZW50RWxlbWVudCkge1xuICAgICAgICAgICAgcHJldmlvdXNMZWF2ZUFuaW1hdGlvbiA9ICRhbmltYXRlLmxlYXZlKGN1cnJlbnRFbGVtZW50KTtcbiAgICAgICAgICAgIHByZXZpb3VzTGVhdmVBbmltYXRpb24uZG9uZShmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgICBpZiAocmVzcG9uc2UgIT09IGZhbHNlKSBwcmV2aW91c0xlYXZlQW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgY3VycmVudEVsZW1lbnQgPSBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHVwZGF0ZSgpIHtcbiAgICAgICAgICB2YXIgbG9jYWxzID0gJHJvdXRlLmN1cnJlbnQgJiYgJHJvdXRlLmN1cnJlbnQubG9jYWxzLFxuICAgICAgICAgICAgICB0ZW1wbGF0Z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G4gICAgICAgICAgICB2YXIgbGFiZWwgPSBcIlwiO1xuICAgICAgICAgICAgaWYgKG5ld0VsZW1lbnQuYXR0cmlidXRlcy50eXBlICE9IFwidG0uRmxvd1wiICYmIG5ld0VsZW1lbnQuYXR0cmlidXRlcy50eXBlICE9IFwidG0uQm91bmRhcnlcIikge1xuICAgICAgICAgICAgICAgIGxhYmVsID0gJ0NvcHkgb2YgJyArIG5ld0VsZW1lbnQuYXR0cmlidXRlcy5hdHRycy50ZXh0LnRleHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvL0lmIHRoZSBlbGVtZW50IGlzIGEgZmxvdyBvciBhIGJvdW5kYXJ5LCBtYWtlIHN1cmUgdGhlIGxhYmVsIGlzIGRlZmluZWQgYmVmb3JlIGNvcHlpbmcgaXRcbiAgICAgICAgICAgIGVsc2UgaWYgKHR5cGVvZiBuZXdFbGVtZW50LmF0dHJpYnV0ZXMubGFiZWxzICE9IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgICAgICAgICBsYWJlbCA9ICdDb3B5IG9mICcgKyBuZXdFbGVtZW50LmF0dHJpYnV0ZXMubGFiZWxzWzBdLmF0dHJzLnRleHQudGV4dDsgICBcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKG5ld0VsZW1lbnQuYXR0cmlidXRlcy50eXBlID09IFwidG0uRmxvd1wiIHx8IG5ld0VsZW1lbnQuYXR0cmlidXRlcy50eXBlID09IFwidG0uQm91bmRhcnlcIikgeyAgICBcbiAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmF0dHJpYnV0ZXMuc291cmNlID0geyd4JyA6IDMwLCAneScgOiAyMH07XG4gICAgICAgICAgICAgICAgbmV3RWxlbWVudC5hdHRyaWJ1dGVzLnRhcmdldCA9IHsneCcgOiAxMTAsICd5JyA6IDEwMH07XG4gICAgICAgICAgICAgICAgaWYgKGxhYmVsICE9IFwiXCIpe1xuICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmF0dHJpYnV0ZXMubGFiZWxzWzBdLmF0dHJzLnRleHQudGV4dCA9IGxhYmVsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkZWxldGUgbmV3RWxlbWVudC5hdHRyaWJ1dGVzLnZlcnRpY2VzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGhlaWdodCA9IG5ld0VsZW1lbnQuYXR0cmlidXRlcy5zaXplLmhlaWdodCArIDIwO1xuICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuYXR0cmlidXRlcy5wb3NpdGlvbi55ICs9IGhlaWdodDtcbiAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmF0dHJpYnV0ZXMuYXR0cnMudGV4dC50ZXh0ID0gbGFiZWw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBkaWFncmFtRGF0YSA9IHsgZGlhZ3JhbUpzb246IHsgY2VsbHM6IHZtLmdyYXBoLmdldENlbGxzKCkgfSB9O1xuICAgICAgICAgICAgdm0uZ3JhcGguaW5pdGlhbGlzZShkaWFncmFtRGF0YS5kaWFncmFtSnNvbik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBvbkdlbmVyYXRlVGhyZWF0cyh0aHJlYXRzKSB7XG4gICAgICAgIHZhciB0aHJlYXRUb3RhbCA9IHRocmVhdHMubGVuZ3RoO1xuICAgICAgICB2YXIgdGhyZWF0TGlzdCA9IHRocmVhdHM7XG4gICAgICAgIHZhciBjdXJyZW50VGhyZWF0O1xuICAgICAgICB2YXIgdGVtcGxhdGU7XG4gICAgICAgIHN1Z2dlc3RUaHJlYXQoKTtcblxuICAgICAgICBmdW5jdGlvbiBzdWdnZXN0VGhyZWF0KCkge1xuICAgICAgICAgICAgaWYgKHRocmVhdExpc3QubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGN1cnJlbnRUaHJlYXQgPSB0aHJlYXRMaXN0LnNoaWZ0KCk7XG4gICAgICAgICAgICAgICAgc2VsZWN0VGVtcGxhdGUoY3VycmVudFRocmVhdC5tb2RlbFR5cGUpO1xuICAgICAgICAgICAgICAgIGRpYWxvZ3MuY29uZmlybSh0ZW1wbGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgYWRkVGhyZWF0LFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRpbmc6ICdBZGQgdGhpcyB0aHJlYXQ/JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJlYXQ6IGN1cnJlbnRUaHJlYXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWRpdGluZzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZWF0SW5kZXg6IHRocmVhdFRvdGFsIC0gdGhyZWF0TGlzdC5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZWF0VG90YWw6IHRocmVhdFRvdGFsXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBpZ25vcmVUaHJlYXQsXG4gICAgICAgICAgICAgICAgICAgICdmYWRlLXJpZ2h0J1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBhZGRUaHJlYXQoYXBwbHlUb0FsbCkge1xuICAgICAgICAgICAgdm0uc2V0RGlydHkoKTtcblxuICAgICAgICAgICAgaWYgKF8uaXNVbmRlZmluZWQodm0uc2VsZWN0ZWQudGhyZWF0cykpIHtcbiAgICAgICAgICAgICAgICB2bS5zZWxlY3RlZC50aHJlYXRzID0gW107XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZtLnNlbGVjdGVkLnRocmVhdHMucHVzaChjdXJyZW50VGhyZWF0KTtcblxuICAgICAgICAgICAgaWYgKGFwcGx5VG9BbGwpIHtcbiAgICAgICAgICAgICAgICB0aHJlYXRMaXN0LmZvckVhY2goZnVuY3Rpb24gKHRocmVhdCkge1xuXG4gICAgICAgICAgICAgICAgICAgIHZtLnNlbGVjdGVkLnRocmVhdHMucHVzaCh0aHJlYXQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgJHRpbWVvdXQoc3VnZ2VzdFRocmVhdCwgNTAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGlnbm9yZVRocmVhdChhcHBseVRvQWxsKSB7XG4gICAgICAgICAgICBpZiAoIWFwcGx5VG9BbGwpIHtcbiAgICAgICAgICAgICAgICAkdGltZW91dChzdWdnZXN0VGhyZWF0LCA1MDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gc2VsZWN0VGVtcGxhdGUodHlwZSkge1xuICAgICAgICAgICAgaWYgKHR5cGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHRlbXBsYXRlID0gJ2RpYWdyYW1zL1N0cmlkZUVkaXRQYW5lLmh0bWwnO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09ICdDSUEnKSB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGUgPSAnZGlhZ3JhbXMvQ2lhRWRpdFBhbmUuaHRtbCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gJ0xJTkREVU4nKSB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGUgPSAnZGlhZ3JhbXMvTGluZGR1bkVkaXRQYW5lLmh0bWwnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZSA9ICdkaWFncmFtcy9TdHJ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SBpcyBhY3RpdmVcbiAgICAgICAgaWYgKHZtLmN1cnJlbnREaWFncmFtLmVsID09PSAkZG9jdW1lbnRbMF0uYWN0aXZlRWxlbWVudCkge1xuICAgICAgICAgICAgaWYgKHZtLnNlbGVjdGVkKSB7XG4gICAgICAgICAgICAgICAgdm0uY29waWVkID0gdm0uc2VsZWN0ZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXN0ZUhvdGtleShldmVudCwgaGFuZGxlcikge1xuICAgICAgICAvLyBpZiB0aGUgY3VycmVudCBkaWFncmFtIGlzIGFjdGl2ZVxuICAgICAgICBpZiAodm0uY3VycmVudERpYWdyYW0uZWwgPT09ICRkb2N1bWVudFswXS5hY3RpdmVFbGVtZW50KSB7XG4gICAgICAgICAgICBpZiAodm0uY29waWVkKSB7XG4gICAgICAgICAgICAgICAgdm0uc2VsZWN0KHZtLmNvcGllZCk7XG4gICAgICAgICAgICAgICAgdm0uZHVwbGljYXRlRWxlbWVudCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdXBkYXRlRGlhZ3JhbVR5cGUoKSB7XG4gICAgICAgIHZhciB0eXBlID0gdm0uZGlhZ3JhbS5kaWFncmFtVHlwZTtcbiAgICAgICAgaWYgKHR5cGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgdm0uZGlhZ3JhbS50aHVtYm5haWwgPSAnLi9wdWJsaWMvY29udGVudC9pbWFnZXMvdGh1bWJuYWlsLnN0cmlkZS5qcGcnO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gJ0NJQScpIHtcbiAgICAgICAgICAgIHZtLmRpYWdyYW0udGh1bWJuYWlsID0gJy4vcHVibGljL2NvbnRlbnQvaW1hZ2VzL3RodW1ibmFpbC5jaWEuanBnJztcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09ICdMSU5ERFVOJykge1xuICAgICAgICAgIC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cbiAgICAgICAgICAgICAgICAgICAgcmVtb3ZlTGlua0Zyb20oY2VsbFZpZXcpO1xuXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChzZWxlY3RlZCAmJiAhc2VsZWN0ZWQubW9kZWwuaXNMaW5rKCkgJiYgc2VsZWN0ZWQubGlua0Zyb20pIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubmV3Rmxvdyh7IHNvdXJjZTogc2VsZWN0ZWQubW9kZWwsIHRhcmdldDogY2VsbFZpZXcubW9kZWwgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVMaW5rRnJvbShzZWxlY3RlZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBzZXRTZWxlY3RlZChjZWxsVmlldyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICBkaWFncmFtLm9uKCdibGFuazpwb2ludGVyY2xpY2snLCBmdW5jdGlvbiAoKSB7XG5cbiAgICAgICAgICAgIGlmIChzZWxlY3RlZCAmJiAhc2VsZWN0ZWQubW9kZWwuaXNMaW5rKCkpIHtcbiAgICAgICAgICAgICAgICByZW1vdmVMaW5rRnJvbShzZWxlY3RlZCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHNldFNlbGVjdGVkKG51bGwpO1xuICAgICAgICB9KTtcblxuICAgICAgICBkaWFncmFtLm9uKCdsaW5rOm9wdGlvbnMnLCBmdW5jdGlvbiAoY2VsbFZpZXcsIGV2dCkge1xuXG4gICAgICAgICAgICBpZiAoc2VsZWN0ZWQgJiYgIXNlbGVjdGVkLm1vZGVsLmlzTGluaygpKSB7XG4gICAgICAgICAgICAgICAgcmVtb3ZlTGlua0Zyb20oc2VsZWN0ZWQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzZXRTZWxlY3RlZChjZWxsVmlldyk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGRpYWdyYW0ub24oJ2NlbGw6cG9pbnRlcm1vdmUnLCBmdW5jdGlvbiAoY2VsbFZpZXcsIGV2dCwgeCwgeSkge1xuXG4gICAgICAgICAgICB2YXIgY29uc3RyYWluZWQgPSBmYWxzZTtcbiAgICAgICAgICAgIHZhciBjb25zdHJhaW5lZFggPSB4O1xuICAgICAgICAgICAgdmFyIGNvbnN0cmFpbmVkWSA9IHk7XG4gICAgICAgICAgICB2YXIgY2VsbFdpZHRoID0gY2VsbFZpZXcubW9kZWwuYXR0cmlidXRlcy5zaXplLndpZHRoO1xuICAgICAgICAgICAgdmFyIGNlbGxIZWlnaHQgPSBjZWxsVmlldy5tb2RlbC5hdHRyaWJ1dGVzLnNpemUuaGVpZ2h0O1xuICAgICAgICAgICAgdmFyIGNlbGxYID0geDtcbiAgICAgICAgICAgIHZhciBjZWxsWSA9IHk7XG4gICAgICAgICAgICB2YXIgYmJveCA9IGNlbGxWaWV3LmdldEJCb3goKTtcblxuICAgICAgICAgICAgaWYgKGNlbGxWaWV3Lm1vZGVsLmF0dHJpYnV0ZXMudHlwZSAhPSAndG0uRmxvdycgJiYgY2VsbFZpZXcubW9kZWwuYXR0cmlidXRlcy50eXBlICE9ICd0bS5Cb3VuZGFyeScpIHtcbiAgICAgICAgICAgICAgICAvL2JvdW5kYXJ5IGJveCBnaXZlcyBiZXR0ZXIgc2Nyb2xsaW5nIGZvciBlbGVtZW50cyBvdGhlciB0aGFuIGZsb3cgJiBib3VuZGFyeVxuICAgICAgICAgICAgICAgIGNlbGxYID0gYmJveC54O1xuICAgICAgICAgICAgICAgIGNlbGxZID0gYmJveC55O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvL2NvbnN0cmFpbiBtb3ZlbWVudCB0byB4ID49IDBcbiAgICAgICAgICAgIGlmIChjZWxsWCA8PSAwKSB7XG4gICAgICAgICAgICAgICAgY29uc3RyYWlu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h0KCkgJiYgY2VsbFkgKyBjZWxsSGVpZ2h0IDwgZGlhZ3JhbS5vcHRpb25zLmhlaWdodCkge1xuICAgICAgICAgICAgICAgICQoZWxlbWVudCkucGFyZW50KCkuc2Nyb2xsVG9wKGNlbGxZICsgY2VsbEhlaWdodCAtICQoZWxlbWVudCkucGFyZW50KCkuaGVpZ2h0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY29uc3RyYWluZWQpIHtcbiAgICAgICAgICAgICAgICBjZWxsVmlldy5wb2ludGVybW92ZShldnQsIGNvbnN0cmFpbmVkWCwgY29uc3RyYWluZWRZKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgZGlhZ3JhbS5zZXRTZWxlY3RlZCA9IGZ1bmN0aW9uIChjZWxsKSB7XG5cbiAgICAgICAgICAgIGlmIChzZWxlY3RlZCkge1xuICAgICAgICAgICAgICAgIHNlbGVjdGVkLnNldFVuc2VsZWN0ZWQoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGNlbGwpIHtcbiAgICAgICAgICAgICAgICB2YXIgY2VsbFZpZXcgPSBkaWFncmFtLmZpbmRWaWV3QnlNb2RlbChjZWxsKTtcblxuICAgICAgICAgICAgICAgIGlmIChjZWxsVmlldykge1xuICAgICAgICAgICAgICAgICAgICBjZWxsVmlldy5zZXRTZWxlY3RlZCgpO1xuICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZCA9IGNlbGxWaWV3O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHNlbGVjdGVkID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS5pbml0aWFsaXNlR3JhcGgoeyBkaWFncmFtOiBkaWFncmFtIH0pO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFkZExpbmtGcm9tKGN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Z3MpIHtcblxuICAgIHZhciBkaXJlY3RpdmUgPVxuICAgICAgICB7XG4gICAgICAgICAgICBsaW5rOiBsaW5rLFxuICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdkaWFncmFtcy9UaHJlYXRTdW1tYXJ5UGFuZS5odG1sJyxcbiAgICAgICAgICAgIHJlc3RyaWN0OiAnRScsXG4gICAgICAgICAgICBzY29wZTpcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzdWdnZXN0OiAnPScsXG4gICAgICAgICAgICAgICAgdGhyZWF0czogJz0nLFxuICAgICAgICAgICAgICAgIHR5cGU6ICc9JyxcbiAgICAgICAgICAgICAgICBzYXZlOiAnJicsXG4gICAgICAgICAgICAgICAgc2V0ZGlydHk6ICc9JyxcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgIHZhciBuZXdUaHJlYXQ7XG4gICAgdmFyIGVkaXRJbmRleCA9IG51bGw7XG4gICAgdmFyIG9yaWdpbmFsVGhyZWF0ID0ge307XG4gICAgdmFyIGdldExvZ0ZuID0gY29tbW9uLmxvZ2dlci5nZXRMb2dGbjtcbiAgICB2YXIgbG9nRXJyb3IgPSBnZXRMb2dGbigndG10RWxlbWVudFRocmVhdHMnLCAnZXJyb3InKTtcblxuICAgIHJldHVybiBkaXJlY3RpdmU7XG5cbiAgICBmdW5jdGlvbiBsaW5rKHNjb3BlLCBlbGVtZW50LCBhdHRycykge1xuICAgICAgICBzY29wZS5hcHBseVRvQWxsID0gZmFsc2U7XG5cbiAgICAgICAgc2NvcGUub25TdWdnZXN0VGhyZWF0cyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHNjb3BlLnN1Z2dlc3Qoc2NvcGUudHlwZSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgc2NvcGUub25OZXdUaHJlYXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBuZXdUaHJlYXQgPSBpbml0aWFsaXNlVGhyZWF0KHNjb3BlLnR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BlLmFkZFRocmVhdCA9IGZ1bmN0aW9uICgpIHtcblxuICAgICAgICAgICAgaWYgKCFzY29wZS50aHJlYXRzKSB7XG4gICAgICAgICAgICAgICAgc2NvcGUudGhyZWF0cyA9IFtdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzY29wZS50aHJlYXRzLnB1c2gobmV3VGhyZWF0KTtcbiAgICAgICAgICAgIHNjb3BlLnNhdmUoeyB0aHJlYXQ6IG5ld1RocmVhdCB9KTtcbiAgICAgICAgICAgIHNjb3BlLnNldGRpcnR5KCk7XG4gICAgICAgICAgICByZXNldChzY29wZS50eXBlKTtcbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS5jYW5jZWxBZGQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXNldChzY29wZS50eXBlKTtcbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS5lZGl0VGhyZWF0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgc2NvcGUuc2F2ZSgpO1xuICAgICAgICAgICAgc2NvcGUuc2V0ZGlydHkoKTtcbiAgICAgICAgICAgIHJlc2V0KHNjb3BlLnR5cGUpO1xuICAgICAgICB9O1xuXG4gICAgICAgIHNjb3BlLmNhbmNlbEVkaXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBzY29wZS50aHJlYXRzW2VkaXRJbmRleF0gPSBvcmlnaW5hbFRocmVhdDtcbiAgICAgICAgICAgIHJlc2V0KHNjb3BlLnR5cGUpO1xuICAgICAgICB9O1xuXG4gICAgICAgIHZhciB0aHJlYXRJZCA9ICRyb3V0ZVBhcmFtcy50aHJlYXQ7XG5cbiAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHRocmVhdElkKSkge1xuICAgICAgICAgICAgdmFyIG1hdGNoaW5nSW5kZXggPSAtMTtcblxuICAgICAgICAgICAgc2NvcGUudGhyZWF0cy5mb3JFYWNoKGZ1bmN0aW9uICh0aHJlYXQsIGluZGV4KSB7XG4gICAgICAgICAgICAgICAgaWYgKHRocmVhdC5pZCA9PSB0aHJlYXRJZCkge1xuICAgICAgICAgICAgICAgICAgICBtYXRjaGluZ0luZGV4ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmIChtYXRjaGluZ0luZGV4ID49IDApIHtcbiAgICAgICAgICAgICAgICBzY29wZS5vbkVkaXRUaHJlYXQobWF0Y2hpbmdJbmRleCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsb2dFcnJvcignSW52YWxpZCB0aHJlYXQgSUQnKTtcbiAgICAgICAgICAgICAgICAkbG9jYXRpb24uc2VhcmNoKCd0aHJlYXQnLCBudWxsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlc2V0KG1vZGVsVHlwZSkge1xuICAgICAgICBuZXdUaHJlYXQgPSBpbml0aWFsaXNlVGhyZWF0KG1vZGVsVHlwZSk7XG4gICAgICAgIGVkaXRJbmRleCA9IG51bGw7XG4gICAgICAgICRsb2NhdGlvbi5zZWFyY2goJ3RocmVhdCcsIG51bGwpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGluaXRpYWxpc2VUaHJlYXQobW9kZWxUeXBlKSB7XG4gICAgICAgIGlmIChtb2RlbFR5cGUgPT0gbnVsbCl7XG4gICAgICAgICAgICByZXR1cm4geyBzdGF0dXM6ICdPcGVuJywgc2V2ZXJpdHk6ICdNZWRpdW0nLCBtb2RlbFR5cGU6ICdVTkRFRklORUQnIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgc3RhdHVzOiAnT3BlbicsIHNldmVyaXR5OiAnTWVkaXVtJywgbW9kZWxUeXBlOiBtb2RlbFR5cGUgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRUZW1wbGF0ZSh0eXBlKSB7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ICAgICAgICAgICB2YXIgc2VsZWN0b3IgPSAnLicgKyBzZWxlY3RvckNsYXNzICsgJy9jbGFzcyc7XG4gICAgICAgICAgICAgICAgdmFyIG9yaWdpbmFsQ2xhc3MgPSB0aGlzLmF0dHIoc2VsZWN0b3IpIHx8IHNlbGVjdG9yQ2xhc3MgKyAnIGhhc05vT3BlblRocmVhdHMgaXNJblNjb3BlJztcblxuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmF0dHIoc2VsZWN0b3IsIG9yaWdpbmFsQ2xhc3MucmVwbGFjZSgnaXNJblNjb3BlJywgJ2lzT3V0T2ZTY29wZScpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYXR0cihzZWxlY3Rvciwgb3JpZ2luYWxDbGFzcy5yZXBsYWNlKCdpc091dE9mU2NvcGUnLCAnaXNJblNjb3BlJykpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMucHJvcCgnb3V0T2ZTY29wZScsIHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfSxcblxuICAgIGRlZmluZUhhc09wZW5UaHJlYXRzOiBmdW5jdGlvbiAocHJvdG8sIHNlbGVjdG9yQ2xhc3Nlcykge1xuXG4gICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShwcm90bywgJ2hhc09wZW5UaHJlYXRzJywge1xuICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLnByb3AoJ2hhc09wZW5UaHJlYXRzJyk7IH0sXG4gICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuXG4gICAgICAgICAgICAgICAgdmFyIGVsZW1lbnQgPSB0aGlzO1xuXG4gICAgICAgICAgICAgICAgc2VsZWN0b3JDbGFzc2VzLmZvckVhY2goZnVuY3Rpb24gKHNlbGVjdG9yQ2xhc3MpIHtcblxuICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0b3IgPSAnLicgKyBzZWxlY3RvckNsYXNzICsgJy9jbGFzcyc7XG4gICAgICAgICAgICAgICAgICAgIHZhciBvcmlnaW5hbENsYXNzID0gZWxlbWVudC5hdHRyKHNlbGVjdG9yKSB8fCBzZWxlY3RvckNsYXNzICsgJyBoYXNOb09wZW5UaHJlYXRzIGlzSW5TY29wZSc7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmF0dHIoc2VsZWN0b3IsIG9yaWdpbmFsQ2xhc3MucmVwbGFjZSgnaGFzTm9PcGVuVGhyZWF0cycsICdoYXNPcGVuVGhyZWF0cycpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cihzZWxlY3Rvciwgb3JpZ2luYWxDbGFzcy5yZXBsYWNlKCdoYXNPcGVuVGhyZWF0cycsICdoYXNOb09wZW5UaHJlYXRzJykpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIHRoaXMucHJvcCgnaGFzT3BlblRocmVhdHMnLCB2YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cbn07XG5cbi8vZGF0YSBmbG93IHNoYXBlXG5cbmpvaW50LnNoYXBlcy50bS5GbG93ID0gam9pbnQuZGlhLkxpbmsuZXh0ZW5kKHtcblxuICAgIGFycm93aGVhZE1hcmt1cDogW1xuICAgICAgICAnPGcgY2xhc3M9XCJtYXJrZXItYXJyb3doZWFkLWdyb3VwIG1hcmtlci1hcnJvd2hlYWQtZ3JvdXAtPCU9IGVuZCAlPlwiPicsXG4gICAgICAgICc8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GlhbGl6ZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgIH0sXG5cbiAgICByZW5kZXI6IGZ1bmN0aW9uICgpIHtcblxuICAgICAgICBqb2ludC5kaWEuRWxlbWVudFZpZXcucHJvdG90eXBlLnJlbmRlci5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuXG4gICAgICAgIHRoaXMucmVuZGVyVG9vbHMoKTtcbiAgICAgICAgdGhpcy51cGRhdGUoKTtcblxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgcmVuZGVyVG9vbHM6IGZ1bmN0aW9uICgpIHtcblxuICAgICAgICB2YXIgdG9vbE1hcmt1cCA9IHRoaXMubW9kZWwudG9vbE1hcmt1cCB8fCB0aGlzLm1vZGVsLmdldCgndG9vbE1hcmt1cCcpO1xuXG4gICAgICAgIGlmICh0b29sTWFya3VwKSB7XG5cbiAgICAgICAgICAgIHZhciBub2RlcyA9IFYodG9vbE1hcmt1cCk7XG4gICAgICAgICAgICBWKHRoaXMuZWwpLmFwcGVuZChub2Rlcyk7XG5cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH0sXG5cbiAgICBwb2ludGVyY2xpY2s6IGZ1bmN0aW9uIChldnQsIHgsIHkpIHtcblxuICAgICAgICB0aGlzLl9keCA9IHg7XG4gICAgICAgIHRoaXMuX2R5ID0geTtcbiAgICAgICAgdGhpcy5fYWN0aW9uID0gJyc7XG5cbiAgICAgICAgdmFyIGNsYXNzTmFtZSA9IGV2dC50YXJnZXQucGFyZW50Tm9kZS5nZXRBdHRyaWJ1dGUoJ2NsYXNzJyk7XG5cbiAgICAgICAgc3dpdGNoIChjbGFzc05hbWUpIHtcblxuICAgICAgICAgICAgY2FzZSAnZWxlbWVudC10b29sLXJlbW92ZSc6XG4gICAgICAgICAgICAgICAgdGhpcy5tb2RlbC5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG5cbiAgICAgICAgICAg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lcmF0ZUZvckVsZW1lbnRJbkNvbnRleHQoKSB7XG4gICAgLy90b2RvXG4gICAgcmV0dXJuIFtdO1xuICB9XG5cbiAgZnVuY3Rpb24gZ2VuZXJhdGVGb3JHcmFwaCgpIHtcbiAgICAvL3RvZG9cbiAgICByZXR1cm4gW107XG4gIH1cblxuICBmdW5jdGlvbiBpbml0aWFsaXNlUnVsZXMoZW5naW5lKSB7XG5cbiAgICAvKiBTVFJJREUgcGVyIEVsZW1lbnRcbiAgICAgICAgICAgICAgUyB8IFQgfCBSIHwgSSB8IEQgfCBFXG4gICAgQUNUT1IgICB8IFggfCAgIHwgWCB8ICAgfCAgIHxcbiAgICBTVE9SRSAgIHwgICB8IFggfCBYIHwgWCB8IFggfFxuICAgIFBST0NFU1MgfCBYIHwgWCB8IFggfCBYIHwgWCB8IFhcbiAgICBGTE9XICAgIHwgICB8IFggfCAgIHwgWCB8IFggfFxuICAgICovXG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ1NUUklERSdcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlByb2Nlc3MnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uQWN0b3InXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnYjJhNmQ0MGQtZDNmOC00NzUwLThlNGQtYzAyY2M4NGIxM2RjJyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnYjJhNmQ0MGQtZDNmOC00NzUwLThlNGQtYzAyY2M4NGIxM2RjJyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgc3Bvb2ZpbmcgdGhyZWF0JyxcbiAgICAgICAgICB0eXBlOiAnU3Bvb2ZpbmcnLFxuICAgICAgICAgIG1vZGVsVHlwZTogJ1NUUklERScsXG4gICAgICAgICAgc3RhdHVzOiAnT3BlbicsXG4gICAgICAgICAgc2V2ZXJpdHk6ICdNZWRpdW0nLFxuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnQSBnZW5lcmljIHNwb29maW5nIHRocmVhdCdcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ1NUUklERSdcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50e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cgdGhyZWF0J1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnU1RSSURFJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uUHJvY2VzcydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5TdG9yZSdcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5BY3RvcidcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGV2ZW50OiB7XG4gICAgICAgIHR5cGU6ICc4N2JjMzdlMi03OThlLTRkNjgtYmI5Ni1mZWIxZGEyNmRhNDgnLFxuICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICBydWxlSWQ6ICc4N2JjMzdlMi03OThlLTRkNjgtYmI5Ni1mZWIxZGEyNmRhNDgnLFxuICAgICAgICAgIHRpdGxlOiAnR2VuZXJpYyByZXB1ZGlhdGlvbiB0aHJlYXQnLFxuICAgICAgICAgIHR5cGU6ICdSZXB1ZGlhdGlvbicsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnU1RSSURFJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgcmVwdWRpYXRpb24gdGhyZWF0J1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnU1RSSURFJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uUHJvY2VzcydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5TdG9yZSdcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5GbG93J1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgZXZlbnQ6IHtcbiAgICAgICAgdHlwZTogJzEzMDAwMjk2LWIxN2QtNGI3Mi05Y2M0LWY1Y2MzM2Y4MGU0YycsXG4gICAgICAgIHBhcmFtczoge1xuICAgICAgICAgIHJ1bGVJZDogJzEzMDAwMjk2LWIxN2QtNGI3Mi05Y2M0LWY1Y2MzM2Y4MGU0YycsXG4gICAgICAgICAgdGl0bGU6ICdHZW5lcmljIGluZm9ybWF0aW9uIGRpc2Nsb3N1cmUgdGhyZWF0JyxcbiAgICAgICAgICB0eXBlOiAnSW5mb3JtYXRpb24gZGlzY2xvc3VyZScsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnU1RSSURFJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgaW5mb3JtYXRpb24gZGlzY2xvc3VyZSB0aHJlYXQnXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcblxuICAgIGVuZ2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdTVFJJREUnXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBhbnk6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5Qcm9jZXNzJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlN0b3JlJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLkZsb3cnXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnZWRiMDVkNzYtYTY5NS00NTVmLTk0N2ItN2Q2N2I3OGJjMzFkJyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnZWRiMDVkNzYtYTY5NS00NTVmLTk0N2ItN2Q2N2I3OGJjMzFkJyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgRG9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ICdTVFJJREUnLFxuICAgICAgICAgIHN0YXR1czogJ09wZW4nLFxuICAgICAgICAgIHNldmVyaXR5OiAnTWVkaXVtJyxcbiAgICAgICAgICBkZXNjcmlwdGlvbjogJ0EgZ2VuZXJpYyBlbGV2YXRpb24gdGhyZWF0J1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICAvKiBTVFJJREUgdXNpbmcgY29udGV4dCAqL1xuICAgIGVuZ2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdTVFJJREUnXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAndG0uRmxvdydcbiAgICAgICAgICB9ICwge1xuICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5pc1B1YmxpY05ldHdvcmsnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogdHJ1ZVxuICAgICAgICAgIH0gLCB7XG4gICAgICAgICAgICBhbnk6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmlzRW5jcnlwdGVkJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogZmFsc2VcbiAgIC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GRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdMSU5ERFVOJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uU3RvcmUnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uRmxvdydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5Qcm9jZXNzJ1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgZXZlbnQ6IHtcbiAgICAgICAgdHlwZTogJzc0ODM0ZjI0LThmODktNDBiYi1iMGM2LWQxZmRkOGI4YWNjYycsXG4gICAgICAgIHBhcmFtczoge1xuICAgICAgICAgIHJ1bGVJZDogJzc0ODM0ZjI0LThmODktNDBiYi1iMGM2LWQxZmRkOGI4YWNjYycsXG4gICAgICAgICAgdGl0bGU6ICdHZW5lcmljIHRocmVhdCB0byBOb24tcmVwdWRpYXRpb24nLFxuICAgICAgICAgIHR5cGU6ICdOb24tcmVwdWRpYXRpb24nLFxuICAgICAgICAgIG1vZGVsVHlwZTogJ0xJTkREVU4nLFxuICAgICAgICAgIHN0YXR1czogJ09wZW4nLFxuICAgICAgICAgIHNldmVyaXR5OiAnTWVkaXVtJyxcbiAgICAgICAgICBkZXNjcmlwdGlvbjogJ0EgZ2VuZXJpYyB0aHJlYXQgdG8gbm9uLXJlcHVkaWF0aW9uJ1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ0xJTkREVU4nXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBhbnk6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5TdG9yZSdcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5GbG93J1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlByb2Nlc3MnXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnZGY0M2IwOTEtOWZmYi00NGUzLTllYjktNDcxYjllZTU2ZDM5JyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnZGY0M2IwOTEtOWZmYi00NGUzLTllYjktNDcxYjllZTU2ZDM5JyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgdGhyZWF0IHRvIERldGVjdGFiaWxpdHknLFxuICAgICAgICAgIHR5cGU6ICdEZXRlY3RhYmlsaXR5JyxcbiAgICAgICAgICBtb2RlbFR5cGU6ICdMSU5ERFVOJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgdGhyZWF0IHRvIGRldGVjdGFiaWxpdHknXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnTElORERVTidcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlN0b3JlJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLkZsb3cnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uUHJvY2VzcydcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGV2ZW50OiB7XG4gICAgICAgIHR5cGU6ICc5ZDU3NjYxMC01YzUzLTRmODQtOTBjNS1lYzcwNzUxYTMzOWQnLFxuICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICBydWxlSWQ6ICc5ZDU3NjYxMC01YzUzLTRmODQtOTBjNS1lYzcwNzUxYTMzOWQnLFxuICAgICAgICAgIHRpdGxlOiAnR2VuZXJpYyB0aHJlYXQgdG8gRGlzY2xvc3VyZSBvZiBpbmZvcm1hdGlvbicsXG4gICAgICAgICAgdHlwZTogJ0Rpc2Nsb3N1cmUg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XG4gICAgICAgICAgc3RhdHVzOiAnT3BlbicsXG4gICAgICAgICAgc2V2ZXJpdHk6ICdNZWRpdW0nLFxuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnQSBnZW5lcmljIHRocmVhdCB0byB1bmF3YXJlbmVzcydcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuICAgIGVuZ2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdMSU5ERFVOJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uU3RvcmUnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uRmxvdydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS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GlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSB0aHJlYXQgdGl0bGUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+Q0lBIHRocmVhdCB0eXBlPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxzZWxlY3QgbmFtZT1cInR5cGVJbnB1dFwiIGNsYXNzPVwiZm9ybS1jb250cm9sXCIgbmctcmVxdWlyZWQ9XCJ0cnVlXCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnR5cGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHNlbGVjdGVkPkNvbmZpZGVudGlhbGl0eTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+SW50ZWdyaXR5PC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5BdmFpbGFiaWxpdHk8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvc2VsZWN0PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBuZy1zaG93PVwiIXRocmVhdEVkaXRGb3JtLnR5cGVJbnB1dC4kdmFsaWQgJiYgdGhyZWF0RWRpdEZvcm0udHlwZUlucHV0LiRkaXJ0eVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tZXhjbGFtYXRpb24tc2lnblwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSB0aHJlYXQgdHlwZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgcHVsbC1sZWZ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+VGhyZWF0IHN0YXR1czwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJidG4tZ3JvdXBcIiBuYW1lPVwic3RhdHVzSW5wdXRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGxhYm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nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8dWliLWFjY29yZGlvbi1oZWFkaW5nPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICBFZGl0IGRpYWdyYW0gPGkgY2xhc3M9XCJwdWxsLXJpZ2h0IGdseXBoaWNvblwiIG5nLWNsYXNzPVwie1xcJ2dseXBoaWNvbi1jaGV2cm9uLWRvd25cXCc6IHZtLnZpZXdTdGVuY2lsLCBcXCdnbHlwaGljb24tY2hldnJvbi1yaWdodFxcJzogIXZtLnZpZXdTdGVuY2lsfVwiPjwvaT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3VpYi1hY2NvcmRpb24taGVhZGluZz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdD1cInN0ZW5jaWwgaW4gdm0uc3RlbmNpbHNcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBoZWlnaHQ9XCIxMjBcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0bXQtc3RlbmNpbCBjbGFzcz1cInN0ZW5jaWxcIiBzaGFwZT1cInN0ZW5jaWwuc2hhcGVcIiBwYWRkaW5nPVwiNVwiIHNjYWxlPVwiMC45XCIgYWN0aW9uPVwic3RlbmNpbC5hY3Rpb24oKVwiIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXZcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwhLS1UaHJlYXQgcGFuZS0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiB1aWItYWNjb3JkaW9uLWdyb3VwIGlzLW9wZW49XCJ2bS52aWV3VGhyZWF0c1wiPlxcbicgK1xuICAgICcgICAgICAgICAg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CJ2bS5lZGl0XCIgc2V0ZGlydHk9XCJ2bS5zZXREaXJ0eVwiIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwidm0uc2VsZWN0ZWQub3V0T2ZTY29wZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGVtPlRoZSBzZWxlY3RlZCBlbGVtZW50IGlzIG91dCBvZiBzY29wZTwvZW0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PiAgICAgICAgICAgICAgICAgICAgICAgXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1pZj1cInZtLnNlbGVjdGVkICYmIHZtLnNlbGVjdGVkLmF0dHJpYnV0ZXMudHlwZSA9PSBcXCd0bS5Cb3VuZGFyeVxcJ1wiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZW0+VGhyZWF0cyBhcmUgbm90IGFzc29jaWF0ZWQgd2l0aCB0cnVzdCBib3VuZGFyaWVzPC9lbT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L3VpYi1hY2NvcmRpb24+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPCEtLURpYWdyYW0gYXJlYS0tPlxcbicgK1xuICAgICcgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbGctOFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwgcGFuZWwtZGVmYXVsdFwiPlxcbicgK1xuICAgICcgICAgICAgICAgIC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veCBuZy1jbGljaz1cInZtLnNldEdyaWQoKVwiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJUb2dnbGUgR3JpZGxpbmVzXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tdGhcIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGEgY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBuZy1ocmVmPVwiIy90aHJlYXRtb2RlbC97e3ZtLmdldFRocmVhdE1vZGVsUGF0aCgpfX1cIiByb2xlPVwiYnV0dG9uXCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIkNsb3NlIERpYWdyYW1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXJlbW92ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2E+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIHR5cGU9XCJidXR0b25cIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLmNsZWFyKClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiRGVsZXRlIEFsbCBFbGVtZW50cyBGcm9tIFRoaXMgRGlhZ3JhbVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tdHJhc2hcIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIHR5cGU9XCJidXR0b25cIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLnJlbG9hZCgpXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIkRpc2NhcmQgQ2hhbmdlcyBBbmQgUmVvcGVuIERpYWdyYW1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJmYSBmYS11bmRvXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBuZy1kaXNhYmxlZD1cInZtLnNlbGVjdGVkID09IG51bGwgfHwgdm0uc2VsZWN0ZWQub3V0T2ZTY29wZSB8fCB2bS5zZWxlY3RlZC5hdHRyaWJ1dGVzLnR5cGUgPT0gXFwndG0uQm91bmRhcnlcXCdcIiB0eXBlPVwiYnV0dG9uXCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgbmctY2xpY2s9XCJ2bS5nZW5lcmF0ZVRocmVhdHModm0uZGlhZ3JhbS5kaWFncmFtVHlwZSlcIiBkYXRhLXBsY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sZT1cIlNhdmUgVGhpcyBEaWFncmFtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1zYXZlXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZm9ybT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidG10LWRpYWdyYW0tY29udGFpbmVyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDx0bXQtZGlhZ3JhbSBncmFwaD1cInZtLmdyYXBoXCIgc2VsZWN0PVwidm0uc2VsZWN0KGVsZW1lbnQpXCIgbmV3LWZsb3c9XCJ2bS5uZXdGbG93KHNvdXJjZSwgdGFyZ2V0KVwiIGluaXRpYWxpc2UtZ3JhcGg9XCJ2bS5pbml0aWFsaXNlKGRpYWdyYW0pXCIgaGVpZ2h0PVwiNjAwXCIgd2lkdGg9XCI4MDBcIiBncmlkLXNpemU9XCIxXCIgaW50ZXJhY3RpdmU9XCJ0cnVlXCIvPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgIDwhLS1FbGVtZW50IHByb3BlcnRpZXMtLT5cXG4nICtcbiAgICAnICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLWxnLTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsIHBhbmVsLWRlZmF1bHRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1oZWFkaW5nIHBhbmVsLXRpdGxlXCI+UHJvcGVydGllczwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwidm0uc2VsZWN0ZWRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPHRtdC1lbGVtZW50LXByb3BlcnRpZXMgZWRpdD1cIiB2bS5lZGl0KClcIiBzZWxlY3RlZD1cInZtLnNlbGVjdGVkXCIgZWxlbWVudC10eXBlPVwie3t2bS5zZWxlY3RlZC5hdHRyaWJ1dGVzLnR5cGV9fVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCIhdm0uc2VsZWN0ZWRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGVtPlNlbGVjdCBhbiBlbGVtZW50IGluIHRoZSBkaWFncmFtIHRvIHNlZSBvciBlZGl0IGl0cyBwcm9wZXJ0aWVzPC9lbT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgPCEtLUVycm9yIGNvbnRlbnQtLT5cXG4nICtcbiAgICAnICAgIDxkaXYgbmctc2hv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oaWNvbi1leGNsYW1hdGlvbi1zaWduXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHRocmVhdCB0aXRsZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXBcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxsYWJlbD5MSU5ERFVOIHRocmVhdCB0eXBlPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxzZWxlY3QgbmFtZT1cInR5cGVJbnB1dFwiIGNsYXNzPVwiZm9ybS1jb250cm9sXCIgbmctcmVxdWlyZWQ9XCJ0cnVlXCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnR5cGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHNlbGVjdGVkPkxpbmthYmlsaXR5PC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5JZGVudGlmaWFiaWxpdHk8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPk5vbi1yZXB1ZGlhdGlvbjwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+RGV0ZWN0YWJpbGl0eTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+RGlzY2xvc3VyZSBvZiBpbmZvcm1hdGlvbjwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+VW5hd2FyZW5lc3M8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPk5vbi1jb21wbGlhbmNlPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L3NlbGVjdD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cIiF0aHJlYXRFZGl0Rm9ybS50eXBlSW5wdXQuJHZhbGlkICYmIHRocmVhdEVkaXRGb3JtLnR5cGVJbnB1dC4kZGlydHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFsZXJ0IGFsZXJ0LWRhbmdlclwiIHJvbGU9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLWV4Y2xhbWF0aW9uLXNpZ25cIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cInNyLW9ubHlcIj5FcnJvcjo8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgdGhyZWF0IHR5cGUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4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xcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYnRuLWdyb3VwXCIgcmVxdWlyZWQ+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxsYWJlbCBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC5zZXZlcml0eVwiIHVpYi1idG4tcmFkaW89XCJcXCdIaWdoXFwnXCI+SGlnaDwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxsYWJlbCBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC5zZXZlcml0eVwiIHVpYi1idG4tcmFkaW89XCJcXCdNZWRpdW1cXCdcIj5NZWRpdW08L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBuZy1tb2RlbD1cInBhcmFtZXRlci50aHJlYXQuc2V2ZXJpdHlcIiB1aWItYnRuLXJhZGlvPVwiXFwnTG93XFwnXCI+TG93PC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNsZWFyZml4XCI+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+RGVzY3JpcHRpb248L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPHRleHRhcmV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gICAgICAgICAgIDxsYWJlbD5UaXRsZTwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8aW5wdXQgbmFtZT1cInRpdGxlSW5wdXRcIiBjbGFzcz1cImZvcm0tY29udHJvbFwiIG5nLXJlcXVpcmVkPVwidHJ1ZVwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnRpdGxlXCIgcGxhY2Vob2xkZXI9XCJBIHNob3J0IHRpdGxlIGZvciB0aGUgdGhyZWF0XCIgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cIiF0aHJlYXRFZGl0Rm9ybS50aXRsZUlucHV0LiR2YWxpZCAmJiB0aHJlYXRFZGl0Rm9ybS50aXRsZUlucHV0LiRkaXJ0eVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tZXhjbGFtYXRpb24tc2lnblwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSB0aHJlYXQgdGl0bGUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+U1RSSURFIHRocmVhdCB0eXBlPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxzZWxlY3QgbmFtZT1cInR5cGVJbnB1dFwiIGNsYXNzPVwiZm9ybS1jb250cm9sXCIgbmctcmVxdWlyZWQ9XCJ0cnVlXCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnR5cGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHNlbGVjdGVkPlNwb29maW5nPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5UYW1wZXJpbmc8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPlJlcHVkaWF0aW9uPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5JbmZvcm1hdGlvbiBkaXNjbG9zdXJlPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5EZW5pYWwgb2Ygc2VydmljZTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+RWxldmF0aW9uIG9mIHByaXZpbGVnZTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9zZWxlY3Q+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IG5nLXNob3c9XCIhdGhyZWF0RWRpdEZvcm0udHlwZUlucHV0LiR2YWxpZCAmJiB0aHJlYXRFZGl0Rm9ybS50eXBlSW5wdXQuJGRpcnR5XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJhbGVydCBhbGVydC1kYW5nZXJcIiByb2xlPVwiYWxlcnRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1leGNsYW1hdGlvbi1zaWduXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHRocmVhdCB0eXBlIGNhbm5vdCBiZSBlbXB0eS5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBwdWxsLWxlZnRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxsYWJlbD5UaHJlYXQgc3RhdHVzPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJ0bi1ncm91cFwiIG5hbWU9XCJzdGF0dXNJbnB1dFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9XCJidG4gYnRuLXByaW1hcnlcIiBuYW1lPVwic3RhdHVzSW5wdXRPcGVuXCIgbmctbW9kZWw9XCJwYXJhb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ICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtMlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5SZXZpZXdlcjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdj57e3ZtLnRocmVhdE1vZGVsLmRldGFpbC5yZXZpZXdlcn19PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtOFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5Db250cmlidXRvcnM6IDwvc3Ryb25nPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXJlcGVhdD1cImNvbnRyaWJ1dG9yIGluIHZtLnRocmVhdE1vZGVsLmRldGFpbC5jb250cmlidXRvcnNcIj4ge3tjb250cmlidXRvci5uYW1lfX08c3BhbiBuZy1zaG93PVwiICEgJGxhc3QgXCI+Ozwvc3Bhbj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsIHBhbmVsLWRlZmF1bHRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWhlYWRpbmcgcGFuZWwtdGl0bGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxoND5IaWdoIGxldmVsIHN5c3RlbSBkZXN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iBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhIG5nLWhyZWY9XCIjL3RocmVhdG1vZGVsL3t7dm0udGhyZWF0TW9kZWxQYXRoKCl9fS9kaWFncmFtL3t7ZGlhZ3JhbS5pZH19XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGltZyBuZy1zcmM9XCJ7e2RpYWdyYW0udGh1bWJuYWlsfX1cIiBjbGFzcz1cImltZy10aHVtYm5haWwgY2VudGVyLWJsb2NrXCIgYWx0PVwiVGh1bWJuYWlsIG9mIHt7ZGlhZ3JhbS50aXRsZX19XCIgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgbmctaWY9XCIoKCRpbmRleCsxKSAlIDQpID09IDBcIiBjbGFzcz1cImNsZWFyZml4IHZpc2libGUtbGctYmxvY2tcIj48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBuZy1yZXBlYXQtZW5kIG5nLWhpZGU+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYnRuLWdyb3VwIHB1bGwtcmlnaHRcIiByb2xlPVwiZ3JvdXBcIj5c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VydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZmEgZmEtZXhjbGFtYXRpb24tdHJpYW5nbGVcIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPiBUaGUgdGhyZWF0IG1vZGVsIHRpdGxlIGNhbm5vdCBiZSBlbXB0eS5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1zaG93PVwidm0ud2lsbE1vdmVUaHJlYXRNb2RlbCh7bW9kZWw6IHZtLnRocmVhdE1vZGVsRWRpdEZvcm0udGhyZWF0TW9kZWxUaXRsZS4kdmlld1ZhbHVlfSkgJiYgIXZtLmlzTmV3TW9kZWwoKVwiPiAgICAgICAgICAgICAgICAgICAgICBcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtaW5mb1wiIHJvbGU9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZmEgZmEtaW5mby1jaXJjbGVcIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+V2FybmluZzo8L3NwYW4+IENoYW5naW5nIHRoZSBtb2RlbCB0aXRsZSB3aWxsIGRlbGV0ZSB0aGUgb2xkIG1vZGVsXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kIGNyZWF0ZSBhIG5ldyBvbmUgdG8gcmVwbGFjZSBpdC5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwhLS1Pd25lci0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgY29sLW1kLTZcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8bGFiZWw+T3duZXI8L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBjbGFzcz1cImZvcm0tY29udHJvbFwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJ2bS50aHJlYXRNb2RlbC5zdW1tYXJ5Lm93bmVyXCIgcGxhY2Vob2xkZXI9XCJUaGUgb3duZXIgb2YgdGhlIHRocmVhdCBtb2RlbFwiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPCEtLXJldmlld2VyLS0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBjb2wtbWQtNlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxsYWJlbD5SZXZpZXdlcjwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGlucHV0IGNsYXNzPVwiZm9ybS1jb250cm9sXCIgdHlwZT1cInRleHRcIiBuZy1tb2RlbD1cInZtLnRocmVhdE1vZGVsLmRldGFpbC5yZXZpZXdlclwiIHBsYWNlaG9sZGVyPVwiVGhlIHJldmlld2VyIG9mIHRoZSB0aHJlYXQgbW9kZWxcIlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwhLS1kZXNjcmlwdGlvbi0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGxhYmVsPkhpZ2ggbGV2ZWwgc3lzdGVtIGRlc2NyaXB0aW9uPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8dGV4dGFyZWEgcm93cz1cIjVcIiBjbGFzcz1cImZvcm0tY29udHJvbFwiIG5nLW1vZGVsPVwidm0udGhyZWF0TW9kZWwuc3VtbWFyeS5kZXNjcmlwdGlvblwiIHBsYWNlaG9sZGVyPVwiQSBoaWdoIGxldmVsIGRlc2NyaXB0aW9uIG9mIHRoZSBzeXN0ZW1cIj48L3RleHRhcmVhPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8IS0tY29udHJpYnV0b3JzLS0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBjb2wtbWQtMTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8bGFiZWw+Q29udHJpYnV0b3JzPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdD1cImNvbnRyaWJ1dG9yIGluIHZtLnRocmVhdE1vZGVsLmRldGFpbC5jb250cmlidXRvcnNcIiBuZy1mb3JtPVwiY29udHJpYnV0b3JTdWJGb3JtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtNlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImlucHV0LWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBuYW1lPVwiY29udHJpYnV0b3JOYW1lXCIgY2xhc3M9XCJmb3JtLWNvbnRyb2xcIiB0eXBlPVwidGV4dFwiIG5nLW1vZGVsPVwiY29udHJpYnV0b3IubmFtZVwiIHJlcXVpcmVkIHBsYWNlaG9sZGVyPVwiVGhlIG5hbWUgb2YgYSBjb250cmlidXRvciB0byB0aGUgdGhyZWF0IG1vZGVsXCJcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJpbnB1dC1ncm91cC1idG5cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLnJlbW92ZUNvbnRyaWJ1dG9yKCRpbmRleClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiUmVtb3ZlIFRoaXMgQ29udHJpYnV0b3JcIiBhcmlhLWhpZGRlbj1cInRydWVcIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXJlbW92ZVwiPjwvc3Bhbj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZW1vdmVcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cImNvbnRyaWJ1dG9yU3ViRm9ybS5jb250cmlidXRvck5hbWUuJGRpcnR5ICYmICFjb250cmlidXRvclN1YkZvcm0uY29udHJpYnV0b3JOYW1lLiR2YWxpZFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImZhIGZhLWV4Y2xhbWF0aW9uLXRyaWFuZ2xlXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPiBUaGUgY29udHJpYnV0b3IgbmFtZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdC1lbmQ+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtNlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImlucHV0LWdyb3VwXCIgbmctc2hvdz1cInZtLmFkZGluZ0NvbnRyaWJ1dG9yXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBjbGFzcz1cImZvcm0tY29udHJvbFwiIG5hbWU9XCJuZXdDb250cmlidXRvck5hbWVJbnB1dFwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJ2bS5uZXdDb250cmlidXRvclwiIHBsYWNlaG9sZGVyPVwiVGhlIG5hbWUgb2YgYSBjb250cmlidXRvclwiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiaW5wdXQtZ3JvdXAtYnRuXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1kZWZhdWx0XCIgbmctZGlzYWJsZWQ9XCJ2bS5uZXdDb250cmlidXRvci5sZW5ndGggPT0gMFwiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIG5nLWNsaWNrPVwidm0uYWRkQ29udHJpYnV0b3IoKVwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJBZGQgdGhpcyBjb250cmlidXRvclwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiIHR5cGU9XCJidXR0b25cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcGx1c1wiPjwvc3Bhbj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBZGRcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJpbnB1dC1ncm91cC1idG5cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWxpbmtcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLmNhbmNlbEFkZGluZ0NvbnRyaWJ1dG9yKClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiQ2FuY2VsIGFkZGluZyB0aGlzIGNvbnRyaWJ1dG9yXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCIgdHlwZT1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1yZW1vdmVcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FuY2VsXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1oaWRlPVwidm0uYWRkaW5nQ29udHJpYnV0b3JcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tbGlua1wiIG5nLWNsaWNrPVwidm0uc3RhcnRBZGRpbmdDb250cmlidXRvcigpXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcGx1c1wiPjwvc3Bhbj4gQWRkIGEgbmV3IGNvbnRyaWJ1dG9yLi4uXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPCEtLWRpYWdyYW1zLS0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBjb2wtbWQtMTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8bGFiZWw+RGlhZ3JhbXM8L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctcmVwZWF0PVwiZGlhZ3JhbSBpbiB2bS50aHJlYXRNb2RlbC5kZXRhaWwuZGlhZ3JhbXNcIiBuZy1mb3JtPVwiZGlhZ3JhbVN1YkZvcm1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC1tZC02XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiaW5wdXQtZ3JvdXBcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IG5hbWU9XCJkaWFncmFtVGl0bGVcIiBjbGFzcz1cImZvcm0tY29udHJvbFwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJkaWFncmFtLnRpdGxlXCIgcmVxdWlyZWQgcGxhY2Vob2xkZXI9XCJEaWFncmFtIHRpdGxlXCJcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJpbnB1dC1ncm91cC1idG5cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLXByaW1hcnlcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLmR1cGxpY2F0ZURpYWdyYW0oJGluZGV4KVwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJEdXBsaWNhdGUgVGhpcyBEaWFncmFtXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCIgdHlwZT1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1kdXBsaWNhdGVcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRHVwbGljYXRlXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLnJlbW92ZURpYWdyYW0oJGluZGV4KVwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJSZW1vdmUgVGhpcyBEaWFncmFtXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCIgdHlwZT1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1yZW1vdmVcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVtb3ZlXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1zaG93PVwiZGlhZ3JhbVN1YkZvcm0uZGlhZ3JhbVRpdGxlLiRkaXJ0eSAmJiAhZGlhZ3JhbVN1YkZvcm0uZGlhZ3JhbVRpdGxlLiR2YWxpZFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImZhIGZhLWV4Y2xhbWF0aW9uLXRyaWFuZ2xlXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPiBUaGUgZGlhZ3JhbSB0aXRsZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdC1lbmQ+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtNlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImlucHV0LWdyb3VwXCIgbmctc2hvdz1cInZtLmFkZGluZ0RpYWdyYW1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IGNsYXNzPVwiZm9ybS1jb250cm9sXCIgdHlwZT1cInRleHRcIiBuZy1tb2RlbD1cInZtLm5ld0RpYWdyYW0udGl0bGVcIiBwbGFjZWhvbGRlcj1cIkRpYWdyYW0gdGl0bGVcIiAvPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImlucHV0LWdyb3VwLWJ0blwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIG5nLWRpc2FibGVkPVwidm0ubmV3RGlhZ3JhbS50aXRsZS5sZW5ndGggPT0gMFwiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIG5nLWNsaWNrPVwidm0uYWRkRGlhZ3JhbSgpXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIkFkZCB0aGlzIGRpYWdyYW1cIiBhcmlhLWhpZGRlbj1cInRydWVcIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXBsdXNcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWRkXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiaW5wdXQtZ3JvdXAtYnRuXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1saW5rXCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgbmctY2xpY2s9XCJ2bS5jYW5jZWxBZGRpbmdEaWFncmFtKClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiQ2FuY2VsIGFkZGluZyB0aGlzIGRpYWdyYW1cIiBhcmlhLWhpZGRlbj1cInRydWVcIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXJlbW92ZVwiPjwvc3Bhbj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW5jZWxcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWhpZGU9XCJ2bS5hZGRpbmdEaWFncmFtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWxpbmtcIiBuZy1jbGljaz1cInZtLnN0YXJ0QWRkaW5nRGlhZ3JhbSgpXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcGx1c1wiPjwvc3Bhbj4gQWRkIGEgbmV3IGRpYWdyYW0uLi5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8IS0tYnV0dG9ucy0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC1tZC0zIGNvbC1tZC1vZmZzZXQtOVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJidG4tZ3JvdXAgcHVsbC1yaWdodFwiIHJvbGU9XCJncm91cFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1kZWZhdWx0XCIgbmctY2xpY2s9XCJ2bS5jYW5jZWwoKVwiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJDYW5jZWwgRWRpdGluZ1wiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcmVtb3ZlXCI+PC9zcGFuPiBDYW5jZWxcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBuZy1kaXNhYmxlZD1cIiF2bS5kaXJ0eVwiIG5nLWNsaWNrPVwidm0ucmVsb2FkKClcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZT1cIlJlc2V0IEZvcm1cIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImZhIGZhLXVuZG9cIj48L3NwYW4+IFJlbG9hZFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tcHJpbWFyeVwiIG5nLWRpc2FibGVkPVwiIXZtLmRpcnR5IHx8ICF2bS50aHJlYXRNb2RlbEVkaXRGb3JtLiR2YWxpZFwiIG5nLWNsaWNrPVwidm0uaXNOZXdNb2RlbCgpID8gdm0uY3JlYXRlKCkgOiB2bS5zYXZlKClcIlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIlNhdmUgQ2hhbmdlc1wiIHR5cGU9XCJidXR0b25cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1zYXZlXCI+PC9zcGFuPiBTYXZlXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZm9ybT5cXG4nICtcbiAgICAnICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgPCEtLW9vcHMtLT5cXG4nICtcbiAgICAnICAgIDxkaXYgbmctaWY9XCJ2bS5lcnJvcmVkXCI+XFxuJyArXG4gICAgJyAgICAgICAgPGRpdiBjbGFzcz1cImp1bWJvdHJvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICA8aDE+b29vb3BzITwvaDE+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgSXQgbG9va3MgbGlrZSB5b3UgdHJpZWQgdG8gZWRpdCBhbiBpbnZhbGlkIHRocmVhdCBtb2RlbC4gTWF5YmUgeW91IHR5cGVkIHRoZSBhZGRyZXNzIHdyb25nPyBPciBpZiB5b3UgY2xpY2tlZCBhIGxpbmsgdG8gZ2V0XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICBoZXJlLCB0aGUgdGhyZWF0IG1vZGVsIG1pZ2h0IGhhdmUgYmVlbiBkZWxldGVkIHNpbmNlIHlvdSBtYWRlIHRoZSBsaW5rIDxzcGFuIGNsYXNzPVwiZmEgZmEtZnJvd24tb1wiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAg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W1kLTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5Pd25lcjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2Pnt7bW9kZWwuc3VtbWFyeS5vd25lcn19PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5SZXZpZXdlcjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2Pnt7bW9kZWwuZGV0YWlsLnJldmlld2VyfX08L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtOFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdj48c3Ryb25nPkNvbnRyaWJ1dG9yczogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXJlcGVhdD1cImNvbnRyaWJ1dG9yIGluIG1vZGVsLmRldGFpbC5jb250cmlidXRvcnNcIj4ge3tjb250cmlidXRvci5uYW1lfX08c3BhbiBuZy1zaG93PVwiICEgJGxhc3QgXCI+Ozwvc3Bhbj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDxkaXYgY2xhc3M9XCJwYW5lbCBwYW5lbC1kZWZ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3BhbiBuZy1zd2l0Y2gtd2hlbj1cInRtLkZsb3dcIj4oRGF0YSBGbG93KTwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2gtd2hlbj1cInRtLlByb2Nlc3NcIj4oUHJvY2Vzcyk8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctc3dpdGNoLXdoZW49XCJ0bS5BY3RvclwiPihFeHRlcm5hbCBBY3Rvcik8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwtYm9keVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj48c3Ryb25nPkRlc2NyaXB0aW9uOiA8L3N0cm9uZz48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHAgY2xhc3M9XCJyZXBvcnRcIj57e2VsZW1lbnQuZGVzY3JpcHRpb259fTwvcD48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJlbGVtZW50Lmhhc09wZW5UaHJlYXRzIHx8IChyZXBvcnRPcHRpb25zLnNob3dNaXRpZ2F0ZWQgJiYgZWxlbWVudC50aHJlYXRzLmxlbmd0aCA+IDApXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1yZXBlYXQ9XCJ0aHJlYXQgaW4gZWxlbWVudC50aHJlYXRzXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJ0aHJlYXQuc3RhdHVzID09IFxcJ09wZW5cXCcgfHwgcmVwb3J0T3B0aW9ucy5zaG93TWl0aWdhdGVkXCIgY2xhc3M9XCJwYW5lbCBwYW5lbC1kZWZhdWx0IHRocmVhdFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWhlYWRpbmcgcGFuZWwtdGl0bGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7e3RocmVhdC50aXRsZX19XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGVtIGNsYXNzPVwic21hbGxcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3t0aHJlYXQudHlwZX19LFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1jbGFzcz1cIntNaXRpZ2F0ZWQ6XFwndGV4dC1zdWNjZXNzXFwnLCBPcGVuOlxcJ3RleHQtZGFuZ2VyXFwnfVt0aHJlYXQuc3RhdHVzXVwiPnt7dGhyZWF0LnN0YXR1c319PC9zcGFuPixcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctY2xhc3M9XCJ7TG93OlxcJ3RleHQtc3VjY2Vzc1xcJywgTWVkaXVtOlxcJ3RleHQtd2FybmluZ1xcJywgSGlnaDpcXCd0ZXh0LWRhbmdlclxcJ31bdGhyZWF0LnNldmVyaXR5XVwiPnt7dGhyZWF0LnNldmVyaXR5fX0gU2V2ZXJpdHk8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9lbT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5EZXNjcmlwdGlvbjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHAgY2xhc3M9XCJyZXBvcnRcIj57e3RocmVhdC5kZXNjcmlwdGlvbn19PC9wPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtMTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj48c3Ryb25nPk1pdGlnYXRpb246IDwvc3Ryb25nPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PjxwIGNsYXNzPVwicmVwb3J0XCI+e3t0aHJlYXQubWl0aWdhdGlvbn19PC9wPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwiZWxlbWVudC50aHJlYXRzLmxlbmd0aCA9PSAwIHx8ICFlbGVtZW50LnRocmVhdHMgfHwgKCFlbGVtZW50Lmhhc09wZW5UaHJlYXRzICYmICFyZXBvcnRPcHRpb25zLnNob3dNaXRpZ2F0ZWQpXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGVtPk5vIHRocmVhdHMgbGlzdGVkLjwvZW0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJyZXBvcnRPcHRpb25zLnNob3dPdXRPZlNjb3BlXCIgbmctcmVwZWF0PVwiZWxlbWVudCBpbiBncmFwaHNbZGlhZ3JhbS5pZF0uZ2V0Q2VsbHMoKSB8IGZpbHRlcjp7b3V0T2ZTY29wZTogdHJ1ZX1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwgcGFuZWwtZGVmYXVsdCBtb2RlbC1lbGVtZW50XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1oZWFkaW5nIHBhbmVsLXRpdGxlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7e2VsZW1lbnQubmFtZX19IChvdXQgb2Ygc2NvcGUgXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2g9XCJlbGVtZW50LmF0dHJpYnV0ZXMudHlwZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXN3aXRjaC13aGVuPVwidG0uU3RvcmVcIj5EYXRhIFN0b3JlKTwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2gtd2hlbj1cInRtLkZsb3dcIj5EYXRhIEZsb3cpPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXN3aXRjaC13aGVuPVwidG0uUHJvY2Vzc1wiPlByb2Nlc3MpPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXN3aXRjaC13aGVuPVwidG0uQWN0b3JcIj5FeHRlcm5hbCBBY3Rvcik8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwtYm9keVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj48c3Ryb25nPkRlc2NyaXB0aW9uOiA8L3N0cm9uZz48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHAgY2xhc3M9XCJyZXBvcnRcIj57e2VsZW1lbnQuZGVzY3JpcHRpb259fTwvcD48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5PdXQgb2Ygc2NvcGUgcmVhc29uOiA8L3N0cm9uZz48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHAgY2xhc3M9XCJyZXBvcnRcIj57e2VsZW1lbnQucmVhc29uT3V0T2ZTY29wZX19PC9wPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgPGRpdiBuZy1pZj1cIiFpc1ByaW50aW5nT3JTYXZpbmdcIiBjbGFzcz1cInJvd1wiPlxcbicgK1xuICAgICcgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtMTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJ0bi1ncm91cCBwdWxsLXJpZ2h0XCIgcm9sZT1cImdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8YnV0dG9uI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kZXRhaWwuZGlhZ3JhbXMuZm9yRWFjaChmdW5jdGlvbiAoaXRlbSkge1xuICAgICAgICAgICAgaWYgKGlkID09IGl0ZW0uaWQpIHtcbiAgICAgICAgICAgICAgICBpZCArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIGlkO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG9uRXJyb3IoZXJyKSB7XG4gICAgICAgIHZtLmVycm9yZWQgPSB0cnVlO1xuICAgICAgICBsb2dFcnJvcihlcnIuZGF0YS5tZXNzYWdlKTtcbiAgICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gdGhyZWF0TW9kZWw7XG4iLCIndXNlIHN0cmljdCc7XG5cbnZhciBfID0gcmVxdWlyZSgnbG9kYXNoJyk7XG5cbmZ1bmN0aW9uIHRocmVhdE1vZGVsUmVwb3J0KCRsb2NhdGlvbiwgJHJvdXRlUGFyYW1zLCB0aHJlYXRtb2RlbGxvY2F0b3IsIGRpYWdyYW1taW5nKSB7XG5cbiAgICB2YXIgZGlyZWN0aXZlID1cbiAgICAgICAge1xuICAgICAgICAgICAgbGluazogbGluayxcbiAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAndGhyZWF0bW9kZWxzL3RocmVhdG1vZGVscmVwb3J0Lmh0bWwnLFxuICAgICAgICAgICAgcmVzdHJpY3Q6ICdFJyxcbiAgICAgICAgICAgIHNjb3BlOlxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIG1vZGVsOiAnPScsXG4gICAgICAgICAgICAgICAgbG9hZGVkOiAnJicsXG4gICAgICAgICAgICAgICAgaXNQcmludGluZ09yU2F2aW5nOiAnPWhpZGVDb250cm9scycsXG4gICAgICAgICAgICAgICAgc2F2ZTogJyY/JyxcbiAgICAgICAgICAgICAgICBwcmludDogJyY/J1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgcmV0dXJuIGRpcmVjdGl2ZTtcblxuICAgIGZ1bmN0aW9uIGxpbmsoc2NvcGUpIHtcbiAgICAgICAgXG4gICAgICAgIHNjb3BlLnByaW50YWJsZSA9IF8uaXNGdW5jdGlvbihzY29wZS5wcmludCk7XG4gICAgICAgIHNjb3BlLnNhdmVhYmxlID0gXy5pc0Z1bmN0aW9uKHNjb3BlLnNhdmUpO1xuICAgICAgICBzY29wZS5zYXZlUERGID0gc2F2ZVBERjtcbiAgICAgICAgc2NvcGUucHJpbnRQREYgPSBwcmludFBERjtcbiAgICAgICAgc2NvcGUuY2FuY2VsID0gY2FuY2VsO1xuICAgICAgICBzY29wZS5pbml0aWFsaXNlID0gaW5pdGlhbGlzZTtcbiAgICAgICAgc2NvcGUuZ3JhcGhzID0gbnVsbDtcbiAgICBcbiAgICAgICAgc2NvcGUucmVwb3J0T3B0aW9ucyA9IHtcbiAgICAgICAgICAgIHNob3dNaXRpZ2F0ZWQ6IHRydWUsXG4gICAgICAgICAgICBzaG93T3V0T2ZTY29wZTogdHJ1ZSxcbiAgICAgICAgICAgIHNob3dEaWFncmFtczogdHJ1ZVxuICAgICAgICB9O1xuXG4gICAgICAgIHByaW1lR3JhcGhzKCk7XG4gICAgICAgIHNjb3BlLmxvYWRlZCgpO1xuXG4gICAgICAgIGZ1bmN0aW9uIGluaXRpYWxpc2UoZGlhZ3JhbSkge1xuICAgICAgICAgICAgaW5pdGlhbGlzZUdyYXBocygpO1xuICAgICAgICAgICAgZGlhZ3JhbS5yZW1vdmVUb29scygpO1xuICAgICAgICAgICAgZGlhZ3JhbS5zY2FsZUNvbnRlbnRUb0ZpdCgpO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gc2F2ZVBERigpIHtcbiAgICAgICAgICAgIHNjb3BlLmlzUHJpbnRpbmdPclNhdmluZyA9IHRydWU7XG4gICAgICAgICAgICBzY29wZS5zYXZlKHtkb25lOiBkb25lfSk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBwcmludFBERigpIHtcbiAgICAgICAgICAgIHNjb3BlLmlzUHJpbnRpbmdPclNhdmluZyA9IHRydWU7XG4gICAgICAgICAgICBzY29wZS5wcmludCh7ZG9uZTogZG9uZX0pO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gZG9uZSgpIHtcbiAgICAgICAgICAgIHNjb3BlLmlzUHJpbnRpbmdPclNhdmluZyA9IGZhbHNlO1xuICAgICAgICAgICAgc2NvcGUuc2FmZUFwcGx5KCk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBjYW5jZWwoKSB7XG4gICAgICAgICAgICBpZiAoIV8uaXNVbmRlZmluZWQoc2NvcGUubW9kZWwuc3VtbWFyeS50aXRsZSkpIHtcbiAgICAgICAgICAgICAgICAkbG9jYXRpb24ucGF0aCgnL3RocmVhdG1vZGVsLycgKyB0aHJlYXRtb2RlbGxvY2F0b3IuZ2V0TW9kZWxQYXRoRnJvbVJvdXRlUGFyYW1zKCRyb3V0ZVBhcmFtcykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgJGxvY2F0aW9uLnBhdGgoJy8nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHNjb3BlLnNhZmVBcHBseSA9IGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgICB2YXIgcGhhc2UgPSB0aGlzLiRyb290LiQkcGhhc2U7XG4gICAgICAgICAgICBpZihwaGFzZSA9PSAnJGFwcGx5JyB8fCBwaGFzZSA9PSAnJGRpZ2VzdCcpIHtcbiAgICAgICAgICAgICAgaWYoZm4gJiYgKHR5cGVvZihmbikgPT09ICdmdW5jdGlvbicpKSB7XG4gICAgICAgICAgICAgICAgZm4oKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhpcy4kYXBwbHkoZm4pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGZ1bmN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dldENvbnRhaW5lcjogZ2V0Q29udGFpbmVyLFxuICAgICAgICAgICAgICAgIGluZm86IGluZm8sXG4gICAgICAgICAgICAgICAgb3B0aW9uczoge30sXG4gICAgICAgICAgICAgICAgc3Vic2NyaWJlOiBzdWJzY3JpYmUsXG4gICAgICAgICAgICAgICAgc3VjY2Vzczogc3VjY2VzcyxcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiAnMi4xLjQnLFxuICAgICAgICAgICAgICAgIHdhcm5pbmc6IHdhcm5pbmdcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHZhciBwcmV2aW91c1RvYXN0O1xuXG4gICAgICAgICAgICByZXR1cm4gdG9hc3RyO1xuXG4gICAgICAgICAgICAvLy8vLy8vLy8vLy8vLy8vXG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGVycm9yKG1lc3NhZ2UsIHRpdGxlLCBvcHRpb25zT3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm90aWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogdG9hc3RUeXBlLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICBpY29uQ2xhc3M6IGdldE9wdGlvbnMoKS5pY29uQ2xhc3Nlcy5lcnJvcixcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogbWVzc2FnZSxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uc092ZXJyaWRlOiBvcHRpb25zT3ZlcnJpZGUsXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBnZXRDb250YWluZXIob3B0aW9ucywgY3JlYXRlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zKSB7IG9wdGlvbnMgPSBnZXRPcHRpb25zKCk7IH1cbiAgICAgICAgICAgICAgICAkY29udGFpbmVyID0gJCgnIycgKyBvcHRpb25zLmNvbnRhaW5lcklkKTtcbiAgICAgICAgICAgICAgICBpZiAoJGNvbnRhaW5lci5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRjb250YWluZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjcmVhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgJGNvbnRhaW5lciA9IGNyZWF0ZUNvbnRhaW5lcihvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICRjb250YWluZXI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGluZm8obWVzc2FnZSwgdGl0bGUsIG9wdGlvbnNPdmVycmlkZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBub3RpZnkoe1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiB0b2FzdFR5cGUuaW5mbyxcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzOiBnZXRPcHRpb25zKCkuaWNvbkNsYXNzZXMuaW5mbyxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogbWVzc2FnZSxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uc092ZXJyaWRlOiBvcHRpb25zT3ZlcnJpZGUsXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBzdWJzY3JpYmUoY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lciA9IGNhbGxiYWNrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBzdWNjZXNzKG1lc3NhZ2UsIHRpdGxlLCBvcHRpb25zT3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm90aWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogdG9hc3RUeXBlLnN1Y2Nlc3MsXG4gICAgICAgICAgICAgICAgICAgIGljb25DbGFzczogZ2V0T3B0aW9ucygpLmljb25DbGFzc2VzLnN1Y2Nlc3MsXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnNPdmVycmlkZTogb3B0aW9uc092ZXJyaWRlLFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gd2FybmluZyhtZXNzYWdlLCB0aXRsZSwgb3B0aW9uc092ZXJyaWRlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vdGlmeSh7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHRvYXN0VHlwZS53YXJuaW5nLFxuICAgICAgICAgICAgICAgICAgICBpY29uQ2xhc3M6IGdldE9wdGlvbnMoKS5pY29uQ2xhc3Nlcy53YXJuaW5nLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBtZXNzYWdlLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zT3ZlcnJpZGU6IG9wdGlvbnNPdmVycmlkZSxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFyKCR0b2FzdEVsZW1lbnQsIGNsZWFyT3B0aW9ucykge1xuICAgICAgICAgICAgICAgIHZhciBvcHRpb25zID0gZ2V0T3B0aW9ucygpO1xuICAgICAgICAgICAgICAgIGlmICghJGNvbnRhaW5lcikgeyBnZXRDb250YWluZXIob3B0aW9ucyk7IH1cbiAgICAgICAgICAgICAgICBpZiAoIWNsZWFyVG9hc3QoJHRvYXN0RWxlbWVudCwgb3B0aW9ucywgY2xlYXJPcHRpb25zKSkge1xuICAgICAgICAgICAgICAgICAgICBjbGVhckNvbnRhaW5lcihvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHJlbW92ZSgkdG9hc3RFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSBnZXRPcHRpb25zKCk7XG4gICAgICAgICAgICAgICAgaWYgKCEkY29udGFpbmVyKSB7IGdldENvbnRhaW5lcihvcHRpb25zKTsgfVxuICAgICAgICAgICAgICAgIGlmICgkdG9hc3RFbGVtZW50ICYmICQoJzpmb2N1cycsICR0b2FzdEVsZW1lbnQpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoJGNvbnRhaW5lci5jaGlsZHJlbigpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gaW50ZXJuYWwgZnVuY3Rpb25zXG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFyQ29udGFpbmVyIChvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRvYXN0c1RvQ2xlYXIgPSAkY29udGFpbmVyLmNoaWxkcmVuKCk7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IHRvYXN0c1RvQ2xlYXIubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJUb2FzdCgkKHRvYXN0c1RvQ2xlYXJbaV0pLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFyVG9hc3QgKCR0b2FzdEVsZW1lbnQsIG9wdGlvbnMsIGNsZWFyT3B0aW9ucykge1xuICAgICAgICAgICAgICAgIHZhciBmb3JjZSA9IGNsZWFyT3B0aW9ucyAmJiBjbGVhck9wdGlvbnMuZm9yY2UgPyBjbGVhck9wdGlvbnMuZm9yY2UgOiBmYWxzZTtcbiAgICAgICAgICAgICAgICBpZiAoJHRvYXN0RWxlbWVudCAmJiAoZm9yY2UgfHwgJCgnOmZvY3VzJywgJHRvYXN0RWxlbWVudCkubGVuZ3RoID09PSAwKSkge1xuICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50W29wdGlvbnMuaGlkZU1ldGhvZF0oe1xuICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb246IG9wdGlvbnMuaGlkZUR1cmF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgZWFzaW5nOiBvcHRpb25zLmhpZGVFYXNpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZTogZnVuY3Rpb24gKCkgeyByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KTsgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gY3JlYXRlQ29udGFpbmVyKG9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAkY29udGFpbmVyID0gJCgnPGRpdi8+JylcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgb3B0aW9ucy5jb250YWluZXJJZClcbiAgICAgICAgICAgICAgICAgICAgLmFkZENsYXNzKG9wdGlvbnMucG9zaXRpb25DbGFzcyk7XG5cbiAgICAgICAgICAgICAgICAkY29udGFpbmVyLmFwcGVuZFRvKCQob3B0aW9ucy50YXJnZXQpKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gJGNvbnRhaW5lcjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0RGVmYXVsdHMoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgdGFwVG9EaXNtaXNzOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICB0b2FzdENsYXNzOiAndG9hc3QnLFxuICAgICAgICAgICAgICAgICAgICBjb250YWluZXJJZDogJ3RvYXN0LWNvbnRhaW5lcicsXG4gICAgICAgICAgICAgICAgICAgIGRlYnVnOiBmYWxzZSxcblxuICAgICAgICAgICAgICAgICAgICBzaG93TWV0aG9kOiAnZmFkZUluJywgLy9mYWRlSW4sIHNsaWRlRG93biwgYW5kIHNob3cgYXJlIGJ1aWx0IGludG8galF1ZXJ5XG4gICAgICAgICAgICAgICAgICAgIHNob3dEdXJhdGlvbjogMzAwLFxuICAgICAgICAgICAgICAgICAgICBzaG93RWFzaW5nOiAnc3dpbmcnLCAvL3N3aW5nIGFuZCBsaW5lYXIgYXJlIGJ1aWx0IGludG8galF1ZXJ5XG4gICAgICAgICAgICAgICAgICAgIG9uU2hvd246IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgaGlkZU1ldGhvZDogJ2ZhZGVPdXQnLFxuICAgICAgICAgICAgICAgICAgICBoaWRlRHVyYXRpb246IDEwMDAsXG4gICAgICAgICAgICAgICAgICAgIGhpZGVFYXNpbmc6ICdzd2luZycsXG4gICAgICAgICAgICAgICAgICAgIG9uSGlkZGVuOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlTWV0aG9kOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgY2xvc2VEdXJhdGlvbjogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlRWFzaW5nOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgY2xvc2VPbkhvdmVyOiB0cnVlLFxuXG4gICAgICAgICAgICAgICAgICAgIGV4dGVuZGVkVGltZU91dDogMTAwMCxcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzZXM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiAndG9hc3QtZXJyb3InLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5mbzogJ3RvYXN0LWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzczogJ3RvYXN0LXN1Y2Nlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgd2FybmluZzogJ3RvYXN0LXdhcm5pbmcnXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGljb25DbGFzczogJ3RvYXN0LWluZm8nLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbkNsYXNzOiAndG9hc3QtdG9wLXJpZ2h0JyxcbiAgICAgICAgICAgICAgICAgICAgdGltZU91dDogNTAwMCwgLy8gU2V0IHRpbWVPdXQgYW5kIGV4dGVuZGVkVGltZU91dCB0byAwIHRvIG1ha2UgaXQgc3RpY2t5XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlQ2xhc3M6ICd0b2FzdC10aXRsZScsXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VDbGFzczogJ3RvYXN0LW1lc3NhZ2UnLFxuICAgICAgICAgICAgICAgICAgICBlc2NhcGVIdG1sOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0OiAnYm9keScsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlSHRtbDogJzxidXR0b24gdHlwZT1cImJ1dHRvblwiPiZ0aW1lczs8L2J1dHRvbj4nLFxuICAgICAgICAgICAgICAgICAgICBjbG9zZUNsYXNzOiAndG9hc3QtY2xvc2UtYnV0dG9uJyxcbiAgICAgICAgICAgICAgICAgICAgbmV3ZXN0T25Ub3A6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIHByZXZlbnREdXBsaWNhdGVzOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXI6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBwcm9ncmVzc0NsYXNzOiAndG9hc3QtcHJvZ3Jlc3MnLFxuICAgICAgICAgICAgICAgICAgICBydGw6IGZhbHNlXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gcHVibGlzaChhcmdzKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFsaXN0ZW5lcikgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICBsaXN0ZW5lcihhcmdzKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gbm90aWZ5KG1hcCkge1xuICAgICAgICAgICAgICAgIHZhciBvcHRpb25zID0gZ2V0T3B0aW9ucygpO1xuICAgICAgICAgICAgICAgIHZhciBpY29uQ2xhc3MgPSBtYXAuaWNvbkNsYXNzIHx8IG9wdGlvbnMuaWNvbkNsYXNzO1xuXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiAobWFwLm9wdGlvbnNPdmVycmlkZSkgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMgPSAkLmV4dGVuZChvcHRpb25zLCBtYXAub3B0aW9uc092ZXJyaWRlKTtcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzID0gbWFwLm9wdGlvbnNPdmVycmlkZS5pY29uQ2xhc3MgfHwgaWNvbkNsYXNzO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChzaG91bGRFeGl0KG9wdGlvbnMsIG1hcCkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICB0b2FzdElkKys7XG5cbiAgICAgICAgICAgICAgICAkY29udGFpbmVyID0gZ2V0Q29udGFpbmVyKG9wdGlvbnMsIHRydWUpO1xuXG4gICAgICAgICAgICAgICAgdmFyIGludGVydmFsSWQgPSBudWxsO1xuICAgICAgICAgICAgICAgIHZhciAkdG9hc3RFbGVtZW50ID0gJCgnPGRpdi8+Jyk7XG4gICAgICAgICAgICAgICAgdmFyICR0aXRsZUVsZW1lbnQgPSAkKCc8ZGl2Lz4nKTtcbiAgICAgICAgICAgICAgICB2YXIgJG1lc3NhZ2VFbGVtZW50ID0gJCgnPGRpdi8+Jyk7XG4gICAgICAgICAgICAgICAgdmFyICRwcm9ncmVzc0VsZW1lbnQgPSAkKCc8ZGl2Lz4nKTtcbiAgICAgICAgICAgICAgICB2YXIgJGNsb3NlRWxlbWVudCA9ICQob3B0aW9ucy5jbG9zZUh0bWwpO1xuICAgICAgICAgICAgICAgIHZhciBwcm9ncmVzc0JhciA9IHtcbiAgICAgICAgICAgICAgICAgICAgaW50ZXJ2YWxJZDogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgaGlkZUV0YTogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbWF4SGlkZVRpbWU6IG51bGxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHZhciByZXNwb25zZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgdG9hc3RJZDogdG9hc3RJZCxcbiAgICAgICAgICAgICAgICAgICAgc3RhdGU6ICd2aXNpYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRUaW1lOiBuZXcgRGF0ZSgpLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiBvcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICBtYXA6IG1hcFxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICBwZXJzb25hbGl6ZVRvYXN0KCk7XG5cbiAgICAgICAgICAgICAgICBkaXNwbGF5VG9hc3QoKTtcblxuICAgICAgICAgICAgICAgIGhhbmRsZUV2ZW50cygpO1xuXG4gICAgICAgICAgICAgICAgcHVibGlzaChyZXNwb25zZSk7XG5cbiAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5kZWJ1ZyAmJiBjb25zb2xlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gJHRvYXN0RWxlbWVudDtcblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGVzY2FwZUh0bWwoc291cmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2UgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlID0gJyc7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvJi9nLCAnJmFtcDsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1wiL2csICcmcXVvdDsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLycvZywgJyYjMzk7JylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC88L2csICcmbHQ7JylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8+L2csICcmZ3Q7Jyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gcGVyc29uYWxpemVUb2FzdCgpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0SWNvbigpO1xuICAgICAgICAgICAgICAgICAgICBzZXRUaXRsZSgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRNZXNzYWdlKCk7XG4gICAgICAgICAgICAgICAgICAgIHNldENsb3NlQnV0dG9uKCk7XG4gICAgICAgICAgICAgICAgICAgIHNldFByb2dyZXNzQmFyKCk7XG4gICAgICAgICAgICAgICAgICAgIHNldFJUTCgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRTZXF1ZW5jZSgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRBcmlhKCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0QXJpYSgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGFyaWFWYWx1ZSA9ICcnO1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1hcC5pY29uQ2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3RvYXN0LXN1Y2Nlc3MnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAndG9hc3QtaW5mbyc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJpYVZhbHVlID0gICdwb2xpdGUnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmlhVmFsdWUgPSAnYXNzZXJ0aXZlJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmF0dHIoJ2FyaWEtbGl2ZScsIGFyaWFWYWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gaGFuZGxlRXZlbnRzKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jbG9zZU9uSG92ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuaG92ZXIoc3RpY2tBcm91bmQsIGRlbGF5ZWRIaWRlVG9hc3QpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zLm9uY2xpY2sgJiYgb3B0aW9ucy50YXBUb0Rpc21pc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuY2xpY2soaGlkZVRvYXN0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmNsb3NlQnV0dG9uICYmICRjbG9zZUVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICRjbG9zZUVsZW1lbnQuY2xpY2soZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50LnN0b3BQcm9wYWdhdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50LmNhbmNlbEJ1YmJsZSAhPT0gdW5kZWZpbmVkICYmIGV2ZW50LmNhbmNlbEJ1YmJsZSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5jYW5jZWxCdWJibGUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLm9uQ2xvc2VDbGljaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uQ2xvc2VDbGljayhldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZVRvYXN0KHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5vbmNsaWNrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmNsaWNrKGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25jbGljayhldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZVRvYXN0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRpc3BsYXlUb2FzdCgpIHtcbiAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5oaWRlKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudFtvcHRpb25zLnNob3dNZXRob2RdKFxuICAgICAgICAgICAgICAgICAgICAgICAge2R1cmF0aW9uOiBvcHRpb25zLnNob3dEdXJhdGlvbiwgZWFzaW5nOiBvcHRpb25zLnNob3dFYXNpbmcsIGNvbXBsZXRlOiBvcHRpb25zLm9uU2hvd259XG4gICAgICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMudGltZU91dCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVydmFsSWQgPSBzZXRUaW1lb3V0KGhpZGVUb2FzdCwgb3B0aW9ucy50aW1lT3V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLm1heEhpZGVUaW1lID0gcGFyc2VGbG9hdChvcHRpb25zLnRpbWVPdXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXIuaGlkZUV0YSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpICsgcHJvZ3Jlc3NCYXIubWF4SGlkZVRpbWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5wcm9ncmVzc0Jhcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLmludGVydmFsSWQgPSBzZXRJbnRlcnZhbCh1cGRhdGVQcm9ncmVzcywgMTApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0SWNvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5pY29uQ2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuYWRkQ2xhc3Mob3B0aW9ucy50b2FzdENsYXNzKS5hZGRDbGFzcyhpY29uQ2xhc3MpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0U2VxdWVuY2UoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLm5ld2VzdE9uVG9wKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLnByZXBlbmQoJHRvYXN0RWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLmFwcGVuZCgkdG9hc3RFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldFRpdGxlKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobWFwLnRpdGxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3VmZml4ID0gbWFwLnRpdGxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXNjYXBlSHRtbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1ZmZpeCA9IGVzY2FwZUh0bWwobWFwLnRpdGxlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICR0aXRsZUVsZW1lbnQuYXBwZW5kKHN1ZmZpeCkuYWRkQ2xhc3Mob3B0aW9ucy50aXRsZUNsYXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuYXBwZW5kKCR0aXRsZUVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0TWVzc2FnZSgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5tZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3VmZml4ID0gbWFwLm1lc3NhZ2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5lc2NhcGVIdG1sKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VmZml4ID0gZXNjYXBlSHRtbChtYXAubWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAkbWVzc2FnZUVsZW1lbnQuYXBwZW5kKHN1ZmZpeCkuYWRkQ2xhc3Mob3B0aW9ucy5tZXNzYWdlQ2xhc3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5hcHBlbmQoJG1lc3NhZ2VFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldENsb3NlQnV0dG9uKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jbG9zZUJ1dHRvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgJGNsb3NlRWxlbWVudC5hZGRDbGFzcyhvcHRpb25zLmNsb3NlQ2xhc3MpLmF0dHIoJ3JvbGUnLCAnYnV0dG9uJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LnByZXBlbmQoJGNsb3NlRWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXRQcm9ncmVzc0JhcigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMucHJvZ3Jlc3NCYXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICRwcm9ncmVzc0VsZW1lbnQuYWRkQ2xhc3Mob3B0aW9ucy5wcm9ncmVzc0NsYXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQucHJlcGVuZCgkcHJvZ3Jlc3NFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldFJUTCgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMucnRsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmFkZENsYXNzKCdydGwnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNob3VsZEV4aXQob3B0aW9ucywgbWFwKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnByZXZlbnREdXBsaWNhdGVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFwLm1lc3NhZ2UgPT09IHByZXZpb3VzVG9hc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNUb2FzdCA9IG1hcC5tZXNzYWdlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBoaWRlVG9hc3Qob3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1ldGhvZCA9IG92ZXJyaWRlICYmIG9wdGlvbnMuY2xvc2VNZXRob2QgIT09IGZhbHNlID8gb3B0aW9ucy5jbG9zZU1ldGhvZCA6IG9wdGlvbnMuaGlkZU1ldGhvZDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGR1cmF0aW9uID0gb3ZlcnJpZGUgJiYgb3B0aW9ucy5jbG9zZUR1cmF0aW9uICE9PSBmYWxzZSA/XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmNsb3NlRHVyYXRpb24gOiBvcHRpb25zLmhpZGVEdXJhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVhc2luZyA9IG92ZXJyaWRlICYmIG9wdGlvbnMuY2xvc2VFYXNpbmcgIT09IGZhbHNlID8gb3B0aW9ucy5jbG9zZUVhc2luZyA6IG9wdGlvbnMuaGlkZUVhc2luZztcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQoJzpmb2N1cycsICR0b2FzdEVsZW1lbnQpLmxlbmd0aCAmJiAhb3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocHJvZ3Jlc3NCYXIuaW50ZXJ2YWxJZCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkdG9hc3RFbGVtZW50W21ldGhvZF0oe1xuICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb246IGR1cmF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgZWFzaW5nOiBlYXNpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZVRvYXN0KCR0b2FzdEVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dChpbnRlcnZhbElkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5vbkhpZGRlbiAmJiByZXNwb25zZS5zdGF0ZSAhPT0gJ2hpZGRlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkhpZGRlbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZS5zdGF0ZSA9ICdoaWRkZW4nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmVuZFRpbWUgPSBuZXcgRGF0ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1Ymxpc2gocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBkZWxheWVkSGlkZVRvYXN0KCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy50aW1lT3V0ID4gMCB8fCBvcHRpb25zLmV4dGVuZGVkVGltZU91dCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVydmFsSWQgPSBzZXRUaW1lb3V0KGhpZGVUb2FzdCwgb3B0aW9ucy5leHRlbmRlZFRpbWVPdXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXIubWF4SGlkZVRpbWUgPSBwYXJzZUZsb2F0KG9wdGlvbnMuZXh0ZW5kZWRUaW1lT3V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLmhpZGVFdGEgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKSArIHByb2dyZXNzQmFyLm1heEhpZGVUaW1lO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc3RpY2tBcm91bmQoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dChpbnRlcnZhbElkKTtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXIuaGlkZUV0YSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuc3RvcCh0cnVlLCB0cnVlKVtvcHRpb25zLnNob3dNZXRob2RdKFxuICAgICAgICAgICAgICAgICAgICAgICAge2R1cmF0aW9uOiBvcHRpb25zLnNob3dEdXJhdGlvbiwgZWFzaW5nOiBvcHRpb25zLnNob3dFYXNpbmd9XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlUHJvZ3Jlc3MoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwZXJjZW50YWdlID0gKChwcm9ncmVzc0Jhci5oaWRlRXRhIC0gKG5ldyBEYXRlKCkuZ2V0VGltZSgpKSkgLyBwcm9ncmVzc0Jhci5tYXhIaWRlVGltZSkgKiAxMDA7XG4gICAgICAgICAgICAgICAgICAgICRwcm9ncmVzc0VsZW1lbnQud2lkdGgocGVyY2VudGFnZSArICclJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBnZXRPcHRpb25zKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAkLmV4dGVuZCh7fSwgZ2V0RGVmYXVsdHMoKSwgdG9hc3RyLm9wdGlvbnMpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgaWYgKCEkY29udGFpbmVyKSB7ICRjb250YWluZXIgPSBnZXRDb250YWluZXIoKTsgfVxuICAgICAgICAgICAgICAgIGlmICgkdG9h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dXRlcykge1xuXG4gICAgcm91dGVzLmZvckVhY2goZnVuY3Rpb24gKHIpIHtcbiAgICAgICAgc2V0Um91dGUoci51cmwsIHIuY29uZmlnKTtcbiAgICB9KTtcblxuICAgICRyb3V0ZVByb3ZpZGVyLm90aGVyd2lzZSh7IHJlZGlyZWN0VG86ICcvJyB9KTtcblxuICAgIGZ1bmN0aW9uIHNldFJvdXRlKHVybCwgY29uZmlnKSB7XG5cbiAgICAgICAgJHJvdXRlUHJvdmlkZXIud2hlbih1cmwsIGNvbmZpZyk7XG5cbiAgICAgICAgcmV0dXJuICRyb3V0ZVByb3ZpZGVyO1xuICAgIH1cbn1cblxuLy8gRGVmaW5lIHRoZSByb3V0ZXMgXG5mdW5jdGlvbiBnZXRSb3V0ZXMoKSB7XG4gICAgcmV0dXJuIFtcbiAgICAgICAge1xuICAgICAgICAgICAgdXJsOiAnLycsXG4gICAgICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJy4vcHVibGljL2FwcC93ZWxjb21lL3dlbGNvbWUuaHRtbCcsXG4gICAgICAgICAgICAgICAgdGl0bGU6ICdXZWxjb21lIFBhZ2UnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvd2VsY29tZScsXG4gICAgICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJy4vcHVibGljL2FwcC93ZWxjb21lL3dlbGNvbWUuaHRtbCcsXG4gICAgICAgICAgICAgICAgdGl0bGU6ICdXZWxjb21lIFBhZ2UnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvdGhyZWF0bW9kZWwnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICcuL3B1YmxpYy9hcHAvdGhyZWF0bW9kZWxzL3JlcG9zLmh0bWwnLFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnQ2hvb3NlIGEgUmVwbycsXG4gICAgICAgICAgICAgICAgc2V0dGluZ3M6IHtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHtcbiAgICAgICAgICAgIHVybDogJy90aHJlYXRtb2RlbC86b3JnYW5pc2F0aW9uLzpyZXBvJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnLi9wdWJsaWMvYXBwL3RocmVhdG1vZGVscy9icmFuY2hlcy5odG1sJyxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ0Nob29zZSBhIEJyYW5jaCcsXG4gICAgICAgICAgICAgICAgc2V0dGluZ3M6IHtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHtcbiAgICAgICAgICAgIHVybDogJy90aHJlYXRtb2RlbC86b3JnYW5pc2F0aW9uLzpyZXBvLzpicmFuY2gnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICcuL3B1YmxpYy9hcHAvdGhyZWF0bW9kZWxzL21vZGVscy5odG1sJyxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ0Nob29zZSBhIE1vZGVsJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL3RocmVhdG1vZGVsLzpvcmdhbmlzYXRpb24vOnJlcG8vOmJyYW5jaC86bW9kZWwnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICdUaHJlYXQgTW9kZWwgRGV0YWlscycsXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICd0aHJlYXRtb2RlbHMvdGhyZWF0bW9kZWxkZXRhaWwuaHRtbCcsXG4gICAgICAgICAgICAgICAgc2V0dGluZ3M6IHtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHtcbiAgICAgICAgICAgIHVybDogJy90aHJlYXRtb2RlbC9lZGl0LzpvcmdhbmlzYXRpb24vOnJlcG8vOmJyYW5jaC86bW9kZWwnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICdFZGl0IFRocmVhdCBNb2RlbCcsXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICd0aHJlYXRtb2RlbHMvdGhyZWF0bW9kZWxlZGl0Lmh0bWwnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvdGhyZWF0bW9kZWwvcmVwb3J0LzpvcmdhbmlzYXRpb24vOnJlcG8vOmJyYW5jaC86bW9kZWwnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICdUaHJlYXQgTW9kZWwgUmVwb3J0JyxcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJy4vcHVibGljL2FwcC90aHJlYXRtb2RlbHMvd2VicmVwb3J0Lmh0bWwnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvbmV3L3RocmVhdG1vZGVsJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRpdGxlOiAnQ2hvb3NlIGEgUmVwbyBGb3IgWW91ciBOZXcgTW9kZWwnLFxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnLi9wdWJsaWMvYXBwL3RocmVhdG1vZGVscy9yZXBvcy5odG1sJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL25ldy90aHJlYXRtb2RlbC86b3JnYW5pc2F0aW9uLzpyZXBvJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRpdGxlOiAnQ2hvb3NlIGEgQnJhbmNoIEZvciBZb3VyIE5ldyBNb2RlbCcsXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICcuL3B1YmxpYy9hcHAvdGhyZWF0bW9kZWxzL2JyYW5jaGVzLmh0bWwnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvbmV3L3RocmVhdG1vZGVsLzpvcmdhbmlzYXRpb24vOnJlcG8vOmJyYW5jaCcsXG4gICAgICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICAgICAgICB0aXRsZTogJ0NyZWF0ZSBhIE5ldyBNb2RlbCcsXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICd0aHJlYXRtb2RlbHMvdGhyZWF0bW9kZWxlZGl0Lmh0bWwnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvdGhyZWF0bW9kZWwvOm9yZ2FuaXNhdGlvbi86cmVwby86YnJhbmNoLzptb2RlbC9kaWFncmFtLzpkaWFncmFtSWQnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGl0bG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07XG5cbiAgICAgICAgcmV0dXJuICRodHRwLmdldChtb2RlbHNVcmksIGNvbmZpZyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbG9hZChsb2NhdGlvbiwgZm9yY2VRdWVyeSkge1xuXG4gICAgICAgIHZhciBsb2MgPSB7XG4gICAgICAgICAgICBvcmdhbmlzYXRpb246IGxvY2F0aW9uLm9yZ2FuaXNhdGlvbixcbiAgICAgICAgICAgIHJlcG86IGxvY2F0aW9uLnJlcG8sXG4gICAgICAgICAgICBicmFuY2g6IGxvY2F0aW9uLmJyYW5jaCxcbiAgICAgICAgICAgIG1vZGVsOiBsb2NhdGlvbi5tb2RlbFxuICAgICAgICB9O1xuXG5cbiAgICAgICAgLy9kb24ndCByZWZldGNoIGlmIHRoZSBsb2NhdGlvbiBoYXMgbm90IGNoYW5nZWRcbiAgICAgICAgaWYgKHNlcnZpY2UudGhyZWF0TW9kZWwgJiYgSlNPTi5zdHJpbmdpZnkobG9jKSA9PT0gSlNPTi5zdHJpbmdpZnkoc2VydmljZS50aHJlYXRNb2RlbExvY2F0aW9uKSAmJiAhZm9yY2VRdWVyeSkge1xuICAgICAgICAgICAgcmV0dXJuICRxLndoZW4oc2VydmljZS50aHJlYXRNb2RlbCk7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgdGhyZWF0TW9kZWxVcmkgPSBidWlsZFVyaShsb2MpICsgJy9kYXRhJztcblxuICAgICAgICB2YXIgY29uZmlnID0ge1xuICAgICAgICAgICAgaGVhZGVyczogeyBBY2NlcHQ6ICdhcHBsaWNhdGlvbi9qc29uJyB9XG4gICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuICRodHRwLmdldCh0aHJlYXRNb2RlbFVyaSwgY29uZmlnKS50aGVuKG9uTG9hZGVkVGhyZWF0TW9kZWwsIG9uTG9hZEVycm9yKTtcblxuICAgICAgICBmdW5jdGlvbiBvbkxvYWRlZFRocmVhdE1vZGVsKHJlc3VsdCkge1xuICAgICAgICAgICAgc2Vydm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1xuICAgICAgICByZXR1cm4gZGF0YWNvbnRleHQucmVwb3MoJGxvY2F0aW9uLnNlYXJjaCgpLnBhZ2UpLnRoZW4oXG4gICAgICAgICAgICBmdW5jdGlvbiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICB2bS5wYWdpbmF0aW9uID0gcmVzcG9uc2UuZGF0YS5wYWdpbmF0aW9uO1xuICAgICAgICAgICAgICAgIHZtLnBhZ2luYXRpb24ucGFnZSA9IHBhcnNlSW50KHZtLnBhZ2luYXRpb24ucGFnZSwgMTApO1xuICAgICAgICAgICAgICAgIHZtLnJlcG9zID0gcmVzcG9uc2UuZGF0YS5yZXBvcztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgdm0ucmVwb3MgPSBbXTtcbiAgICAgICAgICAgICAgICBvbkVycm9yKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0QnJhbmNoZXMob3JnYW5pc2F0aW9uLCByZXBvKSB7XG4gICAgICAgIHJldHVybiBkYXRhY29udGV4dC5icmFuY2hlcyhvcmdhbmlzYXRpb24sIHJlcG8sICRsb2NhdGlvbi5zZWFyY2goKS5wYWdlKS50aGVuKFxuICAgICAgICAgICAgZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgdm0ucGFnaW5hdGlvbiA9IHJlc3BvbnNlLmRhdGEucGFnaW5hdGlvbjtcbiAgICAgICAgICAgICAgICB2bS5wYWdpbmF0aW9uLnBhZ2UgPSBwYXJzZUludCh2bS5wYWdpbmF0aW9uLnBhZ2UsIDEwKTtcbiAgICAgICAgICAgICAgICB2bS5icmFuY2hlcyA9IHJlc3BvbnNlLmRhdGEuYnJhbmNoZXM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgICAgIHZtLmJyYW5jaGVzID0gW107XG4gICAgICAgICAgICAgICAgb25FcnJvcihlcnIpO1xuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldE1vZGVscyhvcmdhbmlzYXRpb24sIHJlcG8sIGJyYW5jaCkge1xuICAgICAgICByZXR1cm4gZGF0YWNvbnRleHQubW9kZWxzKG9yZ2FuaXNhdGlvbiwgcmVwbywgYnJhbmNoKS50aGVuKFxuICAgICAgICAgICAgZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgdm0ubW9kZWxzID0gcmVzcG9uc2UuZGF0YTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgdm0ubW9kZWxzID0gW107XG4gICAgICAgICAgICAgICAgb25FcnJvcihlcnIpO1xuICAgICAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2VsZWN0QnJhbmNoKGJyYW5jaCkge1xuICAgICAgICAkbG9jYXRpb24udXJsKHVyaVByZWZpeCgpICsgJ3RocmVhdG1vZGVsLycgKyB2bS5vcmdhbmlzYXRpb24gKyAnLycgKyB2bS5yZXBvICsgJy8nICsgYnJhbmNoKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzZWxlY3RSZXBvKHJlcG9GdWxsTmFtZSkge1xuICAgICAgICAkbG9jYXRpb24udXJsKHVyaVByZWZpeCgpICsgJ3RocmVhdG1vZGVsLycgKyByZXBvRnVsbE5hbWUpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG5leHRQYWdlKCkge1xuICAgICAgICBpZiAodm0ucGFnaW5hdGlvbi5uZXh0KSB7XG4gICAgICAgICAgICAkbG9jYXRpb24uc2VhcmNoKCdwYWdlJywgdm0ucGFnaW5hdGlvbi5wYWdlICsgMSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsb2dFcnJvcignQ2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ldycpOyB9KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBsb2FkRGVtb01vZGVsKCkge1xuICAgICAgICB2YXIgbG9jID0gJ3RocmVhdG1vZGVsLyc7XG4gICAgICAgIGxvYyArPSBjb21tb25Db25maWcuY29uZmlnLmRlbW9Nb2RlbExvY2F0aW9uLm9yZ2FuaXNhdGlvbiArICcvJztcbiAgICAgICAgbG9jICs9IGNvbW1vbkNvbmZpZy5jb25maWcuZGVtb01vZGVsTG9jYXRpb24ucmVwbyArICcvJztcbiAgICAgICAgbG9jICs9IGNvbW1vbkNvbmZpZy5jb25maWcuZGVtb01vZGVsTG9jYXRpb24uYnJhbmNoICsgJy8nO1xuICAgICAgICBsb2MgKz0gY29tbW9uQ29uZmlnLmNvbmZpZy5kZW1vTW9kZWxMb2NhdGlvbi5tb2RlbDtcbiAgICAgICAgJGxvY2F0aW9uLnBhdGgobG9jKTtcbiAgICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gd2VsY29tZTsiXX0=
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci1hbmltYXRlL2FuZ3VsYXItYW5pbWF0ZS5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLWFuaW1hdGUvaW5kZXguanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci1yb3V0ZS9hbmd1bGFyLXJvdXRlLmpzIiwibm9kZV9tb2R1bGVzL2FuZ3VsYXItcm91dGUvaW5kZXguanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci11aS1ib290c3RyYXAvZGlzdC91aS1ib290c3RyYXAtdHBscy5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLXVpLWJvb3RzdHJhcC9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLXhlZGl0YWJ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XG5cbiAgICAgICAgICAgIHRpbWluZ3MgPSBjb21wdXRlVGltaW5ncyhub2RlLCBmdWxsQ2xhc3NOYW1lLCBjYWNoZUtleSwgZmFsc2UpO1xuICAgICAgICAgICAgcmVsYXRpdmVEZWxheSA9IHRpbWluZ3MubWF4RGVsYXk7XG4gICAgICAgICAgICBtYXhEZWxheSA9IE1hdGgubWF4KHJlbGF0aXZlRGVsYXksIDApO1xuICAgICAgICAgICAgbWF4RHVyYXRpb24gPSB0aW1pbmdzLm1heER1cmF0aW9uO1xuXG4gICAgICAgICAgICBpZiAobWF4RHVyYXRpb24gPT09IDApIHtcbiAgICAgICAgICAgICAgY2xvc2UoKTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmbGFncy5oYXNUcmFuc2l0aW9ucyA9IHRpbWluZ3MudHJhbnNpdGlvbkR1cmF0aW9uID4gMDtcbiAgICAgICAgICAgIGZsYWdzLmhhc0FuaW1hdGlvbnMgPSB0aW1pbmdzLmFuaW1hdGlvbkR1cmF0aW9uID4gMDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmxhZ3MuYXBwbHlBbmltYXRpb25EZWxheSkge1xuICAgICAgICAgICAgcmVsYXRpdmVEZWxheSA9IHR5cGVvZiBvcHRpb25zLmRlbGF5ICE9PSAnYm9vbGVhbicgJiYgdHJ1dGh5VGltaW5nVmFsdWUob3B0aW9ucy5kZWxheSlcbiAgICAgICAgICAgICAgICAgID8gcGFyc2VGbG9hdChvcHRpb25zLmRlbGF5KVxuICAgICAgICAgICAgICAgICAgOiByZWxhdGl2ZURlbGF5O1xuXG4gICAgICAgICAgICBtYXhEZWxheSA9IE1hdGgubWF4KHJlbGF0aXZlRGVsYXksIDApO1xuICAgICAgICAgICAgdGltaW5ncy5hbmltYXRpb25EZWxheSA9IHJlbGF0aXZlRGVsYXk7XG4gICAgICAgICAgICBkZWxheVN0eWxlID0gZ2V0Q3NzRGVsYXlTdHlsZShyZWxhdGl2ZURlbGF5LCB0cnVlKTtcbiAgICAgICAgICAgIHRlbXBvcmFyeVN0eWxlcy5wdXNoKGRlbGF5U3R5bGUpO1xuICAgICAgICAgICAgbm9kZS5zdHlsZVtkZWxheVN0eWxlWzBdXSA9IGRlbGF5U3R5bGVbMV07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgbWF4RGVsYXlUaW1lID0gbWF4RGVsYXkgKiBPTkVfU0VDT05EO1xuICAgICAgICAgIG1heER1cmF0aW9uVGltZSA9IG1heER1cmF0aW9uICogT05FX1NFQ09ORDtcblxuICAgICAgICAgIGlmIChvcHRpb25zLmVhc2luZykge1xuICAgICAgICAgICAgdmFyIGVhc2VQcm9wLCBlYXNlVmFsID0gb3B0aW9ucy5lYXNpbmc7XG4gICAgICAgICAgICBpZiAoZmxhZ3MuaGFzVHJhbnNpdGlvbnMpIHtcbiAgICAgICAgICAgICAgZWFzZVByb3AgPSBUUkFOU0lUSU9OX1BST1AgKyBUSU1JTkdfS0VZO1xuICAgICAgICAgICAgICB0ZW1wb3JhcnlTdHlsZXMucHVzaChbZWFzZVByb3AsIGVhc2VWYWxdKTtcbiAgICAgICAgICAgICAgbm9kZS5zdHlsZVtlYXNlUHJvcF0gPSBlYXNlVmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGZsYWdzLmhhc0FuaW1hdGlvbnMpIHtcbiAgICAgICAgICAgICAgZWFzZVByb3AgPSBBTklNQVRJT05fUFJPUCArIFRJTUlOR19LRVk7XG4gICAgICAgICAgICAgIHRlbXBvcmFyeVN0eWxlcy5wdXNoKFtlYXNlUHJvcCwgZWFzZVZhbF0pO1xuICAgICAgICAgICAgICBub2RlLnN0eWxlW2Vhc2VQcm9wXSA9IGVhc2VWYWw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHRpbWluZ3MudHJhbnNpdGlvbkR1cmF0aW9uKSB7XG4gICAgICAgICAgICBldmVudHMucHVzaChUUkFOU0lUSU9ORU5EX0VWRU5UKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodGltaW5ncy5hbmltYXRpb25EdXJhdGlvbikge1xuICAgICAgICAgICAgZXZlbnRzLnB1c2goQU5JTUFUSU9ORU5EX0VWRU5UKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBzdGFydFRpbWUgPSBEYXRlLm5vdygpO1xuICAgICAgICAgIHZhciB0aW1lclRpbWUgPSBtYXhEZWxheVRpbWUgKyBDTE9TSU5HX1RJTUVfQlVGRkVSICogbWF4RHVyYXRpb25UaW1lO1xuICAgICAgICAgIHZhciBlbmRUaW1lID0gc3RhcnRUaW1lICsgdGltZXJUaW1lO1xuXG4gICAgICAgICAgdmFyIGFuaW1hdGlvbnNEYXRhID0gZWxlbWVudC5kYXRhKEFOSU1BVEVfVElNRVJfS0VZKSB8fCBbXTtcbiAgICAgICAgICB2YXIgc2V0dXBGYWxsYmFja1RpbWVyID0gdHJ1ZTtcbiAgICAgICAgICBpZiAoYW5pbWF0aW9uc0RhdGEubGVuZ3RoKSB7XG4gICAgICAgICAgICB2YXIgY3VycmVudFRpbWVyRGF0YSA9IGFuaW1hdGlvbnNEYXRhWzBdO1xuICAgICAgICAgICAgc2V0dXBGYWxsYmFja1RpbWVyID0gZW5kVGltZSA+IGN1cnJlbnRUaW1lckRhdGEuZXhwZWN0ZWRFbmRUaW1lO1xuICAgICAgICAgICAgaWYgKHNldHVwRmFsbGJhY2tUaW1lcikge1xuICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwoY3VycmVudFRpbWVyRGF0YS50aW1lcik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBhbmltYXRpb25zRGF0YS5wdXNoKGNsb3NlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc2V0dXBGYWxsYmFja1RpbWVyKSB7XG4gICAgICAgICAgICB2YXIgdGltZXIgPSAkdGltZW91dChvbkFuaW1hdGlvbkV4cGlyZWQsIHRpbWVyVGltZSwgZmFsc2UpO1xuICAgICAgICAgICAgYW5pbWF0aW9uc0RhdGFbMF0gPSB7XG4gICAgICAgICAgICAgIHRpbWVyOiB0aW1lcixcbiAgICAgICAgICAgICAgZXhwZWN0ZWRFbmRUaW1lOiBlbmRUaW1lXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYW5pbWF0aW9uc0RhdGEucHVzaChjbG9zZSk7XG4gICAgICAgICAgICBlbGVtZW50LmRhdGEoQU5JTUFURV9USU1FUl9LRVksIGFuaW1hdGlvbnNEYXRhKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZXZlbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgZWxlbWVudC5vbihldmVudHMuam9pbignICcpLCBvbkFuaW1hdGlvblByb2dyZXNzKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAob3B0aW9ucy50bykge1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMuY2xlYW51cFN0eWxlcykge1xuICAgICAgICAgICAgICByZWdpc3RlclJlc3RvcmFibGVTdHlsZXMocmVzdG9yZVN0eWxlcywgbm9kZSwgT2JqZWN0LmtleXMob3B0aW9ucy50bykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXBwbHlBbmltYXRpb25Ub1N0eWxlcyhlbGVtZW50LCBvcHRpb25zKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBvbkFuaW1hdGlvbkV4cGlyZWQoKSB7XG4gICAgICAgICAgdmFyIGFuaW1hdGlvbnNEYXRhID0gZWxlbWVudC5kYXRhKEFOSU1BVEVfVElNRVJfS0VZKTtcblxuICAgICAgICAgIC8vIHRoaXMgd2lsbCBiZSBmYWxzZSBpbiB0aGUgZXZlbnQgdGhhdCB0aGUgZWxlbWVudCB3YXNcbiAgICAgICAgICAvLyByZW1vdmVkIGZyb20gdGhlIERP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bml0RHJpdmVyRm4oYW5pbWF0aW9uRGV0YWlscykge1xuICAgICAgcmV0dXJuIGFuaW1hdGlvbkRldGFpbHMuZnJvbSAmJiBhbmltYXRpb25EZXRhaWxzLnRvXG4gICAgICAgICAgPyBwcmVwYXJlRnJvbVRvQW5jaG9yQW5pbWF0aW9uKGFuaW1hdGlvbkRldGFpbHMuZnJvbSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uRGV0YWlscy50byxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uRGV0YWlscy5jbGFzc2VzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb25EZXRhaWxzLmFuY2hvcnMpXG4gICAgICAgICAgOiBwcmVwYXJlUmVndWxhckFuaW1hdGlvbihhbmltYXRpb25EZXRhaWxzKTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gZmlsdGVyQ3NzQ2xhc3NlcyhjbGFzc2VzKSB7XG4gICAgICAvL3JlbW92ZSBhbGwgdGhlIGBuZy1gIHN0dWZmXG4gICAgICByZXR1cm4gY2xhc3Nlcy5yZXBsYWNlKC9cXGJuZy1cXFMrXFxiL2csICcnKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRVbmlxdWVWYWx1ZXMoYSwgYikge1xuICAgICAgaWYgKGlzU3RyaW5nKGEpKSBhID0gYS5zcGxpdCgnICcpO1xuICAgICAgaWYgKGlzU3RyaW5nKGIpKSBiID0gYi5zcGxpdCgnICcpO1xuICAgICAgcmV0dXJuIGEuZmlsdGVyKGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICByZXR1cm4gYi5pbmRleE9mKHZhbCkgPT09IC0xO1xuICAgICAgfSkuam9pbignICcpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHByZXBhcmVBbmNob3JlZEFuaW1hdGlvbihjbGFzc2VzLCBvdXRBbmN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iAgICAgIHZhciBzdGFydGluZ0FuaW1hdG9yID0gYW5pbWF0b3JPdXQgfHwgYW5pbWF0b3JJbjtcblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBydW5uZXI7XG5cbiAgICAgICAgICB2YXIgY3VycmVudEFuaW1hdGlvbiA9IHN0YXJ0aW5nQW5pbWF0b3Iuc3RhcnQoKTtcbiAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIGlmICghYW5pbWF0b3JJbikge1xuICAgICAgICAgICAgICBhbmltYXRvckluID0gcHJlcGFyZUluQW5pbWF0aW9uKCk7XG4gICAgICAgICAgICAgIGlmIChhbmltYXRvckluKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudEFuaW1hdGlvbiA9IGFuaW1hdG9ySW4uc3RhcnQoKTtcbiAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIGVuZCgpO1xuICAgICAgICAgICAgICAgICAgcnVubmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnRBbmltYXRpb247XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGluIHRoZSBldmVudCB0aGF0IHRoZXJlIGlzIG5vIGBpbmAgYW5pbWF0aW9uXG4gICAgICAgICAgICBlbmQoKTtcbiAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSgpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcnVubmVyID0gbmV3ICQkQW5pbWF0Z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k7XG4gICAgICB2YXIgdG9BbmltYXRpb24gPSBwcmVwYXJlUmVndWxhckFuaW1hdGlvbih0bywgbm9vcCk7XG5cbiAgICAgIHZhciBhbmNob3JBbmltYXRpb25zID0gW107XG4gICAgICBmb3JFYWNoKGFuY2hvcnMsIGZ1bmN0aW9uKGFuY2hvcikge1xuICAgICAgICB2YXIgb3V0RWxlbWVudCA9IGFuY2hvclsnb3V0J107XG4gICAgICAgIHZhciBpbkVsZW1lbnQgPSBhbmNob3JbJ2luJ107XG4gICAgICAgIHZhciBhbmltYXRvciA9IHByZXBhcmVBbmNob3JlZEFuaW1hdGlvbihjbGFzc2VzLCBvdXRFbGVtZW50LCBpbkVsZW1lbnQpO1xuICAgICAgICBpZiAoYW5pbWF0b3IpIHtcbiAgICAgICAgICBhbmNob3JBbmltYXRpb25zLnB1c2goYW5pbWF0b3IpO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgLy8gbm8gcG9pbnQgaW4gZG9pbmcgYW55dGhpbmcgd2hlbiB0aGVyZSBhcmUgbm8gZWxlbWVudHMgdG8gYW5pbWF0ZVxuICAgICAgaWYgKCFmcm9tQW5pbWF0aW9uICYmICF0b0FuaW1hdGlvbiAmJiBhbmNob3JBbmltYXRpb25zLmxlbmd0aCA9PT0gMCkgcmV0dXJuO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICBzdGFydDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGFuaW1hdGlvblJ1bm5lcnMgPSBbXTtcblxuICAgICAgICAgIGlmIChmcm9tQW5pbWF0aW9uKSB7XG4gICAgICAgICAgICBhbmltYXRpb25SdW5uZXJzLnB1c2goZnJvbUFuaW1hdGlvbi5zdGFydCgpKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodG9BbmltYXRpb24pIHtcbiAgICAgICAgICAgIGFuaW1hdGlvblJ1bm5lcnMucHVzaCh0b0FuaW1hdGlvbi5zdGFydCgpKTtcbiAgICAgICAgICB9X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gICAgICAgICAgY2xvc2UoKTtcbiAgICAgICAgICAgIHJ1bm5lciA9IG5ldyAkJEFuaW1hdGVSdW5uZXIoKTtcbiAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSh0cnVlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHJ1bm5lcjtcbiAgICAgICAgfSxcbiAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmIChydW5uZXIpIHtcbiAgICAgICAgICAgIHJldHVybiBydW5uZXI7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcnVubmVyID0gbmV3ICQkQW5pbWF0ZVJ1bm5lcigpO1xuICAgICAgICAgIHZhciBjbG9zZUFjdGl2ZUFuaW1hdGlvbnM7XG4gICAgICAgICAgdmFyIGNoYWluID0gW107XG5cbiAgICAgICAgICBpZiAoYmVmb3JlKSB7XG4gICAgICAgICAgICBjaGFpbi5wdXNoKGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgICAgIGNsb3NlQWN0aXZlQW5pbWF0aW9ucyA9IGJlZm9yZShmbik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoY2hhaW4ubGVuZ3RoKSB7XG4gICAgICAgICAgICBjaGFpbi5wdXNoKGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgICAgIGFwcGx5T3B0aW9ucygpO1xuICAgICAgICAgICAgICBmbih0cnVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhcHBseU9wdGlvbnMoKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoYWZ0ZXIpIHtcbiAgICAgICAgICAgIGNoYWluLnB1c2goZnVuY3Rpb24oZm4pIHtcbiAgICAgICAgICAgICAgY2xvc2VBY3RpdmVBbmltYXRpb25zID0gYWZ0ZXIoZm4pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcnVubmVyLnNldEhvc3Qoe1xuICAgICAgICAgICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgZW5kQW5pbWF0aW9ucygpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNhbmNlbDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGVuZEFuaW1hdGlvbnModHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAkJEFuaW1hdGVSdW5uZXIuY2hhaW4oY2hhaW4sIG9uQ29tcGxldGUpO1xuICAgICAgICAgIHJldHVybiBydW5uZXI7XG5cbiAgICAgICAgICBmdW5jdGlvbiBvbkNvbXBsZXRlKHN1Y2Nlc3MpIHtcbiAgICAgICAgICAgIGNsb3NlKHN1Y2Nlc3MpO1xuICAgICAgICAgICAgcnVubmVyLmNvbXBsZXRlKHN1Y2Nlc3MpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGZ1bmN0aW9uIGVuZEFuaW1hdGlvbnMoY2FuY2VsbGVkKSB7XG4gICAgICAgICAgICBpZiAoIWFuaW1hdGlvbkNsb3NlZCkge1xuICAgICAgICAgICAgICAoY2xvc2VBY3RpdmVBbmltYXRpb25zIHx8IG5vb3ApKGNhbmNlbGxlZCk7XG4gICAgICAgICAgICAgIG9uQ29tcGxldGUoY2FuY2VsbGVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIGZ1bmN0aW9uIGV4ZWN1dGVBbmltYXRpb25GbihmbiwgZWxlbWVudCwgZXZlbnQsIG9wdGlvbnMsIG9uRG9uZSkge1xuICAgICAgICB2YXIgYXJncztcbiAgICAgICAgc3dpdGNoIChldmVudCkge1xuICAgICAgICAgIGNhc2UgJ2FuaW1hdGUnOlxuICAgICAgICAgICAgYXJncyA9IFtlbGVtZW50LCBvcHRpb25zLmZyb20sIG9wdGlvb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0dXJuIHZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBub29wO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsIGV2ZW50LCBvcHRpb25zLCBhbmltYXRpb25zLCBmbk5hbWUpIHtcbiAgICAgICAgdmFyIG9wZXJhdGlvbnMgPSBbXTtcbiAgICAgICAgZm9yRWFjaChhbmltYXRpb25zLCBmdW5jdGlvbihhbmkpIHtcbiAgICAgICAgICB2YXIgYW5pbWF0aW9uID0gYW5pW2ZuTmFtZV07XG4gICAgICAgICAgaWYgKCFhbmltYXRpb24pIHJldHVybjtcblxuICAgICAgICAgIC8vIG5vdGUgdGhhdCBhbGwgb2YgdGhlc2UgYW5pbWF0aW9ucyB3aWxsIHJ1biBpbiBwYXJhbGxlbFxuICAgICAgICAgIG9wZXJhdGlvbnMucHVzaChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBydW5uZXI7XG4gICAgICAgICAgICB2YXIgZW5kUHJvZ3Jlc3NDYjtcblxuICAgICAgICAgICAgdmFyIHJlc29sdmVkID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgb25BbmltYXRpb25Db21wbGV0ZSA9IGZ1bmN0aW9uKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIGlmICghcmVzb2x2ZWQpIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgKGVuZFByb2dyZXNzQ2IgfHwgbm9vcCkocmVqZWN0ZWQpO1xuICAgICAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSghcmVqZWN0ZWQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBydW5uZXIgPSBuZXcgJCRBbmltYXRlUnVubmVyKHtcbiAgICAgICAgICAgICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICA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Rpb25zLCAnYmVmb3JlUmVtb3ZlQ2xhc3MnKTtcbiAgICAgICAgICAgIGIgPSBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsICdhZGRDbGFzcycsIG9wdGlvbnMsIGFuaW1hdGlvbnMsICdiZWZvcmVBZGRDbGFzcycpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoZm5OYW1lID09PSAnc2V0Q2xhc3MnKSB7XG4gICAgICAgICAgICBhID0gZ3JvdXBFdmVudGVkQW5pbWF0aW9ucyhlbGVtZW50LCAncmVtb3ZlQ2xhc3MnLCBvcHRpb25zLCBhbmltYXRpb25zLCAncmVtb3ZlQ2xhc3MnKTtcbiAgICAgICAgICAgIGIgPSBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsICdhZGRDbGFzcycsIG9wdGlvbnMsIGFuaW1hdGlvbnMsICdhZGRDbGFzcycpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChhKSB7XG4gICAgICAgICAgICBvcGVyYXRpb25zID0gb3BlcmF0aW9ucy5jb25jYXQoYSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChiKSB7XG4gICAgICAgICAgICBvcGVyYXRpb25zID0gb3BlcmF0aW9ucy5jb25jYXQoYik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG9wZXJhdGlvbnMubGVuZ3RoID09PSAwKSByZXR1cm47XG5cbiAgICAgICAgLy8gVE9ETyhtYXRza28pOiBhZGQgZG9jdW1lbnRhdGlvblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gc3RhcnRBbmltYXRpb24oY2FsbGJhY2spIHtcbiAgICAgICAgICB2YXIgcnVubmVycyA9IFtdO1xuICAgICAgICAgIGlmIChvcGVyYXRpb25zLmxlbmd0aCkge1xuICAgICAgICAgICAgZm9yRWFjaChvcGVyYXRpb25zLCBmdW5jdGlvbihhbmltYXRlRm4pIHtcbiAgICAgICAgICAgICAgcnVubmVycy5wdXNoKGFuaW1hdGVGbigpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChydW5uZXJzLmxlbmd0aCkge1xuICAgICAgICAgICAgJCRBbmltYXRlUnVubmVyLmFsbChydW5uZXJzLCBjYWxsYmFjayk7XG4gICAgICAgICAgfSAgZWxzZSB7XG4gICAgICAgICAgICBjYWxsYmFjaygpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBmdW5jdGlvbiBlbmRGbihyZWplY3QpIHtcbiAgICAgICAgICAgIGZvckVhY2gocnVubmVycywgZnVuY3Rpb24ocnVubmVyKSB7XG4gICAgICAgICAgICAgIGlmIChyZWplY3QpIHtcbiAgICAgICAgICAgICAgICBydW5uZXIuY2FuY2VsKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcnVubmVyLmVuZCgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9O1xuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG5cbiAgICBmdW5jdGlvbiBsb29rdXBBbmltYXRpb25zKGNsYXNzZXMpIHtcbiAgICAgIGNsYXNzZXMgPSBpc0FycmF5KGNsYXNzZXMpID8gY2xhc3NlcyA6IGNsYXNzZXMuc3BsaXQoJyAnKTtcbiAgICAgIHZhciBtYXRjaGVzID0gW10sIGZsYWdNYXAgPSB7fTtcbiAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2xhc3Nlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIga2xhc3MgPSBjbGFzc2VzW2ldLFxuICAgICAgICAgICAgYW5pbWF0aW9uRmFjdG9yeSA9ICRhbmltYXRlUHJvdmlkZXIuJCRyZWdpc3RlcmVkQW5pbWF0aW9uc1trbGFzc107XG4gICAgICAgIGlmIChhbmltYXRpb25GYWN0b3J5ICYmICFmbGFnTWFwW2tsYXNzXSkge1xuICAgICAgICAgIG1hdGNo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W1hdGlvblJ1bm5lcnMucHVzaChmcm9tQW5pbWF0aW9uLnN0YXJ0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodG9BbmltYXRpb24pIHtcbiAgICAgICAgICAgICAgYW5pbWF0aW9uUnVubmVycy5wdXNoKHRvQW5pbWF0aW9uLnN0YXJ0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAkJEFuaW1hdGVSdW5uZXIuYWxsKGFuaW1hdGlvblJ1bm5lcnMsIGRvbmUpO1xuXG4gICAgICAgICAgICB2YXIgcnVubmVyID0gbmV3ICQkQW5pbWF0ZVJ1bm5lcih7XG4gICAgICAgICAgICAgIGVuZDogZW5kRm5GYWN0b3J5KCksXG4gICAgICAgICAgICAgIGNhbmNlbDogZW5kRm5GYWN0b3J5KClcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gcnVubmVyO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBlbmRGbkZhY3RvcnkoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBmb3JFYWNoKGFuaW1hdGlvblJ1bm5lcnMsIGZ1bmN0aW9uKHJ1bm5lcikge1xuICAgICAgICAgICAgICAgICAgLy8gYXQgdGhpcyBwb2ludCB3ZSBjYW5ub3QgY2FuY2VsIGFuaW1hdGlvbnMgZm9yIGdyb3VwcyBqdXN0IHlldC4gMS41K1xuICAgICAgICAgICAgICAgICAgcnVubmVyLmVuZCgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBkb25lKHN0YXR1cykge1xuICAgICAgICAgICAgICBydW5uZXIuY29tcGxldGUoc3RhdHVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4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AganFMaXRlKGNvbnRhaW5lcikub24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGFuaW1hdGlvbkRldGFpbHMgPSBhY3RpdmVBbmltYXRpb25zTG9va3VwLmdldChub2RlKTtcblxuICAgICAgICAgIGlmICghYW5pbWF0aW9uRGV0YWlscykge1xuICAgICAgICAgICAgLy8gSWYgdGhlcmUncyBhbiBhbmltYXRpb24gb25nb2luZywgdGhlIGNhbGxiYWNrIGNhbGxpbmcgY29kZSB3aWxsIHJlbW92ZVxuICAgICAgICAgICAgLy8gdGhlIGV2ZW50IGxpc3RlbmVycy4gSWYgd2UnZCByZW1vdmUgaGVyZSwgdGhlIGNhbGxiYWNrcyB3b3VsZCBiZSByZW1vdmVkXG4gICAgICAgICAgICAvLyBiZWZvcmUgdGhlIGFuaW1hdGlvbiBlbmRzXG4gICAgICAgICAgICAkYW5pbWF0ZS5vZmYoZXZlbnQsIGNvbnRhaW5lciwgY2FsbGJhY2spO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9LFxuXG4gICAgICBvZmY6IGZ1bmN0aW9uKGV2ZW50LCBjb250YWluZXIsIGNhbGxiYWNrKSB7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxICYmICFpc1N0cmluZyhhcmd1bWVudHNbMF0pKSB7XG4gICAgICAgICAgY29udGFpbmVyID0gYXJndW1lbnRzWzBdO1xuICAgICAgICAgIGZvciAodmFyIGV2ZW50VHlwZSBpbiBjYWxsYmFja1JlZ2lzdHJ5KSB7XG4gICAgICAgICAgICBjYWxsYmFja1JlZ2lzdHJ5W2V2ZW50VHlwZV0gPSBmaWx0ZXJGcm9tUmVnaXN0cnkoY2FsbGJhY2tSZWdpc3RyeVtldmVudFR5cGVdLCBjb250YWluZXIpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBlbnRyaWVzID0gY2Fsb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gICAgICAvLyAgKGVsZW1lbnQsIGJvb2wpIC0gZWxlbWVudCBzZXR0ZXI8RjM3PlxuICAgICAgZW5hYmxlZDogZnVuY3Rpb24oZWxlbWVudCwgYm9vbCkge1xuICAgICAgICB2YXIgYXJnQ291bnQgPSBhcmd1bWVudHMubGVuZ3RoO1xuXG4gICAgICAgIGlmIChhcmdDb3VudCA9PT0gMCkge1xuICAgICAgICAgIC8vICgpIC0gR2xvYmFsIGdldHRlclxuICAgICAgICAgIGJvb2wgPSAhIWFuaW1hdGlvbnNFbmFibGVkO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhciBoYXNFbGVtZW50ID0gaXNFbGVtZW50KGVsZW1lbnQpO1xuXG4gICAgICAgICAgaWYgKCFoYXNFbGVtZW50KSB7XG4gICAgICAgICAgICAvLyAoYm9vbCkgLSBHbG9iYWwgc2V0dGVyXG4gICAgICAgICAgICBib29sID0gYW5pbWF0aW9uc0VuYWJsZWQgPSAhIWVsZW1lbnQ7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBub2RlID0gZ2V0RG9tTm9kZShlbGVtZW50KTtcblxuICAgICAgICAgICAgaWYgKGFyZ0NvdW50ID09PSAxKSB7XG4gICAgICAgICAgICAgIC8vIChlbGVtZW50KSAtIEVsZW1lbnQgZ2V0dGVyXG4gICAgICAgICAgICAgIGJvb2wgPSAhZGlzYWJsZWRFbGVtZW50c0xvb2t1cC5nZXQobm9kZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAvLyAoZWxlbWVudCwgYm9vbCkgLSBFbGVtZW50IHNldHRlclxuICAgICAgICAgICAgICBpZiAoIWRpc2FibGVkRWxlbWVudHNMb29rdXAuaGFzKG5vZGUpKSB7XG4gICAgICAgICAgICAgICAgLy8gVGhlIGVsZW1lbnQgaXMgYWRkZWQgdG8gdGhlIG1hcCBmb3IgdGhlIGZpcnN0IHRpbWUuXG4gICAgICAgICAgICAgICAgLy8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tpXSA9IHtcbiAgICAgICAgICBkb21Ob2RlOiBhbmltYXRpb24uZG9tTm9kZSxcbiAgICAgICAgICBlbGVtZW50OiBhbmltYXRpb24uZWxlbWVudCxcbiAgICAgICAgICBmbjogYW5pbWF0aW9uLmZuLFxuICAgICAgICAgIGNoaWxkcmVuOiBbXVxuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgICAgZm9yIChpID0gMDsgaSA8IGFuaW1hdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgcHJvY2Vzc05vZGUoYW5pbWF0aW9uc1tpXSk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBmbGF0dGVuKHRyZWUpO1xuXG4gICAgICBmdW5jdGlvbiBwcm9jZXNzTm9kZShlbnRyeSkge1xuICAgICAgICBpZiAoZW50cnkucHJvY2Vzc2VkKSByZXR1cm4gZW50cnk7XG4gICAgICAgIGVudHJ5LnByb2Nlc3NlZCA9IHRydWU7XG5cbiAgICAgICAgdmFyIGVsZW1lbnROb2RlID0gZW50cnkuZG9tTm9kZTtcbiAgICAgICAgdmFyIHBhcmVudE5vZGUgPSBlbGVtZW50Tm9kZS5wYXJlbnROb2RlO1xuICAgICAgICBsb29rdXAuc2V0KGVsZW1lbnROb2RlLCBlbnRyeSk7XG5cbiAgICAgICAgdmFyIHBhcmVudEVudHJ5O1xuICAgICAgICB3aGlsZSAocGFyZW50Tm9kZSkge1xuICAgICAgICAgIHBhcmVudEVudHJ5ID0gbG9va3VwLmdldChwYXJlbnROb2RlKTtcbiAgICAgICAgICBpZiAocGFyZW50RW50cnkpIHtcbiAgICAgICAgICAgIGlmICghcGFyZW50RW50cnkucHJvY2Vzc2VkKSB7XG4gICAgICAgICAgICAgIHBhcmVudEVudHJ5ID0gcHJvY2Vzc05vZGUocGFyZW50RW50cnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBhcmVudE5vZGUgPSBwYXJlbnROb2RlLnBhcmVudE5vZGU7XG4gICAgICAgIH1cblxuICAgICAgICAocGFyZW50RW50cnkgfHwgdHJlZSkuY2hpbGRyZW4ucHVzaChlbnRyeSk7XG4gICAgICAgIHJldHVybiBlbnRyeTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gZmxhdHRlbih0cmVlKSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICAgICAgdmFyIHF1ZXVlID0gW107XG4gICAgICAgIHZhciBpO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0cmVlLmNoaWxkcmVuLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgcXVldWUucHVzaCh0cmVlLmNoaWxkcmVuW2ldKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciByZW1haW5pbmdMZXZlbEVudHJpZXMgPSBxdWV1ZS5sZW5ndGg7XG4gICAgICAgIHZhciBuZXh0TGV2ZWxFbnRyaWVzID0gMDtcbiAgICAgICAgdmFyIHJvdyA9IFtdO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgIHZhciBlbnRyeSA9IHF1ZXVlW2ldO1xuICAgICAgICAgIGlmIChyZW1haW5pbmdMZXZlbEVudHJpZXMgPD0gMCkge1xuICAgICAgICAgICAgcmVtYWluaW5nTGV2ZWxFbnRyaWVzID0gbmV4dExldmVsRW50cmllcztcbiAgICAgICAgICAgIG5leHRMZXZlbEVudHJpZXMgPSAwO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2gocm93KTtcbiAgICAgICAgICAgIHJvdyA9IFtdO1xuICAgICAgICAgIH1cbiAgICAgICAgICByb3cucHVzaChlbnRyeSk7XG4gICAgICAgICAgZW50cnkuY2hpbGRyZW4uZm9yRWFjaChmdW5jdGlvbihjaGlsZEVudHJ5KSB7XG4gICAgICAgICAgICBuZXh0TGV2ZWxFbnRyaWVzKys7XG4gICAgICAgICAgICBxdWV1Z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ZGlnZXN0IHJ1bnMgb3JcbiAgICAgICAgICAgICAgLy8gZHVyaW5nIHRoZSBSQUYgc2VxdWVuY2luZyB0aGVuIHdlIHNob3VsZCBub3QgdHJpZ2dlciB0aGUgYW5pbWF0aW9uLlxuICAgICAgICAgICAgICB2YXIgdGFyZ2V0RWxlbWVudCA9IGFuaW1hdGlvbkVudHJ5LmFuY2hvcnNcbiAgICAgICAgICAgICAgICAgID8gKGFuaW1hdGlvbkVudHJ5LmZyb20uZWxlbWVudCB8fCBhbmltYXRpb25FbnRyeS50by5lbGVtZW50KVxuICAgICAgICAgICAgICAgICAgOiBhbmltYXRpb25FbnRyeS5lbGVtZW50O1xuXG4gICAgICAgICAgICAgIGlmIChnZXRSdW5uZXIodGFyZ2V0RWxlbWVudCkpIHtcbiAgICAgICAgICAgICAgICB2YXIgb3BlcmF0aW9uID0gaW52b2tlRmlyc3REcml2ZXIoYW5pbWF0aW9uRW50cnkpO1xuICAgICAgICAgICAgICAgIGlmIChvcGVyYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgIHN0YXJ0QW5pbWF0aW9uRm4gPSBvcGVyYXRpb24uc3RhcnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKCFzdGFydEFuaW1hdGlvbkZuKSB7XG4gICAgICAgICAgICAgICAgY2xvc2VGbigpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBhbmltYXRpb25SdW5uZXIgPSBzdGFydEFuaW1hdGlvbkZuKCk7XG4gICAgICAgICAgICAgICAgYW5pbWF0aW9uUnVubmVyLmRvbmUoZnVuY3Rpb24oc3RhdHVzKSB7XG4gICAgICAgICAgICAgICAgICBjbG9zZUZuKCFzdGF0dXMpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHVwZGF0ZUFuaW1hdGlvblJ1bm5lcnMoYW5pbWF0aW9uRW50cnksIGFuaW1hd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pYnV0ZShOR19BTklNQVRFX1JFRl9BVFRSKTtcbiAgICAgICAgICAgICAgcmVmTG9va3VwW2tleV0gPSByZWZMb29rdXBba2V5XSB8fCB7fTtcbiAgICAgICAgICAgICAgcmVmTG9va3VwW2tleV1bZGlyZWN0aW9uXSA9IHtcbiAgICAgICAgICAgICAgICBhbmltYXRpb25JRDogaW5kZXgsXG4gICAgICAgICAgICAgICAgZWxlbWVudDoganFMaXRlKGFuY2hvcilcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChhbmltYXRpb24pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgdmFyIHVzZWRJbmRpY2VzTG9va3VwID0ge307XG4gICAgICAgIHZhciBhbmNob3JHcm91cHMgPSB7fTtcbiAgICAgICAgZm9yRWFjaChyZWZMb29rdXAsIGZ1bmN0aW9uKG9wZXJhdGlvbnMsIGtleSkge1xuICAgICAgICAgIHZhciBmcm9tID0gb3BlcmF0aW9ucy5mcm9tO1xuICAgICAgICAgIHZhciB0byA9IG9wZXJhdGlvbnMudG87XG5cbiAgICAgICAgICBpZiAoIWZyb20gfHwgIXRvKSB7XG4gICAgICAgICAgICAvLyBvbmx5IG9uZSBvZiB0aGVzZSBpcyBzZXQgdGhlcmVmb3JlIHdlIGNhbid0IGhhdmUgYW5cbiAgICAgICAgICAgIC8vIGFuY2hvciBhbmltYXRpb24gc2luY2UgYWxsIHRocmVlIHBpZWNlcyBhcmUgcmVxdWlyZWRcbiAgICAgICAgICAgIHZhciBpbmRleCA9IGZyb20gPyBmcm9tLmFuaW1hdGlvbklEIDogdG8uYW5pbWF0aW9uSUQ7XG4gICAgICAgICAgICB2YXIgaW5kZXhLZXkgPSBpbmRleC50b1N0cmluZygpO1xuICAgICAgICAgICAgaWYgKCF1c2VkSW5kaWNlc0xvb2t1cFtpbmRleEtleV0pIHtcbiAgICAgICAgICAgICAgdXNlZEluZGljZXNMb29rdXBbaW5kZXhLZXldID0gdHJ1ZTtcbiAgICAgICAgICAgICAgcHJlcGFyZWRBbmltYXRpb25zLnB1c2goYW5pbWF0aW9uc1tpbmRleF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBmcm9tQW5pbWF0aW9uID0gYW5pbWF0aW9uc1tmcm9tLmFuaW1hdGlvbklEXTtcbiAgICAgICAgICB2YXIgdG9BbmltYXRpb24gPSBhbmltYXRpb25zW3RvLmFuaW1hdGlvbklEXTtcbiAgICAgICAgICB2YXIgbG9va3VwS2V5ID0gZnJvbS5hbmltYXRpb25JRC50b1N0cmluZygpO1xuICAgICAgICAgIGlmICghYW5jaG9yR3JvdXBzW2xvb2t1cEtleV0pIHtcbiAgICAgICAgICAgIHZhciBncm91cCA9IGFuY2hvckdyb3Vwc1tsb29rdXBLZXldID0ge1xuICAgICAgICAgICAgICBzdHJ1Y3R1cmFsOiB0cnVlLFxuICAgICAgICAgICAgICBiZWZvcmVTdGFydDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgZnJvbUFuaW1hdGlvbi5iZWZvcmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIHRvQW5pbWF0aW9uLmJlZm9yZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGNsb3NlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBmcm9tQW5pbWF0aW9uLmNsb3NlKCk7XG4gICAgICAgICAgICAgICAgdG9BbmltYXRpb24uY2xvc2UoKTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgY2xhc3NlczogY3NzQ2xhc3Nlc0ludGVyc2VjdGlvbihmcm9tQW5pbWF0aW9uLmNsYXNzZXMsIHRvQW5pbWF0aW9uLmNsYXNzZXMpLFxuICAgICAgICAgICAgICBmcm9tOiBmcm9tQW5pbWF0aW9uLFxuICAgICAgICAgICAgICB0bzogdG9BbmltYXRpb24sXG4gICAgICAgICAgICAgIGFuY2hvcnM6IFtdIC8vIFRPRE8obWF0c2tvKTogY2hhbmdlIHRvIHJlZmVyZW5jZSBub2Rlc1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgLy8gdGhlIGFuY2hvciBhbmltYXRpb25zIHJlcXVpcmUgdGhhdCB0aGUgZnJvbSBhbmQgdG8gZWxlbWVudHMgYm90aCBoYXZlIGF0IGxlYXN0XG4gICAgICAgICAgICAvLyBvbmUgc2hhcmVkIENTUyBjbGFzcyB3aGljaCBlZmZlY3RpdmVseSBtYXJyaWVzIHRoZSB0d28gZWxlbWVudHMgdG9nZXRoZXIgdG8gdXNlXG4gICAgICAgICAgICAvLyB0aGUgc2FtZSBhbmltYXRpb24gZHJpdmVyIGFuZCB0byBwcm9wZXJseSBzZXF1ZW5jZSB0aGUgYW5jaG9yIGFuaW1hdGlvbi5cbiAgICAgICAgICAgIGlmIChncm91cC5jbGFzc2VzLmxlbmd0aCkge1xuICAgICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChncm91cCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChmcm9tQW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgcHJlcGFyZWRBbmltYXRpb25zLnB1c2godG9BbmltYXRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGFuY2hvckdyb3Vwc1tsb29rdXBLZXldLmFuY2hvcnMucHVzaCh7XG4gICAgICAgICAgICAnb3V0JzogZnJvbS5lbGVtZW50LCAnaW4nOiB0by5lbGVtZW50XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBwcmVwYXJlZEFuaW1hdGlvbnM7XG4gICAgICB9XG5cbiAgICAgIG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G4gKiAgICAgICAgICRzY29wZS5jb2xvckNsYXNzID0gZnVuY3Rpb24obnVtYmVyKSB7XG4gKiAgICAgICAgICAgcmV0dXJuIGNvbG9yc1tudW1iZXIgJSBjb2xvcnMubGVuZ3RoXTtcbiAqICAgICAgICAgfTtcbiAqICAgICAgIH1dKTtcbiAqICAgPC9maWxlPlxuICogIDxmaWxlIG5hbWU9XCJhbmltYXRpb25zLmNzc1wiPlxuICogIC5jb250YWluZXIge1xuICogICAgaGVpZ2h0OjI1MHB4O1xuICogICAgd2lkdGg6MjUwcHg7XG4gKiAgICBwb3NpdGlvbjpyZWxhdGl2ZTtcbiAqICAgIG92ZXJmbG93OmhpZGRlbjtcbiAqICAgIGJvcmRlcjoycHggc29saWQgYmxhY2s7XG4gKiAgfVxuICogIC5jb250YWluZXIgLmNlbGwge1xuICogICAgZm9udC1zaXplOjE1MHB4O1xuICogICAgdGV4dC1hbGlnbjpjZW50ZXI7XG4gKiAgICBsaW5lLWhlaWdodDoyNTBweDtcbiAqICAgIHBvc2l0aW9uOmFic29sdXRlO1xuICogICAgdG9wOjA7XG4gKiAgICBsZWZ0OjA7XG4gKiAgICByaWdodDowO1xuICogICAgYm9yZGVyLWJvdHRvbToycHggc29saWQgYmxhY2s7XG4gKiAgfVxuICogIC5zd2FwLWFuaW1hdGlvbi5uZy1lbnRlciwgLnN3YXAtYW5pbWF0aW9uLm5nLWxlYXZlIHtcbiAqICAgIHRyYW5zaXRpb246MC41cyBsaW5lYXIgYWxsO1xuICogIH1cbiAqICAuc3dhcC1hbmltYXRpb24ubmctZW50ZXIge1xuICogICAgdG9wOi0yNTBweDtcbiAqICB9XG4gKiAgLnN3YXAtYW5pbWF0aW9uLm5nLWVudGVyLWFjdGl2ZSB7XG4gKiAgICB0b3A6MHB4O1xuICogIH1cbiAqICAuc3dhcC1hbmltYXRpb24ubmctbGVhdmUge1xuICogICAgdG9wOjBweDtcbiAqICB9XG4gKiAgLnN3YXAtYW5pbWF0aW9uLm5nLWxl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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOmZvcm0jYW5pbWF0aW9ucyBmb3JtIC8gbmdGb3JtfSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh7QGxpbmsgbmcuZGlyZWN0aXZlOmZvcm0jY3NzLWNsYXNzZXMgdmFyaW91cyBjbGFzc2VzfSkgICAgfFxuICogfCB7QGxpbmsgbmdBbmltYXRlLmRpcmVjdGl2ZTpuZ0FuaW1hdGVTd2FwI2FuaW1hdGlvbnMgbmdBbmltYXRlU3dhcH0gICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3MjYW5pbWF0aW9ucyBuZ0NsYXNzIC8ge3tjbGFzcyYjMTI1OyYjODIwMzsmIzEyNTt9ICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3NFdmVuI2FuaW1hdGlvbnMgbmdDbGFzc0V2ZW59ICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3NPZGQjYW5pbWF0aW9ucyBuZ0NsYXNzT2RkfSAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSGlkZSNhbmltYXRpb25zIG5nSGlkZX0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWhpZGVgIGNsYXNzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSWYjYW5pbWF0aW9ucyBuZ0lmfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSW5jbHVkZSNhbmltYXRpb25zIG5nSW5jbHVkZX0gICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbW9kdWxlOm5nTWVzc2FnZXMjYW5pbWF0aW9ucyBuZ01lc3NhZ2UgLyBuZ01lc3NhZ2VFeHB9ICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbW9kdWxlOm5nTWVzc2FnZXMjYW5pbWF0aW9ucyBuZ01lc3NhZ2VzfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWFjdGl2ZWAvYG5nLWluYWN0aXZlYCBjbGFzc2VzKSAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nTW9kZWwjYW5pbWF0aW9ucyBuZ01vZGVsfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh7QGxpbmsgbmcuZGlyZWN0aXZlOm5nTW9kZWwjY3NzLWNsYXNzZXMgdmFyaW91cyBjbGFzc2VzfSkgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nUmVwZWF0I2FuaW1hdGlvbnMgbmdSZXBlYXR9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyLCBsZWF2ZSwgYW5kIG1vdmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nU2hvdyNhbmltYXRpb25zIG5nU2hvd30gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWhpZGVgIGNsYXNzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nU3dpdGNoI2FuaW1hdGlvbnMgbmdTd2l0Y2h9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmdSb3V0ZS5kaXJlY3RpdmU6bmdWaWV3I2FuaW1hdGlvbnMgbmdWaWV3fSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICpcbiAqIChNb3JlIGluZm9ybWF0aW9uIGNhbiBiZSBmb3VuZCBieSB2aXNpdGluZyB0aGUgZG9jdW1lbnRhdGlvbiBhc3NvY2lhdGVkIHdpdGggZWFjaCBkaXJlY3RpdmUuKVxuICpcbiA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zXCIgZml4QmFzZT1cInRydWVcIj5cbiAgICAgKiAgIDxmaWxlIG5hbWU9XCJpbmRleC5odG1sXCI+XG4gICAgICogICAgIDxkaXYgbmctY29udHJvbGxlcj1cIk1haW5Db250cm9sbGVyXCI+XG4gICAgICogICAgICAgQ2hvb3NlOlxuICAgICAqICAgICAgIDxhIGhyZWY9XCJCb29rL01vYnlcIj5Nb2J5PC9hPiB8XG4gICAgICogICAgICAgPGEgaHJlZj1cIkJvb2svTW9ieS9jaC8xXCI+TW9ieTogQ2gxPC9hPiB8XG4gICAgICogICAgICAgPGEgaHJlZj1cIkJvb2svR2F0c2J5XCI+R2F0c2J5PC9hPiB8XG4gICAgICogICAgICAgPGEgaHJlZj1cIkJvb2svR2F0c2J5L2NoLzQ/a2V5PXZhbHVlXCI+R2F0c2J5OiBDaDQ8L2E+IHxcbiAgICAgKiAgICAgICA8YSBocmVmPVwiQm9vay9TY2FybGV0XCI+U2NhcmxldCBMZXR0ZXI8L2E+PGJyLz5cbiAgICAgKlxuICAgICAqICAgICAgIDxkaXYgbmctdmlldz48L2Rpdj5cbiAgICAgKlxuICAgICAqICAgICAgIDxociAvPlxuICAgICAqXG4gICAgICogICAgICAgPHByZT4kbG9jYXRpb24ucGF0aCgpID0ge3skbG9jYXRpb24ucGF0aCgpfX08L3ByZT5cbiAgICAgKiAgICAgICA8cHJlPiRyb3V0ZS5jdXJyZW50LnRlbXBsYXRlVXJsID0ge3skcm91dGUuY3VycmVudC50ZW1wbGF0ZVVybH19PC9wcmU+XG4gICAgICogICAgICAgPHByZT4kcm91dGUuY3VycmVudC5wYXJhbXMgPSB7eyRyb3V0ZS5jdXJyZW50LnBhcmFtc319PC9wcmU+XG4gICAgICogICAgICAgPHByZT4kcm91dGUuY3VycmVudC5zY29wZS5uYW1lID0ge3skcm91dGUuY3VycmVudC5zY29wZS5uYW1lfX08L3ByZT5cbiAgICAgKiAgICAgICA8cHJlPiRyb3V0ZVBhcmFtcyA9IHt7JHJvdXRlUGFyYW1zfX08L3ByZT5cbiAgICAgKiAgICAgPC9kaXY+XG4gICAgICogICA8L2ZpbGU+XG4gICAgICpcbiAgICAgKiAgIDxmaWxlIG5hbWU9XCJib29rLmh0bWxcIj5cbiAgICAgKiAgICAgY29udHJvbGxlcjoge3tuYW1lfX08YnIgLz5cbiAgICAgKiAgICAgQm9vayBJZDoge3twYXJhbXMuYm9va0lkfX08YnIgLz5cbiAgICAgKiAgIDwvZmlsZT5cbiAgICAgKlxuICAgICAqICAgPGZpbGUgbmFtZT1cImNoYXB0ZXIuaHRtbFwiPlxuICAgICAqICAgICBjb250cm9sbGVyOiB7e25hbWV9fTxiciAvPlxuICAgICAqICAgICBCb29rIElkOiB7e3BhcmFtcy5ib29rSWR9fTxiciAvPlxuICAgICAqICAgICBDaGFwdGVyIElkOiB7e3BhcmFtcy5jaGFwdGVySWR9fVxuICAgICAqICAgPC9maWxlPlxuICAgICAqXG4gICAgICogICA8ZmlsZSBuYW1lPVwic2NyaXB0LmpzXCI+XG4gICAgICogICAgIGFuZ3VsYXIubW9kdWxlKCduZ1JvdXRlRXhhbXBsZScsIFsnbmdSb3V0ZSddKVxuICAgICAqXG4gICAgICogICAgICAuY29udHJvbGxlcignTWFpbkNvbnRyb2xsZXInLCBmdW5jdGlvbigkc2NvcGUsICRyb3V0ZSwgJHJvdXRlUGFyYW1zLCAkbG9jYXRpb24pIHtcbiAgICAgKiAgICAgICAgICAkc2NvcGUuJHJvdXRlID0gJHJvdXRlO1xuICAgICAqICAgICAgICAgICRzY29wZS4kbG9jYXRpb24gPSAkbG9jYXRpb247XG4gICAgICogICAgICAgICAgJHNjb3BlLiRyb3V0ZVBhcmFtcyA9ICRyb3V0ZVBhcmFtcztcbiAgICAgKiAgICAgIH0pXG4gICAgICpcbiAgICAgKiAgICAgIC5jb250cm9sbGVyKCdCb29rQ29udHJvbGxlcicsIGZ1bmN0aW9uKCRzY29wZSwgJHJvdXRlUGFyYW1zKSB7XG4gICAgICogICAgICAgICAgJHNjb3BlLm5hbWUgPSAnQm9va0NvbnRyb2xsZXInO1xuICAgICAqICAgICAgICAgICRzY29wZS5wYXJhbXMgPSAkcm91dGVQYXJhbXM7XG4gICAgICogICAgICB9KVxuICAgICAqXG4gICAgICogICAgICAuY29udHJvbGxlcignQ2hhcHRlckNvbnRyb2xsZXInLCBmdW5jdGlvbigkc2NvcGUsICRyb3V0ZVBhcmFtcykge1xuICAgICAqICAgICAgICAgICRzY29wZS5uYW1lID0gJ0NoYXB0ZXJDb250cm9sbGVyJztcbiAgICAgKiAgICAgICAgICAkc2NvcGUucGFyYW1zID0gJHJvdXRlUGFyYW1zO1xuICAgICAqICAgICAgfSlcbiAgICAgKlxuICAgICAqICAgICAuY29uZmlnKGZ1bmN0aW9uKCRyb3V0ZVByb3ZpZGVyLCAkbG9jYXRpb25Qcm92aWRlcikge1xuICAgICAqICAgICAgICRyb3V0ZVByb3ZpZGVyXG4gICAgICogICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkJywge1xuICAgICAqICAgICAgICAgdGVtcGxhdGVVcmw6ICdib29rLmh0bWwnLFxuICAgICAqICAgICAgICAgY29udHJvbGxlcjogJ0Jvb2tDb250cm9sbGVyJyxcbiAgICAgKiAgICAgICAgIHJlc29sdmU6IHtcbiAgICAgKiAgICAgICAgICAgLy8gSSB3aWxsIGNhdXNlIGEgMSBzZWNvbmQgZGVsYXlcbiAgICAgKiAgICAgICAgICAgZGVsYXk6IGZ1bmN0aW9uKCRxLCAkdGltZW91dCkge1xuICAgICAqICAgICAgICAgICAgIHZhciBkZWxheSA9ICRxLmRlZmVyKCk7XG4gICAgICogICAgICAgICAgICAgJHRpbWVvdXQoZGVsYXkucmVzb2x2ZSwgMTAwMCk7XG4gICAgICogICAgICAgICAgICAgcmV0dXJuIGRlbGF5LnByb21pc2U7XG4gICAgICogICAgICAgICAgIH1cbiAgICAgKiAgICAgICAgIH1cbiAgICAgKiAgICAgICB9KVxuICAgICAqICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkL2NoLzpjaGFwdGVySWQnLCB7XG4gICAgICogICAgICAgICB0ZW1wbGF0ZVVybDogJ2NoYXB0ZXIuaHRtbCcsXG4gICAgICogICAgICAgICBjb250cm9sbGVyOiAnQ2hhcHRlckNvbnRyb2xsZXInXG4gICAgICogICAgICAgfSk7XG4gICAgICpcbiAgICAgKiAgICAgICAvLyBjb25maWd1cmUgaHRtbDUgdG8gZ2V0IGxpbmtzIHdvcmtpbmcgb24ganNmaWRkbGVcbiAgICAgKiAgICAgICAkbG9jYXRpb25Qcm92aWRlci5odG1sNU1vZGUodHJ1ZSk7XG4gICAgICogICAgIH0pO1xuICAgICAqXG4gICAgICogICA8L2ZpbGU+XG4gICAgICpcbiAgICAgKiAgIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb3RyYWN0b3JcIj5cbiAgICAgKiAgICAgaXQoJ3Nob3VsZCBsb2FkIGFuZCBjb21waWxlIGNvcnJlY3QgdGVtcGxhdGUnLCBmdW5jdGlvbigpIHtcbiAgICAgKiAgICAgICBlbGVtZW50KGJ5LmxpbmtUZXh0KCdNb2J5OiBDaDEnKSkuY2xpY2soKTtcbiAgICAgKiAgICAgICB2YXIgY29udGVudCA9IGVsZW1lbnQoYnkuY3NzKCdbbmctdmlld10nKSkuZ2V0VGV4dCgpO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9jb250cm9sbGVyOiBDaGFwdGVyQ29udHJvbGxlci8pO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9Cb29rIElkOiBNb2J5Lyk7XG4gICAgICogICAgICAgZXhwZWN0KGNvbnRlbnQpLnRvTWF0Y2goL0NoYXB0ZXIgSWQ6IDEvKTtcbiAgICAgKlxuICAgICAqICAgICAgIGVsZW1lbnQoYnkucGFydGlhbExpbmtUZXh0KCdTY2FybGV0JykpLmNsaWNrKCk7XG4gICAgICpcbiAgICAgKiAgICAgICBjb250ZW50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AgcmV0dXJuIGtlZXBQcm9jZXNzaW5nUm91dGUgJiYgbmV4dFJvdXRlUHJvbWlzZS5cbiAgICAgICAgICAgICAgdGhlbihyZXNvbHZlTG9jYWxzKS5cbiAgICAgICAgICAgICAgdGhlbihmdW5jdGlvbihsb2NhbHMpIHtcbiAgICAgICAgICAgICAgICAvLyBhZnRlciByb3V0ZSBjaGFuZ2VcbiAgICAgICAgICAgICAgICBpZiAobmV4dFJvdXRlID09PSAkcm91dGUuY3VycmVudCkge1xuICAgICAgICAgICAgICAgICAgaWYgKG5leHRSb3V0ZSkge1xuICAgICAgICAgICAgICAgICAgICBuZXh0Um91dGUubG9jYWxzID0gbG9jYWxzO1xuICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmNvcHkobmV4dFJvdXRlLnBhcmFtcywgJHJvdXRlUGFyYW1zKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICRyb290U2NvcGUuJGJyb2FkY2FzdCgnJHJvdXRlQ2hhbmdlU3VjY2VzcycsIG5leHRSb3V0ZSwgbGFzdFJvdXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLmNhdGNoKGZ1bmN0aW9uKGVycm9yKSB7XG4gICAgICAgICAgICBpZiAobmV4dFJvdXRlID09PSAkcm91dGUuY3VycmVudCkge1xuICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRicm9hZGNhc3QoJyRyb3V0ZUNoYW5nZUVycm9yJywgbmV4dFJvdXRlLCBsYXN0Um91dGUsIGVycm9yKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KS5maW5hbGx5KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgLy8gQmVjYXVzZSBgY29tbWl0Um91dGUoKWAgaXMgY2FsbGVkIGZyb20gYSBgJHJvb3RTY29wZS4kZXZhbEFzeW5jYCBibG9jayAoc2VlXG4gICAgICAgICAgICAvLyBgJGxvY2F0aW9uV2F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udmlldy1hbmltYXRlLWNvbnRhaW5lciB7XG4gICAgICAgICAgcG9zaXRpb246cmVsYXRpdmU7XG4gICAgICAgICAgaGVpZ2h0OjEwMHB4IWltcG9ydGFudDtcbiAgICAgICAgICBiYWNrZ3JvdW5kOndoaXRlO1xuICAgICAgICAgIGJvcmRlcjoxcHggc29saWQgYmxhY2s7XG4gICAgICAgICAgaGVpZ2h0OjQwcHg7XG4gICAgICAgICAgb3ZlcmZsb3c6aGlkZGVuO1xuICAgICAgICB9XG5cbiAgICAgICAgLnZpZXctYW5pbWF0ZSB7XG4gICAgICAgICAgcGFkZGluZzoxMHB4O1xuICAgICAgICB9XG5cbiAgICAgICAgLnZpZXctYW5pbWF0ZS5uZy1lbnRlciwgLnZpZXctYW5pbWF0ZS5uZy1sZWF2ZSB7XG4gICAgICAgICAgdHJhbnNpdGlvbjphbGwgY3ViaWMtYmV6aWVyKDAuMjUwLCAwLjQ2MCwgMC40NTAsIDAuOTQwKSAxLjVzO1xuXG4gICAgICAgICAgZGlzcGxheTpibG9jaztcbiAgICAgICAgICB3aWR0aDoxMDAlO1xuICAgICAgICAgIGJvcmRlci1sZWZ0OjFweCBzb2xpZCBibGFjaztcblxuICAgICAgICAgIHBvc2l0aW9uOmFic29sdXRlO1xuICAgICAgICAgIHRvcDowO1xuICAgICAgICAgIGxlZnQ6MDtcbiAgICAgICAgICByaWdodDowO1xuICAgICAgICAgIGJvdHRvbTowO1xuICAgICAgICAgIHBhZGRpbmc6MTBweDtcbiAgICAgICAgfVxuXG4gICAgICAgIC52aWV3LWFuaW1hdGUubmctZW50ZXIge1xuICAgICAgICAgIGxlZnQ6MTAwJTtcbiAgICAgICAgfVxuICAgICAgICAudmlldy1hbmltYXRlLm5nLWVudGVyLm5nLWVudGVyLWFjdGl2ZSB7XG4gICAgICAgICAgbGVmdDowO1xuICAgICAgICB9XG4gICAgICAgIC52aWV3LWFuaW1hdGUubmctbGVhdmUubmctbGVhdmUtYWN0aXZlIHtcbiAgICAgICAgICBsZWZ0Oi0xMDAlO1xuICAgICAgICB9XG4gICAgICA8L2ZpbGU+XG5cbiAgICAgIDxmaWxlIG5hbWU9XCJzY3JpcHQuanNcIj5cbiAgICAgICAgYW5ndWxhci5tb2R1bGUoJ25nVmlld0V4YW1wbGUnLCBbJ25nUm91dGUnLCAnbmdBbmltYXRlJ10pXG4gICAgICAgICAgLmNvbmZpZyhbJyRyb3V0ZVByb3ZpZGVyJywgJyRsb2NhdGlvblByb3ZpZGVyJyxcbiAgICAgICAgICAgIGZ1bmN0aW9uKCRyb3V0ZVByb3ZpZGVyLCAkbG9jYXRpb25Qcm92aWRlcikge1xuICAgICAgICAgICAgICAkcm91dGVQcm92aWRlclxuICAgICAgICAgICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkJywge1xuICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdib29rLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ0Jvb2tDdHJsJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXJBczogJ2Jvb2snXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAud2hlbignL0Jvb2svOmJvb2tJZC9jaC86Y2hhcHRlcklkJywge1xuICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdjaGFwdGVyLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ0NoYXB0ZXJDdHJsJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXJBczogJ2NoYXB0ZXInXG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgJGxvY2F0aW9uUHJvdmlkZXIuaHRtbDVNb2RlKHRydWUpO1xuICAgICAgICAgIH1dKVxuICAgICAgICAgIC5jb250cm9sbGVyKCdNYWluQ3RybCcsIFsnJHJvdXRlJywgJyRyb3V0ZVBhcmFtcycsICckbG9jYXRpb24nLFxuICAgICAgICAgICAgZnVuY3Rpb24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ICB0cmFuc2NsdWRlOiAnZWxlbWVudCcsXG4gICAgbGluazogZnVuY3Rpb24oc2NvcGUsICRlbGVtZW50LCBhdHRyLCBjdHJsLCAkdHJhbnNjbHVkZSkge1xuICAgICAgICB2YXIgY3VycmVudFNjb3BlLFxuICAgICAgICAgICAgY3VycmVudEVsZW1lbnQsXG4gICAgICAgICAgICBwcmV2aW91c0xlYXZlQW5pbWF0aW9uLFxuICAgICAgICAgICAgYXV0b1Njcm9sbEV4cCA9IGF0dHIuYXV0b3Njcm9sbCxcbiAgICAgICAgICAgIG9ubG9hZEV4cCA9IGF0dHIub25sb2FkIHx8ICcnO1xuXG4gICAgICAgIHNjb3BlLiRvbignJHJvdXRlQ2hhbmdlU3VjY2VzcycsIHVwZGF0ZSk7XG4gICAgICAgIHVwZGF0ZSgpO1xuXG4gICAgICAgIGZ1bmN0aW9uIGNsZWFudXBMYXN0VmlldygpIHtcbiAgICAgICAgICBpZiAocHJldmlvdXNMZWF2ZUFuaW1hdGlvbikge1xuICAgICAgICAgICAgJGFuaW1hdGUuY2FuY2VsKHByZXZpb3VzTGVhdmVBbmltYXRpb24pO1xuICAgICAgICAgICAgcHJldmlvdXNMZWF2ZUFuaW1hdGlvbiA9IG51bGw7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGN1cnJlbnRTY29wZSkge1xuICAgICAgICAgICAgY3VycmVudFNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUgPSBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoY3VycmVudEVsZW1lbnQpIHtcbiAgICAgICAgICAgIHByZXZpb3VzTGVhdmVBbmltYXRpb24gPSAkYW5pbWF0ZS5sZWF2ZShjdXJyZW50RWxlbWVudCk7XG4gICAgICAgICAgICBwcmV2aW91c0xlYXZlQW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlIC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sbGVkIGJlZm9yZSBsaW5raW5nIHRoZSBjb250ZW50LCB3aGljaCB3b3VsZCBhcHBseSBjaGlsZFxuICAgICAgICAgICAgLy8gZGlyZWN0aXZlcyB0byBub24gZXhpc3RpbmcgZWxlbWVudHMuXG4gICAgICAgICAgICB2YXIgY2xvbmUgPSAkdHJhbnNjbHVkZShuZXdTY29wZSwgZnVuY3Rpb24oY2xvbmUpIHtcbiAgICAgICAgICAgICAgJGFuaW1hdGUuZW50ZXIoY2xvbmUsIG51bGwsIGN1cnJlbnRFbGVtZW50IHx8ICRlbGVtZW50KS5kb25lKGZ1bmN0aW9uIG9uTmdWaWV3RW50ZXIocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UgIT09IGZhbHNlICYmIGFuZ3VsYXIuaXNEZWZpbmVkKGF1dG9TY3JvbGxFeHApXG4gICAgICAgICAgICAgICAgICAmJiAoIWF1dG9TY3JvbGxFeHAgfHwgc2NvcGUuJGV2YWwoYXV0b1Njcm9sbEV4cCkpKSB7XG4gICAgICAgICAgICAgICAgICAkYW5jaG9yU2Nyb2xsKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgY2xlYW51cExhc3RWaWV3KCk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY3VycmVudEVsZW1lbnQgPSBjbG9uZTtcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZSA9IGN1cnJlbnQuc2NvcGUgPSBuZXdTY29wZTtcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZS4kZW1pdCgnJHZpZXdDb250ZW50TG9hZGVkJyk7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUuJGV2YWwob25sb2FkRXhwKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY2xlYW51cExhc3RWaWV3KCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICB9O1xufVxuXG4vLyBU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WwnIGluIGF0dHJzKTtcbiAgICAgICAgICBpZiAoaG9yaXpvbnRhbCkge1xuICAgICAgICAgICAgY3NzID0ge1xuICAgICAgICAgICAgICB3aWR0aDogJydcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBjc3NUbyA9IHt3aWR0aDogJzAnfTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY3NzID0ge1xuICAgICAgICAgICAgICBoZWlnaHQ6ICcnXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgY3NzVG8gPSB7aGVpZ2h0OiAnMCd9O1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoIXNjb3BlLiRldmFsKGF0dHJzLnVpYkNvbGxhcHNlKSkge1xuICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcygnaW4nKVxuICAgICAgICAgICAgICAuYWRkQ2xhc3MoJ2NvbGxhcHNlJylcbiAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtZXhwYW5kZWQnLCB0cnVlKVxuICAgICAgICAgICAgICAuYXR0cignYXJpYS1oaWRkZW4nLCBmYWxzZSlcbiAgICAgICAgICAgICAgLmNzcyhjc3MpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGdldFNjcm9sbEZyb21FbGVtZW50KGVsZW1lbnQpIHtcbiAgICAgICAgICBpZiAoaG9yaXpvbnRhbCkge1xuICAgICAgICAgICAgcmV0dXJuIHt3aWR0aDogZWxlbWVudC5zY3JvbGxXaWR0aCArICdweCd9O1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4ge2hlaWdodDogZWxlbWVudC5zY3JvbGxIZWlnaHQgKyAncHgnfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGV4cGFuZCgpIHtcbiAgICAgICAgICBpZiAoZWxlbWVudC5oYXNDbGFzcygnY29sbGFwc2UnKSAmJiBlbGVtZW50Lmhhc0NsYXNzKCdpbicpKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgJHEucmVzb2x2ZShleHBhbmRpbmdFeHByKHNjb3BlKSlcbiAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKCdjb2xsYXBzZScpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKCdjb2xsYXBzaW5nJylcbiAgICAgICAgICAgICAgICAuYXR0cignYXJpYS1leHBhbmRlZCcsIHRydWUpXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtaGlkZGVuJywgZmFsc2UpO1xuXG4gICAgICAgICAgICAgIGlmICgkYW5pbWF0ZUNzcykge1xuICAgICAgICAgICAgICAgICRhbmltYXRlQ3NzKGVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgIGFkZENsYXNzOiAnaW4nLFxuICAgICAgICAgICAgICAgICAgZWFzaW5nOiAnZWFzZScsXG4gICAgICAgICAgICAgICAgICBjc3M6IHtcbiAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgdG86IGdldFNjcm9sbEZyb21FbGVtZW50KGVsZW1lbnRbMF0pXG4gICAgICAgICAgICAgICAgfSkuc3RhcnQoKVsnZmluYWxseSddKGV4cGFuZERvbmUpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICRhbmltYXRlLmFkZENsYXNzKGVsZW1lbnQsICdpbicsIHtcbiAgICAgICAgICAgICAgICAgIGNzczoge1xuICAgICAgICAgICAgICAgICAgICBvdmVyZmxvdzogJ2hpZGRlbidcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB0bzogZ2V0U2Nyb2xsRnJvbUVsZW1lbnQoZWxlbWVudFswXSlcbiAgICAgICAgICAgICAgICB9KS50aGVuKGV4cGFuZERvbm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oYXZlIHRoZSBjb2xsYXBzZSBjbGFzcywgdGhpcyByZW1vdmFsXG4gICAgICAgICAgICAgICAgLy8gcHJldmVudHMgdGhlIGFuaW1hdGlvbiBmcm9tIGp1bXBpbmcgdG8gY29sbGFwc2VkIHN0YXRlXG4gICAgICAgICAgICAgICAgLnJlbW92ZUNsYXNzKCdjb2xsYXBzZScpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKCdjb2xsYXBzaW5nJylcbiAgICAgICAgICAgICAgICAuYXR0cignYXJpYS1leHBhbmRlZCcsIGZhbHNlKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdhcmlhLWhpZGRlbicsIHRydWUpO1xuXG4gICAgICAgICAgICAgIGlmICgkYW5pbWF0ZUNzcykge1xuICAgICAgICAgICAgICAgICRhbmltYXRlQ3NzKGVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgIHJlbW92ZUNsYXNzOiAnaW4nLFxuICAgICAgICAgICAgICAgICAgdG86IGNzc1RvXG4gICAgICAgICAgICAgICAgfSkuc3RhcnQoKVsnZmluYWxseSddKGNvbGxhcHNlRG9uZSk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJGFuaW1hdGUucmVtb3ZlQ2xhc3MoZWxlbWVudCwgJ2luJywge1xuICAgICAgICAgICAgICAgICAgdG86IGNzc1RvXG4gICAgICAgICAgICAgICAgfSkudGhlbihjb2xsYXBzZURvbmUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCBhbmd1bGFyLm5vb3ApO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gY29sbGFwc2VEb25lKCkge1xuICAgICAgICAgIGVsZW1lbnQuY3NzKGNzc1RvKTsgLy8gUmVxdWlyZWQgc28gdGhhdCBjb2xsYXBzZSB3b3JrcyB3aGVuIGFuaW1hdGlvbiBpcyBkaXNhYmxlZFxuICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoJ2Nvb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LnNvbWUoZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgICAgICAgICAgICAgdmFyIHRoaXNWYWwgPSBpbnN0YW5jZS5zY29wZS4kZXZhbChvbkV4cCk7XG4gICAgICAgICAgICAgIGlmICh0aGlzVmFsID09PSBjb21wYXJlV2l0aFZhbCkge1xuICAgICAgICAgICAgICAgIG5ld0FjdGl2YXRlZCA9IGluc3RhbmNlO1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmIChkYXRhLmxhc3RBY3RpdmF0ZWQgIT09IG5ld0FjdGl2YXRlZCkge1xuICAgICAgICAgICAgICBpZiAoZGF0YS5sYXN0QWN0aXZhdGVkKSB7XG4gICAgICAgICAgICAgICAgJGFuaW1hdGUucmVtb3ZlQ2xhc3MoZGF0YS5sYXN0QWN0aXZhdGVkLmVsZW1lbnQsIGNsYXp6KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAobmV3QWN0aXZhdGVkKSB7XG4gICAgICAgICAgICAgICAgJGFuaW1hdGUuYWRkQ2xhc3MobmV3QWN0aXZhdGVkLmVsZW1lbnQsIGNsYXp6KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBkYXRhLmxhc3RBY3RpdmF0ZWQgPSBuZXdBY3RpdmF0ZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcbiAgICAgICAgICBleHBUb0RhdGFbZXhwXSA9IGRhdGEgPSB7XG4gICAgICAgICAgICBsYXN0QWN0aXZhdGVkOiBudWxsLFxuICAgICAgICAgICAgc2NvcGU6IHNjb3BlLFxuICAgICAgICAgICAgd2F0Y2hGbjogd2F0Y2hGbixcbiAgICAgICAgICAgIGNvbXBhcmVXaXRoRXhwOiBjb21wYXJlV2l0aEV4cCxcbiAgICAgICAgICAgIHdhdGNoZXI6IHNjb3BlLiR3YXRjaChjb21wYXJlV2l0aEV4c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bmN0aW9uKHBsYWNlbWVudCkge1xuICAgICAgICB2YXIgYXV0b1BsYWNlID0gUExBQ0VNRU5UX1JFR0VYLmF1dG8udGVzdChwbGFjZW1lbnQpO1xuICAgICAgICBpZiAoYXV0b1BsYWNlKSB7XG4gICAgICAgICAgcGxhY2VtZW50ID0gcGxhY2VtZW50LnJlcGxhY2UoUExBQ0VNRU5UX1JFR0VYLmF1dG8sICcnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHBsYWNlbWVudCA9IHBsYWNlbWVudC5zcGxpdCgnLScpO1xuXG4gICAgICAgIHBsYWNlbWVudFswXSA9IHBsYWNlbWVudFswXSB8fCAndG9wJztcbiAgICAgICAgaWYgKCFQTEFDRU1FTlRfUkVHRVgucHJpbWFyeS50ZXN0KHBsYWNlbWVudFswXSkpIHtcbiAgICAgICAgICBwbGFjZW1lbnRbMF0gPSAndG9wJztcbiAgICAgICAgfVxuXG4gICAgICAgIHBsYWNlbWVudFsxXSA9IHBsYWNlbWVudFsxXSB8fCAnY2VudGVyJztcbiAgICAgICAgaWYgKCFQTEFDRU1FTlRfUkVHRVguc2Vjb25kYXJ5LnRlc3QocGxhY2VtZW50WzFdKSkge1xuICAgICAgICAgIHBsYWNlbWVudFsxXSA9ICdjZW50ZXInO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGF1dG9QbGFjZSkge1xuICAgICAgICAgIHBsYWNlbWVudFsyXSA9IHRydWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcGxhY2VtZW50WzJdID0gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcGxhY2VtZW50O1xuICAgICAgfSxcblxuICAgICAgLyoqXG4gICAgICAgKiBQcm92aWRlcyBjb29yZGluYXRlcyBmb3IgYW4gZWxlbWVudCB0byBiZSBwb3NpdGlvbmVkIHJlbGF0aXZlIHRvXG4gICAgICAgKiBhbm90aGVyIGVsZW1lbnQuICBQYXNzaW5nICdhdXRvJyBhcyBwYXJ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gICAgICAgZWxlbSA9IHRoaXMuZ2V0UmF3Tm9kZShlbGVtKTtcblxuICAgICAgICB2YXIgaW5uZXJFbGVtID0gZWxlbS5xdWVyeVNlbGVjdG9yKCcudG9vbHRpcC1pbm5lciwgLnBvcG92ZXItaW5uZXInKTtcbiAgICAgICAgaWYgKCFpbm5lckVsZW0pIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgaXNUb29sdGlwID0gYW5ndWxhci5lbGVtZW50KGlubmVyRWxlbSkuaGFzQ2xhc3MoJ3Rvb2x0aXAtaW5uZXInKTtcblxuICAgICAgICB2YXIgYXJyb3dFbGVtID0gaXNUb29sdGlwID8gZWxlbS5xdWVyeVNlbGVjdG9yKCcudG9vbHRpcC1hcnJvdycpIDogZWxlbS5xdWVyeVNlbGVjdG9yKCcuYXJyb3cnKTtcbiAgICAgICAgaWYgKCFhcnJvd0VsZW0pIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgYXJyb3dDc3MgPSB7XG4gICAgICAgICAgdG9wOiAnJyxcbiAgICAgICAgICBib3R0b206ICcnLFxuICAgICAgICAgIGxlZnQ6ICcnLFxuICAgICAgICAgIHJpZ2h0OiAnJ1xuICAgICAgICB9O1xuXG4gICAgICAgIHBsYWNlbWVudCA9IHRoaXMucGFyc2VQbGFjZW1lbnQocGxhY2VtZW50KTtcbiAgICAgICAgaWYgKHBsYWNlbWVudFsxXSA9PT0gJ2NlbnRlcicpIHtcbiAgICAgICAgICAvLyBubyBhZGp1c3RtZW50IG5lY2Vzc2FyeSAtIGp1c3QgcmVzZXQgc3R5bGVzXG4gICAgICAgICAgYW5ndWxhci5lbGVtZW50KGFycm93RWxlbSkuY3NzKGFycm93Q3NzKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgYm9yZGVyUHJvcCA9ICdib3JkZXItJyArIHBsYWNlbWVudFswXSArICctd2lkdGgn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kubWFwKGZ1bmN0aW9uKGtleSkge1xuICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGtleToga2V5LFxuICAgICAgICAgICAgICAgIHZhbHVlOiBtYXBba2V5XVxuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBnZXQ6IGZ1bmN0aW9uKGtleSkge1xuICAgICAgICAgICAgcmV0dXJuIG1hcFtrZXldO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgaGFzS2V5OiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICAgIHJldHVybiAhIW1hcFtrZXldO1xuICAgICAgICAgIH0sXG4gICAgICAgICAga2V5czogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gT2JqZWN0LmtleXMobWFwKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHB1dDogZnVuY3Rpb24oa2V5LCB2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKCFtYXBba2V5XSkge1xuICAgICAgICAgICAgICBtYXBba2V5XSA9IFtdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBtYXBba2V5XS5wdXNoKHZhbHVlKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHJlbW92ZTogZnVuY3Rpb24oa2V5LCB2YWx1ZSkge1xuICAgICAgICAgICAgdmFyIHZhbHVlcyA9IG1hcFtrZXldO1xuXG4gICAgICAgICAgICBpZiAoIXZhbHVlcykge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBpZHggPSB2YWx1ZXMuaW5kZXhPZih2YWx1ZSk7XG5cbiAgICAgICAgICAgIGlmIChpZHggIT09IC0xKSB7XG4gICAgICAgICAgICAgIHZhbHVlcy5zcGxpY2UoaWR4LCAxKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF2YWx1ZXMubGVuZ3RoKSB7XG4gICAg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fSwge30pO1xuICAgICAgaWYgKG9wZW5Ecm9wZG93bikge1xuICAgICAgICByZXR1cm4gb3BlbmVkRHJvcGRvd25zLmxlbmd0aCA9PT0gMTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG5cbiAgdGhpcy5vcGVuID0gZnVuY3Rpb24oZHJvcGRvd25TY29wZSwgZWxlbWVudCwgYXBwZW5kVG8pIHtcbiAgICBpZiAoIW9wZW5TY29wZSkge1xuICAgICAgJGRvY3VtZW50Lm9uKCdjbGljaycsIGNsb3NlRHJvcGRvd24pO1xuICAgIH1cblxuICAgIGlmIChvcGVuU2NvcGUgJiYgb3BlblNjb3BlICE9PSBkcm9wZG93blNjb3BlKSB7XG4gICAgICBvcGVuU2NvcGUuaXNPcGVuID0gZmFsc2U7XG4gICAgfVxuXG4gICAgb3BlblNjb3BlID0gZHJvcGRvd25TY29wZTtcblxuICAgIGlmICghYXBwZW5kVG8pIHtcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICB2YXIgb3BlbmVkRHJvcGRvd25zID0gb3BlbmVkQ29udGFpbmVycy5nZXQoYXBwZW5kVG8pO1xuICAgIGlmIChvcGVuZWREcm9wZG93bnMpIHtcbiAgICAgIHZhciBvcGVuZWRTY29wZXMgPSBvcGVuZWREcm9wZG93bnMubWFwKGZ1bmN0aW9uKGRyb3Bkb3duKSB7XG4gICAgICAgIHJldHVybiBkcm9wZG93bi5zY29wZTtcbiAgICAgIH0pO1xuICAgICAgaWYgKG9wZW5lZFNjb3Blcy5pbmRleE9mKGRyb3Bkb3duU2NvcGUpID09PSAtMSkge1xuICAgICAgICBvcGVuZWRDb250YWluZXJzLnB1dChhcHBlbmRUbywge1xuICAgICAgICAgIHNjb3BlOiBkcm9wZG93blNjb3BlXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBvcGVuZWRDb250YWluZXJzLnB1dChhcHBlbmRUbywge1xuICAgICAgIC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iBBIGhlbHBlciwgaW50ZXJuYWwgZGF0YSBzdHJ1Y3R1cmUgdGhhdCBhY3RzIGFzIGEgbWFwIGJ1dCBhbHNvIGFsbG93cyBnZXR0aW5nIC8gcmVtb3ZpbmdcbiAqIGVsZW1lbnRzIGluIHRoZSBMSUZPIG9yZGVyXG4gKi9cbiAgLmZhY3RvcnkoJyQkc3RhY2tlZE1hcCcsIGZ1bmN0aW9uKCkge1xuICAgIHJldHVybiB7XG4gICAgICBjcmVhdGVOZXc6IGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgc3RhY2sgPSBbXTtcblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGFkZDogZnVuY3Rpb24oa2V5LCB2YWx1ZSkge1xuICAgICAgICAgICAgc3RhY2sucHVzaCh7XG4gICAgICAgICAgICAgIGtleToga2V5LFxuICAgICAgICAgICAgICB2YWx1ZTogdmFsdWVcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2V0OiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3RhY2subGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgaWYgKGtleSA9PT0gc3RhY2tbaV0ua2V5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0YWNrW2ldO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBrZXlzOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBrZXlzID0gW107XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIGtleXMucHVzaChzdGFja1tpXS5rZXkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGtleXM7XG4gICAgICAgICAgfSxcbiAgICAgICAgICB0b3A6IGZ1bmN0aW9uKCkge1xu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biAgICAgICAgICAgICAgICByZW1vdmVDbGFzczogYXR0cnMubW9kYWxJbkNsYXNzXG4gICAgICAgICAgICAgIH0pLnN0YXJ0KCkudGhlbihkb25lKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cblxuXG4gICAgICAgICAgJHEud2hlbihhbmltYXRpb25Qcm9taXNlKS50aGVuKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgLy8gTm90aWZ5IHtAbGluayAkbW9kYWxTdGFja30gdGhhdCBtb2RhbCBpcyByZW5kZXJlZC5cbiAgICAgICAgICAgIHZhciBtb2RhbCA9ICRtb2RhbFN0YWNrLmdldFRvcCgpO1xuICAgICAgICAgICAgaWYgKG1vZGFsKSB7XG4gICAgICAgICAgICAgICRtb2RhbFN0YWNrLm1vZGFsUmVuZGVyZWQobW9kYWwua2V5KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBJZiBzb21ldGhpbmcgd2l0aGluIHRoZSBmcmVzaGx5LW9wZW5lZCBtb2RhbCBhbHJlYWR5IGhhcyBmb2N1cyAocGVyaGFwcyB2aWEgYVxuICAgICAgICAgICAgICogZGlyZWN0aXZlIHRoYXQgY2F1c2VzIGZvY3VzKSB0aGVuIHRoZXJlJ3Mgbm8gbmVlZCB0byB0cnkgdG8gZm9jdXMgYW55dGhpbmcuXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGlmICghKCRkb2N1bWVudFswXS5hY3RpdmVFbGVtZW50ICYmIGVsZW1lbnRbMF0uY29udGFpbnMoJGRvY3VtZW50WzBdLmFjdGl2ZUVsZW1lbnQpKSkge1xuICAgICAgICAgICAgICB2YXIgaW5wdXRXaXRoQXV0b2ZvY3VzID0gZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yKCdbYXV0b2ZvY3VzXScpO1xuICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICogQXV0by1mb2N1c2luZyBvZiBhIGZyZXNobHktb3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y8gTm90ZSB0aGF0IGl0J3MgaW50ZW50aW9uYWwgdGhhdCBhc3luY1Byb21pc2UgbWlnaHQgYmUgbnVsbC5cbiAgICAgICAgLy8gVGhhdCdzIHdoZW4gc2V0SXNBc3luYyBoYXMgbm90IGJlZW4gY2FsbGVkIGR1cmluZyB0aGVcbiAgICAgICAgLy8gTk9XX0NMT1NJTkdfRVZFTlQgYnJvYWRjYXN0LlxuICAgICAgICByZXR1cm4gJHEud2hlbihhc3luY1Byb21pc2UpLnRoZW4oYWZ0ZXJBbmltYXRpbmcpO1xuXG4gICAgICAgIGZ1bmN0aW9uIGFmdGVyQW5pbWF0aW5nKCkge1xuICAgICAgICAgIGlmIChhZnRlckFuaW1hdGluZy5kb25lKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIGFmdGVyQW5pbWF0aW5nLmRvbmUgPSB0cnVlO1xuXG4gICAgICAgICAgJGFuaW1hdGUubGVhdmUoZG9tRWwpLnRoZW4oZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBpZiAoZG9uZSkge1xuICAgICAgICAgICAgICBkb25lKCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGRvbUVsLnJlbW92ZSgpO1xuICAgICAgICAgICAgaWYgKGNsb3NlZERlZmVycmVkKSB7XG4gICAgICAgICAgICAgIGNsb3NlZERlZmVycmVkLnJlc29sdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgJGRvY3VtZW50Lm9uKCdrZXlkb3duJywga2V5ZG93bkxpc3RlbmVyKTtcblxuICAgICAgJHJvb3RTY29wZS4kb24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICRkb2N1bWVudC5vZmYoJ2tleWRvd24nLCBrZXlkb3duTGlzdGVuZXIpO1xuICAgICAgfSk7XG5cbiAgICAgIGZ1bmN0aW9uIGtleWRvd25MaXN0ZW5lcihldnQpIHtcbiAgICAgICAgaWYgKGV2dC5pc0RlZmF1bHRQcmV2ZW50ZWQoKSkge1xuICAgICAgICAgIHJldHVybiBldnQ7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbW9kYWwgPSBvcGVuZWRXaW5kb3dzLnRvcCgpO1xuICAgICAgICBpZiAobW9kYWwpIHtcbiAgICAgICAgICBzd2l0Y2ggKGV2dC53aGljaCkge1xuICAgICAgICAgICAgY2FzZSAyNzoge1xuICAgICAgICAgICAgICBpZiAobW9kYWwudmFsdWUua2V5Ym9hcmQpIHtcbiAgICAgICAgICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICRtb2RhbFN0YWNrLmRpc21pc3MobW9kYWwua2V5LCAnZXNjYXBlIGtleSBwcmVzcycpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSA5OiB7XG4gICAgICAgICAgICAgIHZhciBsaXN0ID0gJG1vZGFsU3RhY2subG9hZEZvY3VzRWxlbWVudExpc3QobW9kYWwpO1xuICAgICAgICAgICAgICB2YXIgZm9jdXNDaGFuZ2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgIGlmIChldnQuc2hpZnRLZXkpIHtcbiAgICAgICAgICAgICAgICBpZiAoJG1vZGFsU3RhY2suaXNGb2N1c0luRmlyc3RJdGVtKGV2dCwgbGlzdCkgfHwgJG1vZGFsU3RhY2suaXNNb2RhbEZvY3VzZWQoZXZ0LCBtb2RhbCkpIHtcbiAgICAgICAgICAgICAgICAgIGZvY3VzQ2hhbmdlZCA9ICRtb2RhbFN0YWNrLmZvY3VzTGFzdEZvY3VzYWJsZUVsZW1lbnQobGlzdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICgkbW9kYWxTdGFjay5pc0ZvY3VzSW5MYXN0SXRlbShldnQsIGxpc3QpKSB7XG4gICAgICAgICAgICAgICAgICBmb2N1c0NoYW5nZWQgPSAkbW9kYWxTdGFjay5mb2N1c0ZpcnN0Rm9jdXNhYmxlRWxlbWVudChsaXN0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAoZm9jdXNDaGFuZ2VkKSB7XG4gICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgZXZ0LnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgICRtb2RhbFN0YWNrLm9wZW4gPSBmdW5jdGlvbihtb2RhbEluc3RhbmNlLCBtb2RhbCkge1xuICAgICAgICB2YXIgbW9kYWxPcGVuZXIgPSAkZG9jdW1lbnRbMF0uYWN0aXZlRWxlbWVudCxcbiAgICAgICAgICBtb2RhbEJvZHlDbGFzcyA9IG1vZGFsLm9wZW5lZENsYXNzIHx8IE9QRU5FRF9NT0RBTF9DTEFTUztcblxuICAgICAgICB0b2dnbGVUb3BXaW5kb3dDbGFzcyhmYWxzZSk7XG5cbiAgICAgICAgLy8gU3RvcmUgdGhlIGN1cnJlbnQgdG9wIGZpcnN0LCB0byBkZXRlcm1pbmUgd2hhdCBpbmRleCB3ZSBvdWdodCB0byB1c2VcbiAgICAgICAgLy8gZm9yIHRoZSBjdXJyZW50IHRvcCBtb2RhbFxuICAgICAgICBwcmV2aW91c1RvcE9wZW5lZE1vZGFsID0gb3BlbmVkV2luZG93cy50b3AoKTtcblxuICAgICAgICBvcGV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gICAgICAgIHZhciBlbGVtSXNBbHJlYWR5SGlkZGVuID0gc2libGluZy5nZXRBdHRyaWJ1dGUoJ2FyaWEtaGlkZGVuJykgPT09ICd0cnVlJyxcbiAgICAgICAgICAgICAgYXJpYUhpZGRlbkNvdW50ID0gcGFyc2VJbnQoc2libGluZy5nZXRBdHRyaWJ1dGUoQVJJQV9ISURERU5fQVRUUklCVVRFX05BTUUpLCAxMCk7XG5cbiAgICAgICAgICAgIGlmICghYXJpYUhpZGRlbkNvdW50KSB7XG4gICAgICAgICAgICAgIGFyaWFIaWRkZW5Db3VudCA9IGVsZW1Jc0FscmVhZHlIaWRkZW4gPyAxIDogMDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgc2libGluZy5zZXRBdHRyaWJ1dGUoQVJJQV9ISURERU5fQVRUUklCVVRFX05BTUUsIGFyaWFIaWRkZW5Db3VudCArIDEpO1xuICAgICAgICAgICAgc2libGluZy5zZXRBdHRyaWJ1dGUoJ2FyaWEtaGlkZGVuJywgJ3RydWUnKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHJldHVybiBhcHBseUFyaWFIaWRkZW4oZWwucGFyZW50KCkpO1xuXG4gICAgICAgICAgZnVuY3Rpb24gZ2V0U2libGluZ3MoZWwpIHtcbiAgICAgICAgICAgIHZhciBjaGlsZHJlbiA9IGVsLnBhcmVudCgpID8gZWwucGFyZW50KCkuY2hpbGRyZW4oKSA6IFtdO1xuXG4gICAgICAgICAgICByZXR1cm4gQXJyYXkucHJvdG90eXBlLmZpbHRlci5jYWxsKGNoaWxkcmVuLCBmdW5jdGlvbihjaGlsZCkge1xuICAgICAgICAgICAgICByZXR1cm4gY2hpbGQgIT09IGVsWzBdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9O1xuXG4gICAgICBmdW5jdGlvbiBicm9hZGNhc3RDbG9zaW5nKG1vZGFsV2luZG93LCByZXN1bHRPclJlYXNvbiwgY2xvc2lu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2x2ZVN1Y2Nlc3ModHBsQW5kVmFycykge1xuICAgICAgICAgICAgICAgIHZhciBwcm92aWRlZFNjb3BlID0gbW9kYWxPcHRpb25zLnNjb3BlIHx8ICRyb290U2NvcGU7XG5cbiAgICAgICAgICAgICAgICB2YXIgbW9kYWxTY29wZSA9IHByb3ZpZGVkU2NvcGUuJG5ldygpO1xuICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUuJGNsb3NlID0gbW9kYWxJbnN0YW5jZS5jbG9zZTtcbiAgICAgICAgICAgICAgICBtb2RhbFNjb3BlLiRkaXNtaXNzID0gbW9kYWxJbnN0YW5jZS5kaXNtaXNzO1xuXG4gICAgICAgICAgICAgICAgbW9kYWxTY29wZS4kb24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBpZiAoIW1vZGFsU2NvcGUuJCR1aWJEZXN0cnVjdGlvblNjaGVkdWxlZCkge1xuICAgICAgICAgICAgICAgICAgICBtb2RhbFNjb3BlLiRkaXNtaXNzKCckdWliVW5zY2hlZHVsZWREZXN0cnVjdGlvbicpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgdmFyIG1vZGFsID0ge1xuICAgICAgICAgICAgICAgICAgc2NvcGU6IG1vZGFsU2NvcGUsXG4gICAgICAgICAgICAgICAgICBkZWZlcnJlZDogbW9kYWxSZXN1bHREZWZlcnJlZCxcbiAgICAgICAgICAgICAgICAgIHJlbmRlckRlZmVycmVkOiBtb2RhbFJlbmRlckRlZmVycmVkLFxuICAgICAgICAgICAgICAgICAgY2xvc2VkRGVmZXJyZWQ6IG1vZGFsQ2xvc2VkRGVmZXJyZWQsXG4gICAgICAgICAgICAgICAgICBhbmltYXRpb246IG1vZGFsT3B0aW9ucy5hbmltYXRpb24sXG4gICAgICAgICAgICAgICAgICBiYWNrZHJvcDogbW9kYWxPcHRpb25zLmJhY2tkcm9wLFxuICAgICAgICAgICAgICAgICAga2V5Ym9hcmQ6IG1vZGFsT3B0aW9ucy5rZXlib2FyZCxcbiAgICAgICAgICAgICAgICAgIGJhY2tkcm9wQ2xhc3M6IG1vZGFsT3B0aW9ucy5iYWNrZHJvcENsYXNzLFxuICAgICAgICAgICAgICAgICAgd2luZG93VG9wQ2xhc3M6IG1vZGFsT3B0aW9ucy53aW5kb3dUb3BDbGFzcyxcbiAgICAgICAgICAgICAgICAgIHdpbmRvd0NsYXNzOiBtb2RhbE9wdGlvbnMud2luZG93Q2xhc3MsXG4gICAgICAgICAgICAgICAgICB3aW5kb3dUZW1wbGF0ZVVybDogbW9kYWxPcHRpb25zLndpbmRvd1RlbXBsYXRlVXJsLFxuICAgICAgICAgICAgICAgICAgYXJpYUxhYmVsbGVkQnk6IG1vZGFsT3B0aW9ucy5hcmlhTGFiZWxsZWRCeSxcbiAgICAgICAgICAgICAgICAgIGFyaWFEZXNjcmliZWRCeTogbW9kYWxPcHRpb25zLmFyaWFEZXNjcmliZWRCeSxcbiAgICAgICAgICAgICAgICAgIHNpemU6IG1vZGFsT3B0aW9ucy5zaXplLFxuICAgICAgICAgICAgICAgICAgb3BlbmVkQ2xhc3M6IG1vZGFsT3B0aW9ucy5vcGVuZWRDbGFzcyxcbiAgICAgICAgICAgICAgICAgIGFwcGVuZFRvOiBtb2RhbE9wdGlvbnMuYXBwZW5kVG9cbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHt9O1xuICAgICAgICAgICAgICAgIHZhciBjdHJsSW5zdGFuY2UsIGN0cmxJbnN0YW50aWF0ZSwgY3RybExvY2FscyA9IHt9O1xuXG4gICAgICAgICAgICAgICAgaWYgKG1vZGFsT3B0aW9ucy5jb21wb25lbnQpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0cnVjdExvY2Fscyhjb21wb25lbnQsIGZhbHNlLCB0cnVlLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICBjb21wb25lbnQubmFtZSA9IG1vZGFsT3B0aW9ucy5jb21wb25lbnQ7XG4gICAgICAgICAgICAgICAgICBtb2RhbC5jb21wb25lbnQgPSBjb21wb25lbnQ7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtb2RhbE9wdGlvbnMuY29udHJvbGxlcikge1xuICAgICAgICAgICAgICAgICAgY29uc3RydWN0TG9jYWxzKGN0cmxMb2NhbHMsIHRydWUsIGZhbHNlLCB0cnVlKTtcblxuICAgICAgICAgICAgICAgICAgLy8gdGhlIHRoaXJkIHBhcmFtIHdpbGwgbWFrZSB0aGUgY29udHJvbGxlciBpbnN0YW50aWF0ZSBsYXRlcixwcml2YXRlIGFwaVxuICAgICAgICAgICAgICAgICAgLy8gQHNlZSBodHRwczovL2dpdGh1Yi5jb20vYW5ndWxhci9hbmd1bGFyLmpzL2Jsb2IvbWFzdGVyL3NyYy9uZy9jb250cm9sbGVyLmpzI0wxMjZcbiAgICAgICAgICAgICAgICAgIGN0cmxJbnN0YW50aWF0ZSA9ICRjb250cm9sbGVyKG1vZGFsT3B0aW9ucy5jb250cm9sbGVyLCBjdHJsTG9jYWxzLCB0cnVlLCBtb2RhbE9wdGlvbnMuY29udHJvbGxlckFzKTtcbiAgICAgICAgICAgICAgICAgIGlmIChtb2RhbE9wdGlvbnMuY29udHJvbGxlckFzICYmIG1vZGFsT3B0aW9ucy5iaW5kVG9Db250cm9sbGVyKSB7XG4gICAgICAgICAgICAgICAgICAgIGN0cmxJbnN0YW5jZSA9IGN0cmxJbnN0YW50aWF0ZS5pbnN0YW5jZTtcbiAgICAgICAgICAgICAgICAgICAgY3RybEluc3RhbmNlLiRjbG9zZSA9IG1vZGFsU2NvcGUuJGNsb3NlO1xuICAgICAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UuJGRpc21pc3MgPSBtb2RhbFNjb3BlLiRkaXNtaXNzO1xuICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZChjdHJsSW5zdGFuY2UsIHtcbiAgICAgICAgICAgICAgICAgICAgICAkcmVzb2x2ZTogY3RybExvY2Fscy4kc2NvcGUuJHJlc29sdmVcbiAgICAgICAgICAgICAgICAgICAgfSwgcHJvdmlkZWRTY29wZSk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGN0cmxJbnN0YW5jZSA9IGN0cmxJbnN0YW50aWF0ZSgpO1xuXG4gICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKGN0cmxJbnN0YW5jZS4kb25Jbml0KSkge1xuICAgICAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UuJG9uSW5pdCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICghbW9kYWxPcHRpb25zLmNvbXBvbmVudCkge1xuICAgICAgICAgICAgICAgICAgbW9kYWwuY29udGVudCA9IHRwbEFuZFZhcnNbMF07XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgJG1vZGFsU3RhY2sub3Blbihtb2RhbEluc3RhbmNlLCBtb2RhbCk7XG4gICAgICAgICAgICAgICAgbW9kYWxPcGVuZWREZWZlcnJlZC5yZXNvbHZlKHRydWUpO1xuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gY29uc3RydWN0TG9jYWxzKG9iaiwgdGVtcGxhdGUsIGluc3RhbmNlT25TY29wZSwgaW5qZWN0YWJsZSkge1xuICAgICAgICAgICAgICAgICAgb2JqLiRzY29wZSA9IG1vZGFsU2NvcGU7XG4gICAgICAgICAgICAgICAgICBvYmouJHNjb3BlLiRyZXNvbHZlID0ge307XG4gICAgICAgICAgICAgICAgICBpZiAoaW5zdGFuY2VPblNjb3BlKSB7XG4gICAgICAgICAgICAgICAgICAgIG9iai4kc2NvcGUuJHVpYk1vZGFsSW5zdGFuY2UgPSBtb2RhbEluc3RhbmNlO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqLiR1aWJNb2RhbEluc3RhbmNlID0gbW9kYWxJbnN0YW5jZTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgdmFyIHJlc29sdmVzID0gdGVtcGxhdGUgPyB0cGxBbmRWYXJzWzFdIDogdHBsQW5kVmFycztcbiAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChyZXNvbHZlcywgZnVuY3Rpb24odmFsdWUsIGtleSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaW5qZWN0YWJsZSkge1xuICAgICAgICAgICAgICAgICAgICAgIG9ialtrZXldID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBvYmouJHNjb3BlLiRyZXNvbHZlW2tleV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIGZ1bmN0aW9uIHJlc29sdmVFcnJvcihyZWFzb24pIHtcbiAgICAgICAgICAgICAgbW9kYWxPcGVuZWREZWZlcnJlZC5yZWplY3QocmVhc29uKTtcbiAgICAgICAgICAgICAgbW9kYWxSZXN1bHREZWZlcnJlZC5yZWplY3QocmVhc29uKTtcbiAgICAgICAgICAgIH0pWydmaW5hbGx5J10oZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGlmIChwcm9taXNlQ2hhaW4gPT09IHNhbWVQcm9taXNlKSB7XG4gICAgICAgICAgICAgICAgcHJvbWlzZUNoYWluID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBtb2RhbEluc3RhbmNlO1xuICAgICAgICAgIH07XG5cbiAgICAgICAgICByZXR1cm4gJG1vZGFsO1xuICAgICAgICB9XG4gICAgICBdXG4gICAgfTtcblxuICAgIHJldHVybiAkbW9kYWxQcm92aWRlcjtcbiAgfS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2VyTWFwW3RyaWdnZXJdIHx8IHRyaWdnZXI7XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHNob3c6IHNob3csXG4gICAgICAgICAgaGlkZTogaGlkZVxuICAgICAgICB9O1xuICAgICAgfVxuXG4gICAgICB2YXIgZGlyZWN0aXZlTmFtZSA9IHNuYWtlX2Nhc2UodHRUeXBlKTtcblxuICAgICAgdmFyIHN0YXJ0U3ltID0gJGludGVycG9sYXRlLnN0YXJ0U3ltYm9sKCk7XG4gICAgICB2YXIgZW5kU3ltID0gJGludGVycG9sYXRlLmVuZFN5bWJvbCgpO1xuICAgICAgdmFyIHRlbXBsYXRlID1cbiAgICAgICAgJzxkaXYgJysgZGlyZWN0aXZlTmFtZSArICctcG9wdXAgJyArXG4gICAgICAgICAgJ3VpYi10aXRsZT1cIicgKyBzdGFydFN5bSArICd0aXRsZScgKyBlbmRTeW0gKyAnXCIgJyArXG4gICAgICAgICAgKG9wdGlvbnMudXNlQ29udGVudEV4cCA/XG4gICAgICAgICAgICAnY29udGVudC1leHA9XCJjb250ZW50RXhwKClcIiAnIDpcbiAgICAgICAgICAgICdjb250ZW50PVwiJyArIHN0YXJ0U3ltICsgJ2NvbnRlbnQnICsgZW5kU3ltICsgJ1wiICcpICtcbiAgICAgICAgICAnb3JpZ2luLXNjb3BlPVwib3JpZ1Njb3BlXCIgJyArXG4gICAgICAgICAgJ2NsYXNzPVwidWliLXBvc2l0aW9uLW1lYXN1cmUgJyArIHByZWZpeCArICdcIiAnICtcbiAgICAgICAgICAndG9vbHRpcC1hbmltYXRpb24tY2xhc3M9XCJmYWRlXCInICtcbiAgICAgICAgICAndWliLXRvb2x0aXAtY2xhc3NlcyAnICtcbiAgICAgICAgICAnbmctY2xhc3M9XCJ7IGluOiBpc09wZW4gfVwiICcgK1xuICAgICAgICAgICc+JyArXG4gICAgICAgICc8L2Rpdj4nO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICBjb21waWxlOiB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6IHR0UG9zaXRpb24ubGVmdCArICdweCcgfSk7XG4gICAgICAgICAgICAgICAgICB2YXIgcGxhY2VtZW50Q2xhc3NlcyA9IHR0UG9zaXRpb24ucGxhY2VtZW50LnNwbGl0KCctJyk7XG5cbiAgICAgICAgICAgICAgICAgIGlmICghdG9vbHRpcC5oYXNDbGFzcyhwbGFjZW1lbnRDbGFzc2VzWzBdKSkge1xuICAgICAgICAgICAgICAgICAgICB0b29sdGlwLnJlbW92ZUNsYXNzKGxhc3RQbGFjZW1lbnQuc3BsaXQoJy0nKVswXSk7XG4gICAgICAgICAgICAgICAgICAgIHRvb2x0aXAuYWRkQ2xhc3MocGxhY2VtZW50Q2xhc3Nlc1swXSk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGlmICghdG9vbHRpcC5oYXNDbGFzcyhvcHRpb25zLnBsYWNlbWVudENsYXNzUHJlZml4ICsgdHRQb3NpdGlvbi5wbGFjZW1lbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvb2x0aXAucmVtb3ZlQ2xhc3Mob3B0aW9ucy5wbGFjZW1lbnRDbGFzc1ByZWZpeCArIGxhc3RQbGFjZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB0b29sdGlwLmFkZENsYXNzKG9wdGlvbnMucGxhY2VtZW50Q2xhc3NQcmVmaXggKyB0dFBvc2l0aW9uLnBsYWNlbWVudCk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGFkanVzdG1lbnRUaW1lb3V0ID0gJHRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjdXJyZW50SGVpZ2h0ID0gYW5ndWxhci5pc0RlZmluZWQodG9vbHRpcC5vZmZzZXRIZWlnaHQpID8gdG9vbHRpcC5vZmZzZXRIZWlnaHQgOiB0b29sdGlwLnByb3AoJ29mZnNldEhlaWdodCcpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYWRqdXN0bWVudCA9ICRwb3NpdGlvbi5hZGp1c3RUb3AocGxhY2VtZW50Q2xhc3NlcywgZWxlbWVudFBvcywgaW5pdGlhbEhlaWdodCwgY3VycmVudEhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhZGp1c3RtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5jc3MoYWRqdXN0bWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYWRqdXN0bWVudFRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgfSwgMCwgZmFsc2UpO1xuXG4gICAgICAgICAgICAgICAgICAvLyBmaXJzdCB0aW1lIHRocm91Z2ggdHQgZWxlbWVudCB3aWxsIGhhdmUgdGhlXG4gICAgICAgICAgICAgICAgICAvLyB1aWItcG9zaXRpb24tbWVhc3VyZSBjbGFzcyBvciBpZiB0aGUgcGxhY2VtZW50XG4gICAgICAgICAgICAgICAgICAvLyBoYXMgY2hhbmdlZCB3ZSBuZWVkIHRvIHBvc2l0aW9uIHRoZSBhcnJvdy5cbiAgICAgICAgICAgICAgICAgIGlmICh0b29sdGlwLmhhc0NsYXNzKCd1aWItcG9zaXRpb24tbWVhc3VyZScpKSB7XG4gICAgICAgICAgICAgICAgICAgICRwb3NpdGlvbi5wb3NpdGlvbkFycm93KHRvb2x0aXAsIHR0UG9zaXRpb24ucGxhY2VtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmVDbGFzcygndWliLXBvc2l0aW9uLW1lYXN1cmUnKTtcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdFBsYWNlbWVudCAhPT0gdHRQb3NpdGlvbi5wbGFjZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgJHBvc2l0aW9uLnBvc2l0aW9uQXJyb3codG9vbHRpcCwgdHRQb3NpdGlvbi5wbGFjZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgbGFzdFBsYWNlbWVudCA9IHR0UG9zaXRpb24ucGxhY2VtZW50O1xuXG4gICAgICAgICAgICAgICAgICBwb3NpdGlvblRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICAgIH0sIDAsIGZhbHNlKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgLy8gU2V0IHVwIHRoZSBjb3JyZWN0IHNjb3BlIHRvIGFsbG93IHRyYW5zY2x1c2lvbiBsYXRlclxuICAgICAgICAgICAgdHRTY29wZS5vcmlnU2NvcGUgPSBzY29wZTtcblxuICAgICAgICAgICAgLy8gQnkgZGVmYXVsdCwgdGhlIHRvb2x0aXAgaXMgbm90IG9wZW4uXG4gICAgICAgICAgICAvLyBUT0RPIGFkZCBhYmlsaXR5IHRvIHN0YXJ0IHRvb2x0aXAgb3BlbmVkXG4gICAgICAgICAgICB0dFNjb3BlLmlzT3BlbiA9IGZhbHNlO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiB0b2dnbGVUb29sdGlwQmluZCgpIHtcbiAgICAgICAgICAgICAgaWYgKCF0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgIHNob3dUb29sdGlwQmluZCgpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGhpZGVUb29sdGlwQmluZCgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFNob3cgdGhlIHRvb2x0aXAgd2l0aCBkZWxheSBpZiBzcGVjaWZpZWQsIG90aGVyd2lzZSBzaG93IGl0IGltbWVkaWF0ZWx5XG4gICAgICAgICAgICBmdW5jdGlvbiBzaG93VG9vbHRpcEJpbmQoKSB7XG4gICAgICAgICAgICAgIGlmIChoYXNFbmFibGVFeHAgJiYgIXNjb3BlLiRldmFsKGF0dHJzW3ByZWZpeCArICdFbmFibGUnXSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjYW5jZWxIaWRlKCk7XG4gICAgICAgICAgICAgIHByZXBhcmVUb29sdGlwKCk7XG5cbiAgICAgICAgICAgICAgaWYgKHR0U2NvcGUucG9wdXBEZWxheSkge1xuICAgICAgICAgICAgICAgIC8vIERvIG5vdGhpbmcgaWYgdGhlIHRvb2x0aXAgd2FzIGFscmVhZHkgc2NoZWR1bGVkIHRvIHBvcC11cC5cbiAgICAgICAgICAgICAgICAvLyBUaGlzIGhhcHBlbnMgaWYgc2hvdyBpcyB0cmlnZ2VyZWQgbXVsdGlwbGUgdGltZXMgYmVmb3JlIGFueSBoaWRlIGlzIHRyaWdnZXJlZC5cbiAgICAgICAgICAgICAgICBpZiAoIXNob3dUaW1lb3V0KSB7XG4gICAgICAgICAgICAgICAgICBzaG93VGltZW91dCA9ICR0aW1lb3V0KHNob3csIHR0U2NvcGUucG9wdXBEZWxheSwgZmFsc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzaG93KCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gaGlkZVRvb2x0aXBCaW5kKCkge1xuICAgICAgICAgICAgICBjYW5jZWxTaG93KCk7XG5cbiAgICAgICAgICAgICAgaWYgKHR0U2NvcGUucG9wdXBDbG9zZURlbGF5KSB7XG4gICAgICAgICAgICAgICAgaWYgKCFoaWRlVGltZW91dCkge1xuICAgICAgICAgICAgICAgICAgaGlkZVRpbWVvdXQgPSAkdGltZW91dChoaWRlLCB0dFNjb3BlLnBvcHVwQ2xvc2VEZWxheSwgZmFsc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBoaWRlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gU2hvdyB0aGUgdG9vbHRpcCBwb3B1cCBlbGVtZW50LlxuICAgICAgICAgICAgZnVuY3Rpb24gc2hvdygpIHtcbiAgICAgICAgICAgICAgY2FuY2VsU2hvdygpO1xuICAgICAgICAgICAgICBjYW5jZWxIaWRlKCk7XG5cbiAgICAgICAgICAgICAgLy8gRG9uJ3Qgc2hvdyBlbXB0eSB0b29sdGlwcy5cbiAgICAgICAgICAgICAgaWYgKCF0dFNjb3BlLmNvbnRlbnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gYW5ndWxhci5ub29wO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgY3JlYXRlVG9vbHRpcCgpO1xuXG4gICAgICAgICAgICAgIC8vIEFuZCBzaG93IHRoZSB0b29sdGlwLlxuICAgICAgICAgICAgICB0dFNjb3BlLiRldmFsQXN5bmMoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdHRTY29wZS5pc09wZW4gPSB0cnVlO1xuICAgICAgICAgICAgICAgIGFzc2lnbklzT3Blbih0cnVlKTtcbiAgICAgICAgICAgICAgICBwb3NpdGlvblRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNhbmNlbFNob3coKSB7XG4gICAgICAgICAgICAgIGlmIChzaG93VGltZW91dCkge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChzaG93VGltZW91dCk7XG4gICAgICAgICAgICAgICAgc2hvd1RpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKHBvc2l0aW9uVGltZW91dCkge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChwb3NpdGlvblRpbWVvdXQpO1xuICAgICAgICAgICAgICAgIHBvc2l0aW9uVGltZW91dCA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gSGlkZSB0aGUgdG9vbHRpcCBwb3B1cCBlbGVtZW50LlxuICAgICAgICAgICAgZnVuY3Rpb24gaGlkZSgpIHtcbiAgICAgICAgICAgICAgaWYgKCF0dFNjb3BlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gRmlyc3QgdGhpbmdzIGZpcnN0OiB3ZSBkb24ndCBzaG93IGl0IGFueW1vcmUuXG4gICAgICAgICAgICAgIHR0U2NvcGUuJGV2YWxBc3luYyhmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBpZiAodHRTY29wZSkge1xuICAgICAgICAgICAgICAgICAgdHRTY29wZS5pc09wZW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGFzc2lnbklzT3BlbihmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAvLyBBbmQgbm93IHdlIHJlbW92ZSBpdCBmcm9tIHRoZSBET00uIEhvd2V2ZXIsIGlmIHdlIGhhdmUgYW5pbWF0aW9uLCB3ZVxuICAgICAgICAgICAgICAgICAgLy8gbmVlZCB0byB3YWl0IGZvciBpdCB0byBleHBpcmUgYmVmb3JlaGFuZC5cbiAgICAgICAgICAgICAgICAgIC8vIEZJWE1FOiB0aGlzIGlzIGEgcGxhY2Vob2xkZXIgZm9yIGEgcG9ydCBvZiB0aGUgdHJhbnNpdGlvbnMgbGlicmFyeS5cbiAgICAgICAgICAgICAgICAgIC8vIFRoZSBmYWRlIHRyYW5zaXRpb24gaW4gVFdCUyBpcyAxNTBtcy5cbiAgICAgICAgICAgICAgICAgIGlmICh0dFNjb3BlLmFuaW1hdGlvbikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXRyYW5zaXRpb25UaW1lb3V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRpbWVvdXQgPSAkdGltZW91dChyZW1vdmVUb29sdGlwLCAxNTAsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVtb3ZlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNhbmNlbEhpZGUoKSB7XG4gICAgICAgICAgICAgIGlmIChoaWRlVGltZW91dCkge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChoaWRlVGltZW91dCk7XG4gICAgICAgICAgICAgICAgaGlkZVRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKHRyYW5zaXRpb25UaW1lb3V0KSB7XG4gICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHRyYW5zaXRpb25UaW1lb3V0KTtcbiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVGltZW91dCA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gY3JlYXRlVG9vbHRpcCgpIHtcbiAgICAgICAgICAgICAgLy8gVGhlcmUgY2FuIG9ubHkgYmUgb25lIHRvb2x0aXAgZWxlbWVudCBwZXIgZGlyZWN0aXZlIHNob3duIGF0IG9uY2UuXG4gICAgICAgICAgICAgIGlmICh0b29sdGlwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlID0gdHRTY29wZS4kbmV3KCk7XG4gICAgICAgICAgICAgIHRvb2x0aXAgPSB0b29sdGlwTGlua2VyKHRvb2x0aXBMaW5rZWRTY29wZSwgZnVuY3Rpb24odG9vbHRpcCkge1xuICAgICAgICAgICAgICAgIGlmIChhcHBlbmRUb0JvZHkpIHtcbiAgICAgICAgICAgICAgICAgICRkb2N1bWVudC5maW5kKCdib2R5JykuYXBwZW5kKHRvb2x0aXApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBlbGVtZW50LmFmdGVyKHRvb2x0aXApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgb3BlbmVkVG9vbHRpcHMuYWRkKHR0U2NvcGUsIHtcbiAgICAgICAgICAgICAgICBjbG9zZTogaGlkZVxuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICBwcmVwT2JzZXJ2ZXJzKCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHJlbW92ZVRvb2x0aXAoKSB7XG4gICAgICAgICAgICAgIGNhbmNlbFNob3coKTtcbiAgICAgICAgICAgICAgY2FuY2VsSGlkZSgpO1xuICAgICAgICAgICAgICB1bnJlZ2lzdGVyT2JzZXJ2ZXJzKCk7XG5cbiAgICAgICAgICAgICAgaWYgKHRvb2x0aXApIHtcbiAgICAgICAgICAgICAgICB0b29sdGlwLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgIHRvb2x0aXAgPSBudWxsO1xuICAgICAgICAgICAgICAgIGlmIChhZGp1c3RtZW50VGltZW91dCkge1xuICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKGFkanVzdG1lbnRUaW1lb3V0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBvcGVuZWRUb29sdGlwcy5yZW1vdmUodHRTY29wZSk7XG4gICAgICAgICAgICAgIFxuICAgICAgICAgICAgICBpZiAodG9vbHRpcExpbmtlZFNjb3BlKSB7XG4gICAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIFNldCB0aGUgaW5pdGlhbCBzY29wZSB2YWx1ZXMuIE9uY2VcbiAgICAgICAgICAgICAqIHRoZSB0b29sdGlwIGlzIGNyZWF0ZWQsIHRoZSBvYnNlcnZlcnNcbiAgICAgICAgICAgICAqIHdpbGwgYmUgYWRkZWQgdG8ga2VlcCB0aGluZ3MgaW4gc3luYy5cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgZnVuY3Rpb24gcHJlcGFyZVRvb2x0aXAoKSB7XG4gICAgICAgICAgICAgIHR0U2NvcGUudGl0bGUgPSBhdHRyc1twcmVmaXggKyAnVGl0bGUnXTtcbiAgICAgICAgICAgICAgaWYgKGNvbnRlbnRQYXJzZSkge1xuICAgICAgICAgICAgICAgIHR0U2NvcGUuY29udGVudCA9IGNvbnRlbnRQYXJzZShzY29wZSk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdHRTY29wZS5jb250ZW50ID0gYXR0cnNbdHRUeXBlXTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHR0U2NvcGUucG9wdXBDbGFzcyA9IGF0dHJzW3ByZWZpeCArICdDbGFzcyddO1xuICAgICAgICAgICAgICB0dFNjb3BlLnBsYWNlbWVudCA9IGFuZ3VsYXIuaXNEZWZpbmVkKGF0dHJzW3ByZWZpeCArICdQbGFjZW1lbnQnXSkgPyBhdHRyc1twcmVmaXggKyAnUGxhY2VtZW50J10gOiBvcHRpb25zLnBsYWNlbWVudDtcbiAgICAgICAgICAgICAgdmFyIHBsYWNlbWVudCA9ICRwb3NpdGlvbi5wYXJzZVBsYWNlbWVudCh0dFNjb3BlLnBsYWNlbWVudCk7XG4gICAgICAgICAgICAgIGxhc3RQbGFjZW1lbnQgPSBwbGFjZW1l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VuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgIGlmICh2YWwpIHtcbiAgICAgICAgICAgICAgICBjYW5jZWxTaG93KCk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAodmFsICYmIHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgaGlkZSgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgaWYgKGlzT3BlblBhcnNlKSB7XG4gICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChpc09wZW5QYXJzZSwgZnVuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR0U2NvcGUgJiYgIXZhbCA9PT0gdHRTY29wZS5pc09wZW4pIHtcbiAgICAgICAgICAgICAgICAgIHRvZ2dsZVRvb2x0aXBCaW5kKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gcHJlcE9ic2VydmVycygpIHtcbiAgICAgICAgICAgICAgb2JzZXJ2ZXJzLmxlbmd0aCA9IDA7XG5cbiAgICAgICAgICAgICAgaWYgKGNvbnRlbnRQYXJzZSkge1xuICAgICAgICAgICAgICAgIG9ic2VydmVycy5wdXNoKFxuICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGNvbnRlbnRQYXJzZSwgZnVuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgICAgICAgIHR0U2NvcGUuY29udGVudCA9IHZhbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF2YWwgJiYgdHRTY29wZS5pc09wZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgICBoaWRlKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgIG9ic2VydmVycy5wdXNoKFxuICAgICAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyZXBvc2l0aW9uU2NoZWR1bGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgcmVwb3NpdGlvblNjaGVkdWxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlLiQkcG9zdERpZ2VzdChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9zaXRpb25TY2hlZHVsZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0dFNjb3BlICYmIHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb2JzZXJ2ZXJzLnB1c2goXG4gICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZSh0dFR5cGUsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgICAgICB0dFNjb3BlLmNvbnRlbnQgPSB2YWw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdmFsICYmIHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBvYnNlcnZlcnMucHVzaChcbiAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnVGl0bGUnLCBmdW5jdGlvbih2YWwpIHtcbiAgICAgICAgICAgICAgICAgIHR0U2NvcGUudGl0bGUgPSB2YWw7XG4gICAgICAgICAgICAgICAgICBpZiAodHRTY29wZS5pc09wZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb25Ub29sdGlwKCk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICBvYnNlcnZlcnMucHVzaChcbiAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnUGxhY2VtZW50JywgZnVuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgICAgICB0dFNjb3BlLnBsYWNlbWVudCA9IHZhbCA/IHZhbCA6IG9wdGlvbnMucGxhY2VtZW50O1xuICAgICAgICAgICAgICAgICAgaWYgKHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHVucmVnaXN0ZXJPYnNlcnZlcnMoKSB7XG4gICAgICAgICAgICAgIGlmIChvYnNlcnZlcnMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKG9ic2VydmVycywgZnVuY3Rpb24ob2JzZXJ2ZXIpIHtcbiAgICAgICAgICAgICAgICAgIG9ic2VydmVyKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgb2JzZXJ2ZXJzLmxlbmd0aCA9IDA7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gaGlkZSB0b29sdGlwcy9wb3BvdmVycyBmb3Igb3V0c2lkZUNsaWNrIHRyaWdnZXJcbiAgICAgICAgICAgIGZ1bmN0aW9uIGJvZHlIaWRlVG9vbHRpcEJpbmQoZSkge1xuICAgICAgICAgICAgICBpZiAoIXR0U2NvcGUgfHwgIXR0U2NvcGUuaXNPcGVuIHx8ICF0b29sdGlwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB0aGUgdG9vbHRpcC9wb3BvdmVyIGxpbmsgb3IgdG9vbCB0b29sdGlwL3BvcG92ZXIgaXRzZWxmIHdlcmUgbm90IGNsaWNrZWRcbiAgICAgICAgICAgICAgaWYgKCFlbGVtZW50WzBdLmNvbnRhaW5zKGUudGFyZ2V0KSAmJiAhdG9vbHRpcFswXS5jb250YWlucyhlLnRhcmdldCkpIHtcbiAgICAgICAgICAgICAgICBoaWRlVG9vbHRpcEJpbmQoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBLZXlib2FyZEV2ZW50IGhhbmRsZXIgdG8gaGlkZSB0aGUgdG9vbHRpcCBvbiBFc2NhcGUga2V5IHByZXNzXG4gICAgICAgICAgICBmdW5jdGlvbiBoaWRlT25Fc2NhcGVLZXkoZSkge1xuICAgICAgICAgICAgICBpZiAoZS53aGljaCA9PT0gMjcpIHtcbiAgICAgICAgICAgICAgICBoaWRlVG9vbHRpcEJpbmQoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgdW5yZWdpc3RlclRyaWdnZXJzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHRyaWdnZXJzLnNob3cuZm9yRWFjaChmdW5jdGlvbih0cmlnZ2VyKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRyaWdnZXIgPT09ICdvdXRzaWRlQ2xpY2snKSB7XG4gICAgICAgICAgICAgICAgICBlbGVtZW50Lm9mZignY2xpY2snLCB0b2dnbGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIGVsZW1lbnQub2ZmKHRyaWdnZXIsIHNob3dUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgICBlbGVtZW50Lm9mZih0cmlnZ2VyLCB0b2dnbGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsZW1lbnQub2ZmKCdrZXlwcmVzcycsIGhpZGVPbkVzY2FwZUtleSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB0cmlnZ2Vycy5oaWRlLmZvckVhY2goZnVuY3Rpb24odHJpZ2dlcikge1xuICAgICAgICAgICAgICAgIGlmICh0cmlnZ2VyID09PSAnb3V0c2lkZUNsaWNrJykge1xuICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZignY2xpY2snLCBib2R5SGlkZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5vZmYodHJpZ2dlciwgaGlkZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgZnVuY3Rpb24gcHJlcFRyaWdnZXJzKCkge1xuICAgICAgICAgICAgICB2YXIgc2hvd1RyaWdnZXJzID0gW10sIGhpZGVUcmlnZ2VycyA9IFtdO1xuICAgICAgICAgICAgICB2YXIgdmFsID0gc2NvcGUuJGV2YWwoYXR0cnNbcHJlZml4ICsgJ1RyaWdnZXInXSk7XG4gICAgICAgICAgICAgIHVucmVnaXN0ZXJUcmlnZ2VycygpO1xuXG4gICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzT2JqZWN0KHZhbCkpIHtcbiAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyh2YWwpLmZvckVhY2goZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgICAgICAgICBzaG93VHJpZ2dlcnMucHVzaChrZXkpO1xuICAgICAgICAgICAgICAgICAgaGlkZVRyaWdnZXJzLnB1c2godmFsW2tleV0pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHRyaWdnZXJzID0ge1xuICAgICAgICAgICAgICAgICAgc2hvdzogc2hvd1RyaWdnZXJzLFxuICAgICAgICAgICAgICAgICAgaGlkZTogaGlkZVRyaWdnZXJzXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0cmlnZ2VycyA9IGdldFRyaWdnZXJzKHZhbCk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAodHJpZ2dlcnMuc2hvdyAhPT0gJ25vbmUnKSB7XG4gICAgICAgICAgICAgICAgdHJpZ2dlcnMuc2hvdy5mb3JFYWNoKGZ1bmN0aW9uKHRyaWdnZXIsIGlkeCkge1xuICAgICAgICAgICAgICAgICAgaWYgKHRyaWdnZXIgPT09ICdvdXRzaWRlQ2xpY2snKSB7XG4gICAgICAgICAgICAgICAgICAgIGVsZW1lbnQub24oJ2NsaWNrJywgdG9nZ2xlVG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnQub24oJ2NsaWNrJywgYm9keUhpZGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRyaWdnZXIgPT09IHRyaWdnZXJzLmhpZGVbaWR4XSkge1xuICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm9uKHRyaWdnZXIsIHRvZ2dsZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHJpZ2dlcikge1xuICAgICAgICAgICAgICA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ocHJldmlvdXNFbGVtZW50KSB7XG4gICAgICAgICAgcHJldmlvdXNFbGVtZW50LnJlbW92ZSgpO1xuICAgICAgICAgIHByZXZpb3VzRWxlbWVudCA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY3VycmVudFNjb3BlKSB7XG4gICAgICAgICAgY3VycmVudFNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgICAgY3VycmVudFNjb3BlID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjdXJyZW50RWxlbWVudCkge1xuICAgICAgICAgICRhbmltYXRlLmxlYXZlKGN1cnJlbnRFbGVtZW50KS50aGVuKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBwcmV2aW91c0VsZW1lbnQgPSBjdXJyZW50RWxlbWVudDtcbiAgICAgICAgICBjdXJyZW50RWxlbWVudCA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHNjb3BlLiR3YXRjaCgkc2NlLnBhcnNlQXNSZXNvdXJjZVVybChhdHRycy51aWJUb29sdGlwVGVtcGxhdGVUcmFuc2NsdWRlKSwgZnVuY3Rpb24oc3JjKSB7XG4gICAgICAgIHZhciB0aGlzQ2hhbmdlSWQgPSArK2NoYW5nZUNvdW50ZXI7XG5cbiAgICAgICAgaWYgKHNyYykge1xuICAgICAgICAgIC8vc2V0IHRoZSAybmQgcGFyYW0gdG8gdHJ1ZSB0byBpZ25vcmUgdGhlIHRlbXBsYXRlIHJlcXVlc3QgZXJyb3Igc28gdGhhdCB0aGUgaW5uZXJcbiAgICAgICAgICAvL2NvbnRlbnRzIGFuZCBzY29wZSBjYW4gYmUgY2xlYW5lZCB1cC5cbiAgICAgICAgICAkdGVtcGxhdGVSZXF1ZXN0KHNyYywgdHJ1ZSkudGhlbihmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHRoaXNDaGFuZ2VJZCAhPT0gY2hhbmdlQ291bnRlcikgeyByZXR1cm47IH1cbiAgICAgICAgICAgIHZhciBuZXdTY29wZSA9IG9yaWdTY29wZS4kbmV3KCk7XG4gICAgICAgICAgICB2YXIgdGVtcGxhdGUgPSByZXNwb25zZTtcblxuICAgICAgICAgICAgdmFyIGNsb25lID0gJGNvbXBpbGUodGVtcGxhdGUpKG5ld1Njb3BlLCBmdW5jdGlvbihjbG9uZSkge1xuICAgICAgICAgICAgICBjbGVhbnVwTGFzdEluY2x1ZGVDb250ZW50KCk7XG4gICAgICAgICAgICAgICRhbmltYXRlLmVudGVyKGNsb25lLCBlbGVtKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjdXJyZW50U2NvcGUgPSBuZXdTY29wZTtcbiAgICAgICAgICAgIGN1cnJlbnRFbGVtZW50ID0gY2xvbmU7XG5cbiAgICAgICAgICAgIGN1cnJlbnRTY29wZS4kZW1pdCgnJGluY2x1ZGVDb250ZW50TG9hZGVkJywgc3JjKTtcbiAgICAgICAgICB9LCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGlmICh0aGlzQ2hhbmdlSWQgPT09IGNoYW5nZUNvdW50ZXIpIHtcbiAgICAgICAgICAgICAgY2xlYW51cExhc3RJbmNsdWRlQ29udGVudCgpO1xuICAgICAgICAgICAgICBzY29wZS4kZW1pdCgnJGluY2x1ZGVDb250ZW50RXJyb3InLCBzcmMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICAgIHNjb3BlLiRlbWl0KCckaW5jbHVkZUNvbnRlbnRSZXF1ZXN0ZWQnLCBzcmMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNsZWFudXBMYXN0SW5jbHVkZUNvbnRlbnQoKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIHNjb3BlLiRvbignJGRlc3Ryb3knLCBjbGVhbnVwTGFzdEluY2x1ZGVD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YXguYXBwbHkobnVsbCwgdGFic2V0Q3RybC50YWJzLm1hcChmdW5jdGlvbih0KSB7IHJldHVybiB0LmluZGV4OyB9KSkgKyAxO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHNjb3BlLmluZGV4ID0gMDtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoYW5ndWxhci5pc1VuZGVmaW5lZChhdHRycy5jbGFzc2VzKSkge1xuICAgICAgICBzY29wZS5jbGFzc2VzID0gJyc7XG4gICAgICB9XG5cbiAgICAgIHNjb3BlLnNlbGVjdCA9IGZ1bmN0aW9uKGV2dCkge1xuICAgICAgICBpZiAoIXNjb3BlLmRpc2FibGVkKSB7XG4gICAgICAgICAgdmFyIGluZGV4O1xuICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGFic2V0Q3RybC50YWJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAodGFic2V0Q3RybC50YWJzW2ldLnRhYiA9PT0gc2NvcGUpIHtcbiAgICAgICAgICAgICAgaW5kZXggPSBpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICB0YWJzZXRDdHJsLnNlbGVjdChpbmRleCwgZXZ0KTtcbiAgICAgICAgfVxuICAgICAgfTtcblxuICAgICAgdGFic2V0Q3RybC5hZGRUYWIoc2NvcGUpO1xuICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICB0YWJzZXRDdHJsLnJlbW92ZVRhYihzY29wZSk7XG4gICAgICB9KTtcblxuICAgICAgLy9XZSBuZWVkIHRvIHRyYW5zY2x1ZGUgbGF0ZXIsIG9uY2UgdGhlIGNvbnRlbnQgY29udGFpbmVyIGlzIHJlYWR5LlxuICAgICAgLy93aGVuIHRoaXMgbGluayBoYXBwZW5zLCB3ZSdyZSBpbnNpZGUgYSB0YWIgaGVhZGluZy5cbiAgICA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gPSBnZXRNaW51dGVzRnJvbVRlbXBsYXRlKCk7XG4gICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChob3VycykgJiYgYW5ndWxhci5pc0RlZmluZWQobWludXRlcykpIHtcbiAgICAgICAgICBzZWxlY3RlZC5zZXRIb3Vycyhob3Vycyk7XG4gICAgICAgICAgcmVmcmVzaCgpO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB1cGRhdGVUZW1wbGF0ZSgpO1xuICAgICAgfVxuICAgIH0pKTtcbiAgfVxuXG4gIC8vIEdldCAkc2NvcGUuaG91cnMgaW4gMjRIIG1vZGUgaWYgdmFsaWRcbiAgZnVuY3Rpb24gZ2V0SG91cnNGcm9tVGVtcGxhdGUoKSB7XG4gICAgdmFyIGhvdXJzID0gKyRzY29wZS5ob3VycztcbiAgICB2YXIgdmFsaWQgPSAkc2NvcGUuc2hvd01lcmlkaWFuID8gaG91cnMgPiAwICYmIGhvdXJzIDwgMTMgOlxuICAgICAgaG91cnMgPj0gMCAmJiBob3VycyA8IDI0O1xuICAgIGlmICghdmFsaWQgfHwgJHNjb3BlLmhvdXJzID09PSAnJykge1xuICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9XG5cbiAgICBpZiAoJHNjb3BlLnNob3dNZXJpZGlhbikge1xuICAgICAgaWYgKGhvdXJzID09PSAxMikge1xuICAgICAgICBob3VycyA9IDA7XG4gICAgICB9XG4gICAgICBpZiAoJHNjb3BlLm1lcmlkaWFuID09PSBtZXJpZGlhbnNbMV0pIHtcbiAgICAgICAgaG91cnMgPSBob3VycyArIDEyO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gaG91cnM7XG4gIH1cblxuICBmdW5jdGlvbiBnZXRNaW51dGVzRnJvbVRlbXBsYXRlKCkge1xuICAgIHZhciBtaW51dGVzID0gKyRzY29wZS5taW51dGVzO1xuICAgIHZhciB2YWxpZCA9IG1pbnV0ZXMgPj0gMCAmJiBtaW51dGV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sIHNlY29uZHNJbnB1dEVsKSB7XG4gICAgaG91cnNJbnB1dEVsLm9uKCdrZXlkb3duJywgZnVuY3Rpb24oZSkge1xuICAgICAgaWYgKCFkaXNhYmxlZCkge1xuICAgICAgICBpZiAoZS53aGljaCA9PT0gMzgpIHsgLy8gdXBcbiAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgJHNjb3BlLmluY3JlbWVudEhvdXJzKCk7XG4gICAgICAgICAgJHNjb3BlLiRhcHBseSgpO1xuICAgICAgICB9IGVsc2UgaWYgKGUud2hpY2ggPT09IDQwKSB7IC8vIGRvd25cbiAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgJHNjb3BlLmRlY3JlbWVudEhvdXJzKCk7XG4gICAgICAgICAgJHNjb3BlLiRhcHBseSgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICBtaW51dGVzSW5wdXRFbC5vbigna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgIGlmICghZGlzYWJsZWQpIHtcbiAgICAgICAgaWYgKGUud2hpY2ggPT09IDM4KSB7IC8vIHVwXG4gICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICRzY29wZS5pbmNyZW1lbnRNaW51dGVzKCk7XG4gICAgICAgICAgJHNjb3BlLiRhcHBseSgpO1xuICAgICAgICB9IGVsc2UgaWYgKGUud2hpY2ggPT09IDQwKSB7IC8vIGRvd25cbiAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgJHNjb3BlLmRlY3JlbWVudE1pbnV0ZXMoKTtcbiAgICAgICAgICAkc2NvcGUuJGFwcGx5KCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcblxuICAgIHNlY29uZHNJbnB1dEVsLm9uKCdrZXlkb3duJywgZnVuY3Rpb24oZSkge1xuICAgICAgaWYgKCFkaXNhYmxlZCkge1xuICA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BhZ2VcbiAgICAgICAgICAgIC8vZHVlIHRvIG90aGVyIGVsZW1lbnRzIGJlaW5nIHJlbmRlcmVkXG4gICAgICAgICAgICByZWNhbGN1bGF0ZVBvc2l0aW9uKCk7XG5cbiAgICAgICAgICAgIGVsZW1lbnQuYXR0cignYXJpYS1leHBhbmRlZCcsIHRydWUpO1xuXG4gICAgICAgICAgICAvL1NlbGVjdCB0aGUgc2luZ2xlIHJlbWFpbmluZyBvcHRpb24gaWYgdXNlciBpbnB1dCBtYXRjaGVzXG4gICAgICAgICAgICBpZiAoc2VsZWN0T25FeGFjdCAmJiBzY29wZS5tYXRjaGVzLmxlbmd0aCA9PT0gMSAmJiBpbnB1dElzRXhhY3RNYXRjaChpbnB1dFZhbHVlLCAwKSkge1xuICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc051bWJlcihzY29wZS5kZWJvdW5jZVVwZGF0ZSkgfHwgYW5ndWxhci5pc09iamVjdChzY29wZS5kZWJvdW5jZVVwZGF0ZSkpIHtcbiAgICAgICAgICAgICAgICAkJGRlYm91bmNlKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0KDAsIGV2dCk7XG4gICAgICAgICAgICAgICAgfSwgYW5ndWxhci5pc051bWJlcihzY29wZS5kZWJvdW5jZVVwZGF0ZSkgPyBzY29wZS5kZWJvdW5jZVVwZGF0ZSA6IHNjb3BlLmRlYm91bmNlVXBkYXRlWydkZWZhdWx0J10pO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdCgwLCBldnQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChzaG93SGludCkge1xuICAgICAgICAgICAgICB2YXIgZmlyc3RMYWJlbCA9IHNjb3BlLm1hdGNoZXNbMF0ubGFiZWw7XG4gICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzU3RyaW5nKGlucHV0VmFs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ZWxlY3Rpb24nXSxcbiAgICAgICAgICAgIFsnZURhdGVwaWNrZXJBcHBlbmRUb0JvZHknLCAnZGF0ZXBpY2tlci1hcHBlbmQtdG8tYm9keSddLFxuICAgICAgICAgICAgWydlT25PcGVuRm9jdXMnLCAnb24tb3Blbi1mb2N1cyddLFxuICAgICAgICAgICAgWydlTmFtZScsICduYW1lJ10sXG4gICAgICAgICAgICBbJ2VEYXRlRGlzYWJsZWQnLCAnZGF0ZS1kaXNhYmxlZCddLFxuICAgICAgICAgICAgWydlQWx0SW5wdXRGb3JtYXRzJywgJ2FsdC1pbnB1dC1mb3JtYXRzJ10sXG4gICAgICAgICAgICBbJ2VEYXRlcGlja2VyVGVtcGxhdGVVcmwnLCAnZGF0ZXBpY2tlci10ZW1wbGF0ZS11cmwnXVxuICAgICAgICBdO1xuXG4gICAgICAgIHZhciBkYXRlT3B0aW9uc05hbWVzID0gW1xuICAgICAgICAgICAgWydlRm9ybWF0RGF5JywgJ2Zvcm1hdERheSddLFxuICAgICAgICAgICAgWydlRm9ybWF0TW9udGgnLCAnZm9ybWF0TW9udGgnXSxcbiAgICAgICAgICAgIFsnZUZvcm1hdFllYXInLCAnZm9ybWF0WWVhciddLFxuICAgICAgICAgICAgWydlRm9ybWF0RGF5SGVhZGVyJywgJ2Zvcm1hdERheUhlYWRlciddLFxuICAgICAgICAgICAgWydlRm9ybWF0RGF5VGl0bGUnLCAnZm9ybWF0RGF5VGl0bGUnXSxcbiAgICAgICAgICAgIFsnZUZvcm1hdE1vbnRoVGl0bGUnLCAnZm9ybWF0TW9udGhUaXRsZSddLFxuICAgICAgICAgICAgWydlTWF4TW9kZScsICdtYXhNb2RlJ10sXG4gICAgICAgICAgICBbJ2VNaW5Nb2RlJywgJ21pbk1vZGUnXSxcbiAgICAgICAgICAgIFsnZURhdGVwaWNrZXJNb2RlJywgJ2RhdGVwaWNrZXJNb2RlJ11cbiAgICAgICAgXTtcblxuICAgICAgICByZXR1cm4gZWRpdGFibGVEaXJl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ICAgIGlucHV0RGF0ZVBpY2tlci5hdHRyKCd5ZWFyLXJhbmdlJywgYXR0cnMuZVllYXJSYW5nZSB8fCAyMCk7XG4gICAgICAgICAgICAgICAgaW5wdXREYXRlUGlja2VyLmF0dHIoJ25nLXJlYWRvbmx5JywgYXR0cnMuZVJlYWRvbmx5IHx8IGZhbHNlKTtcblxuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBwb3B1cEF0dHJOYW1lcy5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcG9wdXBBdHRyID0gYXR0cnNbcG9wdXBBdHRyTmFtZXNbaV1bMF1dO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBvcHVwQXR0ciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0RGF0ZVBpY2tlci5hdHRyKHBvcHVwQXR0ck5hbWVzW2ldWzFdLCBwb3B1cEF0dHIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGF0dHJzLmVOZ0NoYW5nZSkge1xuICAgICAgICAgICAgICAgICAgICBpbnB1dERhdGVQaWNrZXIuYXR0cignbmctY2hhbmdlJywgYXR0cnMuZU5nQ2hhbmdlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ25nLWNoYW5nZScpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChhdHRycy5lU3R5bGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5wdXREYXRlUGlja2VyLmF0dHIoJ3N0eWxlJywgYXR0cnMuZVN0eWxlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ3N0eWxlJyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIGRhdGVPcHRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICBtYXhEYXRlOiBzY29wZS4kZXZhbChhdHRycy5lTWF4RGF0ZSkgfHwgdWliRGF0ZXBpY2tlckNvbmZpZy5tYXhEYXRlLFxuICAgICAgICAgICAgICAgICAgICBtaW5EYXRlOiBzY29wZS4kZXZhbChhdHRycy5lTWluRGF0ZSkgfHwgdWliRGF0ZXBpY2tlckNvbmZpZy5taW5EYXRlLFxuICAgICAgICAgICAgICAgICAgICBzaG93V2Vla3M6IGF0dHJzLmVTaG93V2Vla3MgPyBhdHRycy5lU2hvd1dlZWtzLnRvTG93ZXJDYXNlKCkgPT09ICd0cnVlJyA6IHVpYkRhdGVwaWNrZXJDb25maWcuc2hvd1dlZWtzLFxuICAgICAgICAgICAgICAgICAgICBzdGFydGluZ0RheTogYXR0cnMuZVN0YXJ0aW5nRGF5IHx8IDAsXG4gICAgICAgICAgICAgICAgICAgIGluaXREYXRlOiBzY29wZS4kZXZhbChhdHRycy5lSW5pdERhdGUpIHx8IG5ldyBEYXRlKClcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgaWYgKGF0dHJzLmVEYXRlcGlja2VyT3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZURhdGVwaWNrZXJPcHRpb25zID0gJHBhcnNlKGF0dHJzLmVEYXRlcGlja2VyT3B0aW9ucykoc2NvcGUpO1xuICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZChkYXRlT3B0aW9ucywgZURhdGVwaWNrZXJPcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmb3IgKHZhciB6ID0gZGF0ZU9wdGlvbnNOYW1lcy5sZW5ndGggLSAxOyB6ID49IDA7IHotLSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZG9BdHRyID0gYXR0cnNbZGF0ZU9wdGlvbnNOYW1lc1t6XVswXV07XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZG9BdHRyICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0ZU9wdGlvbnNbZGF0ZU9wdGlvbnNOYW1lc1t6XVsxXV0gPSBkb0F0dHI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBzY29wZS5kYXRlT3B0aW9ucyA9IGRhdGVPcHRpb25zO1xuXG4gICAgICAgICAgICAgICAgdmFyIHNob3dDYWxlbmRhckJ1dHRvbiA9IGFuZ3VsYXIuaXNEZWZpbmVkKGF0dHJzLmVTaG93Q2FsZW5kYXJCdXR0b24pID8gYXR0cnMuZVNob3dDYWxlbmRhckJ1dHRvbiA6IFwidHJ1ZVwiO1xuXG4gICAgICAgICAgICAgICAgLy9TZWUgaWYgY2FsZW5kYXIgYnV0dG9uIHNob3VsZCBiZSBkaXNwbGF5ZWRcbiAgICAgICAgICAgICAgICBpZiAoc2hvd0NhbGVuZGFyQnV0dG9uID09PSBcInRydWVcIikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYnV0dG9uRGF0ZVBpY2tlciA9IGFuZ3VsYXIuZWxlbWVudCgnPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCIgY2xhc3M9XCInICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50aGVtZS5jYWxlbmRhckJ1dHRvbkNsYXNzICsgJ1wiPjxpIGNsYXNzPVwiJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaWNvbl9zZXQuY2FsZW5kYXIgKyAnXCI+PC9pPjwvYnV0dG9uPicpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYnV0dG9uV3JhcHBlciA9IGFuZ3VsYXIuZWxlbWVudCgnPHNwYW4gY2xhc3M9XCInICsgdGhpcy50aGVtZS5idXR0b25Hcm91cEFwcGVuZENsYXNzKyAnXCI+PC9zcGFuPicpO1xuXG4gICAgICAgICAgICAgICAgICAgIGJ1dHRvbkRhdGVQaWNrZXIuYXR0cignbmctY2xpY2snLCBhdHRycy5lTmdDbGljayk7XG5cbiAgICAgICAgICAgICAgICAgICAgYnV0dG9uV3JhcHBlci5hcHBlbmQoYnV0dG9uRGF0ZVBpY2tlcik7XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLmFwcGVuZChidXR0b25XcmFwcGVyKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvL0lmIG5vIGNhbGVuZGFyIGJ1dHRvbiwgZGlzcGxheSBjYWxlbmRhciBwb3B1cCBvbiBjbGljayBvZiBpbnB1dCBmaWVsZFxuICAgICAgICAgICAgICAgICAgICBpbnB1dERhdGVQaWNrZXIuYXR0cignbmctY2xpY2snLCBhdHRycy5lTmdDbGljayk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaW5wdXREYXRlUGlja2VyLmF0dHIoJ2RhdGVwaWNrZXItb3B0aW9ucycsIFwiZGF0ZU9wdGlvbnNcIik7XG5cbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucHJlcGVuZChpbnB1dERhdGVQaWNrZXIpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ2NsYXNzJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ25nLWNsaWNrJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ2lzLW9wZW4nKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cignaW5pdC1kYXRlJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ2RhdGVwaWNrZXItcG9wdXAnKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cigncmVxdWlyZWQnKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cignbmctbW9kZWwnKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cignZGF0ZS1waWNrZXItYXBwZW5kLXRvLWJvZHknKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cignbmFtZScpO1xuICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hdHRyKCdjbGFzcycsJ2lucHV0LWdyb3VwJyk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYXV0b3N1Ym1pdDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgICAgIHNlbGYuaW5wdXRFbC5iaW5kKCdjaGFuZ2UnLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uJHN1Ym1pdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0sIDUwMCk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgLy9zdWJtaXQgb24gdGFiXG4gICAgICAgICAgICAgICAgICAgIGlmIChlLmtleUNvZGUgPT09IDkgJiYgc2VsZi5lZGl0b3JFbC5hdHRyKCdibHVyJykgPT09ICdzdWJtaXQnKSB7XG4gICAgICAgICAgICAgIC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bnQoKS5wcmVwZW5kKGxhYmVsKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBBZGQgY2xhc3NlcyB0byB0aGUgZm9ybVxuICAgICAgICAgICAgaWYgKGF0dHJzLmVGb3JtY2xhc3MpIHtcbiAgICAgICAgICAgICAgdGhpcy5lZGl0b3JFbC5hZGRDbGFzcyhhdHRycy5lRm9ybWNsYXNzKTtcbiAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ2Zvcm1jbGFzcycpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgYXV0b3N1Ym1pdDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgICAgICAvL3N1Ym1pdCBvbiB0YWJcbiAgICAgICAgICAgICAgICBpZiAoZS5rZXlDb2RlID09PSA5ICYmIHNlbGYuZWRpdG9yRWwuYXR0cignYmx1cicpID09PSAnc3VibWl0Jykge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uJHN1Ym1pdCgpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1dKTtcbiAgfSk7XG5cbiAgLy9gcmFuZ2VgIGlzIGJpdCBzcGVjaWZpY1xuICBhbmd1bGFyLm1vZHVsZSgneGVkaXRhYmxlJykuZGlyZWN0aXZlKCdlZGl0YWJsZVJhbmdlJywgWydlZGl0YWJsZURpcmVjdGl2ZUZhY3RvcnknLCAnJGludGVycG9sYXRlJy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Igc2VsZiA9IHRoaXM7XG4gICAgICAgIHNlbGYucGFyZW50LmFkZExpc3RlbmVycy5jYWxsKHNlbGYpO1xuICAgICAgICAvLyBzdWJtaXQgdGV4dGFyZWEgYnkgY3RybCtlbnRlciBldmVuIHdpdGggYnV0dG9uc1xuICAgICAgICBpZiAoc2VsZi5zaW5nbGUgJiYgc2VsZi5idXR0b25zICE9PSAnbm8nKSB7XG4gICAgICAgICAgc2VsZi5hdXRvc3VibWl0KCk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBhdXRvc3VibWl0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICBpZiAoc2VsZi5hdHRycy5zdWJtaXRPbkVudGVyKSB7XG4gICAgICAgICAgICBpZiAoZS5rZXlDb2RlID09PSAxMyAmJiAhZS5zaGlmdEtleSkge1xuICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRmb3JtLiRzdWJtaXQoKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmICgoZS5jdHJsS2V5IHx8IGUubWV0YUtleSkgJiYgKGUua2V5Q29kZSA9PT0gMTMpIHx8IFxuICAgICAgICAgICAgICAgIChlLmtleUNvZGUgPT09IDkgJiYgc2VsZi5lZGl0b3JFbC5hdHRyKCdibHVyJykgPT09ICdzdWJtaXQnKSkge1xuICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uJHN1Ym1pdCgpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH1cbiAg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24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRmb3JtLiRzdWJtaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9LCA1MDApO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgc2VsZi5pbnB1dEVsLmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vc3VibWl0IG9uIHRhYlxuICAgICAgICAgICAgICAgICAgICBpZiAoZS5rZXlDb2RlID09PSA5ICYmIHNlbGYuZWRpdG9yRWwuYXR0cignYmx1cicpID09PSAnc3VibWl0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kZm9ybS4kc3VibWl0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICB2YXIgbGlua09yZyA9IGRpci5saW5rO1xuXG4gICAgICAgIGRpci5saW5rID0gZnVuY3Rpb24gKHNjb3BlLCBlbCwgYXR0cnMsIGN0cmwpIHtcbiAgICAgICAgICAgIHZhciBtYXRjaEVsID0gZWwuZmluZCgnZWRpdGFibGUtdWktc2VsZWN0LW1hdGNoJyk7XG4gICAgICAgICAgICB2YXIgY2hvaWNlc0VsID0gZWwuZmluZCgnZWRpdGFibGUtdWktc2VsZWN0LWNob2ljZXMnKTtcblxuICAgICAgICAgICAgYXR0cnMuJG1hdGNoRWxlbWVudCA9IG1hdGNoRWwuY2xvbmUoKTtcbiAgICA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ICAgICAgICAgICpcbiAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmhpZGVcbiAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZWxlbWVudFxuICAgICAgICAgICAqL1xuICAgICAgICAgIGlmICgkYXR0cnMub25oaWRlKSB7XG4gICAgICAgICAgICBzZWxmLm9uaGlkZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgcmV0dXJuICRwYXJzZSgkYXR0cnMub25oaWRlKSgkc2NvcGUpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBjb250cm9sIGlzIGNhbmNlbGxlZC5cbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEB2YXIge21ldGhvZHxhdHRyaWJ1dGV9IG9uY2FuY2VsXG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWVsZW1lbnRcbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpZiAoJGF0dHJzLm9uY2FuY2VsKSB7XG4gICAgICAgICAgICBzZWxmLm9uY2FuY2VsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICByZXR1cm4gJHBhcnNlKCRhdHRycy5vbmNhbmNlbCkoJHNjb3BlKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQ2FsbGVkIGR1cmluZyBzdWJtaXQgYmVmb3JlIHZhbHVlIGlzIHNhdmVkIHRvIG1vZGVsLlxuICAgICAgICAgICAqIFNlZSBbZGVtb10oI29uYmVmb3Jlc2F2ZSkuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmJlZm9yZXNhdmVcbiAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZWxlbWVudFxuICAgICAgICAgICAqL1xuICAg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biAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgdHJhbnNmZXJBdHRyID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgbmV4dExldHRlciA9IGsuc3Vic3RyaW5nKDEsIDIpO1xuXG4gICAgICAgICAgICAvLyBpZiBzdGFydHMgd2l0aCBgZWAgKyB1cHBlcmNhc2UgbGV0dGVyXG4gICAgICAgICAgICBpZiAoay5zdWJzdHJpbmcoMCwgMSkgPT09ICdlJyAmJiBuZXh0TGV0dGVyID09PSBuZXh0TGV0dGVyLnRvVXBwZXJDYXNlKCkpIHtcbiAgICAgICAgICAgICAgdHJhbnNmZXJBdHRyID0gay5zdWJzdHJpbmcoMSk7IC8vIGN1dCBgZWBcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBleGNsdWRlIGBmb3JtYCBhbmQgYG5nLXN1Ym1pdGAsXG4gICAgICAgICAgICBpZiAodHJhbnNmZXJBdHRyID09PSAnRm9ybScgfHwgdHJhbnNmZXJBdHRyID09PSAnTmdTdWJtaXQnKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgZmlyc3RMZXR0ZXIgPSB0cmFuc2ZlckF0dHIuc3Vic3RyaW5nKDAsIDEpO1xuICAgICAgICAgICAgdmFyIHNlY29uZExldHRlciA9IHRyYW5zZmVyQXR0ci5zdWJzdHJpbmcoMSwgMik7XG5cbiAgICAgICAgICAgIC8vIGNvbnZlcnQgYmFjayB0byBsb3dlcmNhc2Ugc3R5bGVcbiAgICAgICAgICAgIGlmIChzZWNvbmRMZXR0ZXIgPT09IHNlY29uZExldHRlci50b1VwcGVyQ2FzZSgpICYmXG4gICAgICAgICAgICAgIGZpcnN0TGV0dGVyID09PSBmaXJzdExldHRlci50b1VwcGVyQ2FzZS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gICAgICAgLy8gY2FuY2VsXG4gICAgICAgIHNlbGYuY2FuY2VsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgIC8vIG9uY2FuY2VsXG4gICAgICAgICAgc2VsZi5vbmNhbmNlbCgpO1xuICAgICAgICAgIC8vIGRvbid0IGNhbGwgaGlkZSgpIGhlcmUgYXMgaXQgY2FsbGVkIGluIGZvcm0ncyBjb2RlXG4gICAgICAgIH07XG5cbiAgICAgICAgLypcbiAgICAgICAgQ2FsbGVkIGFmdGVyIHNob3cgdG8gYXR0YWNoIGxpc3RlbmVyc1xuICAgICAgICAqL1xuICAgICAgICBzZWxmLmFkZExpc3RlbmVycyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAvLyBiaW5kIGtleXVwIGZvciBgZXNjYXBlYFxuICAgICAgICAgIHNlbGYuaW5wdXRFbC5iaW5kKCdrZXl1cCcsIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICBpZiAoIXNlbGYuc2luZ2xlKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gdG9kbzogbW92ZSB0aGlzIHRvIGVkaXRhYmxlLWZvcm0hXG4gICAgICAgICAgICBzd2l0Y2ggKGUua2V5Q29kZSkge1xuICAgICAgICAgICAgICAvLyBoaWRlIG9uIGBlc2NhcGVgIHByZXNzXG4gICAgICAgICAgICAgIGNhc2UgMjc6XG4gICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kZm9ybS4kY2FuY2VsKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAvLyBhdXRvc3VibWl0IHdoZW4gYG5vIGJ1dHRvbnNgXG4gICAgICAgICAgaWYgKHNlbGYuc2luZ2xlICYmIHNlbGYuYnV0dG9ucyA9PT0gJ25vJykge1xuICAgICAgICAgICAgc2VsZi5hdXRvc3VibWl0KCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gY2xpY2sgLSBtYXJrIGVsZW1lbnQgYXMgY2xpY2tlZCB0byBleGNsdWRlIGluIGRvY3VtZW50IGNsaWNrIGhhbmRsZXJcbiAgICAgICAgICBzZWxmLmVkaXRvckVsLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgIC8vIGlnbm9yZSByaWdodC9taWRkbGUgYnV0dG9uIGNsaWNrXG4gICAgICAgICAgICBpZiAoZS53aGljaCAmJiBlLndoaWNoICE9PSAxKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHNlbGYuc2NvcGUuJGZvcm0uJHZpc2libGUpIHtcbiAgICAgICAgICAgICAgc2VsZi5zY29wZS4kZm9ybS5fY2xpY2tlZCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgLy8gc2V0V2FpdGluZ1xuICAgICAgICBzZWxmLnNldFdhaXRpbmcgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICBpZiAodmFsdWUpIHtcbiAgICAgICAgICAgIC8vIHBhcnRpY2lwYXRlIGluIHdhaXRpbmcgb25seSBpZiBub3QgZGlzYWJsZWRcbiAgICAgICAgICAgIGluV2FpdGluZyA9ICFzZWxmLmlucHV0RWwuYXR0cignZGlzYWJsZWQnKSAmJlxuICAgICAgICAgICAgICAhc2VsZi5pbnB1dEVsLmF0dHIoJ25nLWRpc2FibGVkJykgJiZcbiAgICAgICAgICAgICAgIXNlbGYuaW5wdXRFbC5hdHRyKCduZy1lbmFibGVkJyk7XG4gICAgICAgICAgICBpZiAoaW5XYWl0aW5nKSB7XG4gICAgICAgICAgICAgIHNlbGYuaW5wdX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oKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChlbC5mb2N1cykge1xuICAgICAgICAgICAgICAgIGVsLmZvY3VzKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LCAwKTtcbiAgICAgICAgfTtcblxuICAgICAgICBzZWxmLnNldEVycm9yID0gZnVuY3Rpb24gKG1zZykge1xuICAgICAgICAgIGlmICghYW5ndWxhci5pc09iamVjdChtc2cpKSB7XG4gICAgICAgICAgICAkc2NvcGUuJGVycm9yID0gJHNjZS50cnVzdEFzSHRtbChtc2cpO1xuICAgICAgICAgICAgc2VsZi5lcnJvciA9IG1zZztcbiAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgLypcbiAgICAgICAgQ2hlY2tzIHRoYXQgcmVzdWx0IGlzIHN0cmluZyBvciBwcm9taXNlIHJldHVybmVkIHN0cmluZyBhbmQgc2hvd3MgaXQgYXMgZXJyb3IgbWVzc2FnZVxuICAgICAgICBBcHBsaWVkIHRvIG9uc2hvdywgb25iZWZvcmVzYXZlLCBvbmFmdGVyc2F2ZVxuICAgICAgICAqL1xuICAgICAgICBzZWxmLmNhdGNoRXJyb3IgPSBmdW5jdGlvbiAocmVzdWx0LCBub1Byb21pc2UpIHtcbiAgICAgICAgICBpZiAoYW5ndWxhci5pc09iamVjdChyZXN1bHQpICYmIG5vUHJvbWlzZSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgJHEud2hlbihyZXN1bHQpLnRoZW4oXG4gICAgICAgICAgICAgIC8vc3VjY2VzcyBhbmQgZmFpbCBoYW5kbGVycyBhcmUgZXF1YWxcbiAgICAgICAgICAgICAgYW5ndWxhci5iaW5kKHRoaXMsIGZ1bmN0aW9uIChyKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jYXRjaEVycm9yKHIsIHRydWUpO1xuICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgYW5ndWxhci5iaW5kKHRoaXMsIGZ1bmN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eWV0XG4gICAgICAgICAgICAgICAgZUZvcm1DdHJsID0gbnVsbDtcbiAgICAgICAgICAgICAgICBoYXNGb3JtID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8qXG4gICAgICAgIGlmKGhhc0Zvcm0gJiYgIWF0dHJzLmVOYW1lKSB7XG4gICAgICAgICAgdGhyb3cgJ1lvdSBzaG91bGQgcHJvdmlkZSBgZS1uYW1lYCBmb3IgZWRpdGFibGUgZWxlbWVudCBpbnNpZGUgZm9ybSEnO1xuICAgICAgICB9XG4gICAgICAgICovXG5cbiAgICAgICAgLy9jaGVjayBmb3IgYGVkaXRhYmxlLWZvcm1gIGF0dHIgaW4gZm9ybVxuICAgICAgICAvKlxuICAgICAgICBpZihlRm9ybUN0cmwgJiYgKSB7XG4gICAgICAgICAgdGhyb3cgJ1lvdSBzaG91bGQgcHJvdmlkZSBgZS1uYW1lYCBmb3IgZWRpdGFibGUgZWxlbWVudCBpbnNpZGUgZm9ybSEnO1xuICAgICAgICB9XG4gICAgICAgICovXG5cbiAgICAgICAgLy8gc3RvcmUgb3JpZ2luYWwgcHJvcHMgdG8gYHBhcmVudGAgYmVmb3JlIG1lcmdlXG4gICAgICAgIGFuZ3VsYXIuZm9yRWFjaChvdmVyd3JpdGVzLCBmdW5jdGlvbih2LCBrKSB7XG4gICAgICAgICAgaWYoZUN0cmxba10gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgZUN0cmwucGFyZW50W2tdID0gZUN0cmxba107XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBtZXJnZSBvdmVyd3JpdGVzIHRvIGJhc2UgZWRpdGFibGUgY29udHJvbGxlclxuICAgICAgICBhbmd1bGFyLmV4dGVuZChlQ3RybCwgb3ZlcndyaXRlcyk7XG5cbiAgICAgICAgLy8geC1lZGl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BlZGl0YWJsZXMgPSBzaG93bi4kZWRpdGFibGVzO1xuICAgICAgICBhbmd1bGFyLmZvckVhY2goZWRpdGFibGVzLCBmdW5jdGlvbiAodikge1xuICAgICAgICAgIHZhciBlbGVtZW50ID0gdi5lZGl0b3JFbFswXTtcbiAgICAgICAgICBpZiAoaXNTZWxmT3JEZXNjZW5kYW50KGVsZW1lbnQsIGV2ZW50LnRhcmdldCkpXG4gICAgICAgICAgICBpc0JsdXIgPSBmYWxzZTtcblxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIGlzQmx1cjtcbiAgICAgIH07XG5cbiAgICAgIHZhciBjbGlja0hhbmRsZXIgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAvLyBpZ25vcmUgcmlnaHQvbWlkZGxlIGJ1dHRvbiBjbGlja1xuICAgICAgICBpZiAoZS53aGljaCAmJiBlLndoaWNoICE9PSAxKSB7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHRvQ2FuY2VsID0gW107XG4gICAgICAgIHZhciB0b1N1Ym1pdCA9IFtdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNob3duLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgLy8gY29uc29sZS5sb2coXCJpbiBmb3JcIiwgc2hvd25baV0pO1xuICAgICAgICAgIC8vIGV4Y2x1ZGUgY2xpY2tlZFxuICAgICAgICAgIGlmIChzaG93bltpXS5fY2xpY2tlZCkge1xuICAgICAgICAgICAgc2hvd25baV0uX2NsaWNrZWQgPSBmYWxzZTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIGV4Y2x1ZGUgd2FpdGluZ1xuICAgICAgICAgIGlmIChzaG93bltpXS4kd2FpdGluZykge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNob3duW2ldLl9ibHVyID09PSAnY2FuY2VsJyAmJiBpc0JsdXIoc2hvd25baV0sIGUpKSB7XG4gICAgICAgICAgICB0b0NhbmNlbC5wdXNoKHNob3duW2ldKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc2hvd25baV0uX2JsdXIgPT09ICdzdWJtaXQnICYmIGlzQmx1cihzaG93bltpXSwgZSkpIHtcbiAgICAgICAgICAgIHRvU3VibWl0LnB1c2goc2hvd25baV0pO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0b0NhbmNlbC5sZW5ndGggfHwgdG9TdWJtaXQubGVuZ3RoKSB7XG4gICAgICAgICAgJHJvb3RTY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHRvQ2FuY2VsLCBmdW5jdGlvbiAodikgeyB2LiRjYW5jZWwoKTsgfSk7XG4gICAgICAgICAgICBhbmd1bGFyLmZvckVhY2godG9TdWJtaXQsIGZ1bmN0aW9uICh2KSB7IHYuJHN1Ym1pdCgpOyB9KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfTtcblxuXG5cbiAgICAgICRyb290U2NvcGUuJG9uKCdjbG9zZUVkaXQnLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2hvd24ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICBzaG93bltpXS4kaGlkZSgpO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgdmFyIGJhc2UgPSB7XG4gICAgICAgICRhZGRFZGl0YWJsZTogZnVuY3Rpb24gKGVkaXRhYmxlKSB7XG4gICAgICAgICAgLy9jb25zb2xlLmxvZygnYWRkIGVkaXRhYmxlJywgZWRpdGFibGUuZWxlbSwgZWRpdGFibGUuZWxlbS5iaW5kKTtcbiAgICAgICAgICB0aGlzLiRlZGl0YWJsZXMucHVzaChlZGl0YWJsZSk7XG5cbiAgICAgICAgICAvLyd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AgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogU2hvd3MgZm9ybSB3aXRoIGVkaXRhYmxlIGNvbnRyb2xzLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAbWV0aG9kICRzaG93KClcbiAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICovXG4gICAgICAgICRzaG93OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgaWYgKHRoaXMuJHZpc2libGUpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB0aGlzLiR2aXNpYmxlID0gdHJ1ZTtcblxuICAgICAgICAgIHZhciBwYyA9IGVkaXRhYmxlUHJvbWlzZUNvbGxlY3Rpb24oKTtcblxuICAgICAgICAgIC8vb3duIHNob3dcbiAgICAgICAgICBwYy53aGVuKHRoaXMuJG9uc2hvdygpKTtcblxuICAgICAgICAgIC8vY2xlYXIgZXJyb3JzXG4gICAgICAgICAgdGhpcy4kc2V0RXJyb3IobnVsbCwgJycpO1xuXG4gICAgICAgICAgLy9jaGlsZHJlbiBzaG93XG4gICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHRoaXMuJGVkaXRhYmxlcywgZnVuY3Rpb24gKGVkaXRhYmxlKSB7XG4gICAgICAgICAgICBwYy53aGVuKGVkaXRhYmxlLnNob3coKSk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAvL3dhaXQgcHJvbWlzZXMgYW5kIGFjdGl2YXRlXG4gICAgICAgICAgcGMudGhlbih7XG4gICAgICAgICAgICBvbldhaXQ6IGFuZ3VsYXIuYmluZCh0aGlzLCB0aGlzLiRzZXRXYWl0aW5nKSxcbiAgICAgICAgICAgIG9uVHJ1ZTogYW5ndWxhci5iaW5kKHRoaXMsIHRoaXMuJGFjdGl2YXRlKSxcbiAgICAgICAgICAgIG9uRmFsc2U6IGFuZ3VsYXIuYmluZCh0aGlzLCB0aGlzLiRhY3RpdmF0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Rpb24gaXMgY2FsbGVkLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAbWV0aG9kICRhY3RpdmF0ZShuYW1lKVxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBuYW1lIG9mIGZpZWxkXG4gICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAqL1xuICAgICAgICAkYWN0aXZhdGU6IGZ1bmN0aW9uIChuYW1lKSB7XG4gICAgICAgICAgdmFyIGksXG4gICAgICAgICAgICBzZWxlY3Rpb25TdGFydCxcbiAgICAgICAgICAgIHNlbGVjdGlvbkVuZDtcbiAgICAgICAgICBpZiAodGhpcy4kZWRpdGFibGVzLmxlbmd0aCkge1xuICAgICAgICAgICAgLy9hY3RpdmF0ZSBieSBuYW1lXG4gICAgICAgICAgICBpZiAoYW5ndWxhci5pc1N0cmluZyhuYW1lKSkge1xuICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGhpcy4kZWRpdGFibGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuJGVkaXRhYmxlc1tpXS5uYW1lID09PSBuYW1lKSB7XG4gICAgICAgICAgICAgICAgICB0aGlzLiRlZGl0YWJsZXNbaV0uYWN0aXZhdGUoKTtcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy90cnkgYWN0aXZhdGUgZXJyb3IgZmllbGRcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0aGlzLiRlZGl0YWJsZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgaWYgKHRoaXMuJGVkaXRhYmxlc1tpXS5lcnJvcikge1xuICAgICAgICAgICAgICAgIHRoaXMuJGVkaXRhYmxlc1tpXS5hY3RpdmF0ZSgpO1xuICAgICAgICAgICAgICAgIHJldHVybj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4kZWRpdGFibGVzLCBmdW5jdGlvbiAoZWRpdGFibGUpIHtcbiAgICAgICAgICAgIGVkaXRhYmxlLnNldFdhaXRpbmcoISF2YWx1ZSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFNob3dzIGVycm9yIG1lc3NhZ2UgZm9yIHBhcnRpY3VsYXIgZmllbGQuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBtZXRob2QgJHNldEVycm9yKG5hbWUsIG1zZylcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgbmFtZSBvZiBmaWVsZFxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbXNnIGVycm9yIG1lc3NhZ2VcbiAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICovXG4gICAgICAgICRzZXRFcnJvcjogZnVuY3Rpb24gKG5hbWUsIG1zZykge1xuICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLiRlZGl0YWJsZXMsIGZ1bmN0aW9uIChlZGl0YWJsZSkge1xuICAgICAgICAgICAgaWYgKCFuYW1lIHx8IGVkaXRhYmxlLm5hbWUgPT09IG5hbWUpIHtcbiAgICAgICAgICAgICAgZWRpdGFibGUuc2V0RXJyb3IobXNnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcblxuICAgICAgICAkc3VibWl0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgaWYgKHRoaXMuJHdhaXRpbmcpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvL2NsZWFyIGVycm9yc1xuICAgICAgICAgIHRoaXMuJHNldEVycm9yKG51bGwsICcnKTtcblxuICAgICAgICAgIC8vY2hpbGRyZW4gb25iZWZvcmVzYXZlXG4gICAgICAgICAgdmFyIHBjID0gZWRpdGFibGVQcm9taXNlQ29sb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zdCBjbG9zZSBmb3JtXG4gICAgICAgICAgLSBzdHJpbmc6IGtlZXAgZm9ybSBvcGVuIGFuZCBzaG93IGVycm9yXG4gICAgICAgICAgKi9cbiAgICAgICAgICBwYy50aGVuKHtcbiAgICAgICAgICAgIG9uV2FpdDogYW5ndWxhci5iaW5kKHRoaXMsIHRoaXMuJHNldFdhaXRpbmcpLFxuICAgICAgICAgICAgb25UcnVlOiBhbmd1bGFyLmJpbmQodGhpcywgdGhpcy4kaGlkZSksXG4gICAgICAgICAgICBvbkZhbHNlOiBhbmd1bGFyLmJpbmQodGhpcywgdGhpcy4kaGlkZSksXG4gICAgICAgICAgICBvblN0cmluZzogYW5ndWxhci5iaW5kKHRoaXMsIHRoaXMuJGFjdGl2YXRlKVxuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgICRvbnNob3c6IGFuZ3VsYXIubm9vcCxcbiAgICAgICAgJG9uY2FuY2VsOiBhbmd1bGFyLm5vb3AsXG4gICAgICAgICRvbmhpZGU6IGFuZ3VsYXIubm9vcCxcbiAgICAgICAgJG9uYmVmb3Jlc2F2ZTogYW5ndWxhci5ub29wLFxuICAgICAgICAkb25hZnRlcnNhdmU6IGFuZ3VsYXIubm9vcFxuICAgICAgfTtcblxuICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIGFuZ3VsYXIuZXh0ZW5kKHtcbiAgICAgICAgICAkZWRpdGFibGVzOiBbXSxcbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBGb3JtIHZpc2liaWxpdHkgZmxhZy5cbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEB2YXIge2Jvb2x9ICR2aXNpYmxlXG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICAgKi9cbiAgICAgICAgICAkdmlzaWJsZTogZmFsc2UsXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogRm9ybSB3YWl0aW5nIGZ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vIGZvcm0gYW5kIHB1Ymxpc2ggaWYgZm9ybSBoYXMgbmFtZVxuICAgICAgICAgICAgICBlRm9ybSA9IGVkaXRhYmxlRm9ybUNvbnRyb2xsZXIoKTtcbiAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQoZm9ybSwgZUZvcm0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvL3JlYWQgZWRpdGFibGVzIGZyb20gYnVmZmVyICh0aGF0IGFwcGVhcmVkIGJlZm9yZSBGT1JNIHRhZylcbiAgICAgICAgICAgIHZhciBidWYgPSAkcm9vdFNjb3BlLiQkZWRpdGFibGVCdWZmZXI7XG4gICAgICAgICAgICB2YXIgbmFtZSA9IGZvcm0uJG5hbWU7XG4gICAgICAgICAgICBpZihuYW1lICYmIGJ1ZiAmJiBidWZbbmFtZV0pIHtcbiAgICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKGJ1ZltuYW1lXSwgZnVuY3Rpb24oZWRpdGFibGUpIHtcbiAgICAgICAgICAgICAgICBlRm9ybS4kYWRkRWRpdGFibGUoZWRpdGFibGUpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgZGVsZXRlIGJ1ZltuYW1lXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIHBvc3Q6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRycywgY3RybCkge1xuICAgICAgICAgICAgdmFyIGVGb3JtO1xuXG4gICAgICAgICAgICBpZihhdHRycy5lZGl0YWJsZUZvcm0gJiYgc2NvcGVbYXR0cnMuZWRpdGFibGVGb3JtXSAmJiBzY29wZVthdHRycy5lZGl0YWJsZUZvcm1dLiRzaG93KSB7XG4gICAgICAgICAgICAgIGVGb3JtID0gc2NvcGVbYXR0cnMuZWRpdGFibGVGb3JtXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGVGb3JtID0gY3RybFswXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBmb3JtIGlzIHNob3duLlxuICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbnNob3cgXG4gICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBpZihhdHRycy5vbnNob3cpIHtcbiAgICAgICAgICAgICAgZUZvcm0uJG9uc2hvdyA9IGFuZ3VsYXIuYmluZChlRm9ybSwgJHBhcnNlKGF0dHJzLm9uc2hvdyksIHNjb3BlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBmb3JtIGhpZGVzIGFmdGVyIGJvdGggc2F2ZSBvciBjYW5jZWwuXG4gICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAqIEB2YXIge21ldGhvZHxhdHRyaWJ1dGV9IG9uaGlkZSBcbiAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGlmKGF0dHJzLm9uaGlkZSkge1xuICAgICAgICAgICAgICBlRm9ybS4kb25oaWRlID0gYW5ndWxhci5iaW5kKGVGb3JtLCAkcGFyc2UoYXR0cnMub25oaWRlKSwgc2NvcGUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIENhbGxlZCB3aGVuIGZvcm0gaXMgY2FuY2VsbGVkLlxuICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmNhbmNlbFxuICAgICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgaWYoYXR0cnMub25jYW5jZWwpIHtcbiAgICAgICAgICAgICAgZUZvcm0uJG9uY2FuY2VsID0gYW5ndWxhci5iaW5kKGVGb3JtLCAkcGFyc2UoYXR0cnMub25jYW5jZWwpLCBzY29wZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogV2hldGhlciBmb3JtIGluaXRpYWxseSByZW5kZXJlZCBpbiBzaG93biBzdGF0ZS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAdmFyIHtib29sfGF0dHJpYnV0ZX0gc2hvd25cbiAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGlmKGF0dHJzLnNob3duICYmICRwYXJzZShhdHRycy5zaG93bikoc2NvcGUpKSB7XG4gICAgICAgICAgICAgIGVGb3JtLiRzaG93KCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQWN0aW9uIHdoZW4gZm9ybSBsb3NzZXMgZm9jdXMuIFZhbHVlczogYGNhbmNlbHxzdWJtaXR8aWdub3JlYC5cbiAgICAgICAgICAgICAqIERlZmF1bHQgaXMgYGlnbm9yZWAuXG4gICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAqIEB2YXIge3N0cmluZ3xhdHRyaWJ1dGV9IGJsdXJcbiAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGVGb3JtLl9ibHVyID0gYXR0cnMuYmx1ciB8fCBlZGl0YWJsZU9wdGlvbnMuYmx1ckZvcm07XG5cbiAgICAgICAgICAgIC8vIG9uYmVmb3Jlc2F2ZSwgb25hZnRlcnNhdmVcbiAgICAgICAgICAgIGlmKCFhdHRycy5uZ1N1Ym1pdCAmJiAhYXR0cnMuc3VibWl0KSB7XG4gICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgKiBDYWxsZWQgYWZ0ZXIgYWxsIGNoaWxkcmVuIGBvbmJlZm9yZXNhdmVgIGNhbGxiYWNrcyBidXQgYmVmb3JlIHNhdmluZyBmb3JtIHZhbHVlc1xuICAgICAgICAgICAgICAgKiB0byBtb2RlbC4gIFxuICAgICAgICAgICAgICAgKiBJZiBhdCBsZWFzdCBvbmUgY2hpbGRyZW4gY2FsbGJhY2sgcmV0dXJucyBgbm9uLXN0cmluZ2AgLSBpdCB3aWxsIG5vdCBub3QgYmUgY2FsbGVkLiAgXG4gICAgICAgICAgICAgICAqIFNlZSBbZWRpdGFibGUtZm9ybSBkZW1vXSgjZWRpdGFibGUtZm9ybSkgZm9yIGRldGFpbHMuXG4gICAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmJlZm9yZXNhdmVcbiAgICAgICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICBpZihhdHRycy5vbmJlZm9yZXNhdmUpIHtcbiAgICAgICAgICAgICAgICBlRm9ybS4kb25iZWZvcmVzYXZlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gJHBhcnNlKGF0dHJzLm9uYmVmb3Jlc2F2ZSkoc2NvcGUsIHskZGF0YTogZUZvcm0uJGRhdGF9KTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAqIENhbGxlZCB3aGVuIGZvcm0gdmFsdWVzIGFyZSBzYXZlZCB0byBtb2RlbC4gIFxuICAgICAgICAgICAgICAgKiBTZWUgW2VkaXRhYmxlLWZvcm0gZGVtb10oI2VkaXRhYmxlLWZvcm0pIGZvciBkZXRhaWxzLlxuICAgICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25hZnRlcnNhdmUgXG4gICAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgaWYoYXR0cnMub25hZnRlcnNhdmUpIHtcbiAgICAgICAgICAgICAgICBlRm9ybS4kb25hZnRlcnNhdmUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiAkcGFyc2UoYXR0cnMub25hZnRlcnNhdmUpKHNjb3BlLCB7JGRhdGE6IGVGb3JtLiRkYXRhfSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGVsZW0uYmluZCgnc3VibWl0JywgZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIGVGb3JtLiRzdWJtaXQoKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgLy8gY2xpY2sgLSBtYXJrIGZvcm0gYXMgY2xpY2tlZCB0byBleGNsdWRlIGluIGRvY3VtZW50IGNsaWNrIGhhbmRsZXJcbiAgICAgICAgICAgIGVsZW0uYmluZCgnY2xpY2snLCBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgIC8vIGlnbm9yZSByaWdodC9taWRkbGUgYnV0dG9uIGNsaWNrXG4gICAgICAgICAgICAgIGlmIChlLndoaWNoICYmIGUud2hpY2ggIT09IDEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAoZUZvcm0uJHZpc2libGUpIHtcbiAgICAgICA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ZXNvbHZlZCAgICAgICBcbiAgICAgICAgICAgIGZ1bmN0aW9uKHJlc3VsdHMpIHtcbiAgICAgICAgICAgICAgb25XYWl0KGZhbHNlKTtcbiAgICAgICAgICAgICAgLy9jaGVjayBhbGwgcmVzdWx0cyB2aWEgc2FtZSBgd2hlbmAgbWV0aG9kICh3aXRob3V0IGNoZWNraW5nIHByb21pc2VzKVxuICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2gocmVzdWx0cywgZnVuY3Rpb24ocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgc2VsZi53aGVuKHJlc3VsdCwgdHJ1ZSk7ICBcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGFwcGx5Q2FsbGJhY2soKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvL3NvbWUgcmVqZWN0ZWRcbiAgICAgICAgICAgIGZ1bmN0aW9uKGVycm9yKSB7IFxuICAgICAgICAgICAgICBvbldhaXQoZmFsc2UpO1xuICAgICAgICAgICAgICBvblN0cmluZygpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBhcHBseUNhbGxiYWNrKCk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBhcHBseUNhbGxiYWNrKCkge1xuICAgICAgICAgIGlmICghc2VsZi5oYXNTdHJpbmcgJiYgIXNlbGYuaGFzRmFsc2UpIHtcbiAgICAgICAgICAgIG9uVHJ1ZSgpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoIXNlbGYuaGFzU3RyaW5nICYmIHNlbGYuaGFzRmFsc2UpIHtcbiAgICAgICAgICAgIG9uRmFsc2UoKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb25TdHJpbmcoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgfVxuICAgIH07XG4gIH1cblxuICByZXR1cm4gcHJvbWlzZUNvbGxlY3Rpb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ge1xuICAgICAgICAgICAgZGVsdGEgPSB7dmFsdWU6IG9wdFZhbHVlLCBkaXN0YW5jZTogZGlzdGFuY2V9O1xuICAgICAgICAgIH0gXG4gICAgICAgIH0pOyBcbiAgICAgICAgcmV0dXJuIGRlbHRhLnZhbHVlO1xuICAgICAgfVxuICAgICAgXG4gICAgICBpZihkdC5pc1ZhbGlkKCkpIHtcbiAgICAgICAgLy9yZWFkIHZhbHVlcyBmcm9tIGRhdGUgb2JqZWN0XG4gICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLm1hcCwgZnVuY3Rpb24odiwgaykge1xuICAgICAgICAgIGlmKGsgPT09ICdhbXBtJykge1xuICAgICAgICAgICAgcmV0dXJuOyBcbiAgICAgICAgICB9XG4gICAgICAgICAgdmFsdWVzW2tdID0gZHRbdlsxXV0oKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYodGhpcy4kYW1wbSkge1xuICAgICAgICAgIC8vMTI6MDAgcG0gLS0+IDEyOjAwICgyNC1oIGZvcm1hdCwgbWlkZGF5KSwgMTI6MDAgYW0gLS0+IDAwOjAwICgyNC1oIGZvcm1hdCwgbWlkbmlnaHQsIHN0YXJ0IG9mIGRheSlcbiAgICAgICAgICBpZih2YWx1ZXMuaG91ciA+PSAxMikge1xuICAgICAgICAgICAgdmFsdWVzLmFtcG0gPSAncG0nO1xuICAgICAgICAgICAgaWYodmFsdWVzLmhvdXIgPiAxMikge1xuICAgICAgICAgICAgICB2YWx1ZXMuaG91ciAtPSAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWVzLmFtcG0gPSAnYW0nO1xuICAgICAgICAgICAgaWYodmFsdWVzLmhvdXIgPT09IDApIHtcbiAgICAgICAgICAgICAgdmFsdWVzLmhvdXIgPSAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBhbmd1bGFyLmZvckVhY2godmFsdWVzLCBmdW5jdGlvbih2LCBrKSB7XG4gICAgICAgICAgLy9jYWxsIHZhbCgpIGZvciBlYWNoIGV4aXN0aW5nIGNvbWJvLCBlLmcuIHRoaXMuJGhvdXIudmFsKClcbiAgICAgICAgICBpZih0aGF0WyckJytrXSkge1xuXG4gICAgICAgICAgICBpZihrID09PSAnbWludXRlJyAmJiB0aGF0Lm9wdGlvbnMubWludXRlU3RlcCA+IDEgJiYgdGhhdC5vcHRpb25zLnJvdW5kVGltZSkge1xuICAgICAgICAgICAgIHYgPSBnZXROZWFyZXN0KHRoYXRbJyQnK2tdLCB2KTtcbiAgICAgICAgICAgfVxuICAgICAgICAgICBcbiAgICAgICAgICAgaWYoayA9PT0gJ3NlY29uZCcgJiYgdGhhdC5vcHRpb25zLnNlY29uZFN0ZXAgPiAxICYmIHRoYXQub3B0aW9ucy5yb3VuZFRpbWUpIHtcbiAgICAgICAgICAgICB2ID0gZ2V0TmVhcmVzdCh0aGF0WyckJytrXSwgdik7XG4gICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICBcbiAgICAgICAgICAgdGhhdFsnJCcra10udmFsKHYpO1xuICAgICAgICAgfVxuICAgICAgIH0pO1xuXG4gICAgICAgIC8vIHVwZGF0ZSBkYXlzIGNvdW50XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMuc21hcnREYXlzKSB7XG4gICAgICAgICAgdGhpcy5maWxsQ29tYm8oJ2RheScpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy4kZWxlbWVudC52YWwoZHQuZm9ybWF0KHRoaXMub3B0aW9ucy5mb3JtYXQpKS50cmlnZ2VySGFuZGxlcignY2hhbmdlJyk7XG4gICAgICB9XG4gICAgfSxcbiAgICBcbiAgICAvKlxuICAgICBoaWdobGlnaHQgY29tYm9zIGlmIGRhdGUgaXMgaW52YWxpZFxuICAgICAqL1xuICAgICBoaWdobGlnaHQ6IGZ1bmN0aW9uKGR0KSB7XG4gICAgICB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ICAgdGhpcy5pbnB1dEVsLmFkZENsYXNzKCdmb3JtLWNvbnRyb2wnKTtcbiAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hdHRyKCduZy1jbGFzcycsIFwieydpcy1pbnZhbGlkJzogJGVycm9yfVwiKTtcbiAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnRoZW1lLmlucHV0Q2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyBkb25gdCBhcHBseSBgZm9ybS1jb250cm9sLXNtYCBhbmQgYGZvcm0tY29udHJvbC1sZ2AgdG8gc2VsZWN0IG11bHRpcGxlXG4gICAgICAgICAgICAgICAgICAgICAgLy8gc2hvdWxkIGJlIGZpeGVkIGluIGJzIGl0c2VsZiFcbiAgICAgICAgICAgICAgICAgICAgICBpZih0aGlzLmlucHV0RWwuYXR0cignbXVsdGlwbGUnKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAodGhpcy50aGVtZS5pbnB1dENsYXNzID09PSAnZm9ybS1jb250cm9sLXNtJyB8fCB0aGlzLnRoZW1lLmlucHV0Q2xhc3MgPT09ICdmb3JtLWNvbnRyb2wtbGcnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLmFkZENsYXNzKHRoaXMudGhlbWUuaW5wdXRDbGFzcyk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSAnZWRpdGFibGVDaGVja2JveCc6XG4gICAgICAgICAgICAgICAgICB0aGlzLmVkaXRvckVsLmFkZENsYXNzKCdmb3JtLWNoZWNrJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy9hcHBseSBidXR0b25zQ2xhc3MgKGJzNCBzcGVjaWZpYyEpXG4gICAgICAgICAgaWYodGhpcy5idXR0b25zRWwgJiYgdGh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lvbiBhYm91dCB0aGUgbW9kdWxlXG4gICAgICAgICAgICogQHJldHVybnMge09iamVjdHxNb2R1bGV9IFRoZSBjdXJyZW50IGluZm8gb2JqZWN0IGZvciB0aGlzIG1vZHVsZSBpZiBjYWxsZWQgYXMgYSBnZXR0ZXIsXG4gICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgIG9yIGB0aGlzYCBpZiBjYWxsZWQgYXMgYSBzZXR0ZXIuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBSZWFkIGFuZCB3cml0ZSBjdXN0b20gaW5mb3JtYXRpb24gYWJvdXQgdGhpcyBtb2R1bGUuXG4gICAgICAgICAgICogRm9yIGV4YW1wbGUgeW91IGNvdWxkIHB1dCB0aGUgdmVyc2lvbiBvZiB0aGUgbW9kdWxlIGluIGhlcmUuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBgYGBqc1xuICAgICAgICAgICAqIGFuZ3VsYXIubW9kdWxlKCdteU1vZHVsZScsIFtdKS5pbmZvKHsgdmVyc2lvbjogJzEuMC4wJyB9KTtcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIFRoZSB2ZXJzaW9uIGNvdWxkIHRoZW4gYmUgcmVhZCBiYWNrIG91dCBieSBhY2Nlc3NpbmcgdGhlIG1vZHVsZSBlbHNld2hlcmU6XG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKiB2YXIgdmVyc2lvbiA9IGFuZ3VsYXIubW9kdWxlKCdteU1vZHVsZScpLmluZm8oKS52ZXJzaW9uO1xuICAgICAgICAgICAqIGBgYFxuICAgICAgICAgICAqXG4gICAgICAgICAgICogWW91IGNhbiBhbHNvIHJldHJpZXZlIHRoaXMgaW5mb3JtYXRpb24gZHVyaW5nIHJ1bnRpbWUgdmlhIHRoZVxuICAgICAgICAgICAqIHtAbGluayAkaW5qZWN0b3IjbW9kdWxlcyBgJGluamVjdG9yLm1vZHVsZXNgfSBwcm9wZXJ0eTpcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIGBgYGpzXG4gICAgICAgICAgICogdmFyIHZlcnNpb24gPSAkaW5qZWN0b3IubW9kdWxlc1snbXlNb2R1bGUnXS5pbmZvKCkudmVyc2lvbjtcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpbmZvOiBmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZCh2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgaWYgKCFpc09iamVjdCh2YWx1ZSkpIHRocm93IG5nTWluRXJyKCdhb2JqJywgJ0FyZ3VtZW50IFxcJ3swfVxcJyBtdXN0IGJlIGFuIG9iamVjdCcsICd2YWx1ZScpO1xuICAgICAgICAgICAgICBpbmZvID0gdmFsdWU7XG4gICAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGluZm87XG4gICAgICAgICAgfSxcblxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEBuZ2RvYyBwcm9wZXJ0eVxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI3JlcXVpcmVzXG4gICAgICAgICAgICogQG1vZHVsZSBuZ1xuICAgICAgICAgICAqXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogSG9sZHMgdGhlIGxpc3Qgb2YgbW9kdWxlcyB3aGljaCB0aGUgaW5qZWN0b3Igd2lsbCBsb2FkIGJlZm9yZSB0aGUgY3VycmVudCBtb2R1bGUgaXNcbiAgICAgICAgICAgKiBsb2FkZWQuXG4gICAgICAgICAgICovXG4gICAgICAgICAgcmVxdWlyZXM6IHJlcXVpcmVzLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIHByb3BlcnR5XG4gICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjbmFtZVxuICAgICAgICAgICAqIEBtb2R1bGUgbmdcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIE5hbWUgb2YgdGhlIG1vZHVsZS5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBuYW1lOiBuYW1lLFxuXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjcHJvdmlkZXJcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgc2VydmljZSBuYW1lXG4gICAgICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gcHJvdmlkZXJUeXBlIENvbnN0cnVjdGlvbiBmdW5jdGlvbiBmb3IgY3JlYXRpbmcgbmV3IGluc3RhbmNlIG9mIHRoZVxuICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXJ2aWNlLlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIFNlZSB7QGxpbmsgYXV0by4kcHJvdmlkZSNwcm92aWRlciAkcHJvdmlkZS5wcm92aWRlcigpfS5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBwcm92aWRlcjogaW52b2tlTGF0ZXJBbmRTZXRNb2R1bGVOYW1lKCckcHJvdmlkZScsICdwcm92aWRlcicpLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI2ZhY3RvcnlcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgc2VydmljZSBuYW1lXG4gICAgICAgICAgICogQHBhcmFtIHtGdW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30gbmFtZSBzZXJ2aWNlIG5hbWVcbiAgICAgICAgICAgKiBAcGFyYW0geyp9IG9iamVjdCBTZXJ2aWNlIGluc3RhbmNlIG9iamVjdC5cbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBTZWUge0BsaW5rIGF1dG8uJHByb3ZpZGUjdmFsdWUgJHByb3ZpZGUudmFsdWUoKX0uXG4gICAgICAgICAgICovXG4gICAgICAgICAgdmFsdWU6IGludm9rZUxhdGVyKCckcHJvdmlkZScsICd2YWx1ZScpLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI2NvbnN0YW50XG4gICAgICAgICAgICogQG1vZHVsZSBuZ1xuICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBuYW1lIGNvbnN0YW50IG5hbWVcbiAgICAgICAgICAgKiBAcGFyYW0geyp9IG9iamVjdCBDb25zdGFudCB2YWx1ZS5cbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBCZWNhdXNlIHRoZSBjb25zdGFudHMgYXJlIGZpeGVkLCB0aGV5IGdldCBhcHBsaWVkIGJlZm9yZSBvdGhlciBwcm92aWRlIG1ldGhvZHMuXG4gICAgICAgICAgICogU2VlIHtAbGluayBhdXRvLiRwcm92aWRlI2NvbnN0YW50ICRwcm92aWRlLmNvbnN0YW50KCl9LlxuICAgICAgICAgICAqL1xuICAgICAgICAgIGNvbnN0YW50OiBpbnZva2VMYXRlcignJHByb3ZpZGUnLCAnY29uc3RhbnQnLCAndW5zaGlmdCcpLFxuXG4gICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNkZWNvcmF0b3JcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgVGhlIG5hbWUgb2YgdGhlIHNlcnZpY2UgdG8gZGVjb3JhdGUuXG4gICAgICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gZGVjb3JGbiBUaGlzIGZ1bmN0aW9uIHdpbGwgYmUgaW52b2tlZCB3aGVuIHRoZSBzZXJ2aWNlIG5lZWRzIHRvIGJlXG4gICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICBpbnN0YW50aWF0ZWQgYW5kIHNob3VsZCByZXR1cm4gdGhlIGRlY29yYXRlZCBzZXJ2aWNlIGluc3RhbmNlLlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIFNlZSB7QGxpbmsgYXV0by4kcHJvdmlkZSNkZWNvcmF0b3IgJHByb3ZpZGUuZGVjb3JhdG9yKCl9LlxuICAgICAgICAgICAqL1xuICAgICAgICAgIGRlY29yYXRvcjogaW52b2tlTGF0ZXJBbmRTZXRNb2R1bGVOYW1lKCckcHJvdmlkZScsICdkZWNvcmF0b3InLCBjb25maWdCbG9ja3MpLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI2FuaW1hdGlvblxuICAgICAgICAgICAqIEBtb2R1bGUgbmdcbiAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBhbmltYXRpb24gbmFtZVxuICAgICAgICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IGFuaW1hdGlvbkZhY3RvcnkgRmFjdG9yeSBmdW5jdGlvbiBmb3IgY3JlYXRpbmcgbmV3IGluc3RhbmNlIG9mIGFuXG4gICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiAqKk5PVEUqKjogYW5pbWF0aW9ucyB0YWtlIGVmZmVjdCBvbmx5IGlmIHRoZSAqKm5nQW5pbWF0ZSoqIG1vZHVsZSBpcyBsb2FkZWQuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIERlZmluZXMgYW4gYW5pbWF0aW9uIGhvb2sgdGhhdCBjYW4gYmUgbGF0ZXIgdXNlZCB3aXRoXG4gICAgICAgICAgICoge0BsaW5rICRhbmltYXRlICRhbmltYXRlfSBzZXJ2aWNlIGFuZCBkaXJlY3RpdmVzIHRoYXQgdXNlIHRoaXMgc2VydmljZS5cbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIGBgYGpzXG4gICAgICAgICAgICogbW9kdWxlLmFuaW1hdGlvbignLmFuaW1hdGlvbi1uYW1lJywgZnVuY3Rpb24oJGluamVjdDEsICRpbmplY3QyKSB7XG4gICAgICAgICAgICogICByZXR1cm4ge1xuICAgICAgICAgICAqICAgICBldmVudE5hbWUgOiBmdW5jdGlvbihlbGVtZW50LCBkb25lKSB7XG4gICAgICAgICAgICogICAgICAgLy9jb2RlIHRvIHJ1biB0aGUgYW5pbWF0aW9uXG4gICAgICAgICAgICogICAgICAgLy9vbmNlIGNvbXBsZXRlLCB0aGVuIHJ1biBkb25lKClcbiAgICAgICAgICAgKiAgICAgICByZXR1cm4gZnVuY3Rpb24gY2FuY2VsbGF0aW9uRnVuY3Rpb24oZWxlbWVudCkge1xuICAgICAgICAgICAqICAgICAgICAgLy9jb2RlIHRvIGNhbmNlbCB0aGUgYW5pbWF0aW9uXG4gICAgICAgICAgICogICAgICAgfVxuICAgICAgICAgICAqICAgICB9XG4gICAgICAgICAgICogICB9XG4gICAgICAgICAgICogfSlcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIFNlZSB7QGxpbmsgbmcuJGFuaW1hdGVQcm92aWRlciNyZWdpc3RlciAkYW5pbWF0ZVByb3ZpZGVyLnJlZ2lzdGVy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nVsIGZvciBzZXJ2aWNlXG4gICAgICAgICAgICogICAgY29uZmlndXJhdGlvbi5cbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBVc2UgdGhpcyBtZXRob2QgdG8gY29uZmlndXJlIHNlcnZpY2VzIGJ5IGluamVjdGluZyB0aGVpclxuICAgICAgICAgICAqIHtAbGluayBhbmd1bGFyLk1vZHVsZSNwcm92aWRlciBgcHJvdmlkZXJzYH0sIGUuZy4gZm9yIGFkZGluZyByb3V0ZXMgdG8gdGhlXG4gICAgICAgICAgICoge0BsaW5rIG5nUm91dGUuJHJvdXRlUHJvdmlkZXIgJHJvdXRlUHJvdmlkZXJ9LlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogTm90ZSB0aGF0IHlvdSBjYW4gb25seSBpbmplY3Qge0BsaW5rIGFuZ3VsYXIuTW9kdWxlI3Byb3ZpZGVyIGBwcm92aWRlcnNgfSBhbmRcbiAgICAgICAgICAgKiB7QGxpbmsgYW5ndWxhci5Nb2R1bGUjY29uc3RhbnQgYGNvbnN0YW50c2B9IGludG8gdGhpcyBmdW5jdGlvbi5cbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEZvciBtb3JlIGFib3V0IGhvdyB0byBjb25maWd1cmUgc2VydmljZXMsIHNlZVxuICAgICAgICAgICAqIHtAbGluayBwcm92aWRlcnMjcHJvdmlkZXItcmVjaXBlIFByb3ZpZGVyIFJlY2lwZX0uXG4gICAgICAgICAgICovXG4gICAgICAgICAgY29uZmlnOiBjb25maWcsXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjcnVuXG4gICAgICAgICAgICogQG1vZHVsZSBuZ1xuICAgICAgICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IGluaXRpYWxpemF0aW9uRm4gRXhlY3V0ZSB0aGlzIGZ1bmN0aW9uIGFmdGVyIGluamVjdG9yIGNyZWF0aW9uLlxuICAgICAgICAgICAqICAgIFVzZWZ1bCBmb3IgYXBwbGljYXRpb24gaW5pdGlhbGl6YXRpb24uXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogVXNlIHRoaXMgbWV0aG9kIHRvIHJlZ2lzdGVyIHdvcmsgd2hpY2ggc2hvdWxkIGJlIHBlcmZvcm1lZCB3aGVuIHRoZSBpbmplY3RvciBpcyBkb25lXG4gICAgICAgICAgICogbG9hZGluZyBhbGwgbW9kdWxlcy5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBydW46IGZ1bmN0aW9uKGJsb2NrKSB7XG4gICAgICAgICAgICBydW5CbG9ja3MucHVzaChibG9jayk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKGNvbmZpZ0ZuKSB7XG4gICAgICAgICAgY29uZmlnKGNvbmZpZ0ZuKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBtb2R1bGVJbnN0YW5jZTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHByb3ZpZGVyXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBtZXRob2RcbiAgICAgICAgICogQHBhcmFtIHtTdHJpbmc9fSBpbnNlcnRNZXRob2RcbiAgICAgICAgICogQHJldHVybnMge2FuZ3VsYXIuTW9kdWxlfVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlTGF0ZXIocHJvdmlkZXIsIG1ldGhvZCwgaW5zZXJ0TWV0aG9kLCBxdWV1ZSkge1xuICAgICAgICAgIGlmICghcXVldWUpIHF1ZXVlID0gaW52b2tlUXVldWU7XG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcXVldWVbaW5zZXJ0TWV0aG9kIHx8ICdwdXNoJ10oW3Byb3ZpZG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V3IE5nTWFwKCksXG4gICAgICBwcm92aWRlckNhY2hlID0ge1xuICAgICAgICAkcHJvdmlkZToge1xuICAgICAgICAgICAgcHJvdmlkZXI6IHN1cHBvcnRPYmplY3QocHJvdmlkZXIpLFxuICAgICAgICAgICAgZmFjdG9yeTogc3VwcG9ydE9iamVjdChmYWN0b3J5KSxcbiAgICAgICAgICAgIHNlcnZpY2U6IHN1cHBvcnRPYmplY3Qoc2VydmljZSksXG4gICAgICAgICAgICB2YWx1ZTogc3VwcG9ydE9iamVjdCh2YWx1ZSksXG4gICAgICAgICAgICBjb25zdGFudDogc3VwcG9ydE9iamVjdChjb25zdGFudCksXG4gICAgICAgICAgICBkZWNvcmF0b3I6IGRlY29yYXRvclxuICAgICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBwcm92aWRlckluamVjdG9yID0gKHByb3ZpZGVyQ2FjaGUuJGluamVjdG9yID1cbiAgICAgICAgICBjcmVhdGVJbnRlcm5hbEluamVjdG9yKHByb3ZpZGVyQ2FjaGUsIGZ1bmN0aW9uKHNlcnZpY2VOYW1lLCBjYWxsZXIpIHtcbiAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzU3RyaW5nKGNhbGxlcikpIHtcbiAgICAgICAgICAgICAgcGF0aC5wdXNoKGNhbGxlcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyAkaW5qZWN0b3JNaW5FcnIoJ3VucHInLCAnVW5rbm93biBwcm92aWRlcjogezB9JywgcGF0aC5qb2luKCcgPC0gJykpO1xuICAgICAgICAgIH0pKSxcbiAgICAgIGluc3RhbmNlQ2FjaGUgPSB7fSxcbiAgICAgIHByb3RvSW5zdGFuY2VJbmplY3RvciA9XG4gICAgICAgICAgY3JlYXRlSW50ZXJuYWxJbmplY3RvcihpbnN0YW5jZUNhY2hlLCBmdW5jdGlvbihzZXJ2aWNlTmFtZSwgY2FsbGVyKSB7XG4gICAgICAgICAgICB2YXIgcHJvdmlkZXIgPSBwcm92aWRlckluamV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gICAgaWYgKGNhY2hlW3NlcnZpY2VOYW1lXSA9PT0gSU5TVEFOVElBVElORykge1xuICAgICAgICAgICAgZGVsZXRlIGNhY2hlW3NlcnZpY2VOYW1lXTtcbiAgICAgICAgICB9XG4gICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgIHBhdGguc2hpZnQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuXG4gICAgZnVuY3Rpb24gaW5qZWN0aW9uQXJncyhmbiwgbG9jYWxzLCBzZXJ2aWNlTmFtZSkge1xuICAgICAgdmFyIGFyZ3MgPSBbXSxcbiAgICAgICAgICAkaW5qZWN0ID0gY3JlYXRlSW5qZWN0b3IuJCRhbm5vdGF0ZShmbiwgc3RyaWN0RGksIHNlcnZpY2VOYW1lKTtcblxuICAgICAgZm9yICh2YXIgaSA9IDAsIGxlbmd0aCA9ICRpbmplY3QubGVuZ3RoOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgdmFyIGtleSA9ICRpbmplY3RbaV07XG4gICAgICAgIGlmICh0eXBlb2Yga2V5ICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgIHRocm93ICRpbmplY3Rvck1pbkVycignaXRrbicsXG4gICAgICAgICAgICAgICAgICAnSW5jb3JyZWN0IGluamVjdGlvbiB0b2tlbiEgRXhwZWN0ZWQgc2VydmljZSBuYW1lIGFzIHN0cmluZywgZ290IHswfScsIGtleSk7XG4gICAgICAgIH1cbiAgICAgICAgYXJncy5wdXNoKGxvY2FscyAmJiBsb2NhbHMuaGFzT3duUHJvcGVydHkoa2V5KSA/IGxvY2Fsc1trZXldIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldFNlcnZpY2Uoa2V5LCBzZXJ2aWNlTmFtZSkpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGFyZ3M7XG4gICAgfVxuXG4gICAgZnVuY3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sbCwgJGxvY2F0aW9uLCAkc2NvcGUpIHtcbiAgICAgICAgICAgICAgICRzY29wZS5nb3RvQW5jaG9yID0gZnVuY3Rpb24oeCkge1xuICAgICAgICAgICAgICAgICB2YXIgbmV3SGFzaCA9ICdhbmNob3InICsgeDtcbiAgICAgICAgICAgICAgICAgaWYgKCRsb2NhdGlvbi5oYXNoKCkgIT09IG5ld0hhc2gpIHtcbiAgICAgICAgICAgICAgICAgICAvLyBzZXQgdGhlICRsb2NhdGlvbi5oYXNoIHRvIGBuZXdIYXNoYCBhbmRcbiAgICAgICAgICAgICAgICAgICAvLyAkYW5jaG9yU2Nyb2xsIHdpbGwgYXV0b21hdGljYWxseSBzY3JvbGwgdG8gaXRcbiAgICAgICAgICAgICAgICAgICAkbG9jYXRpb24uaGFzaCgnYW5jaG9yJyArIHgpO1xuICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgIC8vIGNhbGwgJGFuY2hvclNjcm9sbCgpIGV4cGxpY2l0bHksXG4gICAgICAgICAgICAgICAgICAgLy8gc2luY2UgJGxvY2F0aW9uLmhhc2ggaGFzbid0IGNoYW5nZWRcbiAgICAgICAgICAgICAgICAgICAkYW5jaG9yU2Nyb2xsKCk7XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgfVxuICAgICAgICAgICBdKTtcbiAgICAgICA8L2ZpbGU+XG4gICAgICAgPGZpbGUgbmFtZT1cInN0eWxlLmNzc1wiPlxuICAgICAgICAgYm9keSB7XG4gICAgICAgICAgIHBhZGRpbmctdG9wOiA1MHB4O1xuICAgICAgICAgfVxuXG4gICAgICAgICAuYW5jaG9yIHtcbiAgICAgICAgICAgYm9yZGVyOiAycHggZGFzaGVkIERhcmtPcmNoaWQ7XG4gICAgICAgICAgIHBhZGRpbmc6IDEwcHggMTBweCAyMDBweCAxMHB4O1xuICAgICAgICAgfVxuXG4gICAgICAgICAuZml4ZWQtaGVhZGVyI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iAgICAgICAgICAgIHZhciBoYXNDbGFzcyA9ICEhZXhpc3RpbmdbY2xhc3NOYW1lXTtcbiAgICAgICAgICAgIGlmIChzdGF0dXMgIT09IGhhc0NsYXNzKSB7XG4gICAgICAgICAgICAgIGlmIChzdGF0dXMpIHtcbiAgICAgICAgICAgICAgICB0b0FkZCArPSAodG9BZGQubGVuZ3RoID8gJyAnIDogJycpICsgY2xhc3NOYW1lO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRvUmVtb3ZlICs9ICh0b1JlbW92ZS5sZW5ndGggPyAnICcgOiAnJykgKyBjbGFzc05hbWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIGZvckVhY2goZWxlbWVudCwgZnVuY3Rpb24oZWxtKSB7XG4gICAgICAgICAgICBpZiAodG9BZGQpIHtcbiAgICAgICAgICAgICAganFMaXRlQWRkQ2xhc3MoZWxtLCB0b0FkZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodG9SZW1vdmUpIHtcbiAgICAgICAgICAgICAganFMaXRlUmVtb3ZlQ2xhc3MoZWxtLCB0b1JlbW92ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcG9zdERpZ2VzdFF1ZXVlLmRlbGV0ZShlbGVtZW50KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICBwb3N0RGlnZXN0RWxlbWVudHMubGVuZ3RoID0gMDtcbiAgICB9XG5cblxuICAgIGZ1bmN0aW9uIGFkZFJlbW92ZUNsYXNzZXNQb3N0RGlnZXN0KGVsZW1lbnQsIGFkZCwgcmVtb3ZlKSB7XG4gICAgICB2YXIgZGF0YSA9IHBvc3REaWdlc3RRdWV1ZS5nZXQoZWxlbWVudCkgfHwge307XG5cbiAgICAgIHZhciBjbGFzc2VzQWRkZWQgPSB1cGRhdGVEYXRhKGRhdGEsIGFkZCw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y5ydW5uZXIgPSAkYW5pbWF0ZS5hZGRDbGFzcygkZWxlbWVudC5maW5kKCdkaXYnKSwgJ3JlZCcpO1xuICAgICAgICAgICAgICAgICAgdmFyIGN0cmwgPSB0aGlzO1xuICAgICAgICAgICAgICAgICAgdGhpcy5ydW5uZXIuZmluYWxseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgY3RybC5ydW5uZXIgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHRoaXMucmVtb3ZlQ2xhc3MgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHRoaXMucnVubmVyID0gJGFuaW1hdGUucmVtb3ZlQ2xhc3MoJGVsZW1lbnQuZmluZCgnZGl2JyksICdyZWQnKTtcbiAgICAgICAgICAgICAgICAgIHZhciBjdHJsID0gdGhpcztcbiAgICAgICAgICAgICAgICAgIHRoaXMucnVubmVyLmZpbmFsbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGN0cmwucnVubmVyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICB0aGlzLmNhbmNlbCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgJGFuaW1hdGUuY2FuY2VsKHRoaXMucnVubmVyKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICA8L2ZpbGU+XG4gICAgICAgICAgPGZpbGUgbmFtZT1cInRlbXBsYXRlLmh0bWxcIj5cbiAgICAgICAgICAgIDxwPlxuICAgICAgICAgICAgICA8YnV0dG9uIGlkPVwiYWRkXCIgbmctY2xpY2s9XCIkY3RybC5hZGRDbGFzcygpXCI+QWRkPC9idXR0b24+XG4gICAgICAgICAgICAgIDxidXR0b24gbmctY2xpY2s9XCIkY3RybC5yZW1vdmVDbGFzcygpXCI+UmVtb3ZlPC9idXR0b24+XG4gICAgICAgICAgICAgIDxicj5cbiAgICAgICAgICAgICAgPGJ1dHRvbiBpZD1cImNhbmNlbFwiIG5nLWNsaWNrPVwiJGN0cmwuY2FuY2VsKClcIiBuZy1kaXNhYmxlZD1cIiEkY3RybC5ydW5uZXJcIj5DYW5jZWw8L2J1dHRvbj5cbiAgICAgICAgICAgICAgPGJyPlxuICAgICAgICAgICAgICA8ZGl2IGlkPVwidGFyZ2V0XCI+Q1NTLUFuaW1hdGVkIFRleHQ8L2Rpdj5cbiAgICAgICAgICAgIDwvcD5cbiAgICAgICAgICA8L2ZpbGU+XG4gICAgICAgICAgPGZpbGUgbmFtZT1cImluZGV4Lmh0bWxcIj5cbiAgICAgICAgICAgIDxjYW5jZWwtZXhhbXBsZT48L2NhbmNlbC1leGFtcGxlPlxuICAgICAgICAgIDwvZmlsZT5cbiAgICAgICAgICA8ZmlsZSBuYW1lPVwic3R5bGUuY3NzXCI+XG4gICAgICAgICAgICAucmVkLWFkZCwgLnJlZC1yZW1vdmUge1xuICAgICAgICAgICAgICB0cmFuc2l0aW9uOiBhbGwgNHMgY3ViaWMtYmV6aWVyKDAuMjUwLCAwLjQ2MCwgMC40NTAsIDAuOTQwKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLnJlZCxcbiAgICAgICAgICAgIC5yZWQtYWRkLnJlZC1hZGQtYWN0aXZlIHtcbiAgICAgICAgICAgICAgY29sb3I6ICNGRjAwMDA7XG4gICAgICAgICAgICAgIGZvbnQtc2l6ZTogNDBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLnJlZC1yZW1vdmUucmVkLXJlbW92ZS1hY3RpdmUge1xuICAgICAgICAgICAgICBmb250LXNpemU6IDEwcHg7XG4gICAgICAgICAgICAgIGNvbG9yOiBibGFjaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIDwvZmlsZT5cbiAgICAgICAgPC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1bmN0aW9uKGNoYWluLCBjYWxsYmFjaykge1xuICAgICAgdmFyIGluZGV4ID0gMDtcblxuICAgICAgbmV4dCgpO1xuICAgICAgZnVuY3Rpb24gbmV4dCgpIHtcbiAgICAgICAgaWYgKGluZGV4ID09PSBjaGFpbi5sZW5ndGgpIHtcbiAgICAgICAgICBjYWxsYmFjayh0cnVlKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBjaGFpbltpbmRleF0oZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgICAgICBpZiAocmVzcG9uc2UgPT09IGZhbHNlKSB7XG4gICAgICAgICAgICBjYWxsYmFjayhmYWxzZSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgICAgbmV4dCgpO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9O1xuXG4gICAgQW5pbWF0ZVJ1bm5lci5hbGwgPSBmdW5jdGlvbihydW5uZXJzLCBjYWxsYmFjaykge1xuICAgICAgdmFyIGNvdW50ID0gMDtcbiAgICAgIHZhciBzdGF0dXMgPSB0cnVlO1xuICAgICAgZm9yRWFjaChydW5uZXJzLCBmdW5jdGlvbihydW5uZXIpIHtcbiAgICAgICAgcnVubmVyLmRvbmUob25Qcm9ncmVzcyk7XG4gICAgICB9KTtcblxuICAgICAgZnVuY3Rpb24gb25Qcm9ncmVzcyhyZXNwb25zZSkge1xuICAgICAgICBzdGF0dXMgPSBzdGF0dXMgJiYgcmVzcG9uc2U7XG4gICAgICAgIGlmICgrK2NvdW50ID09PSBydW5uZXJzLmxlbmd0aCkge1xuICAgICAgICAgIGNhbGxiYWNrKHN0YXR1cyk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gQW5pbWF0ZVJ1bm5lcihob3N0KSB7XG4gICAgICB0aGlzLnNldEhvc3QoaG9zdCk7XG5cbiAgICAgIHZhciByYWZUaWNrID0gJCRhbmltYXRlQXN5bmNSdW4oKTtcbiAgICAgIHZhciB0aW1lb3V0VGljayA9IGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICR0aW1lb3V0KGZuLCAwLCBmYWxzZSk7XG4gICAgICB9O1xuXG4gICAgICB0aGlzLl9kb25lQ2FsbGJhY2tzID0gW107XG4gICAgICB0aGlzLl90aWNrID0gZnVuY3Rpb24oZm4pIHtcbiAgICAgICAgaWYgKCQkaXNEb2N1bWVudEhpZGRlbigpKSB7XG4gICAgICAgICAgdGltZW91dFRpY2soZm4pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJhZlRpY2soZm4pO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgdGhpcy5fc3RhdGUgPSAwO1xuICAgIH1cblxuICAgIEFuaW1hdGVSdW5uZXIucHJvdG90eXBlID0ge1xuICAgICAgc2V0SG9zdDogZnVuY3Rpb24oaG9zdCkge1xuICAgICAgICB0aGlzLmhvc3QgPSBob3N0IHx8IHt9O1xuICAgICAgfSxcblxuICAgICAgZG9uZTogZnVuY3Rpb24oZm4pIHtcbiAgICAgICAgaWYgKHRoaXMuX3N0YXRlID09PSBET05FX0NPTVBMRVRFX1NUQVRFKSB7XG4gICAgICAgICAgZm4oKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aGlzLl9kb25lQ2FsbGJhY2tzLnB1c2goZm4pO1xuICAgICAgICB9XG4gICAgICB9LFxuXG4gICAgICBwcm9ncmVzczogbm9vcCxcblxuICAgICAgZ2V0UHJvbWlzZTogZnVuY3Rpb24oKSB7XG4gICAgICAgIGlmICghdGhpcy5wcm9taXNlKSB7XG4gICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgIHRoaXMucHJvbWlzZSA9ICRxKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgc2VsZi5kb25lKGZ1bmN0aW9uKHN0YXR1cykge1xuICAgICAgICAgICAgICBpZiAoc3RhdHVzID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICAgIHJlamVjdCgpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucHJvbWlzZTtcbiAgICAgIH0sXG5cbiAgICAgIHRoZW46IGZ1bmN0aW9uKHJlc29sdmVIYW5kbGVyLCByZWplY3RIYW5kbGVyKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmdldFByb21pc2UoKS50aGVuKHJlc29sdmVIYW5kbGVyLCByZWplY3RIYW5kbGVyKTtcbiAgICAgIH0sXG5cbiAgICAgICdjYXRjaCc6IGZ1bmN0aW9uKGhhbmRsZXIpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0UHJvbWlzZSgpWydjYXRjaCddKGhhbmRsZXIpO1xuICAgICAgfSxcblxuICAgICAgJ2ZpbmFsbHknOiBmdW5jdGlvbihoYW5kbGVyKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmdldFByb21pc2UoKVsnZmluYWxseSddKGhhbmRsZXIpO1xuICAgICAgfSxcblxuICAgICAgcGF1c2U6IGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAodGhpcy5ob3N0LnBhdXNlKSB7XG4gICAgICAgICAgdGhpcy5ob3N0LnBhdXNlKCk7XG4gICAgICAgIH1cbiAgICAgIH0sXG5cbiAgICAgIHJlc3VtZTogZnVuY3Rpb24oKSB7XG4gICAgICAgIGlmICh0aGlzLmhvc3QucmVzdW1lKSB7XG4gICAgICAgICAgdGhpcy5ob3N0LnJlc3VtZSgpO1xuICAgICAgICB9XG4gICAgICB9LFxuXG4gICAgICBlbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAodGhpcy5ob3N0LmVuZCkge1xuICAgICAgICAgI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sT3B0aW9ucyB8fCB7fTtcbiAgICAgIGlmICghb3B0aW9ucy4kJHByZXBhcmVkKSB7XG4gICAgICAgIG9wdGlvbnMgPSBjb3B5KG9wdGlvbnMpO1xuICAgICAgfVxuXG4gICAgICAvLyB0aGVyZSBpcyBubyBwb2ludCBpbiBhcHBseWluZyB0aGUgc3R5bGVzIHNpbmNlXG4gICAgICAvLyB0aGVyZSBpcyBubyBhbmltYXRpb24gdGhhdCBnb2VzIG9uIGF0IGFsbCBpblxuICAgICAgLy8gdGhpcyB2ZXJzaW9uIG9mICRhbmltYXRlQ3NzLlxuICAgICAgaWYgKG9wdGlvbnMuY2xlYW51cFN0eWxlcykge1xuICAgICAgICBvcHRpb25zLmZyb20gPSBvcHRpb25zLnRvID0gbnVsbDtcbiAgICAgIH1cblxuICAgICAgaWYgKG9wdGlvbnMuZnJvbSkge1xuICAgICAgICBlbGVtZW50LmNzcyhvcHRpb25zLmZyb20pO1xuICAgICAgICBvcHRpb25zLmZyb20gPSBudWxsO1xuICAgICAgfVxuXG4gICAgICB2YXIgY2xvc2VkLCBydW5uZXIgPSBuZXcgJCRBbmltYXRlUnVubmVyKCk7XG4gICAgICByZXR1cm4ge1xuICAgICAgICBzdGFydDogcnVuLFxuICAgICAgICBlbmQ6IHJ1blxuICAgICAgfTtcblxuICAgICAgZnVuY3Rpb24gcnVuKCkge1xuICAgICAgICAkJHJBRihmdW5jdGlvbigpIHtcbiAgICAgICAgICBhcHBseUFuaW1hdGlvbkNvbnRlbnRzKCk7XG4gICAgICAgICAgaWYgKCFjbG9zZWQpIHtcbiAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjbG9zZWQgPSB0cnVlO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHJ1bm5lcjtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gYXBwbHlBbmltYXRpb25Db250ZW50cygpIHtcbiAgICAgICAgaWYgKG9wd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AgICpcbiAgICAgICAqIEV4YW1wbGUgdGVzdDpcbiAgICAgICAqXG4gICAgICAgKiBgYGBqc1xuICAgICAgICogIGl0KCdzaG91bGQgYmVoYXZlIGxpa2UgYSBjYWNoZScsIGluamVjdChmdW5jdGlvbihzdXBlckNhY2hlKSB7XG4gICAgICAgKiAgICBzdXBlckNhY2hlLnB1dCgna2V5JywgJ3ZhbHVlJyk7XG4gICAgICAgKiAgICBzdXBlckNhY2hlLnB1dCgnYW5vdGhlciBrZXknLCAnYW5vdGhlciB2YWx1ZScpO1xuICAgICAgICpcbiAgICAgICAqICAgIGV4cGVjdChzdXBlckNhY2hlLmluZm8oKSkudG9FcXVhbCh7XG4gICAgICAgKiAgICAgIGlkOiAnc3VwZXItY2FjaGUnLFxuICAgICAgICogICAgICBzaXplOiAyXG4gICAgICAgKiAgICB9KTtcbiAgICAgICAqXG4gICAgICAgKiAgICBzdXBlckNhY2hlLnJlbW92ZSgnYW5vdGhlciBrZXknKTtcbiAgICAgICAqICAgIGV4cGVjdChzdXBlckNhY2hlLmdldCgnYW5vdGhlciBrZXknKSkudG9CZVVuZGVmaW5lZCgpO1xuICAgICAgICpcbiAgICAgICAqICAgIHN1cGVyQ2FjaGUucmVtb3ZlQWxsKCk7XG4gICAgICAgKiAgICBleHBlY3Qoc3VwZXJDYWNoZS5pbmZvKCkpLnRvRXF1YWwoe1xuICAgICAgICogICAgICBpZDogJ3N1cGVyLWNhY2hlJyxcbiAgICAgICAqICAgICAgc2l6ZTogMFxuICAgICAgICogICAgfSk7XG4gICAgICAgKiAgfSkpO1xuICAgICAgICogYGBgXG4gICAgICAgKi9cbiAgICAgIHJldHVybiAoY2FjaGVzW2NhY2hlSWRdID0ge1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAqIEBuYW1lICRjYWNoZUZhY3RvcnkuQ2FjaGUjcHV0XG4gICAgICAgICAqIEBraW5kIGZ1bmN0aW9uXG4gICAgICAg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AgICAgdmFyIGxydUVudHJ5ID0gbHJ1SGFzaFtrZXldIHx8IChscnVIYXNoW2tleV0gPSB7a2V5OiBrZXl9KTtcblxuICAgICAgICAgICAgcmVmcmVzaChscnVFbnRyeSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCEoa2V5IGluIGRhdGEpKSBzaXplKys7XG4gICAgICAgICAgZGF0YVtrZXldID0gdmFsdWU7XG5cbiAgICAgICAgICBpZiAoc2l6ZSA+IGNhcGFjaXR5KSB7XG4gICAgICAgICAgICB0aGlzLnJlbW92ZShzdGFsZUVuZC5rZXkpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI2dldFxuICAgICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICAgKlxuICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICogUmV0cmlldmVzIG5hbWVkIGRhdGEgc3RvcmVkIGluIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0gb2JqZWN0LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30ga2V5IHRoZSBrZXkgb2YgdGhlIGRhdGEgdG8gYmUgcmV0cmlldmVkXG4gICAgICAgICAqIEByZXR1cm5zIHsqfSB0aGUgdmFsdWUgc3RvcmVkLlxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0OiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICBpZiAoY2FwYWNpdHkgPCBOdW1iZXIuTUFYX1ZBTFVFKSB7XG4gICAgICAgICAgICB2YXIgbHJ1RW50cnkgPSBscnVIYXNoW2tleV07XG5cbiAgICAgICAgICAgIGlmICghbHJ1RW50cnkpIHJldHVybjtcblxuICAgICAgICAgICAgcmVmcmVzaChscnVFbnRyeSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIGRhdGFba2V5XTtcbiAgICAgICAgfSxcblxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAqIEBuYW1lICRjYWNoZUZhY3RvcnkuQ2FjaGUjcmVtb3ZlXG4gICAgICAgICAqIEBraW5kIGZ1bmN0aW9uXG4gICAgICAgICAqXG4gICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgKiBSZW1vdmVzIGFuIGVudHJ5IGZyb20gdGhlIHtAbGluayAkY2FjaGVGYWN0b3J5LkNhY2hlIENhY2hlfSBvYmplY3QuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgdGhlIGtleSBvZiB0aGUgZW50cnkgdG8gYmUgcmVtb3ZlZFxuICAgICAgICAgKi9cbiAgICAgICAgcmVtb3ZlOiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICBpZiAoY2FwYWNpdHkgPCBOdW1iZXIuTUFYX1ZBTFVFKSB7XG4gICAgICAgICAgICB2YXIgbHJ1RW50cnkgPSBscnVIYXNoW2tleV07XG5cbiAgICAgICAgICAgIGlmICghbHJ1RW50cnkpIHJldHVybjtcblxuICAgICAgICAgICAgaWYgKGxydUVudHJ5ID09PSBmcmVzaEVuZCkgZnJlc2hFbmQgPSBscnVFbnRyeS5wO1xuICAgICAgICAgICAgaWYgKGxydUVudHJ5ID09PSBzdGFsZUVuZCkgc3RhbGVFbmQgPSBscnVFbnRyeS5uO1xuICAgICAgICAgICAgbGluayhscnVFbnRyeS5uLGxydUVudHJ5LnApO1xuXG4gICAgICAgICAgICBkZWxldGUgbHJ1SGFzaFtrZXldO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmICghKGtleSBpbiBkYXRhKSkgcmV0dXJuO1xuXG4gICAgICAgICAgZGVsZXRlIGRhdGFba2V5XTtcbiAgICAgICAgICBzaXplLS07XG4gICAgICAgIH0sXG5cblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI3JlbW92ZUFsbFxuICAgICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICAgKlxuICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICogQ2xlYXJzIHRoZSBjYWNoZSBvYmplY3Qgb2YgYW55IGVudHJpZXMuXG4gICAgICAgICAqL1xuICAgICAgICByZW1vdmVBbGw6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGRhdGEgPSBjcmVhdGVNYXAoKTtcbiAgICAgICAgICBzaXplID0gMDtcbiAgICAgICAgICBscnVIYXNoID0gY3JlYXRlTWFwKCk7XG4gICAgICAgICAgZnJlc2hFbmQgPSBzdGFsZUVuZCA9IG51bGw7XG4gICAgICAgIH0sXG5cblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI2Rlc3Ryb3lcbiAgICAgICAgICogQGtpbmQgZnVuY3Rpb25cbiAgICAgICAgICpcbiAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAqIERlc3Ryb3lzIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0gb2JqZWN0IGVudGlyZWx5LFxuICAgICAgICAgKiByZW1vdmluZyBpdCBmcm9tIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeSAkY2FjaGVGYWN0b3J5fSBzZXQuXG4gICAgICAgICAqL1xuICAgICAgICBkZXN0cm95OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBkYXRhID0gbnVsbDtcbiAgICAgICAgICBzdGF0cyA9IG51bGw7XG4gICAgICAgICAgbHJ1SGFzaCA9IG51bGw7XG4gICAgICAgICAgZGVsZXRlIGNhY2hlc1tjYWNoZUlkXTtcbiAgICAgICAgfSxcblxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAqIEBuYW1lICRjYWNoZUZhY3RvcnkuQ2FjaGUjaW5mb1xuICAgICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICAgKlxuICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICogUmV0cmlldmUgaW5mb3JtYXRpb24gcmVnYXJkaW5nIGEgcGFydGljdWxhciB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0uXG4gICAgICAgICAqXG4gICAgICAgICAqIEByZXR1cm5zIHtvYmplY3R9IGFuIG9iamVjdCB3aXRoIHRoZSBmb2xsb3dpbmcgcHJvcGVydGllczpcbiAgICAgICAgICogICA8dWw+XG4gICAgICAgICAqICAgICA8bGk+KippZCoqOiB0aGUgaWQgb2YgdGhlIGNhY2hlIGluc3RhbmNlPC9saT5cbiAgICAgICAgICogICAgIDxsaT4qKnNpemUqKjogdGhlIG51bWJlciBvZiBlbnRyaWVzIGtlcHQgaW4gdGhlIGNhY2hlIGluc3RhbmNlPC9saT5cbiAgICAgICAgICogICAgIDxsaT4qKi4uLioqOiBhbnkgYWRkaXRpb25hbCBwcm9wZXJ0aWVzIGZyb20gdGhlIG9wdGlvbnMgb2JqZWN0IHdoZW4gY3JlYXRpbmcgdGhlXG4gICAgICAgICAqICAgICAgIGNhY2hlLjwvbGk+XG4gICAgICAgICAqICAgPC91bD5cbiAgICAgICAgICovXG4gICAgICAgIGluZm86IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBleHRlbmQoe30sIHN0YXRzLCB7c2l6ZTogc2l6ZX0pO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuXG4gICAgICAvKipcbiAgICAgICAqIG1ha2VzIHRoZSBgZW50cnlgIHRoZSBmcmVzaEVuZCBvZiB0aGUg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bigkY2FjaGVGYWN0b3J5KSB7XG4gICAgcmV0dXJuICRjYWNoZUZhY3RvcnkoJ3RlbXBsYXRlcycpO1xuICB9XTtcbn1cblxuLyogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKlxuICogICAgIEFueSBjb21taXRzIHRvIHRoaXMgZmlsZSBzaG91bGQgYmUgcmV2aWV3ZWQgd2l0aCBzZWN1cml0eSBpbiBtaW5kLiAgKlxuICogICBDaGFuZ2VzIHRvIHRoaXMgZmlsZSBjYW4gcG90ZW50aWFsbHkgY3JlYXRlIHNlY3VyaXR5IHZ1bG5lcmFiaWxpdGllcy4gKlxuICogICAgICAgICAgQW4gYXBwcm92YWwgZnJvbSAyIENvcmUgbWVtYmVycyB3aXRoIGhpc3Rvcnkgb2YgbW9kaWZ5aW5nICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBmaWxlIGlzIHJlcXVpcmVkLiAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogIERvZXMgdGhlIGNoYW5nZSBzb21laG93IGFsbG93IGZvciBhcmJpdHJhcnkgamF2YXNjcmlwdCB0byBiZSBleGVjdXRlZD8gKlxuICogICAgT3IgYWxsb3dzIGZvciBzb21lb25lIHRvIGNoYW5nZSB0aGUgcHJvdG90eXBlIG9mIGJ1aWx0LWluIG9iamVjdHM/ICAgKlxuICogICAgIE9yIGdpdmVzIHVuZGVzaXJlZCBhY2Nlc3MgdG8gdmFyaWFibGVzIGxpa2UgZG9jdW1lbnQgb3Igd2luZG93PyAgICAqXG4gKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqL1xuXG4vKiAhIFZBUklBQkxFL0ZVTkNUS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HtAbGluayAkY29tcGlsZSMtdHJhbnNjbHVkZS0gdHJhbnNjbHVkZX06IGZhbHNlLFxuICogICAgICAge0BsaW5rICRjb21waWxlIy1yZXN0cmljdC0gcmVzdHJpY3R9OiAnQScsXG4gKiAgICAgICB7QGxpbmsgJGNvbXBpbGUjLXRlbXBsYXRlbmFtZXNwYWNlLSB0ZW1wbGF0ZU5hbWVzcGFjZX06ICdodG1sJyxcbiAqICAgICAgIHtAbGluayAkY29tcGlsZSMtc2NvcGUtIHNjb3BlfTogZmFsc2UsXG4gKiAgICAgICB7QGxpbmsgJGNvbXBpbGUjLWNvbnRyb2xsZXItIGNvbnRyb2xsZXJ9OiBmdW5jdGlvbigkc2NvcGUsICRlbGVtZW50LCAkYXR0cnMsICR0cmFuc2NsdWRlLCBvdGhlckluamVjdGFibGVzKSB7IC4uLiB9LFxuICogICAgICAge0BsaW5rICRjb21waWxlIy1jb250cm9sbGVyYXMtIGNvbnRyb2xsZXJBc306ICdzdHJpbmdJZGVudGlmaWVyJyxcbiAqICAgICAgIHtAbGluayAkY29tcGlsZSMtYmluZHRvY29udHJvbGxlci0gYmluZFRvQ29udHJvbGxlcn06IGZhbHNlLFxuICogICAgICAge0BsaW5rICRjb21waWxlIy1yZXF1aXJlLSByZXF1aXJlfTogJ3NpYmxpbmdEaXJlY3RpdmVOYW1lJywgLy8gb3IgLy8gWydecGFyZW50RGlyZWN0aXZlTmFtZScsICc/b3B0aW9uYWxEaXJlY3RpdmVOYW1lJywgJz9eb3B0aW9uYWxQYXJlbnQnXSxcbiAqICAgICAgIHtAbGluayAkY29tcGlsZSMtbXVsdGllbGVtZW50LSBtdWx0aUVsZW1lbnR9OiBmYWxzZSxcbiAqICAgICAgIHtAbGluayAkY29tcGlsZSMtY29tcGlsZS0gY29tcGlsZX06IGZ1bmN0aW9uIGNvbXBpbGUodEVsZW1lbnQsIHRBdHRycywgdHJhbnNjbHVkZSkge1xuICogICAgICAgICByZXR1cm4ge1xuICogICAgICAgICAgICB7QGxpbmsgJGNvbXBpbGUjcHJlLWxpbmtpbmctZnVuY3Rpb24gcHJlfTogZnVuY3Rpb24gcHJlTGluayhzY29wZSwgaUVsZW1lbnQsIGlBdHRycywgY29udHJvbGxlcikgeyAuLi4gfSxcbiAqICAgICAgICAgICAge0BsaW5rICRjb21waWxlI3Bvc3QtbGlua2luZy1mdW5jdGlvbiBwb3N0fTogZnVuY3Rpb24gcG9zdExpbmsoc2NvcGUsIGlFbGVtZW50LCBpQXR0cnMsIGNvbnRyb2xsZXIpIHsgLi4uIH1cbiAqICAgICAgICAgfVxuICogICAgICAgICAvLyBvclxuICogICAgICAgICAvLyByZXR1cm4gZnVuY3Rpb24gcG9zdExpbmsoIC4uLiApIHsgLi4uIH1cbiAqICAgICAgIH0sXG4gKiAgICAgICAvLyBvclxuICogICAgICAgLy8ge0BsaW5rICRjb21waWxlIy1saW5rLSBsaW5rfToge1xuICogICAgICAgLy8gIHtAbGluayAkY29tcGlsZSNwcmUtbGlua2luZy1mdW5jdGlvbiBwcmV9OiBmdW5jdGlvbiBwcmVMaW5rKHNjb3BlLCBpRWxlbWVudCwgaUF0dHJzLCBjb250cm9sbGVyKSB7IC4uLiB9LFxuICogICAgICAgLy8gIHtAbGluayAkY29tcGlsZSNwb3N0LWxpbmtpbmctZnVuY3Rpb24gcG9zdH06IGZ1bmN0aW9uIHBvc3RMaW5rKHNjb3BlLCBpRWxlbWVudCwgaUF0dHJzLCBjb250cm9sbGVyKSB7IC4uLiB9XG4gKiAgICAgICAvLyB9XG4gKiAgICAgICAvLyBvclxuICogICAgICAgLy8ge0BsaW5rICRjb21waWxlIy1saW5rLSBsaW5rfTogZnVuY3Rpb24gcG9zdExpbmsoIC4uLiApIHsgLi4uIH1cbiAqICAgICB9O1xuICogICAgIHJldHVybiBkaXJlY3RpdmVEZWZpbml0aW9uT2JqZWN0O1xuICogICB9KTtcbiAqIGBgYFxuICpcbiAqIDxkaXYgY2xhc3M9XCJhbGVydCBhbGVydC13YXJuaW5n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fScgK1xuICogICAgICAgICAgICc8dGVzdCBkYXRlPVwiJGN0cmwuZGF0ZVwiPjwvdGVzdD4nLFxuICogICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICB0aGlzLmRhdGUgPSBuZXcgRGF0ZSgpO1xuICogICAgICAgICAgIHRoaXMubW9udGggPSB0aGlzLmRhdGUuZ2V0TW9udGgoKTtcbiAqICAgICAgICAgICB0aGlzLnVwZGF0ZURhdGUgPSBmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICAgIHRoaXMuZGF0ZS5zZXRNb250aCh0aGlzLm1vbnRoKTtcbiAqICAgICAgICAgICB9O1xuICogICAgICAgICB9XG4gKiAgICAgICB9KVxuICogICAgICAgLmNvbXBvbmVudCgndGVzdCcsIHtcbiAqICAgICAgICAgYmluZGluZ3M6IHsgZGF0ZTogJzwnIH0sXG4gKiAgICAgICAgIHRlbXBsYXRlOlxuICogICAgICAgICAgICc8cHJlPnt7ICRjdHJsLmxvZyB8IGpzb24gfX08L3ByZT4nLFxuICogICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICB2YXIgcHJldmlvdXNWYWx1ZTtcbiAqICAgICAgICAgICB0aGlzLmxvZyA9IFtdO1xuICogICAgICAgICAgIHRoaXMuJGRvQ2hlY2sgPSBmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICAgIHZhciBjdXJyZW50VmFsdWUgPSB0aGlzLmRhdGUgJiYgdGhpcy5kYXRlLnZhbHVlT2YoKTtcbiAqICAgICAgICAgICAgIGlmIChwcmV2aW91c1ZhbHVlICE9PSBjdXJyZW50VmFsdWUpIHtcbiAqICAgICAgICAgICAgICAgdGhpcy5sb2cucHVzaCgnZG9DaGVjazogZGF0ZSBtdXRhdGVkOiAnICsgdGhpcy5kYXRlKTtcbiAqICAgICAgICAgICAgICAgcHJldmlvdXNWYWx1ZSA9IGN1cnJlbnRWYWx1ZTtcbiAqICAgICAgICA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Rpdj5cbiAqICAgPC9maWxlPlxuICogICA8ZmlsZSBuYW1lPVwiYXBwLmpzXCI+XG4gKiAgICAgIGFuZ3VsYXIubW9kdWxlKCdkby1jaGVjay1tb2R1bGUnLCBbXSlcbiAqICAgICAgICAuY29tcG9uZW50KCd0ZXN0Jywge1xuICogICAgICAgICAgYmluZGluZ3M6IHsgaXRlbXM6ICc8JyB9LFxuICogICAgICAgICAgdGVtcGxhdGU6XG4gKiAgICAgICAgICAgICc8cHJlPnt7ICRjdHJsLmxvZyB8IGpzb24gfX08L3ByZT4nLFxuICogICAgICAgICAgY29udHJvbGxlcjogZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICAgIHRoaXMubG9nID0gW107XG4gKlxuICogICAgICAgICAgICB0aGlzLiRkb0NoZWNrID0gZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICAgICAgaWYgKHRoaXMuaXRlbXNfcmVmICE9PSB0aGlzLml0ZW1zKSB7XG4gKiAgICAgICAgICAgICAgICB0aGlzLmxvZy5wdXNoKCdkb0NoZWNrOiBpdGVtcyBjaGFuZ2VkJyk7XG4gKiAgICAgICAgICAgICAgICB0aGlzLml0ZW1zX3JlZiA9IHRoaXMuaXRlbXM7XG4gKiAgICAgICAgICAgICAgfVxuICogICAgICAgICAgICAgIGlmICghYW5ndWxhci5lcXVhbHModGhpcy5pdGVtc19jbG9uZSwgdGhpcy5pdGVtcykpIHtcbiAqICAgICAgICAgICAgICAgIHRoaXMubG9nLnB1c2goJ2RvQ2hlY2s6IGl0ZW1zIG11dGF0ZWQnKTtcbiAqICAgICAgICAgICAgICAgIHRoaXMuaXRlbXNfY2xvbmUgPSBhbmd1bGFyLmNvcHkodGhpcy5pdGVtcyk7XG4gKiAgICAgICAgICAgICAgfVxuICogICAgICAgICAgICB9O1xuICogICAgICAgICAgfVxuICogICAgICAgIH0pO1xuICogICA8L2ZpbGU+XG4gKiA8L2V4YW1wbGU+XG4gKlxuICpcbiAqICMjIyBEaXJlY3RpdmUg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zY29wZSoqIGFuZCBhcmUgcmVzdHJpY3RlZCB0byBlbGVtZW50cy5cbiAgICpcbiAgICogSGVyZSBhcmUgYSBmZXcgZXhhbXBsZXMgb2YgaG93IHlvdSB3b3VsZCB1c3VhbGx5IGRlZmluZSBjb21wb25lbnRzOlxuICAgKlxuICAgKiBgYGBqc1xuICAgKiAgIHZhciBteU1vZCA9IGFuZ3VsYXIubW9kdWxlKC4uLik7XG4gICAqICAgbXlNb2QuY29tcG9uZW50KCdteUNvbXAnLCB7XG4gICAqICAgICB0ZW1wbGF0ZTogJzxkaXY+TXkgbmFtZSBpcyB7eyRjdHJsLm5hbWV9fTwvZGl2PicsXG4gICAqICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigpIHtcbiAgICogICAgICAgdGhpcy5uYW1lID0gJ3NoYWhhcic7XG4gICAqICAgICB9XG4gICAqICAgfSk7XG4gICAqXG4gICAqICAgbXlNb2QuY29tcG9uZW50KCdteUNvbXAnLCB7XG4gICAqICAgICB0ZW1wbGF0ZTogJzxkaXY+TXkgbmFtZSBpcyB7eyRjdHJsLm5hbWV9fTwvZGl2PicsXG4gICAqICAgICBiaW5kaW5nczoge25hbWU6ICdAJ31cbiAgICogICB9KTtcbiAgICpcbiAgICogICBteU1vZC5jb21wb25lbnQoJ215Q29tcCcsIHtcbiAgICogICAgIHRlbXBsYXRlVXJsOiAndmlld3MvbXktY29tcC5odG1sJyxcbiAgICogICAgIGNvbnRyb2xsZXI6ICdNeUN0cmwnLFxuICAgKiAgICAgY29udHJvbGxlckFzOiAnY3RybCcsXG4gICAqICAgICBiaW5kaW5nczoge25hbWU6ICdAJ31cbiAgICogICB9KTtcbiAgICpcbiAgICogYGBgXG4gICAqIEZvciBtb3JlIGV4YW1wbGVzLCBhbmQgYW4gaW4tZGVwdGggZ3VpZGUsIHNlZSB0aGUge0BsaW5rIGd1aWRlL2NvbXBvbmVudCBjb21wb25lbnQgZ3VpZGV9LlxuICAgKlxuICAgKiA8YnIgLz5cbiAgIC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ZhbHNlKSB3aXRoIHN1Y2ggYXR0cmlidXRlcy4gVG8gYXZvaWQgaXNzdWVzXG4gICAgICAgICAgICAgIC8vIGluIFhIVE1MLCBjYWxsIGByZW1vdmVBdHRyYCBpbiBzdWNoIGNhc2VzIGluc3RlYWQuXG4gICAgICAgICAgICAgIC8vIFNlZSBodHRwczovL2dpdGh1Yi5jb20vanF1ZXJ5L2pxdWVyeS9pc3N1ZXMvNDI0OVxuICAgICAgICAgICAgICBpZiAoYm9vbGVhbktleSAmJiB2YWx1ZSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiQkZWxlbWVudC5yZW1vdmVBdHRyKGF0dHJOYW1lKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLiQkZWxlbWVudC5hdHRyKGF0dHJOYW1lLCB2YWx1ZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHNldFNwZWNpYWxBdHRyKHRoaXMuJCRlbGVtZW50WzBdLCBhdHRyTmFtZSwgdmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGZpcmUgb2JzZXJ2ZXJzXG4gICAgICAgIHZhciAkJG9ic2VydmVycyA9IHRoaXMuJCRvYnNlcnZlcnM7XG4gICAgICAgIGlmICgkJG9ic2VydmVycykge1xuICAgICAgICAgIGZvckVhY2goJCRvYnNlcnZlcnNbb2JzZXJ2ZXJdLCBmdW5jdGlvbihmbikge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgZm4odmFsdWUpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSxcblxuXG4gICAgICAvKipcbiAg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9ybWFsaXplIHRoZSBub24tcHJlZml4ZWQgbmFtZVxuICAgICAgICAgICAgICBuYW1lID0gbmFtZS5yZXBsYWNlKFBSRUZJWF9SRUdFWFAsICcnKVxuICAgICAgICAgICAgICAgIC50b0xvd2VyQ2FzZSgpXG4gICAgICAgICAgICAgICAgLnN1YnN0cig0ICsgbmdQcmVmaXhNYXRjaFsxXS5sZW5ndGgpLnJlcGxhY2UoL18oLikvZywgZnVuY3Rpb24obWF0Y2gsIGxldHRlcikge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIGxldHRlci50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvLyBTdXBwb3J0ICotc3RhcnQgLyAqLWVuZCBtdWx0aSBlbGVtZW50IGRpcmVjdGl2ZXNcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoKG11bHRpRWxlbWVudE1hdGNoID0gbk5hbWUubWF0Y2goTVVMVElfRUxFTUVOVF9ESVJfUkUpKSAmJiBkaXJlY3RpdmVJc011bHRpRWxlbWVudChtdWx0aUVsZW1lbnRNYXRjaFsxXSkpIHtcbiAgICAgICAgICAgICAgYXR0clN0YXJ0TmFtZSA9IG5hbWU7XG4gICAgICAgICAgICAgIGF0dHJFbmROYW1lID0gbmFtZS5zdWJzdHIoMCwgbmFtZS5sZW5ndGggLSA1KSArICdlbmQnO1xuICAgICAgICAgICAgICBuYW1lID0gbmFtZS5zdWJzdHIoMCwgbmFtZS5sZW5ndGggLSA2KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGlzTmdQcm9wIHx8IGlzTmdFdmVudCkge1xuICAgICAgICAgICAgICBhdHRyc1tuTmFtZV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgYXR0cnNNYXBbbk5hbWVdID0gYXR0ci5uYW1lO1xuXG4gICAgICAgICAgICAgIGlmIChpc05nUHJvcCkge1xuICAgICAgICAgICAgICAgIGFkZFByb3BlcnR5RGlyZWN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gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUgYXJndW1lbnQgaXMgYXV0by1nZW5lcmF0ZWQgdG8gdGhlIG5ld1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZCBvZiB0aGUgdHJhbnNjbHVkZWQgcGFyZW50IHNjb3BlLlxuICAgICAqIEBwYXJhbSB7SlFMaXRlfSBqcUNvbGxlY3Rpb24gSWYgd2UgYXJlIHdvcmtpbmcgb24gdGhlIHJvb3Qgb2YgdGhlIGNvbXBpbGUgdHJlZSB0aGVuIHRoaXNcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3VtZW50IGhhcyB0aGUgcm9vdCBqcUxpdGUgYXJyYXkgc28gdGhhdCB3ZSBjYW4gcmVwbGFjZSBub2Rlc1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24gaXQuXG4gICAgICogQHBhcmFtIHtPYmplY3Q9fSBvcmlnaW5hbFJlcGxhY2VEaXJlY3RpdmUgQW4gb3B0aW9uYWwgZGlyZWN0aXZlIHRoYXQgd2lsbCBiZSBpZ25vcmVkIHdoZW5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21waWxpbmcgdGhlIHRyYW5zY2x1c2lvbi5cbiAgICAgKiBAcGFyYW0ge0FycmF5LjxGdW5jdGlvbj59IHByZUxpbmtGbnNcbiAgICAgKiBAcGFyYW0ge0FycmF5LjxGdW5jdGlvbj59IHBvc3RMaW5rRm5zXG4gICAgICogQHBhcmFtIHtPYmplY3R9IHByZXZpb3VzQ29tcGlsZUNvbnRleHQgQ29udGV4dCB1c2VkIGZvciBwcmV2aW91cyBjb21waWxhdGlvbiBvZiB0aGUgY3VycmVudFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVcbiAg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sdWRlRm4gPSBjb21waWxhdGlvbkdlbmVyYXRvcihtaWdodEhhdmVNdWx0aXBsZVRyYW5zY2x1c2lvbkVycm9yLCAkdGVtcGxhdGUsIHRyYW5zY2x1ZGVGbiwgdGVybWluYWxQcmlvcml0eSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXBsYWNlRGlyZWN0aXZlICYmIHJlcGxhY2VEaXJlY3RpdmUubmFtZSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG9uJ3QgcGFzcyBpbjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIC0gY29udHJvbGxlckRpcmVjdGl2ZXMgLSBvdGhlcndpc2Ugd2UnbGwgY3JlYXRlIGR1cGxpY2F0ZXMgY29udHJvbGxlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIC0gbmV3SXNvbGF0ZVNjb3BlRGlyZWN0aXZlIG9yIHRlbXBsYXRlRGlyZWN0aXZlIC0gY29tYmluaW5nIHRlbXBsYXRlcyB3aXRoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgIGVsZW1lbnQgdHJhbnNjbHVzaW9uIGRvZXNuJ3QgbWFrZSBzZW5zZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBuZWVkIG9ubHkgbm9uVGxiVHJhbnNjbHVkZURpcmVjdGl2ZSBzbyB0aGF0IHdlIHByZXZlbnQgcHV0dGluZyB0cmFuc2NsdXNpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9uIHRoZSBzYW1lIGVsZW1lbnQgbW9yZSB0aGFuIG9uY2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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Y29udGVudHMoKSwgZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgIHZhciBzbG90TmFtZSA9IHNsb3RNYXBbZGlyZWN0aXZlTm9ybWFsaXplKG5vZGVOYW1lXyhub2RlKSldO1xuICAgICAgICAgICAgICAgIGlmIChzbG90TmFtZSkge1xuICAgICAgICAgICAgICAgICAgZmlsbGVkU2xvdHNbc2xvdE5hbWVdID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIHNsb3RzW3Nsb3ROYW1lXSA9IHNsb3RzW3Nsb3ROYW1lXSB8fCB3aW5kb3cuZG9jdW1lbnQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpO1xuICAgICAgICAgICAgICAgICAgc2xvdHNbc2xvdE5hbWVdLmFwcGVuZENoaWxkKG5vZGUpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAkdGVtcGxhdGUuYXBwZW5kQ2hpbGQobm9kZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAvLyBDaGVjayBmb3IgcmVxdWlyZWQgc2xvdHMgdGhhdCB3ZXJlIG5vdCBmaWxsZWRcbiAgICAgICAgICAgICAgZm9yRWFjaChmaWxsZWRTbG90cywgZnVuY3Rpb24oZmlsbGVkLCBzbG90TmFtZSkge1xuICAgICAgICAgICAgICAgIGlmICghZmlsbGVkKSB7XG4gICAgICAgICAgICAgICAgICB0aHJvdyAkY29tcGlsZU1pbkVycigncmVxc2xvdCcsICdSZXF1aXJlZCB0cmFuc2NsdXNpb24gc2xvdCBgezB9YCB3YXMgbm90IGZpbGxlZC4nLCBzbG90TmFtZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICBmb3IgKHZhciBzbG90TmFtZSBpbiBzbG90cykge1xuICAgICAgICAgICAgICAgIGlmIChzbG90c1tzbG90TmFtZV0pIHtcbiAgICAgICAg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GFsbCBjb250cm9sbGVycyB0aGF0IGhhdmUgdGhlbVxuICAgICAgICBmb3JFYWNoKGVsZW1lbnRDb250cm9sbGVycywgZnVuY3Rpb24oY29udHJvbGxlcikge1xuICAgICAgICAgIHZhciBjb250cm9sbGVySW5zdGFuY2UgPSBjb250cm9sbGVyLmluc3RhbmNlO1xuICAgICAgICAgIGlmIChpc0Z1bmN0aW9uKGNvbnRyb2xsZXJJbnN0YW5jZS4kb25DaGFuZ2VzKSkge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgY29udHJvbGxlckluc3RhbmNlLiRvbkNoYW5nZXMoY29udHJvbGxlci5iaW5kaW5nSW5mby5pbml0aWFsQ2hhbmdlcyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNGdW5jdGlvbihjb250cm9sbGVySW5zdGFuY2UuJG9uSW5pdCkpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGNvbnRyb2xsZXJJbnN0YW5jZS4kb25Jbml0KCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNGdW5jdGlvbihjb250cm9sbGVySW5zdGFuY2UuJGRvQ2hlY2spKSB7XG4gICAgICAgICAgICBjb250cm9sbGVyU2NvcGUuJHdhdGNoKGZ1bmN0aW9uKCkgeyBjb250cm9sbGVySW5zdGFuY2UuJGRvQ2hlY2soKTsgfSk7XG4gICAgICAgICAgICBjb250cm9sbGVySW5zdGFuY2UuJGRvQ2hlY2soKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzRnVuY3Rpb24oY29udHJvbGxlckluc3RhbmNlLiRvb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290RWxlbWVudC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgIGogPCBqajsgaisrLCBqMisrKSB7XG4gICAgICAgICAgICAgIGlmIChqMiA8IGpqKSB7XG4gICAgICAgICAgICAgICAgJHJvb3RFbGVtZW50W2pdID0gJHJvb3RFbGVtZW50W2oyXTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgJHJvb3RFbGVtZW50W2pdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkcm9vdEVsZW1lbnQubGVuZ3RoIC09IHJlbW92ZUNvdW50IC0gMTtcblxuICAgICAgICAgICAgLy8gSWYgdGhlIHJlcGxhY2VkIGVsZW1lbnQgaXMgYWxzbyB0aGUgalF1ZXJ5IC5jb250ZXh0IHRoZW4gcmVwbGFjZSBpdFxuICAgICAgICAgICAgLy8gLmNvbnRleHQgaXMgYSBkZXByZWNhdGVkIGpRdWVyeSBhcGksIHNvIHdlIHNob3VsZCBzZXQgaXQgb25seSB3aGVuIGpRdWVyeSBzZXQgaXRcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9hcGkuanF1ZXJ5LmNvbS9jb250ZXh0L1xuICAgICAgICAgICAgaWYgKCRyb290RWxlbWVudC5jb250ZXh0ID09PSBmaXJzdEVsZW1lbnRUb1JlbW92ZSkge1xuICAgICAgICAgICAgICAkcm9vdEVsZW1lbnQuY29udGV4dCA9IG5ld05vZGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKHBhcmVudCkge1xuICAgICAgICBwYXJlbnQucmVwbGFjZUNoaWxkKG5ld05vZGUsIGZpcnN0RWxlbWVudFRvUmVtb3ZlKTtcbiAgICAgIH1cblxuICAgICAgLy8gQXBwZW5kIGFsbCB0aGUgYGVsZW1lbnRzVG9SZW1vdmVgIHRvIGEgZnJhZ21lbnQuI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aWxsIG5vdCBpbnZva2UgdGhlIGNvbnRyb2xsZXIgdW50aWwgYSByZXR1cm5lZFxuICAgICAgLy8gICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayBpcyBpbnZva2VkLlxuICAgICAgLy8gICBwYXJhbSBgaWRlbnRgIC0tLSBBbiBvcHRpb25hbCBsYWJlbCB3aGljaCBvdmVycmlkZXMgdGhlIGxhYmVsIHBhcnNlZCBmcm9tIHRoZSBjb250cm9sbGVyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgICAgIGV4cHJlc3Npb24sIGlmIGFueS5cbiAgICAgIHZhciBpbnN0YW5jZSwgbWF0Y2gsIGNvbnN0cnVjdG9yLCBpZGVudGlmaWVyO1xuICAgICAgbGF0ZXIgPSBsYXRlciA9PT0gdHJ1ZTtcbiAgICAgIGlmIChpZGVudCAmJiBpc1N0cmluZyhpZGVudCkpIHtcbiAgICAgICAgaWRlbnRpZmllciA9IGlkZW50O1xuICAgICAgfVxuXG4gICAgICBpZiAoaXNTdHJpbmcoZXhwcmVzc2lvbikpIHtcbiAgICAgICAgbWF0Y2ggPSBleHByZXNzaW9uLm1hdGNoKENOVFJMX1JFRyk7XG4gICAgICAgIGlmICghbWF0Y2gpIHtcbiAgICAgICAgICB0aHJvdyAkY29udHJvbGxlck1pbkVycignY3RybGZtdCcsXG4gICAgICAgICAgICAnQmFkbHkgZm9ybWVkIGNvbnRyb2xsZXIgc3RyaW5nIFxcJ3swfVxcJy4gJyArXG4gICAgICAgICAgICAnTXVzdCBtYXRjaCBgX19uYW1lX18gYXMgX19pZF9fYCBvciBgX19uYW1lX19gLicsIGV4cHJlc3Npb24pO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0cnVjdG9yID0gbWF0Y2hbMV07XG4gICAgICAgIGlkZW50aWZpZXIgPSBpZGVudGlmaWVyIHx8IG1hdGNoWzNdO1xuICAgICAgICBleHByZXNzaW9uID0gY29udHJvbGxlcnMuaGFzT3duUHJvcGVydHkoY29uc3RydWN0b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0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCdcbiAgICogICAgIH1cbiAgICogICB9KTtcbiAgICpcbiAgICogfSk7XG4gICAqIGBgYFxuICAgKlxuICAgKi9cbiAgdGhpcy4kZ2V0ID0gZnVuY3Rpb24oKSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uIGpRdWVyeUxpa2VQYXJhbVNlcmlhbGl6ZXIocGFyYW1zKSB7XG4gICAgICBpZiAoIXBhcmFtcykgcmV0dXJuICcnO1xuICAgICAgdmFyIHBhcnRzID0gW107XG4gICAgICBzZXJpYWxpemUocGFyYW1zLCAnJywgdHJ1ZSk7XG4gICAgICByZXR1cm4gcGFydHMuam9pbignJicpO1xuXG4gICAgICBmdW5jdGlvbiBzZXJpYWxpemUodG9TZXJpYWxpemUsIHByZWZpeCwgdG9wTGV2ZWwpIHtcbiAgICAgICAgaWYgKGlzQXJyYXkodG9TZXJpYWxpemUpKSB7XG4gICAgICAgICAgZm9yRWFjaCh0b1NlcmlhbGl6ZSwgZnVuY3Rpb24odmFsdWUsIGluZGV4KSB7XG4gICAgICAgICAgICBzZXJpYWxpemUodmFsdWUsIHByZWZpeCArICdbJyArIChpc09iamVjdCh2YWx1ZSkgPyBpbmRleCA6ICcnKSArICddJyk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAoaXNPYmplY3QodG9TZXJpYWxpemUpICYmICFpc0RhdGUodG9TZXJpYWxpemUpKSB7XG4gICAgICAgICAgZm9yRWFjaFNvcnRlZCh0b1NlcmlhbGl6ZSwgZnVuY3Rpb24odmFsdWUsIGtleSkge1xuICAgICAgICAgICAgc2VyaWFsaXplKHZhbHVlLCBwcmVmaXggK1xuICAgICAgICAgICAgICAgICh0b3BMZXZlbCA/ICcnIDogJ1snKSArXG4gICAgICAgICAgICAgICAga2V5ICtcbiAgICAgICAgICAgICAgICAodG9wTGV2ZWwgPyAnJyA6ICddJykpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9I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vIHJldHVybiB0aGUgYHJlc3BvbnNlYFxuICAgICAqICAgICBvYmplY3QgZGlyZWN0bHksIG9yIGFzIGEgcHJvbWlzZSBjb250YWluaW5nIHRoZSBgcmVzcG9uc2VgIG9yIGEgbmV3IGByZXNwb25zZWAgb2JqZWN0LlxuICAgICAqICAgKiBgcmVzcG9uc2VFcnJvcmA6IGludGVyY2VwdG9yIGdldHMgY2FsbGVkIHdoZW4gYSBwcmV2aW91cyBpbnRlcmNlcHRvciB0aHJldyBhbiBlcnJvciBvclxuICAgICAqICAgICByZXNvbHZlZCB3aXRoIGEgcmVqZWN0aW9uLlxuICAgICAqXG4gICAgICpcbiAgICAgKiBgYGBqc1xuICAgICAqICAgLy8gcmVnaXN0ZXIgdGhlIGludGVyY2VwdG9yIGFzIGEgc2VydmljZVxuICAgICAqICAgJHByb3ZpZGUuZmFjdG9yeSgnbXlIdHRwSW50ZXJjZXB0b3InLCBmdW5jdGlvbigkcSwgZGVwZW5kZW5jeTEsIGRlcGVuZGVuY3kyKSB7XG4gICAgICogICAgIHJldHVybiB7XG4gICAgICogICAgICAgLy8gb3B0aW9uYWwgbWV0aG9kXG4gICAgICogICAgICAgJ3JlcXVlc3QnOiBmdW5jdGlvbihjb25maWcpIHtcbiAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBzdWNjZXNzXG4gICAgICogICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgICAqICAgICAgIH0sXG4gICAgICpcbiAgICAgKiAgICAgICAvLyBvcHRpb25hbCBtZXRob2RcbiAgICAgKiAgICAgICdyZXF1ZXN0RXJyb3InOiBmdW5jdGlvbihyZWplY3Rpb24pIHtcbiAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBlcnJvclxuICAgICAqICAgICAgICAgaWYgKGNhblJlY292ZXIocmVqZWN0aW9uKSkge1xuICAgICAqICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VPck5ld1Byb21pc2VcbiAgICAgKiAgICAgICAgIH1cbiAgICAgKiAgICAgICAgIHJldHVybiAkcS5yZWplY3QocmVqZWN0aW9uKTtcbiAgICAgKiAgICAgICB9LFxuICAgICAqXG4gICAgICpcbiAgICAgKlxuICAgICAqICAgICAgIC8vIG9wdGlvbmFsIG1ldGhvZFxuICAgICAqICAgICAgICdyZXNwb25zZSc6IGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICogICAgICAgICAvLyBkbyBzb21ldGhpbmcgb24gc3VjY2Vzc1xuICAgICAqICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAqICAgICAgIH0sXG4gICAgICpcbiAgICAgKiAgICAgICAvLyBvcHRpb25hbCBtZXRob2RcbiAgICAgKiAgICAgICdyZXNwb25zZUVycm9yJzogZnVuY3Rpb24ocmVqZWN0aW9uKSB7XG4gICAgICogICAgICAgICAvLyBkbyBzb21ldGhpbmcgb24gZXJyb3JcbiAgICAgKiAgICAgICAgIGlmIChjYW5SZWNvdmVyKHJlamVjdGlvbikpIHtcbiAgICAgKiAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlT3JOZXdQcm9taXNlXG4gICAgICogICAgICAgICB9XG4gICAgICogICAgICAgICByZXR1cm4gJHEucmVqZWN0KHJlamVjdGlvbik7XG4gICAgICogICAgICAgfVxuICAgICAqICAgICB9O1xuICAgICAqICAgfSk7XG4gICAgICpcbiAgICAgKiAgICRodHRwUHJvdmlkZXIuaW50ZXJjZXB0b3JzLnB1c2goJ215SHR0cEludGVyY2VwdG9yJyk7XG4gICAgICpcbiAgICAgKlxuICAgICAqICAgLy8gYWx0ZXJuYXRpdmVseSwgcmVnaXN0ZXIgdGhlIGludGVyY2VwdG9yIHZpYSBhbiBhbm9ueW1vdXMgZmFjdG9yeVxuICAgICAqICAgJGh0dHBQcm92aWRlci5pbnRlcmNlcHRvcnMucHVzaChmdW5jdGlvbigkcSwgZGVwZW5kZW5jeTEsIGRlcGVuZGVuY3kyKSB7XG4gICAgICogICAgIHJldHVybi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GlvbiBmb3IgbWVyZ2VkIGhlYWRlcnNcbiAgICAgICAgcmV0dXJuIGV4ZWN1dGVIZWFkZXJGbnMocmVxSGVhZGVycywgc2hhbGxvd0NvcHkoY29uZmlnKSk7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIHNlcnZlclJlcXVlc3QoY29uZmlnKSB7XG4gICAgICAgIHZhciBoZWFkZXJzID0gY29uZmlnLmhlYWRlcnM7XG4gICAgICAgIHZhciByZXFEYXRhID0gdHJhbnNmb3JtRGF0YShjb25maWcuZGF0YSwgaGVhZGVyc0dldHRlcihoZWFkZXJzKSwgdW5kZWZpbmVkLCBjb25maWcudHJhbnNmb3JtUmVxdWVzdCk7XG5cbiAgICAgICAgLy8gc3RyaXAgY29udGVudC10eXBlIGlmIGRhdGEgaXMgdW5kZWZpbmVkXG4gICAgICAgIGlmIChpc1VuZGVmaW5lZChyZXFEYXRhKSkge1xuICAgICAgICAgIGZvckVhY2goaGVhZGVycywgZnVuY3Rpb24odmFsdWUsIGhlYWRlcikge1xuICAgICAgICAgICAgaWYgKGxvd2VyY2FzZShoZWFkZXIpID09PSAnY29udGVudC10eXBlJykge1xuICAgICAgICAgICAgICBkZWxldGUgaGVhZGVyc1toZWFkZXJdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGNvbmZpZy53aXRoQ3JlZGVudGlhbHMpICYmICFpc1VuZGVmaW5lZChkZWZhdWx0cy53aXRoQ3JlZGVudGlhbHMpKSB7XG4gICAgICAgICAgY29uZmlnLndpdGhDcmVkZW50aWFscyA9IGRlZmF1bHRzLndpdGhDcmVkZW50aWFscztcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHNlbmQgcmVxdWVzdFxuICAgICAgICByZXR1cm4gc2VuZFJlcShjb25maWcsIHJlcURhdGEpLnRoZW4odHJhbnNmb3JtUmVzcG9uc2UsIHRyYW5zZm9ybVJlc3Bvb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y5ldmVudEhhbmRsZXJzKSxcbiAgICAgICAgICAgIGNyZWF0ZUFwcGx5SGFuZGxlcnMoY29uZmlnLnVwbG9hZEV2ZW50SGFuZGxlcnMpKTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHByb21pc2U7XG5cbiAgICAgIGZ1bmN0aW9uIGNyZWF0ZUFwcGx5SGFuZGxlcnMoZXZlbnRIYW5kbGVycykge1xuICAgICAgICBpZiAoZXZlbnRIYW5kbGVycykge1xuICAgICAgICAgIHZhciBhcHBseUhhbmRsZXJzID0ge307XG4gICAgICAgICAgZm9yRWFjaChldmVudEhhbmRsZXJzLCBmdW5jdGlvbihldmVudEhhbmRsZXIsIGtleSkge1xuICAgICAgICAgICAgYXBwbHlIYW5kbGVyc1trZXldID0gZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgaWYgKHVzZUFwcGx5QXN5bmMpIHtcbiAgICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRhcHBseUFzeW5jKGNhbGxFdmVudEhhbmRsZXIpO1xuICAgICAgICAgICAgICB9IGVsc2UgaWYgKCRyb290U2NvcGUuJCRwaGFzZSkge1xuICAgICAgICAgICAgICAgIGNhbGxFdmVudEhhbmRsZXIoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRhcHBseShjYWxsRXZlbnRIYW5kbGVyKTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGZ1bmN0aW9uIGNhbGxFdmVudEhhbmRsZXIoKSB7XG4gICAgICAgICAgICAgICAgZXZlbnRIYW5kbGVyKGV2ZW50KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICByZXR1cm4gYXBwbHlIYW5kbGVycztcbiAgICAgICAgfVxuICAgICAgfVxuXG5cbiAgICAgIC8qKlxuICAgICAgICogQ2FsbGJhY2sgcmVnaXN0ZXJlZC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ICAgICAgLy8gSW4gYW4gdW5wcml2aWxlZ2VkIGNvbnRleHQgb3Igb25seSBvbmUgcGFydDoganVzdCBjb25jYXRlbmF0ZSBhbmQgcmV0dXJuLlxuICAgICAgICAgIHJldHVybiBjb25jYXQuam9pbignJyk7XG4gICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuIGV4dGVuZChmdW5jdGlvbiBpbnRlcnBvbGF0aW9uRm4oY29udGV4dCkge1xuICAgICAgICAgICAgdmFyIGkgPSAwO1xuICAgICAgICAgICAgdmFyIGlpID0gZXhwcmVzc2lvbnMubGVuZ3RoO1xuICAgICAgICAgICAgdmFyIHZhbHVlcyA9IG5ldyBBcnJheShpaSk7XG5cbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGZvciAoOyBpIDwgaWk7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhbHVlc1tpXSA9IHBhcnNlRm5zW2ldKGNvbnRleHQpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgcmV0dXJuIGNvbXB1dGUodmFsdWVzKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcigkaW50ZXJwb2xhdGVNaW5FcnIuaW50ZXJyKHRleHQsIGVycikpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSwge1xuICAgICAgICAgIC8vIGFsbCBvZiB0aGVzZSBwcm9wZXJ0aWVzIGFyZSB1bmRvY3VtZW50ZWQgZm9yIG5vd1xuICAgICAgICAgIGV4cDogdGV4dCwgLy9qdXN0IGZvciBjb21wYXRpYmlsaXR5IHdpdGggcmVndWxhciB3YXRjaGVycyBjcmVhdGVkIHZpYSAkd2F0Y2hcbiAgICAgICAgICBleHByZXNzaW9uczogZXhwcmVzc2lvbnMsXG4gICAgICAgICAgJCR3YXRjaERlbGVnYXRlOiBmdW5jdGlvbihzY29wZSwgbGlzdGVuZXIpIHtcbiAgICAgICAgICAg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5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgJyRpbnRlcnZhbCcsXG4gICAgICogICAgICAgICBmdW5jdGlvbigkc2NvcGUsICRpbnRlcnZhbCkge1xuICAgICAqICAgICAgICAgICAkc2NvcGUuZm9ybWF0ID0gJ00vZC95eSBoOm1tOnNzIGEnO1xuICAgICAqICAgICAgICAgICAkc2NvcGUuYmxvb2RfMSA9IDEwMDtcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLmJsb29kXzIgPSAxMjA7XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgdmFyIHN0b3A7XG4gICAgICogICAgICAgICAgICRzY29wZS5maWdodCA9IGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgICAgICAgIC8vIERvbid0IHN0YXJ0IGEgbmV3IGZpZ2h0IGlmIHdlIGFyZSBhbHJlYWR5IGZpZ2h0aW5nXG4gICAgICogICAgICAgICAgICAgaWYgKCBhbmd1bGFyLmlzRGVmaW5lZChzdG9wKSApIHJldHVybjtcbiAgICAgKlxuICAgICAqICAgICAgICAgICAgIHN0b3AgPSAkaW50ZXJ2YWwoZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgICAgICAgICBpZiAoJHNjb3BlLmJsb29kXzEgPiAwICYmICRzY29wZS5ibG9vZF8yID4gMCkge1xuICAgICAqICAgICAgICAgICAgICAgICAkc2NvcGUuYmxvb2RfMSA9ICRzY29wZS5ibG9vZF8xIC0gMztcbiAgICAgKiAgICAgICAgICAgICAgICAgJHNjb3BlLmJsb29kXzIgPSAkc2NvcGUuYmxvb2RfMiAtIDQ7XG4gICAgICogICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAqICAgICAgICAgICAgICAgICAkc2NvcGUuc3RvcEZpZ2h0KCk7XG4gICAgICogICAgICAgICAgICAgICB9XG4gICAgICogICAgICAgICAgICAgfSwgMTAwKTtcbiAgICAgKiAgICAgICAgICAgfTtcbiAgICAgKlxuICAgICAqICAgICAgICAgICAkc2NvcGUuc3RvcEZpZ2h0ID0gZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHN0b3ApKSB7XG4gICAgICogICAgICAgICAgICAgICAkaW50ZXJ2YWwuY2FuY2VsKHN0b3ApO1xuICAgICAqICAgICAgICAgICAgICAgc3RvcCA9IHVuZGVmaW5lZDtcbiAgICAgKiAgICAgICAgICAgICB9XG4gICAgICogICAgICAgICAgIH07XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLnJlc2V0RmlnaHQgPSBmdW5jdGlvbigpIHtcbiAgICAgKiAgICAgICAgICAgICAkc2NvcGUuYmxvb2RfMSA9IDEwMDtcbiAgICAgKiAgICAgICAgICAgICAkc2NvcGUuYmxvb2RfMiA9IDEyMDtcbiAgICAgKiAgICAgICAgICAgfTtcbiAgICAgKlxuICAgICAqICAgICAgICAgICAkc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB0aGF0IHRoZSBpbnRlcnZhbCBpcyBkZXN0cm95ZWQgdG9vXG4gICAgICogICAgICAgICAgICAgJHNjb3BlLnN0b3BGaWdodCgpO1xuICAgICAqICAgICAgICAgICB9KTtcbiAgICAgKiAgICAgICAgIH1dKVxuICAgICAqICAgICAgIC8vIFJlZ2lzdGVyIHRoZSAnbXlDdXJyZW50VGltZScgZGlyZWN0aXZlIGZhY3RvcnkgbWV0aG9kLlxuICAgICAqICAgICAgIC8vIFdlIGluamVjdCAkaW50ZXJ2YWwgYW5kIGRhdGVGaWx0ZXIgc2VydmljZSBzaW5jZSB0aGUgZmFjdG9yeSBtZXRob2QgaXMgREkuXG4gICAgICogICAgICAgLmRpcmVjdGl2ZSgnbXlDdXJyZW50VGltZScsIFsnJGludGVydmFsJywgJ2RhdGVGaWx0ZXInLFxuICAgICAqICAgICAgICAgZnVuY3Rpb24oJGludGVydmFsLCBkYXRlRmlsdGVyKSB7XG4gICAgICogICAgICAgICAgIC8vIHJldHVybiB0aGUgZGlyZWN0aXZlIGxpbmsgZnVuY3Rpb24uIChjb21waWxlIGZ1bmN0aW9uIG5vdCBuZWVkZWQpXG4gICAgICogICAgICAgICAgIHJldHVybiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMpIHtcbiAgICAgKiAgICAgICAgICAgICB2YXIgZm9ybWF0LCAgLy8gZGF0ZSBmb3JtYXRcbiAgICAgKiAgICAgICAgICAgICAgICAgc3RvcFRpbWU7IC8vIHNvIHRoYXQgd2UgY2FuIGNhbmNlbCB0aGUgdGltZSB1cGRhdGVzXG4gICAgICpcbiAgICAgKiAgICAgICAgICAgICAvLyB1c2VkIHRvIHVwZGF0ZSB0aGUgVUlcbiAgICAgKiAgICAgICAgICAgICBmdW5jdGlvbiB1cGRhdGVUaW1lKCkge1xuICAgICAqICAgICAgICAgICAgICAgZWxlbWVudC50ZXh0KGRhdGVGaWx0ZXIobmV3IERhdGUoKSwgZm9ybWF0KSk7XG4gICAgICogICAgICAgICAgICAgfVxuICAgICAqXG4gICAgICogICAgICAgICAgICAgLy8gd2F0Y2ggdGhlIGV4cHJlc3Npb24sIGFuZCB1cGRhdGUgdGhlIFVJIG9uIGNoYW5nZS5cbiAgICAgKiAgICAgICAgICAgICBzY29wZS4kd2F0Y2goYXR0cnMubXlDdXJyZW50VGltZSwgZnVuY3Rpb24odmFsdWUpIHtcbiAgICAgKiAgICAgICAgICAgICAgIGZvcm1hdCA9IHZhbHVlO1xuICAgICAqICAgICAgICAgICAgICAgdXBkYXRlVGltZSgpO1xuICAgICAqICAgICAgICAgICAgIH0pO1xuICAgICAqXG4gICAgICogICAgICAgICAgICAgc3RvcFRpbWUgPSAkaW50ZXJ2YWwodXBkYXRlVGltZSwgMTAwMCk7XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgICAvLyBsaXN0ZW4gb24gRE9NIGRlc3Ryb3kgKHJlb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gICAgICAgICBpdGVyYXRpb24gPSAwLFxuICAgICAgICAgICAgc2tpcEFwcGx5ID0gaXNEZWZpbmVkKGludm9rZUFwcGx5KSAmJiAhaW52b2tlQXBwbHksXG4gICAgICAgICAgICBkZWZlcnJlZCA9IChza2lwQXBwbHkgPyAkJHEgOiAkcSkuZGVmZXIoKSxcbiAgICAgICAgICAgIHByb21pc2UgPSBkZWZlcnJlZC5wcm9taXNlO1xuXG4gICAgICAgIGNvdW50ID0gaXNEZWZpbmVkKGNvdW50KSA/IGNvdW50IDogMDtcblxuICAgICAgICBmdW5jdGlvbiBjYWxsYmFjaygpIHtcbiAgICAgICAgICBpZiAoIWhhc1BhcmFtcykge1xuICAgICAgICAgICAgZm4oaXRlcmF0aW9uKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZm4uYXBwbHkobnVsbCwgYXJncyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gdGljaygpIHtcbiAgICAgICAgICBpZiAoc2tpcEFwcGx5KSB7XG4gICAgICAgICAgICAkYnJvd3Nlci5kZWZlcihjYWxsYmFjayk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICRyb290U2NvcGUuJGV2YWxBc3luYyhjYWxsYmFjayk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGRlZmVycmVkLm5vdGlmeShpdGVyYXRpb24rKyk7XG5cbiAgICAgICAgICBpZiAoY291bnQgPiAwICYmIGl0ZXJhdGlvbiA+PSBjb3VudCkge1xuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShpdGVyYXRpb24pO1xuICAgICAgICAgICAgY2xlYXJJbnRlcnZhbEZuKHByb21pc2UuJCRpbnRlcnZhbElkKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoIXNraXBBcHBseSkgJHJvb3RTY29wZS4kYXBwbHkoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHByb21pc2UuJCRpbn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JuIHtcbiAgICAgIC8qKlxuICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICogQG5hbWUgJGxvZyNsb2dcbiAgICAgICAqXG4gICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAqIFdyaXRlIGEgbG9nIG1lc3NhZ2VcbiAgICAgICAqL1xuICAgICAgbG9nOiBjb25zb2xlTG9nKCdsb2cnKSxcblxuICAgICAgLyoqXG4gICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgKiBAbmFtZSAkbG9nI2luZm9cbiAgICAgICAqXG4gICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAqIFdyaXRlIGFuIGluZm9ybWF0aW9uIG1lc3NhZ2VcbiAgICAgICAqL1xuICAgICAgaW5mbzogY29uc29sZUxvZygnaW5mbycpLFxuXG4gICAgICAvKipcbiAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAqIEBuYW1lICRsb2cjd2FyblxuICAgICAgICpcbiAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICogV3JpdGUgYSB3YXJuaW5nIG1lc3NhZ2VcbiAgICAgICAqL1xuICAgICAgd2FybjogY29uc29sZUxvZygnd2FybicpLFxuXG4gICAgICAvKipcbiAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAqIEBuYW1lICRsb2cjZXJyb3JcbiAgICAgICAqXG4gICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAqIFdyaXRlIGFuIGVycm9yIG1lc3NhZ2VcbiAgICAgICAqL1xuICAgICAgZXJyb3I6IGNvbnNvbGVMb2coJ2Vycm9yJyksXG5cbiAgICAgIC8qKlxuICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICogQG5hbWUgJGxvZyNkZWJ1Z1xuICAgICAgICpcbiAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICogV3JpdGUgYSBkZWJ1ZyBtZXNzYWdlXG4gICAgICAgKi9cbiAgICAgIGRlYnVnO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9uKGFyZykge1xuICAgICAgICAgIGFyZ3MucHVzaChmb3JtYXRFcnJvcihhcmcpKTtcbiAgICAgICAgfSk7XG4gICAgICAgIC8vIFN1cHBvcnQ6IElFIDkgb25seVxuICAgICAgICAvLyBjb25zb2xlIG1ldGhvZHMgZG9uJ3QgaW5oZXJpdCBmcm9tIEZ1bmN0aW9uLnByb3RvdHlwZSBpbiBJRSA5IHNvIHdlIGNhbid0XG4gICAgICAgIC8vIGNhbGwgYGxvZ0ZuLmFwcGx5KGNvbnNvbGUsIGFyZ3MpYCBkaXJlY3RseS5cbiAgICAgICAgcmV0dXJuIEZ1bmN0aW9uLnByb3RvdHlwZS5hcHBseS5jYWxsKGxvZ0ZuLCBjb25zb2xlLCBhcmdzKTtcbiAgICAgIH07XG4gICAgfVxuICB9XTtcbn1cblxuLyogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKlxuICogICAgIEFueSBjb21taXRzIHRvIHRoaXMgZmlsZSBzaG91bGQgYmUgcmV2aWV3ZWQgd2l0aCBzZWN1cml0eSBpbiBtaW5kLiAgKlxuICogICBDaGFuZ2VzIHRvIHRoaXMgZmlsZSBjYW4gcG90ZW50aWFsbHkgY3JlYXRlIHNlY3VyaXR5IHZ1bG5lcmFiaWxpdGllcy4gKlxuICogICAgICAgICAgQW4gYXBwcm92YWwgZnJvbSAyIENvcmUgbWVtYmVycyB3aXRoIGhpc3Rvcnkgb2YgbW9kaWZ5aW5nICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBmaWxlIGlzIHJlcXVpcmVkLiAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogIERvZXMgdGhlIGNoYW5nZSBzb21laG93IGFsbG93IGZvciBhcmJpdHJhcnkgamF2YXNjcm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eTtcbiAgICBpZiAodGhpcy5wZWVrVG9rZW4oKS50ZXh0ICE9PSAnfScpIHtcbiAgICAgIGRvIHtcbiAgICAgICAgaWYgKHRoaXMucGVlaygnfScpKSB7XG4gICAgICAgICAgLy8gU3VwcG9ydCB0cmFpbGluZyBjb21tYXMgcGVyIEVTNS4xLlxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIHByb3BlcnR5ID0ge3R5cGU6IEFTVC5Qcm9wZXJ0eSwga2luZDogJ2luaXQnfTtcbiAgICAgICAgaWYgKHRoaXMucGVlaygpLmNvbnN0YW50KSB7XG4gICAgICAgICAgcHJvcGVydHkua2V5ID0gdGhpcy5jb25zdGFudCgpO1xuICAgICAgICAgIHByb3BlcnR5LmNvbXB1dGVkID0gZmFsc2U7XG4gICAgICAgICAgdGhpcy5jb25zdW1lKCc6Jyk7XG4gICAgICAgICAgcHJvcGVydHkudmFsdWUgPSB0aGlzLmV4cHJlc3Npb24oKTtcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLnBlZWsoKS5pZGVudGlmaWVyKSB7XG4gICAgICAgICAgcHJvcGVydHkua2V5ID0gdGhpcy5pZGVudGlmaWVyKCk7XG4gICAgICAgICAgcHJvcGVydHkuY29tcHV0ZWQgPSBmYWxzZTtcbiAgICAgICAgICBpZiAodGhpcy5wZWVrKCc6JykpIHtcbiAgICAgICAgICAgIHRoaXMuY29uc3VtZSgnOicpO1xuICAgICAgICAgICAgcHJvcGVydHkudmFsdWUgPSB0aGlzLmV4cHJlc3Npb24oKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcHJvcGVydHkudmFsdWUgPSBwcm9wZXJ0eS5rZXk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHRoaXMucGVlaygnWycpKSB7XG4gICAgICAgICAgdGhpcy5jb25zdW1lKCdbJyk7XG4gICAgICAgICAgcHJvcGVydHkua2V5ID0gdGhpcy5leHByZXNzaW9uKCk7X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