diff --git a/CHANGELOG.md b/CHANGELOG.md index 90d346a..962b383 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [3.1.1] - 2024-06-03 +### CHANGED +- The `http` option `keepAlive` will now default to `true` if it is not specified. + +#### FIXED +- `WideSkyClient.batch.updateOrCreate` errored with list type tags. + ## [3.1.0] - 2024-05-23 ### ADDED - Added new [options](./docs/client/options.md) under `http` which allows an optional configuration @@ -206,7 +213,7 @@ duplicated, even in the case where a package's version was unpublished. This is ### ADDED - Alpha release -[Unreleased]: https://github.com/widesky/jswidesky-client/compare/master...3.1.0 +[Unreleased]: https://github.com/widesky/jswidesky-client/compare/master...3.1.1 [1.0.0]: https://github.com/widesky/jswidesky-client/compare/1.0.0...1.0.0 [1.1.0]: https://github.com/widesky/jswidesky-client/compare/1.1.0...1.0.0 [1.1.1]: https://github.com/widesky/jswidesky-client/compare/1.1.1...1.1.0 @@ -230,3 +237,4 @@ duplicated, even in the case where a package's version was unpublished. This is [3.0.0]: https://github.com/widesky/jswidesky-client/compare/3.0.0...2.1.5 [3.0.1]: https://github.com/widesky/jswidesky-client/compare/3.0.1...3.0.0 [3.1.0]: https://github.com/widesky/jswidesky-client/compare/3.1.0...3.0.1 +[3.1.0]: https://github.com/widesky/jswidesky-client/compare/3.1.1...3.1.0 diff --git a/dist/jsWideSky.develop.js b/dist/jsWideSky.develop.js index 3e883e0..2829bc6 100644 --- a/dist/jsWideSky.develop.js +++ b/dist/jsWideSky.develop.js @@ -531,8 +531,18 @@ class WideSkyClient { * Apply the config to be used for all axios requests. */ initAxios() { - this.httpAgent = new http.Agent(this.options?.http || {}); - this.httpsAgent = new https.Agent(this.options?.http || {}); + // If HTTP options keepAlive is undefined, default it to true. + if (typeof this.options.http === 'object') { + if (this.options.http.keepAlive === undefined) { + this.options.http.keepAlive = true; // default to true + } + } else { + this.options.http = { + keepAlive: true // default to true + }; + } + this.httpAgent = new http.Agent(this.options.http); + this.httpsAgent = new https.Agent(this.options.http); this.axios = axios.create(Object.assign({ baseURL: this.baseUri, httpAgent: this.httpAgent, @@ -2820,6 +2830,23 @@ const createUpdatePayload = (oldEntity, newEntity, logger) => { } if (oldEntity[tag] === undefined) { updatePayload[tag] = value; + } else if (Array.isArray(value) && Array.isArray(oldEntity[tag])) { + if (value.length !== oldEntity[tag].length) { + // Not the same, no need to verify + updatePayload[tag] = value; + } + + // verify list changes + let isDifferent = false; + for (const item of value) { + if (!oldEntity[tag].includes(item)) { + isDifferent = true; + break; + } + } + if (isDifferent) { + updatePayload[tag] = value; + } } else if (oldEntity[tag] !== value) { if (tag.includes("Ref") || ["metaOf"].includes(tag)) { // Ref can be different by the ID is what matters here @@ -67813,4 +67840,4 @@ module.exports = /*#__PURE__*/JSON.parse('{"version":"2024a","zones":["Africa/Ab /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNXaWRlU2t5LmRldmVsb3AuanMiLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBLHlHQUF5RyxNQUFNLHFDQUFxQyxhQUFhLHFEQUFxRCxNQUFNLHdCQUF3QixhQUFhLHFEQUFxRCxNQUFNLHdDQUF3QyxhQUFhO0FBQ2pYO0FBQ0E7QUFDQTtBQUNBLCtHQUErRyxNQUFNLHFDQUFxQyxhQUFhLHFEQUFxRCxNQUFNLHdCQUF3QixhQUFhLHFEQUFxRCxNQUFNLHdDQUF3QyxhQUFhO0FBQ3ZYO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTzs7Ozs7Ozs7O0FDVkE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxVQUFVO0FBQ1Y7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7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WxlL2JnLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2JtLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2JuLWJkLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2JuLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2JvLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2JyLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2JzLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2NhLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2NzLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2N2LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2N5LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2RhLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2RlLWF0LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2RlLWNoLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2RlLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2R2LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VsLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VuLWF1LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VuLWNhLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VuLWdiLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VuLWllLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VuLWlsLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VuLWluLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VuLW56LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VuLXNnLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VvLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VzLWRvLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VzLW14LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2VzLXVzLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQv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gICAgICAgICAgICAgICAgICAgICAtIG5hbWU6IE5hbWUgb2YgbG9nZ2luZyBpbnN0YW5jZVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgIC0gbGV2ZWw6IEJ1bnlhbiBsb2dnaW5nIGxldmVsIHRvIHNob3cgbG9ncyBoaWdoZXIuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgLSByYXc6IElmIHRydWUsIG91dHB1dCBpbiBKU09OIGZvcm1hdC4gSWYgZmFsc2UsIG91dHB1dCBpbiBwcmV0dGlmaWVkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICBCdW55YW4gbG9nZ2luZyBmb3JtYXQuXG4gICAgICogICAgICAgICAgICAgICAgICAtIEJ1bnlhbiBsb2dnaW5nIGluc3RhbmNlLlxuICAgICAqIEBwYXJhbSBhY2Nlc3NUb2tlbiBBIHZhbGlkIFdpZGVTa3kgYWNjZXNzIHRva2VuLlxuICAgICAqIEBwYXJhbSBvcHRpb25zIEFuIE9iamVjdCBjb250YWluaW5nIGF0dHJpYnV0ZXMgXCJheGlvc1wiLCBcImh0dHBzXCIgYW5kIFwiY2xpZW50XCIgZm9yIGNvbmZpZ3VyaW5nXG4gICAgICogICAgICAgICAgICAgICAgdGhlIGF4aW9zLCBodHRwc0FnZW50IGFuZCBXaWRlU2t5IGNsaWVudCByZXNwZWN0aXZlbHkuXG4gICAgICpcbiAgICAgKiAgICAgICAgICAgICAgICBBeGlvcyBjb25maWd1cmF0aW9ucyBhcmVcbiAgICAgKiAgICAgICAgICAgICAgICBkZXNjcmliZWQgYXQgaHR0cHM6Ly9heGlvcy1odHRwLmNvbS9kb2NzL2NvbmZpZ19kZWZhdWx0cy5cbiAgICAgKlxuICAgICAqICAgICAgICAgICAgICAgIEh0dHBzQWdlbnQgY29uZmlndXJhdGlvbnMgYXJlIGRlc2NyaWJlZCBhdFxuICAgICAqICAgICAgICAgICAgICAgIGh0dHBzOi8vbm9kZWpzLm9yZy9kb2NzL2xhdGVzdC12MTYueC9hcGkvaHR0cC5odG1sI25ldy1hZ2VudG9wdGlvbnNcbiAgICAgKi9cbiAgICBjb25zdHJ1Y3RvcihiYXNlVXJpLFxuICAgICAgICAgICAgICAgIHVzZXJuYW1lLFxuICAgICAgICAgICAgICAgIHBhc3N3b3JkLFxuICAgICAgICAgICAgICAgIGNsaWVudElkLFxuICAgICAgICAgICAgICAgIGNsaWVudFNlY3JldCxcbiAgICAgICAgICAgICAgICBsb2dnZXIsXG4gICAgICAgICAgICAgICAgYWNjZXNzVG9rZW4sXG4gICAgICAgICAgICAgICAgb3B0aW9ucz17fSkge1xuICAgICAgICB0aGlzLmJhc2VVcmkgPSBiYXNlVXJpO1xuICAgICAgICB0aGlzLiN1c2VybmFtZSA9IHVzZXJuYW1lO1xuICAgICAgICB0aGlzLiNwYXNzd29yZCA9IHBhc3N3b3JkO1xuICAgICAgICB0aGlzLiNjbGllbnRJZCA9IGNsaWVudElkO1xuICAgICAgICB0aGlzLiNjbGllbnRTZWNyZXQgPSBjbGllbnRTZWNyZXQ7XG4gICAgICAgIHRoaXMuI2FjY2Vzc1Rva2VuID0gYWNjZXNzVG9rZW47XG4gICAgICAgIHRoaXMubG9nZ2VyID0gaW5pdExvZ2dlcihsb2dnZXIpO1xuICAgICAgICB0aGlzLm9wdGlvbnMgPSBvcHRpb25zO1xuICAgICAgICB0aGlzLmNsaWVudE9wdGlvbnMgPSBudWxsO1xuICAgICAgICB0aGlzLmh0dHBBZ2VudCA9IG51bGw7XG4gICAgICAgIHRoaXMuaHR0cHNBZ2VudCA9IG51bGw7XG4gICAgICAgIHRoaXMuX2ltcGVyc29uYXRlID0gbnVsbDtcbiAgICAgICAgdGhpcy5fYWNjZXB0R3ppcEVuY29kaW5nICA9IHRydWU7XG4gICAgICAgIHRoaXMuaW5pdGlhbGlzZWQgPSBmYWxzZTtcblxuICAgICAgICB0aGlzLmluaXRBY2Nlc3NUb2tlbigpO1xuICAgICAgICB0aGlzLmluaXRBeGlvcygpO1xuICAgICAgICAv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xvZ3MgaGlnaGVyLlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgIC0gcmF3OiBJZiB0cnVlLCBvdXRwdXQgaW4gSlNPTiBmb3JtYXQuIElmIGZhbHNlLCBvdXRwdXQgaW4gcHJldHRpZmllZCBCdW55YW4gbG9nZ2luZyBmb3JtYXQuXG4gICAgICogICAgICAgICAgICAgICAgICAtIEJ1bnlhbiBsb2dnaW5nIGluc3RhbmNlLlxuICAgICAqIEByZXR1cm5zIHtXaWRlU2t5Q2xpZW50fSBBIFdpZGVTa3kgY2xpZW50IGluc3RhbmNlLlxuICAgICAqL1xuICAgIHN0YXRpYyBtYWtlRnJvbUNvbmZpZyhjb25maWc9e30pIHtcbiAgICAgICAgY29uc3QgcmVxdWlyZWRQcm9wcyA9IFtcbiAgICAgICAgICAgIFwic2VydmVyVVJMXCIsXG4gICAgICAgICAgICBcInVzZXJuYW1lXCIsXG4gICAgICAgICAgICBcInBhc3N3b3JkXCIsXG4gICAgICAgICAgICBcImNsaWVudElkXCIsXG4gICAgICAgICAgICBcImNsaWVudFNlY3JldFwiXG4gICAgICAgIF07XG4gICAgICAgIGZvciAoY29uc3QgcHJvcCBvZiByZXF1aXJlZFByb3BzKSB7XG4gICAgICAgICAgICBpZiAoY29uZmlnW3Byb3BdID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYENvbmZpZ3VyYXRpb24gcGFyYW1ldGVyIHJlcXVpcmVzIHByb3BlcnRpZXMgJHtyZXF1aXJlZFByb3BzLmpvaW4oXCIsIFwiKX1gKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBuZXcgV2lkZVNreUNsaWVudChcbiAgICAgICAgICAgIGNvbmZpZy5zZXJ2ZXJVUkwsXG4gICAgICAgICAgICBjb25maWcudXNlcm5hbWUsXG4gICAgICAgICAgICBjb25maWcucGFzc3dvcmQsXG4gICAgICAgICAgICBjb25maWcuY2xpZW50SWQsXG4gICAgICAgICAgICBjb25maWcuY2xpZW50U2VjcmV0LFxuICAgICAgICAgICAgY29uZmlnLmxvZ2dlcixcbiAgICAgICAgICAgIGNvbmZpZy5hY2Nlc3NUb2tlbixcbiAgICAgICAgICAgIGNvbmZpZy5vcHRpb25zXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgYXNzaWduU3ViRnVuY3Rpb25zKCkge1xuICAgICAgICBjb25zdCBwZXJmb3JtUHJlQ2hlY2sgPSAoZnVuYykgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIGFzeW5jICguLi5hcmdzKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLmluaXRpYWxpc2VkKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubG9nZ2VyLmluZm8oXCJOb3QgZmluaXNoZWQgaW5pdGlhbGlzaW5nLiBXYWl0aW5nLi4uXCIpO1xuICAgICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLmluaXRXYWl0Rm9yO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiBmdW5jLmNhbGwodGhpcywgLi4uYXJncyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBhc3NpZ25Qcm90b3R5cGUgPSAodGhpc1Byb3AsIGZ1bmN0aW9ucywgd2l0aFByZUNoZWNrPWZhbHNlKSA9PiB7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IFtuYW1lLCBmdW5jXSBvZiBPYmplY3QuZW50cmllcyhmdW5jdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgaWYgKHdpdGhQcmVDaGVjaykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzUHJvcFtuYW1lXSA9IHBlcmZvcm1QcmVDaGVjay5jYWxsKHRoaXMsIGZ1bmMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpc1By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gIH0sIHRoaXMub3B0aW9ucy5heGlvcyB8fCB7fSkpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEluaXRpYWxpc2UgdGhlIFdpZGVTa3lDbGllbnQgd2l0aCB0aGUgdXNlciBjb25maWd1cmF0aW9ucy5cbiAgICAgKiBAcmV0dXJucyB7UHJvbWlzZTx2b2lkPn1cbiAgICAgKi9cbiAgICBhc3luYyBpbml0Q2xpZW50T3B0aW9ucygpIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGF3YWl0IENMSUVOVF9TQ0hFTUEudmFsaWRhdGUodGhpcy5vcHRpb25zLmNsaWVudCk7XG4gICAgICAgICAgICB0aGlzLmNsaWVudE9wdGlvbnMgPSBDTElFTlRfU0NIRU1BLmNhc3QodGhpcy5vcHRpb25zLmNsaWVudCk7XG4gICAgICAgICAgICB0aGlzLnNldEFjY2VwdEd6aXAodGhpcy5jbGllbnRPcHRpb25zLmFjY2VwdEd6aXApO1xuXG4gICAgICAgICAgICBpZiAodGhpcy5jbGllbnRPcHRpb25zLmltcGVyc29uYXRlQXMgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmltcGVyc29uYXRlQXModGhpcy5jbGllbnRPcHRpb25zLmltcGVyc29uYXRlQXMpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5pc1Byb2dyZXNzRW5hYmxlZCkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmNsaWVudE9wdGlvbnMucHJvZ3Jlc3MuaW5zdGFuY2UgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjbGlQcm9ncmVzcyA9IHJlcXVpcmUoXCJjbGktcHJvZ3Jlc3NcIik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2xpZW50T3B0aW9ucy5wcm9ncmVzcy5pbnN0YW5jZSA9IG5ldyBjbGlQcm9ncmVzcy5NdWx0aUJhcih7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck9uQ29tcGxldGU6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgaGlkZUN1cnNvcjogdHJ1ZVxuICAgICAgICAgICAgICAgICAgICB9LCBjbGlQcm9ncmVzcy5QcmVzZXRzLnNoYWRlc19jbGFzc2ljKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuaW5pdGlhbGlzZWQgPSB0cnVlO1xuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGVycm9yLm1lc3NhZ2UpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUGVyZm9ybSBhIGxvZy1pbiwgaWYgbm90IGFscmVhZHkgZG9uZS4gIFRoaXMgZG9lcyBhIGBnZXRUb2tlbmAgd2hpbHN0XG4gICAgICogcGVyZm9ybWluZyBubyBmdXJ0aGVyIG9wZXJhdGlvbnMuXG4gICAgICovXG4gICAgbG9naW4oKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmdldFRva2VuKCk7XG4gICAgfTtcblxuICAgIGltcGVyc29uYXRlQXModXNlcklkKSB7XG4gICAgICAgIGlmICghdGhpcy5pbml0aWFsaXNlZCkge1xuICAgICAgICAgICAgY29uc3Qgb2xkUHJvbWlzZSA9IHRoaXMuaW5pdFdhaXRGb3I7XG4gICAgICAgICAgICB0aGlzLmluaXRXYWl0Rm9yID0gbmV3IFByb21pc2UoYXN5bmMgKHJlc29sdmUpID0+IHtcbiAgICAgICAgICAgICAgICBhd2FpdCBvbGRQcm9taXNlO1xuICAgICAgICAgICAgICAgIHRoaXMuX2ltcGVyc29uYXRlID0gdXNlcklkO1xuICAgICAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5faW1wZXJzb25hdGUgPSB1c2VySWQ7XG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gdGhpcy5sb2dnZXIudHJhY2UoY29uZmlnLCAnUmF3IHJlcXVlc3QnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCByZXM7XG4gICAgICAgIHN3aXRjaCAobWV0aG9kLnRvVXBwZXJDYXNlKCkpIHtcbiAgICAgICAgICAgIGNhc2UgJ0dFVCc6XG4gICAgICAgICAgICAgICAgcmVzID0gYXdhaXQgdGhpcy5heGlvcy5nZXQodXJpLCBjb25maWcpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnUE9TVCc6XG4gICAgICAgICAgICAgICAgcmVzID0gYXdhaXQgdGhpcy5heGlvcy5wb3N0KHVyaSwgYm9keSwgY29uZmlnKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ1BBVENIJzpcbiAgICAgICAgICAgICAgICByZXMgPSBhd2FpdCB0aGlzLmF4aW9zLnBhdGNoKHVyaSwgYm9keSwgY29uZmlnKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ1BVVCc6XG4gICAgICAgICAgICAgICAgcmVzID0gYXdhaXQgdGhpcy5heGlvcy5wdXQodXJpLCBib2R5LCBjb25maWcpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYE5vdCBjb25maWd1cmVkIGZvciBtZXRob2QgJHttZXRob2R9LmApO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlcy5kYXRhO1xuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBBdHRhY2ggbmVjZXNzYXJ5IGhlYWRlcnMgdG8gcmVxdWVzdCBjb25maWcuXG4gICAgICogQHBhcmFtIGNvbmZpZyBFeGlzdGluZyBjb25maWcgdG8gYWRkIHRvLlxuICAgICAqIEByZXR1cm5zIE1vZGlmaWVkIGNvbmZpZy5cbiA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HVyaSk7XG4gICAgICAgICAgICB0aGlzLmxvZ2dlci5kZWJ1ZyhcIldpdGggYm9keSAlaiBhbmQgY29uZmlnICVqXCIsIGJvZHksIGNvbmZpZyk7XG4gICAgICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5fd3NSYXdTdWJtaXQobWV0aG9kLCB1cmksIGJvZHksIGNvbmZpZyk7XG4gICAgICAgIH1cbiAgICAgICAgY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgbGV0IHBhcnNlZEVyciA9IGVycjtcbiAgICAgICAgICAgIGlmIChpc0F4aW9zRXJyb3IoZXJyKSkge1xuICAgICAgICAgICAgICAgIGlmIChlcnIucmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVzcG9uc2UgaGFzIGJlZW4gcmVjZWl2ZWQgZnJvbSBBUEkgc2VydmVyXG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnIucmVzcG9uc2Uuc3RhdHVzID09PSA0MDEgJiYgdGhpcy5fd3NfdG9rZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIGVycm9yIGlzIDQwMSwgdGhlbiBnZXQgbmV3IHRva2VuXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl93c190b2tlbiA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maWcgPSBhd2FpdCB0aGlzLl9hdHRhY2hSZXFDb25maWcoY29uZmlnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl93c1Jhd1N1Ym1pdChtZXRob2QsIHVyaSwgYm9keSwgY29uZmlnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlZEVyciA9IFJlcXVlc3RFcnJvci5tYWtlKGVyciwgdGhpcy5sb2dnZXIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5sb2dnZXIuZXJyb3IocGFyc2VkRXJyKTtcbiAgICAgICAgICAgIGlmIChwYXJzZWRFcnIgaW5zdGFuY2VvZiBHcmFwaFFMRXJyb3IgJiYgcGFyc2VkRXJyLmVycm9ycy5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAgICAgcGFyc2VkRXJyLmVycm9ycy5mb3JFYWNoKChtc2csIGkpID0+IHRoaXMubG9nZ2VyLmVycm9yKFwiR3JhcGhRTCBlcnJvciAjJWQ6ICVzXCIsIGkgKyAxLCBtc2cpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IHBhcnNlZEVycjtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFByaXZhdGUgbWV0aG9kOiBwZXJmb3JtIGEgbmV3IGxvZy1pbi4gIFJldHVybnMgSlNPTiByZXNwb25zZSBmcm9tXG4gICAgICogc2VydmVyIG9yIHJhaXNlcyBhbiBlcnJvci5cbiAgICAgKi9cbiAgICBfZG9Mb2dpbigpIHtcbiAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgaWYgKHRoaXMubG9nZ2VyKSB7XG4gICAgICAgICAgICB0aGlzLmxvZ2dlci50cmFjZSgnUGVyZm9ybWluZyBsb2dpbiBhdHRlbXB0Jyk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5fd3NSYXdTdWJtaXQoXG4gICAgICAgICAgICAnUE9TVCcsXG4gICAgICAgICAgICAnL29hdXRoMi90b2tlbicsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgdXNlcm5hbWU6IHRoaXMuI3VzZXJuYW1lLFxuICAgICAgICAgICAgICAgIHBhc3N3b3JkOiB0aGlzLiNwYXNzd29yZCxcbiAgICAgICAgICAgICAgICBncmFudF90eXBlOiAncGFzc3dvcmQnXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGF1dGg6IHtcbiAgICAgICAgICAgICAgICAgICAgdXNlcm5hbWU6IHRoaXMuI2NsaWVudElkLFxuICAgICAgICAgICAgICAgICAgICBwYXNzd29yZDogdGhpcy4jY2xpZW50U2VjcmV0XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBQcml2YXRlIG1ldGhvZDogcmVmcmVzaCBhIHRva2VuLiBSZXR1cm5zIEpTT04gcmVzcG9uc2UgZnJvbSBzZXJ2ZXIgb3JcbiAgICAgKiByYWlzZXMgYW4gZXJyb3IuIFJlcXVpcmVzIHRoYXQgX3dzX3Rva2VuIGlzIG5vdCBudWxsLlxuICAgICAqL1xuICAgIF9kb1JlZnJlc2goKSB7XG4gICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgIGlmICh0aGlzLmxvZ2dlcikgdGhpcy5sb2dnZXIudHJhY2UoJ1BlcmZvcm1pbmcgdG9rZW4gcmVmcmVzaCBhdHRlbXB0Jyk7XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuX3dzUmF3U3VibWl0KFxuICAgICAgICAgICAgJ1BPU1QnLFxuICAgICAgICAgICAgJy9vYXV0aDIvdG9rZW4nLFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHJlZnJlc2hfdG9rZW46IHRoaXMuX3dzX3Rva2VuLnJlZnJlc2hfdG9rZW4sXG4gICAgICAgICAgICAgICAgZ3JhbnRfdHlwZTogJ3JlZnJlc2hfdG9rZW4nXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGF1dGg6IHtcbiAgICAgICAgICAgICAgICAgICAgdXNlcm5hbWU6IHRoaXMuI2NsaWVudElkLFxuICAgICAgICAgICAgICAgICAgICBwYXNzd29yZDogdGhpcy4jY2xpZW50U2VjcmV0XG4gICAgICAgICAgICAgICAg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yLnJlamVjdChlcnIpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBQcml2YXRlIG1ldGhvZDogcmV0cmlldmUgdGhlIGFjY2VzcyB0b2tlbi4gIFRoaXMgcGVyZm9ybXMgYSBsb2dpbiBpZlxuICAgICAqIHRoZSBjdXJyZW50IHRva2VuIGlzIGFic2VudCBvciBhdHRlbXB0cyBhIHJlZnJlc2ggaWYgZXhwaXJlZC5cbiAgICAgKi9cbiAgICBnZXRUb2tlbigpIHtcbiAgICAgICAgbGV0IGZpcnN0U3RlcDtcbiAgICAgICAgbGV0IHJlZnJlc2ggPSBmYWxzZTtcblxuICAgICAgICAvKiBJcyBhIHJlcXVlc3QgaW4gcHJvZ3Jlc3M/ICovXG4gICAgICAgIGlmICh0aGlzLl93c190b2tlbl93YWl0ICE9PSBudWxsKSB7XG4gICAgICAgICAgICAvKiBKb2luIHRoZSBxdWV1ZSAqL1xuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgIGlmICh0aGlzLmxvZ2dlcikge1xuICAgICAgICAgICAgICAgIHRoaXMubG9nZ2VyLnRyYWNlKCdXYWl0aW5nIGZvciB0b2tlbiBhY3F1aXNpdGlvbicpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoIChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLl93c190b2tlbl93YWl0LnB1c2goe1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlOiByZXNvbHZlLFxuICAgICAgICAgICAgICAgICAgICByZWplY3Q6IHJlamVjdFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5fd3NfdG9rZW4gPT09IG51bGwpIHtcbiAgICAgICAgICAgIC8qIE5vIHRva2VuLCBzbyBhY3F1aXJlIG9uZSAqL1xuICAgICAgICAgICAgdGhpcy5fd3NfdG9rZW5fd2FpdCA9IFtdO1xuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgIGlmICh0aGlzLmxvZ2dlcikge1xuICAgICAgICAgICAgICAgIHRoaXMubG9nZ2VyLnRyYWNlKCdCZWdpbiB0b2tlbiBhY3F1aXNpdGlvbicpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmaXJzdFN0ZXAgPSB0aGlzLl9kb0xvZ2luKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodGhpcy5fd3NfdG9rZW4uZXhwaXJlc19pbiA8IERhdGUubm93KCkpIHtcbiAgICAgICAgICAgIC8qIFRva2VuIGlzIGV4cGlyZWQsIHNvIGRvIGEgcmVmcmVzaCAqL1xuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgIGlmICh0aGlzLmxvZ2dlcikge1xuICAgICAgICAgICAgICAgIHRoaXMubG9nZ2VyLnRyYWNlKCdCZWdpbiB0b2tlbiByZWZyZXNoJyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuX3dzX3Rva2VuX3dhaXQgPSBbXTtcbiAgICAgICAgICAgIGZpcnN0U3RlcCA9IHRoaXMuX2RvUmVmcmVzaCgpO1xuICAgICAgICAgICAgcmVmcmVzaCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fd3NfdG9rZW47XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoIGFzeW5jIChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBmaXJzdFN0ZXBcbiAgICAgICAgICAgICAgICAudGhlbigodG9rZW4pID0+IHRoaXMuX2dldFRva2VuU3VjY2Vzcyh0b2tlbiwgcmVzb2x2ZSkpXG4gICAgICAgICAgICAgICAgLmNhdGNoKChlcnIpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgLyogSWYgd2UncmUgcmVmcmVzaGluZywgdHJ5IGEgZnVsbCBsb2ctaW4gKi9cbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlZnJlc2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5sb2dnZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmxvZ2dlci5pbmZvKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdSZWZyZXNoIGZhaWxzLCB0cnlpbmcgbG9nLWluIGluc3RlYWQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9kb0xvZ2luKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGhlbigodG9rZW4pID0+IHRoaXMuX2dldFRva2VuU3VjY2Vzcyh0b2tlbiwgcmVzb2x2ZSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhdGNoKChlcnIpID0+IHRoaXMuX2dldFRva2VuRmFpbChlcnIsIHJlamVjdCkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2dldFRva2VuRmFpbChlcnIsIHJlamVjdCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFBlcmZvcm0gYW4gb3BlcmF0aW9uIGdpdmVuIGJ5IHRoZSB1cmkgd2l0aCBhcmd1bWVudCBpZHMuIElkcyBjYW4gZWl0aGVyIGJlIGEgU3RyaW5nIG9yIGFuIGFycmF5IG9mIFN0cmluZydzLlxuICAgICAqIEBwYXJhbSBpZHMgRW50aXR5IGlkL3MgZm9yIHRoZSBvcGVyYXRpb24gdG8gYmUgcGVyZm9ybWVkIG9uLlxuICAgICAqIEBwYXJhbSB1cmkgQVBJIGVuZHBvaW50IHRvIHBlcmZvcm0gdGhlIG9wZXJhdGlvbi5cbiAgICAgKiBAcmV0dXJucyB7UHJvbWlzZTwqPn1cbiAgICAgKi9cbiAgICBfb3BCeUlkcyhpZHMsIHVyaSkge1xuICAgICAgICBpZiAodHlwZW9mIGlkcyA9PT0gJ3N0cmluZycgfHwgKEFycmF5LmlzQXJyYXkoaWRzKSAmJiBpZHMubGVuZ3RoID09PSAxKSkge1xuICAgICAgICAgICAgY29uc3QgaWQgPSBBcnJheS5pc0FycmF5KGlkcykgPyBpZHNbMF0gOiBpZHM7XG5cbiAgICAgICAgICAgIHJldHVybiB0aGlzLnN1Ym1pdFJlcXVlc3QoXG4gICAgICAgICAgICAgICAgJ0dFVCcsXG4gICAgICAgICAgICAgICAgdXJpLFxuICAgICAgICAgICAgICAgIHt9LFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogKG5ldyBkYXRhLlJlZihpZCkpLnRvSFNaSU5DKClcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoQXJyYXkuaXNBcnJheShpZHMpKSB7XG4gICAgICAgICAgICBpZiAoaWRzLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICAgICAgICAvLyB2ZXJpZnkgaW5wdXQgaXMgYWxsIHN0cmluZ3NcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGlkIG9mIGlkcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoISh0eXBlb2YgaWQgPT09ICdzdHJpbmcnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlkIGluc3RhbmNlb2YgT2JqZWN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgaXRzIGNvbXBhdGlibGUgd2l0aCBjbGFzcyBSZWZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgZGF0YS5SZWYoaWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYFBhcmFtZXRlciAnaWRzJyBjb250YWlucyBhbiBlbGVtZW50IHRoYXQgaXMgb2YgdHlwZSBvYmplY3QgYnV0IG5vdCBjb21wYXRpYmxlIGAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYHdpdGggY2xhc3MgUmVmIGR1ZSB0bzogJHtlcnJvci5tZXNzYWdlfWBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYFBhcmFtZXRlciAnaWRzJyBjb250YWlucyBhbiBlbGVtZW50IHRoYXQgaXMgbm90IGEgc3RyaW5nLiBGb3VuZCAke3R5cGVvZiBpZH0uYFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5zdWJtaXRSZXF1ZXN0KFxuICAgICAgICAgICAgICAgICAgICAnUE9TVCcsXG4gICAgICAgICAgICAgICAgICAgIHVyaSxcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWV0YToge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcjogJzIuMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sczogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtuYW1lOiAnaWQnfVxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJvd3M6IGlkcy5tYXAoZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtpZDogKG5ldyBkYXRhLlJlZihpZCkpLnRvSFNKU09OKCl9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgQW4gZW1wdHkgYXJyYXkgb2YgaWQncyB3YXMgZ2l2ZW4uYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFBhcmFtZXRlciAnaWRzJyBpcyBuZWl0aGVyIGEgc2luZ2xlIGlkIG9yIGFuIGFycmF5IG9mIGlkJ3MuYCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBQZXJmb3JtIGEgZmlsdGVyIG9wZXJhdGlvbiwgY29uZHVjdGluZyB0aGUgbmVjZXNzYXJ5IGNoZWNrcyBiZWZvcmUgZG9pbmcgc28uXG4gICAgICogQHBhcmFtIG9wIE9wZXJhdGlvbiB0byBiZSBjb21wbGV0ZWRcbiAgICAgKiBAcGFyYW0gZmlsdGVyIEZpbHRlciB0byBiZSB1c2VkLlxuICAgICAqIEBwYXJhbSBsaW1pdCBMaW1pdCB0byBiZSB1c2VkLlxuICAgICAqIEByZXR1cm5zIHtQcm9taXNlPCo+fSBSZXN1bHQgb2YgQVBJIGNhbGwuXG4gICAgICovXG4gICAgX2J5RmlsdGVyKG9wLCBmaWx0ZXIsIGxpbWl0KSB7XG4gICAgICAgIGlmIChsaW1pdCA8IDApIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignSW52YWxpZCBuZWdhdGl2ZSBsaW1pdCBnaXZlbi4nKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgZmlsdGVyICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkIGZpbHRlciB0eXBlICR7dHlwZW9mIGZpbHRlcn0gZ2l2ZW4uIEV4cGVjdGVkIHN0cmluZy5gKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLnN1Ym1pdFJlcXVlc3QoXG4gICAgICAgICAgICBcIlBPU1RcIixcbiAgICAgICAgICAgIGAvYXBpLyR7b3B9YCxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBtZXRhOiB7XG4gICAgICAgICAgICAgICAgICAgIHZlcjogXCIyLjBcIlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY29sczogW1xuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcIm5hbWVcIjogXCJmaWx0ZXJcIlxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcIm5hbWVcIjogXCJsaW1pdFwiXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIHJvd3M6IFtcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyOiBgczoke2ZpbHRlcn1gLFxuICAgICAgICAgICAgICAgICAgICAgICAgbGltaXQ6IGBuOiR7bGltaXR9YFxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFBlcmZvcm0gYSBgcmVhZGAgcmVxdWVzdCBvZiB0aGUgV2lkZVNreSBBUEkgc2VydmVyLiAgVGhpcyBmdW5jdGlvbiB0YWtlc1xuICAgICAqIG9uZSBvciBtb3JlIElEcyBleHByZXNzZWQgYXMgYSBsaXN0LlxuICAgICAqXG4gICAgICogQHBhcmFtICAgaWRzICAgICBFbnRpdHkgSURzLCBlaXRoZXIgYSBzaW5nbGUgSUQgb3IgYW4gYXJyYXkuICAoc3RyaW5nIG9yXG4gICAgICogICAgICAgICAgICAgICAgICBhcnJheSBvZiBzdHJpbmdzKVxuICAgICAqIEByZXR1cm5zIFByb21pc2UgdGhhdCByZXNvbHZlcyB0byB0aGUgcmF3IGdyaWQuXG4gICAgICovXG4gICAgcmVhZChpZHMpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX29wQnlJZHMoaWRzLCAnL2FwaS9yZWFkJyk7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFBlcmZvcm0gYSBncmFwaHFsIHJlcXVlc3QgdG8gdGhlIFdpZGVTa3kgQVBJIHNlcnZlci5cbiAgICAgKiBUaGlzIGZ1bmN0aW9uIHRha2VzIGluIGEgc3RyaW5nIHdoaWNoIGNvbnRhaW5zIHRoZVxuICAgICAqIGdyYXBoIHF1ZXJ5LlxuICAgICAqXG4gICAgICogQHBhcmFtICAgZ3JhcGhxbCBUaGUgZ3JhcGggcXVlc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gICAgICAgICAgICAgaWYgKCFwcmVzZW50W2NvbF0pIHtcbiAgICAgICAgICAgICAgICAgICAgcHJlc2VudFtjb2xdID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvKiBVcGdyYWRlIHRvIEhheXN0YWNrIDMuMCAqL1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KGVudGl0eVtjb2xdKSkge1xuICAgICAgICAgICAgICAgICAgICB2ZXIgPSAnMy4wJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgLyogRW5zdXJlIHVwZGF0ZVJlYyBsaXN0cyBgaWRgICovXG4gICAgICAgIGlmICgoIXByZXNlbnQuaWQpICYmIChvcCA9PT0gJ3VwZGF0ZVJlYycpKSB7XG4gICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICAgICAgICAgICAgaWYgKHRoaXMubG9nZ2VyKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5sb2dnZXIudHJhY2UoZW50aXRpZXMsICdFbnRpdGllcyBsYWNrcyBpZCBjb2x1bW4nKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdpZCBpcyBtaXNzaW5nJyk7XG4gICAgICAgIH1cblxuICAgICAgICAvKiBHZW5lcmF0ZSB0aGUgY29sdW1ucyB0byBiZSBlbWl0dGVkLCBzdGFydGluZyB3aXRoIHRoZSBzcGVjaWFsIG9uZXMgKi9cbiAgICAgICAgU1BFQ0lBTF9DT0xTLmZvckVhY2goKGMpID0+IHtcbiAgICAgICAgICAgIGlmIChwcmVzZW50W2NdKSB7XG4gICAgICAgICAgICAgICAgY29scy5wdXNoKGMpO1xuICAgICAgICAgICAgICAgIGRlbGV0ZSBwcmVzZW50W2NdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvKiBBZGQgdGhlIG90aGVycyBpbiwgaW4gYWxwaGFiZXRpY2FsIG9yZGVyICovXG4gICAgICAgIGNvbHMgPSBbLi4uY29scywgLi4uKE9iamVjdC5rZXlzKHByZXNlbnQpLnNvcnQoKSldO1xuXG4gICAgICAgIHJldHVybiB0aGlzLnN1Ym1pdFJlcXVlc3QoXG4gICAgICAgICAgICAnUE9TVCcsXG4gICAgICAgICAgICBgL2FwaS8ke29wfWAsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgbWV0YToge3ZlcjogdmVyfSxcbiAgICAgICAgICAgICAgICBjb2xzOiBjb2xzLm1hcChmdW5jdGlvbiAoYykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4ge25hbWU6IGN9O1xuICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgIHJvd3M6IGVudGl0aWVzXG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIENyZWF0ZSBvbmUgb3IgbW9yZSBlbnRpdGllcy4gIFRoaXMgdGFrZXMgYW4gYXJyYXkgb2Ygb2JqZWN0cyBhbmQgYXR0ZW1wdHNcbiAgICAgKiB0byBjcmVhdGUgdGhvc2UgZW50aXRpZXMgaW4gV2lkZVNreS5cbiAgICAgKlxuICAgICAqIEBwYXJhbSAgIGVudGl0aWVzICAgIEFycmF5IG9mIGVudGl0eSBvYmplY3RzXG4gICAgICogQHJldHVybnMgUHJvbWlzZSB0aGF0IHJlc29sdmVzIHRvIHRoZSByYXcgZ3JpZC5cbiAgICAgKi9cbiAgICBjcmVhdGUoZW50aXRpZXMpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2NyZWF0ZV9vcl91cGRhdGUoJ2NyZWF0ZVJlYycsIGVudGl0aWVzKTtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogVXBkYXRlIG9uZSBvciBtb3JlIGVudGl0aWVzLiAgVGhpcyB0YWtlcyBhbiBhcnJheSBvZiBvYmplY3RzIGFuZCBhdHRlbXB0c1xuICAgICAqIHRvIHVwZGF0ZSB0aG9zZSBlbnRpdGllcyBpbiBXaWRlU2t5LlxuICAgICAqXG4gICAgICogQHBhcmFtICAgZW50aXRpZXMgICAgQXJyYXkgb2YgZW50aXR5IG9iamVjdHNcbiAgICAgKiBAcmV0dXJucyBQcm9taXNlIHRoYXQgcmVzb2x2ZXMgdG8gdGhlIHJhdyBncmlkLlxuICAgICAqL1xuICAgIHVwZGF0ZShlbnRpdGllcykge1xuICAgICAgICByZXR1cm4gdGhpcy5fY3JlYXRlX29yX3VwZGF0ZSgndXBkYXRlUmVjJywgZW50aXRpZXMpO1xuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBDcmVhdGUgYSBuZXcgdXNlciBhY2NvdW50LlxuICAgICAqXG4gICAgICogQHBhcmFtICAge3N0cmluZ30gICAgZW1haWwgICAgICAgRW1haWwgKHVzZXIgbmFtZSkgb2YgdGhlIG5ldyB1c2VyXG4gICAgICogQHBhcmFtICAge3N0cmluZ30gICAgbmFtZSAgICAgICAgTmFtZSAoZGVzY3JpcHRpb24pIG9mIHRoZSBuZXcgdXNlciBhY2NvdW50LFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbGwgYmVjb21lIHRoZSBgZGlzYCBmaWVsZCBvZiB0aGUgdXNlciBlbnRpdHkuXG4gICAgICogQHBhcmFtICAge3N0cmluZ30gICAgZGVzY3JpcHRpb24gUHVycG9zZSBvZiB0aGUgdXNlciBhY2NvdW50LCBlLmcuIFwiVXNlclwiLFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiU3VwZXJVc2VyXCIsIOKApiBldGMuICBGaWxscyBpbiB0aGUgYHByaW1hcnlGdW5jdGlvbmAgdGFnLlxuICAgICAqIEBwYXJhbSAgIHtzdHJpbmdbXX0gIHJvbGVzICAgICAgIFRoZSBJRHMgKFVVSURzIG9yIG5hbWVzKSBvZiB0aGUgYHJvbGVgIGVudGl0aWVzIHRvIGxpbmsgdG9cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzIG5ldyB1c2VyLlxuICAgICAqIEBwYXJhbSAgIHtzdHJpbmc/fSAgIHBhc3N3b3JkICAgIFRoZSBuZXcgcGFzc3dvcmQgZm9yIHRoZSB1c2VyLiAgSWYgc2V0IHRvIGBudWxsYCBvciB0aGVcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbXB0eSBzdHJpbmcsIHRoZSB1c2VyIHdpbGwgYmUgc2VudCBhbiBlbWFpbCB0byBcImFjdGl2YXRlXCJcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGVpciB1c2VyIGFjY291bnQgKGFuZCBzdXBwbHkgYSBwYXNzd29yZCBhcyB0aGV5IGRvIHNvKS5cbiAgICAgKiBAcGFyYW0gICB7c3RyaW5nP30gICBtZXRob2QgICAgICBUaGUgYXV0aGVudGljYXRpb24gbWV0aG9kIGZvciB0aGUgbmV3IHVzZXIuICBBdCB0aGUgdGltZVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mIHdyaXRpbmcsIHRoZSBjaG9pY2VzIGFyZTogXCJsb2NhbFwiICh0aGUgZGVmYXVsdCwgdXNpbmdcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPQXV0aDIgYXV0aGVudGljYXRpb24pIGFuZCBcInNjcmFtXCIgKFNDUkFNIGF1dGhlbnRpY2F0aW9uKS5cbiAgICAgKi9cbiAgICBjcmVhdGVVc2VyKGVtYWlsLCBuYW1lLCBkZXNjcmlwdGlvbiwgcm9sZXMsIHBhc3N3b3JkPW51bGwsIG1ldGhvZD1BVVRIX01FVEhPRC5MT0NBTCkge1xuICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICAgICAgICBpZiAodGhpcy5sb2dnZXIpIHtcbiAg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YXRlKSAgICAgIFN0YXJ0aW5nIHRpbWVzdGFtcCBvZiByZWFkXG4gICAgICogQHBhcmFtICAgdG8gICAgICAgICAgKERhdGUpICAgICAgRW5kaW5nIHRpbWVzdGFtcCBvZiByZWFkXG4gICAgICpcbiAgICAgKiBAcGFyYW0gICBiYXRjaFNpemUgICAgKE51bWJlcikgICAgT3B0aW9uYWwgYmF0Y2ggc2l6ZSB3aGVuIHJlYWRpbmcgbXVsdGlwbGVcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludHMuICBTb21lIGVudmlyb25tZW50cyBtYXkgZXhwZXJpZW5jZVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzc3VlcyByZWFkaW5nIG1vcmUgdGhhbiBhIGZldyBkb3plbiBwb2ludHNcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdCBhIHRpbWUgZHVlIHRvIEhUVFAgcmVxdWVzdCBwYXlsb2FkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Rpb25zLCBzbyBiaWdnZXIgcmVhZHMgd2lsbCBiZVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyb2tlbiB1cCBpbnRvIDUwLXBvaW50IGdyb3Vwcy5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgc2l6ZSBjYW4gYmUgdHVuZWQgaGVyZS5cbiAgICAgKlxuICAgICAqIEByZXR1cm5zIFByb21pc2UgdGhhdCByZXNvbHZlcyB0byB0aGUgcmF3IGdyaWQuXG4gICAgICovXG4gICAgaGlzUmVhZChpZHMsIGZyb20sIHRvLCBiYXRjaFNpemU9NTApIHtcbiAgICAgICAgbGV0IHJhbmdlO1xuXG4gICAgICAgIGlmICh0byAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAvKiBGdWxsIHJhbmdlIGdpdmVuLCBib3RoIGZyb20gYW5kIHRvICptdXN0KiBiZSBEYXRlcyAqL1xuICAgICAgICAgICAgaWYgKCEoZnJvbSBpbnN0YW5jZW9mIERhdGUpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdgZnJvbWAgaXMgbm90IGEgRGF0ZScpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoISh0byBpbnN0YW5jZW9mIERhdGUpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdgdG9gIGlzIG5vdCBhIERhdGUnKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmFuZ2UgPSBmcm9tLnRvSFNaSU5DKCkgKyAnLCcgKyB0by50b0hTWklOQygpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmFuZ2UgPSBmcm9tO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCEoQXJyYXkuaXNBcnJheShpZHMpKSkge1xuICAgICAgICAgICAgaWRzID0gW2lkc107XG4gICAgICAgIH1cblxuICAgICAgICAvKiBGb3JtYXQgdGhlIHJhbmdlICovXG4gICAgICAgIHJhbmdlID0gcmFuZ2UudG9IU1pJTkMoKTtcblxuICAgICAgICAvKiBOb3JtYWxpc2UgdGhlIElEcyBpbnRvIHN0YW5kYXJkIGZvcm0gKi9cbiAgICAgICAgaWRzID0gaWRzLm1hcChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgIHJldHVybiAobmV3IGRhdGEuUmVmKGlkKSkudG9IU0pTT04oKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKGlkcy5sZW5ndGggPCBiYXRjaFNpemUpIHtcbiAgICAgICAgICAgIC8qIFNtYWxsIGhpc1JlYWQsIGhhbmRsZSBhcyBub3JtYWwgKi9cbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9oaXNSZWFkKGlkcywgcmFuZ2UpO1xuICAgICAgICB9XG5cbiAgICAgICAgLyogR3JvdXAgdGhlIElEcyBpbnRvIGJsb2NrcyAqL1xuICAgICAgICBjb25zdCByZWFkcyA9IFtdO1xuICAgICAgICBsZXQgb2Zmc2V0ID0gMDtcblxuICAgICAgICB3aGlsZSAob2Zmc2V0IDwgaWRzLmxlbmd0aCkge1xuICAgICAgICAgICAgY29uc3QgYmxvY2sgPSBpZHMuc2xpY2Uob2Zmc2V0LCBvZmZzZXQgKyBiYXRjaFNpemUpO1xuXG4gICAgICAgICAgICByZWFkcy5wdXNoKGJsb2NrKTtcbiAgICAgICAgICAgIG9mZnNldCArPSBibG9jay5sZW5ndGg7XG4gICAgICAgIH1cblxuICAgICAgICAvKiBBc3NlbWJsZSB0aGUgb3ZlcmFsbCByZXN1bHQgKi9cbiAgICAgICAgY29uc3QgcmVzdWx0ID0ge1xuICAgICAgICAgICAgbWV0YToge1xuICAgICAgICAgICAgICAgIHZlcjogJzIuMCcsXG4gICAgICAgICAgICAgICAgaGlzU3RhcnQ6IG51bGwsXG4gICAgICAgICAgICAgICAgaGlzRW5kOiBudWxsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY29sczogW1xuICAgICAgICAgICAgICAgIHtuYW1lOiAndHMnfVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHJvd3M6IFtdXG4gICAgICAgIH07XG5cbiAgICAgICAgY29uc3Qgc3RhdHVzID0ge1xuICAgICAgICAgICAgaGlzU3RhcnQ6IG51bGwsXG4gICAgICAgICAgICBoaXNFbmQ6IG51bGwsXG4gICAgICAgICAgICByb3dUczoge30sXG4gICAgICAgICAgICBjb2xJZDoge31cbiAgICAgICAgfTtcblxuICAgICAgICAvKiBFbnVtZXJhdGUgdGhlIGNvbHVtbnMgKi9cbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHN0YXR1cy5jb2xJZFtpZHNbaV1dID0gaTtcbiAgICAgICAgICAgIHJlc3VsdC5jb2xzLnB1c2goe1xuICAgICAgICAgICAgICAgIG5hbWU6ICd2JyArIGksXG4gICAgICAgICAgICAgICAgaWQ6IGlkc1tpXVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICAvKiBFeGVjdXRlIHRoZSByZWFkcyAqL1xuICAgICAgICByZXR1cm4gUHJvbWlzZS5hbGwoXG4gICAgICAgICAgICByZWFkcy5tYXAoKGJsb2NrX2lkcykgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9oaXNSZWFkKGJsb2NrX2lkcywgcmFuZ2UpLnRoZW4oKGJsb2NrX3JlcykgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9tZXJnZUhpc1JlYWRSZXMocmVzdWx0LCBzdGF0dXMsIGJsb2NrX2lkcywgYmxvY2tfcmVzKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICkudGhlbigoKSA9PiB7XG4gICAgICAgICAgICAvKiBBc3NlbWJsZSBhbGwgdGhlIHJvd3MgKi9cbiAgICAgICAgICAgIGxldCB0aW1lcyA9IE9iamVjdC5rZXlzKHN0YXR1cy5yb3dUcykubWFwKCh0cykgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUludCh0cyk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHRpbWVzLnNvcnQoKTtcblxuICAgICAgICAgICAgcmVzdWx0LnJvd3MgPSB0aW1lcy5tYXAoZnVuY3Rpb24gKHRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1cy5yb3dUc1t0c107XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgLyogUmV0dXJuIHRoZSBtZXJnZWQgcmVzdWx0ICovXG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9KTtcbiAgICB9O1xuXG4gICAgX21lcmdlSGlzUmVhZFJlcyhyZXN1bHQsIHN0YXR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GlzX2VuZCBpbnN0YW5jZW9mIERhdGUpKSB7XG4gICAgICAgICAgICAvKiBJcyB0aGlzX2VuZCBsYXRlciB0aGFuIHN0YXR1cy5oaXNTdGFydD8gKi9cbiAgICAgICAgICAgIHRoaXNfZW5kID0gdGhpc19lbmQudmFsdWVPZigpO1xuICAgICAgICAgICAgaWYgKChzdGF0dXMuaGlzRW5kID09IG51bGwpIHx8IChzdGF0dXMuaGlzRW5kIDwgdGhpc19lbmQpKSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzLmhpc0VuZCA9IHRoaXNfZW5kO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5tZXRhLmhpc0VuZCA9IGJsb2NrUmVzLm1ldGEuaGlzRW5kO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLyogQXJlIHRoZXJlIG90aGVyIGZpZWxkcyB0byBtZXJnZT8gIChmb3IgZnV0dXJlIGV4cGFuc2lvbikgKi9cblxuICAgICAgICBmb3IgKGNvbnN0IGZpZWxkIGluIGJsb2NrUmVzLm1ldGEpIHtcbiAgICAgICAgICAgIGlmICghcmVzdWx0Lm1ldGEuaGFzT3duUHJvcGVydHkoZmllbGQpKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0Lm1ldGFbZmllbGRdID0gYmxvY2tSZXMubWV0YVtmaWVsZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvKiBOb3csIG1lcmdlIHRoZSBkYXRhICovXG5cbiAgICAgICAgZm9yIChsZXQgciA9IDA7IHIgPCBibG9ja1Jlcy5yb3dzLmxlbmd0aDsgcisrKSB7XG4gICAgICAgICAgICBjb25zdCBpbl9yb3cgPSBibG9ja1Jlcy5yb3dzW3JdO1xuICAgICAgICAgICAgbGV0IHRzID0gZGF0YS5wYXJzZShpbl9yb3cudHMpO1xuXG4gICAgICAgICAgICAvKiBTYW5pdHkgY2hlY2ssIGB0c2AgbXVzdCBiZSBhIERhdGUgKi9cbiAgICAgICAgICAgIGlmICgodHMgPT0gbnVsbCkgfHwgISh0cyBpbnN0YW5jZW9mIERhdGUpKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICAnRXhwZWN0ZWQgZGF0ZS90aW1lIGZvciB0cyBjb2x1bW4sIGdvdDogJyArIGluX3Jvdy50c1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qIEV4dHJhY3QgbXMgdGltZSAqL1xuICAgICAgICAgICAgdHMgPSB0cy52YWx1ZU9mKCk7XG4gICAgICAgICAgICBsZXQgb3V0X3JvdztcblxuICAgICAgICAgICAgaWYgKHN0YXR1cy5yb3dUcy5oYXNPd25Qcm9wZXJ0eSh0cykpIHtcbiAgICAgICAgICAgICAgICBvdXRfcm93ID0gc3RhdHVzLnJvd1RzW3RzXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIG91dF9yb3cgPSB7dHM6IGluX3Jvdy50c307XG4gICAgICAgICAgICAgICAgc3RhdHVzLnJvd1RzW3RzXSA9IG91dF9yb3c7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qIENvcHkgdGhlIGNvbHVtbnMgaW4gKi9cbiAgICAgICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgYmxvY2tJZHMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICBjb25zdCB2YWwgPSBpbl9yb3dbJ3YnICsgY107XG5cbiAgICAgICAgICAgICAgICBpZiAodmFsICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgaWQgPSBibG9ja0lkc1tjXTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY29sID0gc3RhdHVzLmNvbElkW2lkXTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoY29sID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5leHBlY3RlZCBJRCAnICsgaWQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgb3V0X3Jvd1sndicgKyBjb2xdID0gdmFsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICBfaGlzUmVhZChpZHMsIHJhbmdlKSB7XG4gICAgICAgIGNvbnN0IGNvbmZpZyA9IHtcbiAgICAgICAgICAgIHBhcmFtczoge1xuICAgICAgICAgICAgICAgIHJhbmdlXG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKGlkcy5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgIGNvbmZpZy5wYXJhbXMuaWQgPSAobmV3IGRhdGEuUmVmKGlkc1swXSkpLnRvSFNaSU5DKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBpZHMuZm9yRWFjaCgoaWQsIGlkeCkgPT4ge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5wYXJhbXNbJ2lkJyArIGlkeF0gPSAobmV3IGRhdGEuUmVmKGlkKSkudG9IU1pJTkMoKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuc3VibWl0UmVxdWVzdChcbiAgICAgICAgICAgICdHRVQnLFxuICAgICAgICAgICAgJy9hcGkvaGlzUmVhZCcsXG4gICAgICAgICAgICB7fSxcbiAgICAgICAgICAgIGNvbmZpZ1xuICAgICAgICApO1xuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBQZXJmb3JtIGEgaGlzdG9yeSB3cml0ZSByZXF1ZXN0LlxuICAgICAqXG4gICAgICogQHBhcmFtICAgcmVjb3JkcyAgICAgUmVjb3JkcyB0byBiZSB3cml0dGVuIGtleWVkIGJ5IHRpbWVzdGFtcCAob2JqZWN0KVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgIEVhY2ggcmVjb3JkIHZhbHVlIHNob3VsZCBtYXAgdGhlIHBvaW50IHRvIGl0cyB2YWx1ZVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgIGZvciB0aGF0IHRpbWUgcmVjb3JkLiBSZWNvcmRzIHNob3VsZCBoYXZlIHRoZSBmb3JtYXQgb2Y6XG4gICAgICogICAgICAgICAgICAgICAgICAgICAge1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICA8dGltZT46IHtcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpZD46IDx2YWx1ZVRvQmVXcml0dGVuPixcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC4uLlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAuLi5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgd2hlcmUgZWFjaCBvZiB0aGUgJzw+JyB2YWx1ZXMgYXJlIGluIEhheVN0YWNrIGZvcm1hdC5cbiAgICAgKiBAcmV0dXJucyBQcm9taXNlIHRoYXQgcmVzb2x2ZXMgdG8gdGhlIHJhdyBncmlkLlxuICAgICAqL1xuICAgIGhpc1dyaXRlKHJlY29yZHMpIHtcbiAgICAgICAgY29uc3QgY29scyA9IHt9LCBvdXRDb2xzID0gW3tuYW1lOiAndHMnfV07XG4gICAgICAgIGNvbnN0IHJvd3MgPSBPYmplY3Qua2V5cyhyZWNvcmRzKS5tYXAoZnVuY3Rpb24gKHRzKSB7XG4gICAgICAgICAgICBjb25zdCByZWMgPSByZWNvcmRzW3RzXTtcbiAgICAgICAgICAgIGNvbnN0IHJvdyA9IHt0czogdHN9O1xuXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhyZWMpLnNvcnQoKS5mb3JFYWNoKChpZCkgPT4ge1xuICAgICAgICAgICAgICAgIC8qIERldGVybWluZSBjb2x1bW4gKi9cbiAgICAgICAgICAgICAgICBsZXQgY29sID0gY29sc1tpZF07XG4gICAgICAgICAgICAgICAgaWYgKGNvbCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbCA9ICd2JyArIChvdXRDb2xzLmxlbmd0aCAtIDEpO1xuICAgICAgICAgICAgICAgICAgICBvdXRDb2xzLnB1c2goe25hbWU6IGNvbCwgaWQ6IGlkfSk7XG4gICAgICAgICAgICAgICAgICAgIGNvbHNbaWRdID0gY29sO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8qIEluc2VydCAqL1xuICAgICAgICAgICAgICAgIHJvd1tjb2xdID0gcmVjW2lkXTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gcm93O1xuICAgICAgICB9KS5zb3J0KChyMSwgcjIpID0+IHtcbiAgICAgICAgICAgIC8qXG4gICAgICAgICAgICAgKiBUaGlzIGZ1bmN0aW9uIGlzIGF0IHRoZSBtZXJjeSBvZiB0aGUgc29ydGluZyBhbGdvcml0aG1cbiAgICAgICAgICAgICAqIHNvIGlzIG5vdCBndWFyYW50ZWVkIHRvIHVzZSBhbGwgY29kZSBwYXRocy5cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgaWYgKHIxLnRzIDwgcjIudHMpXG4gICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgIGlmIChyMS50cyA+IHIyLnRzKVxuICAgICAgICAgICAgICAgIHJldHVybiAxO1xuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgIHJldHVybiAwXG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiB0aGlzLnN1Ym1pdFJlcXVlc3QoXG4gICAgICAgICAgICAnUE9TVCcsXG4gICAgICAgICAgICAnL2Fwa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AgKi9cbiAgICBmaWxlVXBsb2FkIChpZCxcbiAgICAgICAgICAgICAgICB0cyxcbiAgICAgICAgICAgICAgICBmaWxlLFxuICAgICAgICAgICAgICAgIGZpbGVuYW1lLFxuICAgICAgICAgICAgICAgIG1lZGlhVHlwZSxcbiAgICAgICAgICAgICAgICBpbmxpbmVSZXRyaWV2YWw9dHJ1ZSxcbiAgICAgICAgICAgICAgICBjYWNoZU1heEFnZT0xODAwLCAgICAgICAvLyAzMCBtaW51dGVzXG4gICAgICAgICAgICAgICAgZm9yY2U9ZmFsc2UsXG4gICAgICAgICAgICAgICAgdGFncz17fSkge1xuXG4gICAgICAgIGlmICh0eXBlb2YgZmlsZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIC8vIEFzc3VtZSBhbiBhYnNvbHV0ZSBmaWxlIHBhdGhcbiAgICAgICAgICAgIGZpbGUgPSBmcy5jcmVhdGVSZWFkU3RyZWFtKGZpbGUpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKEJ1ZmZlci5pc0J1ZmZlcihmaWxlKSkge1xuICAgICAgICAgICAgLy8gYnVmZmVyIGlzIG9rXG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZpbGUgY2FuIG9ubHkgYmUgYSBidWZmZXIgb3IgYW4gYWJzb2x1dGUgZmlsZSBwYXRoIChzdHJpbmcpLicpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiBmaWxlbmFtZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignRmlsZSBuYW1lIG11c3QgYmUgYSBzdHJpbmcuJyk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIGZvcmNlICE9PSAnYm9vbGVhbicpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignRm9yY2UgbXVzdCBiZSBvZiB0eXBlIGJvb2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vZiB0YWdWYWwgIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdUYWcgdmFsdWUgZm9yIGtleSAnICsgdGFnS2V5ICsgJyBtdXN0IGJlIHN0cmluZy4nKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmVxdWVzdFRhZ3MucHVzaChgJHt0YWdLZXl9PSR7dGFnVmFsfWApO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IGNvbnRlbnREaXNwb3NpdGlvbiA9IGlubGluZVJldHJpZXZhbCA/ICdpbmxpbmUnOiAnYXR0YWNobWVudCc7XG4gICAgICAgIGlmICghaW5saW5lUmV0cmlldmFsICYmIGZpbGVuYW1lKSB7XG4gICAgICAgICAgICAvLyBlLmcuIGF0dGFjaG1lbnQ7IGZpbGVuYW1lPVwibXlQREYucGRmXCJcbiAgICAgICAgICAgIGNvbnRlbnREaXNwb3NpdGlvbiArPSAnOyBmaWxlbmFtZT1cIicgKyBmaWxlbmFtZSArIFwiJ1wiO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gQ3JlYXRlIGZvcm1cbiAgICAgICAgY29uc3QgZm9ybURhdGEgPSBuZXcgRm9ybURhdGEoKTtcbiAgICAgICAgY29uc3QgZm9ybSA9IHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RzJzogdHMsXG4gICAgICAgICAgICAnZGF0YSc6IGZpbGUsXG4gICAgICAgICAgICAnZm9yY2UnOiBmb3JjZS50b1N0cmluZygpLFxuICAgICAgICAgICAgJ2NhY2hlTWF4QWdlJzogY2FjaGVNYXhBZ2UudG9TdHJpbmcoKSxcbiAgICAgICAgICAgICdjb250ZW50RGlzcG9zaXRpb24nOiBjb250ZW50RGlzcG9zaXRpb24sXG4gICAgICAgICAgICAndGFncyc6IEpTT04uc3RyaW5naWZ5KHJlcXVlc3RUYWdzKVxuICAgICAgICB9O1xuXG4gICAgICAgIGZvciAoY29uc3QgW2tleSwgdmFsdWVdIG9mIE9iamVjdC5lbnRyaWVzKGZvcm0pKSB7XG4gICAgICAgICAgICBpZiAoa2V5ID09PSAnZGF0YScpIHtcbiAgICAgICAgICAgICAgICAvLyBmb3JtZGF0YSBuZWVkcyB0byBrbm93IHRoZSBtaW1ldHlwZSBvZiB0aGUgRmlsZSBvciBCdWZmZXJcbiAgICAgICAgICAgICAgICAvLyB0aGUgbWltZXR5cGUgaXMgZGVyaXZlZCBhdXRvbWF0aWNhbGx5IGJ5IGxvb2tpbmcgYXQgdGhlIGdpdmVuIGZpbGVuYW1lLlxuICAgICAgICAgICAgICAgIC8vIE1pbWVUeXBlIGlzIHJlcXVpcmVkIG9yIG90aGVyd2lzZSBpdCB3aWxsIGJlIGRpc3JlZ2FyZGVkIGFuZCBub3Qgc2VudCB0byBBUEkgc2VydmVyXG4gICAgICAgICAgICAgICAgZm9ybURhdGEuYXBwZW5kKGtleSwgdmFsdWUsIHtcbiAgICAgICAgICAgICAgICAgICAgZmlsZW5hbWUsXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50VHlwZSc6IG1lZGlhVHlwZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZm9ybURhdGEuYXBwZW5kKGtleSwgdmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuc3VibWl0UmVxdWVzdChcbiAgICAgICAgICAgICdQVVQnLFxuICAgICAgICAgICAgJy9hcGkvZmlsZS9zdG9yYWdlJyxcbiAgICAgICAgICAgIGZvcm1EYXRhLFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdtdWx0aXBhcnQvZm9ybS1kYXRhJ1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiA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wYXJhbSAgIHByZXNpZ25lZCAgICAgKGJvb2xlYW4pICAgRmxhZyBmb3IgaW5kaWNhdGluZyBpZiB0aGUgcmV0dXJuZWQgVVJMIHNob3VsZCBiZSBwcmVzaWduZWQuXG4gICAgICogQHBhcmFtICAgcHJlc2lnbkV4cGlyeSAobnVtYmVyKSAgICBEdXJhdGlvbiBpbiBzZWNvbmRzIHdoZXJlIHRoZSBwcmVzaWduZWQgbGluayB3aWxsIGV4cGlyZS5cbiAgICAgKlxuICAgICAqXG4gICAgICogQHJldHVybnMgUHJvbWlzZSB0aGF0IHJlc29sdmVzIHRvIHRoZSBmb2xsb3dpbmcgZm9ybWF0LlxuICAgICAqIFtcbiAgICAgKiAgICAge1xuICAgICAqICAgICAgICAgcG9pbnRJZDogYzdiZDY0ZDktMGE3Mi00NTg0LTk0NWEtYzY2NzA4MWM5N2Y2LFxuICAgICAqICAgICAgICAgdXJsczogW1xuICAgICAqICAgICAgICAgICAgIHRpbWU6IDIwODc5MTE4MDAsXG4gICAgICogICAgICAgICAgICAgdmFsdWU6IGh0dHBzOi8vYWJjLm9uLndpZGVza3kuY2xvdWQvYXBpL2ZpbGUvc3RvcmFnZS8yMDg3OTExODAwX3p4Y3Zibi4uLlxuICAgICAqICAgICAgICAgXVxuICAgICAqICAgICB9XG4gICAgICogXVxuICAgICAqL1xuICAgIGZpbGVSZXRyaWV2ZShwb2ludElkcywgZnJvbSwgdG8sIHByZXNpZ25lZD10cnVlLCBwcmVzaWduRXhwaXJ5PTE4MDApIHtcbiAgICAgICAgaWYgKCEoQXJyYXkuaXNBcnJheShwb2ludElkcykpKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHBvaW50SWRzICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgUG9pbnQgaWQgJHtwb2ludElkc30gbXVzdCBiZSBhIHN0cmluZy5gKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcG9pbnRJZHMgPSBbcG9pbnRJZHNdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZm9yIChsZXQgaW5kZXggPSAwOyBpbmRleCA8IHBvaW50SWRzLmxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcG9pbnRJZHNbaW5kZXhdICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1BvaW50IGlkICcgKyBwb2ludElkc1tpbmRleF0gKyAnIG11c3QgYmUgc3RyaW5nLicpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IG1Gcm9tID0gbW9tZW50KGZyb20pO1xuICAgICAgICBpZiAobUZyb20uaXNWYWxpZCgpICE9PSB0cnVlKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0Zyb20gZGF0ZSAnICsgZnJvbSArICcgaXMgbm90IGEgdmFsaWQgZGF0ZS4nKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IG1UbyA9IG1vbWVudCh0byk7XG4gICAgICAgIGlmIChtVG8uaXNWYWxpZCgpICE9PSB0cnVlKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1RvIGRhdGUgJyArIGZyb20gKyAnIGlzIG5vdCBhIHZhbGlkIGRhdGUuJyk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobUZyb20udmFsdWVPZigpID09PSBtVG8udmFsdWVPZigpKSB7XG4gICAgICAgICAgICAvLyBVc2VyIHByb2JhYmx5IG1lYW50IGF0IHRoZSBwb2ludCBpbiB0aW1lLlxuICAgICAgICAgICAgLy8gUHVzaCB0aGUgJ3RvJyBkYXRldGltZSBieSAxIG1zIGxhdGVyIHNvIFdpZGVTa3kgd2lsbCBtYXRjaCBzb21ldGhpbmcsIG90aGVyd2lzZVxuICAgICAgICAgICAgLy8gc3VjaCBxdWVyeSBpcyBnb2luZyB0byByZXR1cm4gbm90aGluZy5cbiAgICAgICAgICAgIG1Uby5hZGQoMSwgJ21zJyk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIHByZXNpZ25lZCAhPT0gJ2Jvb2xlYW4nKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1ByZXNpZ25lZCBmbGFnIG11c3QgYmUgYSBib29sZWFuIHZhbHVlLicpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHByZXNpZ25lZCA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmVzaWduRXhwaXJ5ICE9PSAnbnVtYmVyJykge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignUHJlc2lnbkV4cGlyeSB2YWx1ZSAnICsgcHJlc2lnbkV4cGlyeSArICcgbXVzdCBiZSBhIG51bWJlcicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAocHJlc2lnbkV4cGlyeSA8IDApIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1ByZXNpZ25FeHBpcnkgdmFsdWUgJyArIHByZXNpZ25FeHBpcnkgKyAnIG11c3QgYmUgZ3JlYXRlciB0aGFuIHplcm8uJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5zdWJtaXRSZXF1ZXN0KFxuICAgICAgICAgICAgJ0dFVCcsXG4gICAgICAgICAgICAnL2FwaS9maWxlL3N0b3JhZ2UnLFxuICAgICAgICAgICAge30sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgICAgICAgICAgIHBvaW50SWRzOiBKU09OLnN0cmluZ2lmeShwb2ludElkcyksXG4gICAgICAgICAgICAgICAgICAgIGZyb206IG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kuaXNBcnJheShwb2ludElkcykpKSB7XG4gICAgICAgICAgICBwb2ludElkcyA9IFtwb2ludElkc107XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCByb3dzID0gcG9pbnRJZHMubWFwKChpZCkgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHtpZDogYHI6JHtpZH1gfTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuc3VibWl0UmVxdWVzdChcbiAgICAgICAgICAgICdQT1NUJyxcbiAgICAgICAgICAgICcvYXBpL3dhdGNoU3ViJyxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBtZXRhOiB7XG4gICAgICAgICAgICAgICAgICAgIHZlcjogJzIuMCcsXG4gICAgICAgICAgICAgICAgICAgIHdhdGNoRGlzOiBgczoke2Rlc2NyaXB0aW9ufWAsXG4gICAgICAgICAgICAgICAgICAgIGxlYXNlOiBsZWFzZVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY29sczogW1xuICAgICAgICAgICAgICAgICAgICB7bmFtZTogJ2lkJ31cbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIHJvd3M6IHJvd3NcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb25maWdcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBJbml0aWF0ZSBhIGhheXN0YWNrIHdhdGNoU3ViIG9wIHRvIGV4dGVuZCBhIHdhdGNoIGdpdmVuIHRoZSB3YXRjaElkXG4gICAgICogYW5kIGxlYXNlLlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSB3YXRjaElkIElEIG9mIHRoZSBvcGVuZWQgd2F0Y2guXG4gICAgICogQHBhcmFtIHsqfSBwb2ludElkcyBTdHJpbmcgb3IgQXJyYXkuIFRoZSBwb2ludHMuXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGxlYXNlIER1cmF0aW9uIChtcykgdGhlIHdhdGNoIHdhcyBjcmVhdGVkIHdpdGguXG4gICAgICogQHBhcmFtIHtPYmplY3R9IGNvbmZpZyBDb25maWd1cmF0aW9uIG9wdGlvbnMgdXNlZCBpbiBgc3VibWl0UmVxdWVzdCgpYFxuICAgICAqIEByZXR1cm5zIFByb21pc2VcbiAgICAgKi9cbiAgICB3YXRjaEV4dGVuZCh3YXRjaElkLCBwb2ludElkcywgbGVhc2UsIGNvbmZpZyA9IHt9KSB7XG4gICAgICAgIGlmICghKEFycmF5LmlzQXJyYXkocG9pbnRJZHMpKSkge1xuICAgICAgICAgICAgcG9pbnRJZHMgPSBbcG9pbnRJZHNdO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3Qgcm93cyA9IHBvaW50SWRzLm1hcCgoaWQpID0+IHtcbiAgICAgICAgICAgIHJldHVybiB7aWQ6IGByOiR7aWR9YH07XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiB0aGlzLnN1Ym1pdFJlcXVlc3QoXG4gICAgICAgICAgICAnUE9TVCcsXG4gICAgICAgICAgICAnL2FwaS93YXRjaFN1YicsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgbWV0YToge1xuICAgICAgICAgICAgICAgICAgICB2ZXI6ICcyLjAnLFxuICAgICAgICAgICAgICAgICAgICB3YXRjaElkOiBgczoke3dhdGNoSWR9YCxcbiAgICAgICAgICAgICAgICAgICAgbGVhc2U6IGxlYXNlXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICBjb2xzOiBbe25hbWU6ICdpZCd9XSxcbiAgICAgICAgICAgICAgICByb3dzOiByb3dzXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY29uZmlnXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogSW5pdGlhdGUgYSB3YXRjaFVuc3ViIG9wIHVzaW5nIHRoZSBnaXZlbiB3YXRjaElkLlxuICAgICAqIElmIGRlbGV0ZVBvaW50SWRzIGlzIHNldCwgdGhlbiB0aGUgbGlzdGVkIHBvaW50cyB3aWxsIGJlIHJlbW92ZWRcbiAgICAgKiBmcm9tIHRoZSB3YXRjaC5cbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gd2F0Y2hJZCBJRCBvZiB0aGUgb3BlbmVkIHdhdGNoLlxuICAgICAqIEBwYXJhbSB7Kn0gZGVsZXRlUG9pbnRJZHMgU3RyaW5nIG9yIEFycmF5LiBUaGUgcG9pbnRzIHRvIGJlIGRlbGV0ZWQuXG4gICAgICogQHBhcmFtIHtib29sZWFufSBjbG9zZSBJZiB0cnVlLCB0aGUgd2F0Y2ggc2Vzc2lvbiB3aWxsIGJlIGNsb3NlZC5cbiAgICAgKiBAcGFyYW0ge09iamVjdH0gY29uZmlnIENvbmZpZ3VyYXRpb24gb3B0aW9ucyB1c2VkIGluIGBzdWJtaXRSZXF1ZXN0KClgXG4gICAgICogQHJldHVybnMgUHJvbWlzZVxuICAgICAqL1xuICAgIHdhdGNoVW5zdWIod2F0Y2hJZCwgZGVsZXRlUG9pbnRJZHMsIGNsb3NlID0gdHJ1ZSwgY29uZmlnID0ge30pIHtcbiAgICAgICAgaWYgKCEoQXJyYXkuaXNBcnJheShkZWxldGVQb2ludElkcykpKSB7XG4gICAgICAgICAgICBkZWxldGVQb2ludElkcyA9IFtkZWxldGVQb2ludElkc107XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBwYXlsb2FkID0ge1xuICAgICAgICAgICAgbWV0YToge1xuICAgICAgICAgICAgICAgIHZlcjogJzIuMCcsXG4gICAgICAgICAgICAgICAgd2F0Y2hJZDogYHM6YCArIHdhdGNoSWQsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY29sczogW10sXG4gICAgICAgICAgICByb3dzOiBbXVxuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChkZWxldGVQb2ludElkcy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBwYXlsb2FkLmNvbHMucHVzaCh7bmFtZTogJ2lkJ30pO1xuXG4gICAg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92YWwgPT09ICd0b2RheScgfHxcbiAgICAgICAgICAgICAgcmFuZ2VfdmFsID09PSAneWVzdGVyZGF5JykpIHtcblxuICAgICAgICAgICAgaWYgKHJhbmdlX3ZhbC5pbmNsdWRlcygnLCcpKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgcmFuZ2VzID0gcmFuZ2VfdmFsLnNwbGl0KCcsJyk7XG5cbiAgICAgICAgICAgICAgICAvLyBTaG91bGQgbm90IGJlIG1vcmUgb3IgbGVzcyB0aGFuIDIgZGF0ZSh0aW1lKSB2YWx1ZXMgaW4gYSByYW5nZS5cbiAgICAgICAgICAgICAgICBpZiAocmFuZ2VzLmxlbmd0aCAhPT0gMikge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IocmFuZ2VfZXJyICsgJ051bWJlciBvZiB0aW1lc3RhbXBzIGNhbm5vdCBleGNlZWQgMi4nKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHRzIGluIHJhbmdlcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmFuZ2VzW3RzXS5pbmNsdWRlcygnICcpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByYW5nZXNbdHNdID0gcmFuZ2VzW3RzXS50cmltU3RhcnQoKS5zcGxpdCgnICcpWzBdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghbW9tZW50KHJhbmdlc1t0c10udHJpbSgpLCBtb21lbnQuSVNPXzg2MDEpLmlzVmFsaWQoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKHJhbmdlX2VyciArICdJbnZhbGlkIElTTzg2MDEgdGltZXN0YW1wLicpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICghbW9tZW50KHJhbmdlX3ZhbCwgbW9tZW50LklTT184NjAxKS5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKHJhbmdlX2VyciArICdJbnZhbGlkIElTTzg2MDEgdGltZXN0YW1wLicpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIE5vcm1hbGlzZSB0aGUgSURzIGludG8gc3RhbmRhcmQgZm9ybVxuICAgICAgICBpZHMgPSBpZHMubWFwKGZ1bmN0aW9uIChpZCkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBkYXRhLlJlZihpZCkudG9IU0pTT04oKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gQnVpbGQgcmVxdWVzdCBib2R5XG4gICAgICAgIGNvbnN0IHBheWxvYWQgPSB7XG4gICAgICAgICAgICBtZXRhOiB7XG4gICAgICAgICAgICAgICAgdmVyOiAnMi4wJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb2xzOiBbXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBuYW1lOiAncmFuZ2UnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgcm93czogW1xuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2U6IHJhbmdlLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBdLFxuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChpZHMubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICBwYXlsb2FkLnJvd3NbMF0uaWQgPSBuZXcgZGF0YS5SZWYoaWRzWzBdKS50b0hTSlNPTigpO1xuICAgICAgICAgICAgcGF5bG9hZC5jb2xzLnB1c2goe25hbWU6ICdpZCd9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlkcy5mb3JFYWNoKChpZCwgaWR4KSA9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ICAgICAgICAgIHNpemU6IG5leHQubGVuZ3RoXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dDogW3RyYW5zZm9ybWVyKG5leHQpLCAuLi5jbGllbnRBcmdzXSxcbiAgICAgICAgICAgICAgICAgICAgc2l6ZTogbmV4dC5sZW5ndGhcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBoYXNNb3JlID0gKCkgPT4gcGF5bG9hZC5sZW5ndGggPiAwO1xuXG4gICAgICAgIGlmICh0aGlzLmlzUHJvZ3Jlc3NFbmFibGVkKSB7XG4gICAgICAgICAgICBwMSA9IHRoaXMucHJvZ3Jlc3NDcmVhdGUocGF5bG9hZC5sZW5ndGgpO1xuICAgICAgICB9XG4gICAgfSBlbHNlIGlmICh0eXBlb2YgcGF5bG9hZCA9PT0gXCJvYmplY3RcIikge1xuICAgICAgICAvLyBjaGVjayBpZiBzdHJ1Y3R1cmUgaXMgYXMgZXhwZWN0ZWRcbiAgICAgICAgZm9yIChjb25zdCBba2V5LCB2YWx1ZUFzT2JqZWN0XSBvZiBPYmplY3QuZW50cmllcyhwYXlsb2FkKSkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBwYXlsb2FkICE9PSBcIm9iamVjdFwiKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiT2JqZWN0IHBheWxvYWQgc3RydWN0dXJlIGZvciBiYXRjaCBvcGVyYXRpb24gaXMgbWFsZm9ybWVkXCIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgcGF5bG9hZEtleXMgPSBPYmplY3Qua2V5cyhwYXlsb2FkKTtcbiAgICAgICAgY29uc3Qga2V5VmFsdWVMZW5ndGggPSBwYXlsb2FkS2V5cy5tYXAoKGtleSkgPT4gT2JqZWN0LmtleXMocGF5bG9hZFtrZXldKS5sZW5ndGgpO1xuICAgICAgICBjb25zdCBrZXlWYWx1ZVJlbWFpbmluZyA9IFsuLi5rZXlWYWx1ZUxlbmd0aF07XG4gICAgICAgIGxldCBjdXJyS2V5SW5kZXggPSAwO1xuICAgICAgICBnZXROZXh0ID0gKCkgPT4ge1xuICAgICAgICAgICAgLy8gZ2V0IG5leHQgc2V0IHVzaW5nIGJhdGNoU2l6ZSBhcyBtYXhpbXVtIG51bWJlciBvZiByb3dzLCBub3QgaW5jbHVzaXZlIG9mIHRoZSBrZXlcbiAgICAgICAgICAgIGNvbnN0IG5leHQgPSB7fTtcbiAgICAgICAgICAgIGxldCB0b3RhbFJvd3MgPSAwO1xuICAgICAgICAgICAgd2hpbGUgKHRvdGFsUm93cyA8IGJhdGNoU2l6ZSAmJiBjdXJyS2V5SW5kZXggPCBwYXlsb2FkS2V5cy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBpZiAoa2V5VmFsdWVSZW1haW5pbmdbY3VycktleUluZGV4XSA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBhbGwgZGF0YSBmZXRjaGVkIGZyb20gaGVyZVxuICAgICAgICAgICAgICAgICAgICBjdXJyS2V5SW5kZXgrKztcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29uc3QgY3VycktleSA9IHBheWxvYWRLZXlzW2N1cnJLZXlJbmRleF07XG4gICAgICAgICAgICAgICAgY29uc3QgY3VycktleUVudHJpZXMgPSBPYmplY3QuZW50cmllcyhwYXlsb2FkW2N1cnJLZXldKTtcbiAgICAgICAgICAgICAgICBjb25zdCBrZXlSZW1haW5pbmcgPSBrZXlWYWx1ZVJlbWFpbmluZ1tjdXJyS2V5SW5kZXhdO1xuICAgICAgICAgICAgICAgIGNvbnN0IGtleU1heCA9IGtleVZhbHVlTGVuZ3RoW2N1cnJLZXlJbmRleF1cbiAgICAgICAgICAgICAgICBjb25zdCBrZXlWYWx1ZVN0YXJ0RnJvbSA9IGtleU1heCAtIGtleVJlbWFpbmluZztcbiAgICAgICAgICAgICAgICBpZiAoY3VycktleUVudHJpZXMubGVuZ3RoID4gKGJhdGNoU2l6ZSAtIHRvdGFsUm93cykgfHwga2V5VmFsdWVTdGFydEZyb20gIT09IE9iamVjdC5rZXlzKHBheWxvYWRbY3VycktleV0pLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAvLyB0YWtlIHBhcnQgb2YgdGhlIHNldCB0aGF0IGRvZXNuJ3QgZXhjZWVkIHRoZSBjdXJyZW50IGJhdGNoIHNpemVcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRbY3VycktleV0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dFtjdXJyS2V5XSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IHRha2VuID0gMDtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcGFydFRha2UgPSBiYXRjaFNpemUgLSB0b3RhbFJvd3M7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSBrZXlWYWx1ZVN0YXJ0RnJvbTsgaSAtIGtleVZhbHVlU3RhcnRGcm9tIDwgcGFydFRha2UgJiYgaSA8IGtleU1heDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0W2N1cnJLZXldW2N1cnJLZXlFbnRyaWVzW2ldWzBdXSA9IGN1cnJLZXlFbnRyaWVzW2ldWzFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGFrZW4rKztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBrZXlWYWx1ZVJlbWFpbmluZ1tjdXJyS2V5SW5kZXhdIC09IHRha2VuO1xuICAgICAgICAgICAgICAgICAgICB0b3RhbFJvd3MgKz0gdGFrZW47XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dFtjdXJyS2V5XSA9IHBheWxvYWRbY3VycktleV07XG4gICAgICAgICAgICAgICAgICAgIGtleVZhbHVlUmVtYWluaW5nW2N1cnJLZXlJbmRleF0gPSAwO1xuICAgICAgICAgICAgICAgICAgICB0b3RhbFJvd3MgKz0gY3VycktleUVudHJpZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBjdXJyS2V5SW5kZXgrKztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgbmV4dDogW3RyYW5zZm9ybWVyKG5leHQpLCAuLi5jbGllbnRBcmdzXSxcbiAgICAgICAgICAgICAgICBzaXplOiB0b3RhbFJvd3NcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgaGFzTW9yZSA9ICgpID0+IHtcbiAgICAgICAgICAgIC8vIHNraXAgb3ZlciBlbXB0eSBkYXRhIHNldHNcbiAgICAgICAgICAgIHdoaWxlIChjdXJyS2V5SW5kZXggPCBwYXlsb2FkS2V5cy5sZW5ndGggJiYga2V5VmFsdWVSZW1haW5pbmdbY3VycktleUluZGV4XSA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGN1cnJLZXlJbmRleCsrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJLZXlJbmRleCAhPT0gcGF5bG9hZEtleXMubGVuZ3RoICYmIGtleVZhbHVlTGVuZ3RoW2N1cnJLZXlJbmRleF0gIT09IDBcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAodGhpcy5pc1Byb2dyZXNzRW5hYmxlZCkge1xuICAgICAgICAgICAgcDEgPSB0aGlzLnByb2dyZXNzQ3JlYXRlKE9iamVjdC5rZXlzKHBheWxvYWQpLmxlbmd0aCk7XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICB0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vciBhbGxcbiAgICAgICAgICAgICAgICAvLyBmdW5jdGlvbiB0aGF0IHVzZSBXaWRlU2t5Q2xpZW50LmJhdGNoLmhpc1JlYWRcbiAgICAgICAgICAgICAgICByZXMucm93cy5zb3J0KChyb3dBLCByb3dCKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHRpbWVBID0gRGF0ZS5wYXJzZShIcy5yZW1vdmVQcmVmaXgocm93QS50cykpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCB0aW1lQiA9IERhdGUucGFyc2UoSHMucmVtb3ZlUHJlZml4KHJvd0IudHMpKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodGltZUEgPiB0aW1lQikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGltZUEgPCB0aW1lQikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yIChjb25zdCByb3cgb2YgcmVzLnJvd3MpIHtcbiAgICAgICAgICAgICAgICBjb25zdCB7IHRzIH0gPSByb3c7XG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBbdklkLCB2YWxdIG9mIE9iamVjdC5lbnRyaWVzKHJvdykpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZJZCA9PT0gXCJ0c1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gTnVtYmVyKHZJZC5zbGljZSgxKSk7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdEJ5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bmVkO1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJNYXggPT09IGJhdGNoU2l6ZSkge1xuICAgICAgICAgICAgICAgIC8vIGFscmVhZHkgYXQgbWF4aW11bSBiYXRjaCBzaXplXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgZ2V0RGF0YUNvdW50ID0gZGF0YVNldC5tYXAoKGRhdGEpID0+XG4gICAgICAgICAgICByb3dzQmV0d2VlblJhbmdlKGRhdGEsIGdyYWJGcm9tLCBzb3J0QnlSYW5nZVtpXSkpO1xuICAgICAgICBjb25zdCBtYXhEYXRhQ291bnQgPSBNYXRoLm1heCguLi5nZXREYXRhQ291bnQpO1xuICAgICAgICBpZiAobWF4RGF0YUNvdW50ID09PSBiYXRjaFNpemUpIHtcbiAgICAgICAgICAgIC8vIHdlJ3JlIGF0IG1heFxuICAgICAgICAgICAgZGVsZXRlUm93Q291bnRzID0gZ2V0RGF0YUNvdW50O1xuICAgICAgICAgICAgY3VyTWF4ID0gbWF4RGF0YUNvdW50O1xuICAgICAgICAgICAgZW5kUmFuZ2UgPSBzb3J0QnlSYW5nZVtpXTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9IGVsc2UgaWYgKGJhdGNoU2l6ZSA+PSBtYXhEYXRhQ291bnQgJiYgbWF4RGF0YUNvdW50ID4gY3VyTWF4ICkge1xuICAgICAgICAgICAgZGVsZXRlUm93Q291bnRzID0gZ2V0RGF0YUNvdW50O1xuICAgICAgICAgICAgY3VyTWF4ID0gbWF4RGF0YUNvdW50O1xuICAgICAgICAgICAgZW5kUmFuZ2UgPSBzb3J0QnlSYW5nZVtpXTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB7IGVuZFJhbmdl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VEVSX1NDSEVNQS52YWxpZGF0ZShvcHRpb25zKTtcbiAgICBvcHRpb25zID0gZGVyaXZlRnJvbURlZmF1bHRzKHRoaXMuY2xpZW50T3B0aW9ucy5iYXRjaC51cGRhdGVCeUZpbHRlciwgb3B0aW9ucyk7XG4gICAgY29uc3QgeyBsaW1pdCB9ID0gb3B0aW9ucztcblxuICAgIGxldCBlbnRpdGllcztcbiAgICB0cnkge1xuICAgICAgICBlbnRpdGllcyA9IGF3YWl0IHRoaXMudjIuZmluZChmaWx0ZXIsIGxpbWl0KTtcbiAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgc3VjY2VzczogW10sXG4gICAgICAgICAgICBlcnJvcnM6IFt7XG4gICAgICAgICAgICAgICAgZXJyb3I6IGVycm9yLm1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgYXJnczogW1widjIuZmluZFwiLCBmaWx0ZXIsIGxpbWl0XVxuICAgICAgICAgICAgfV1cbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBjb25zdCB1cGRhdGVQYXlsb2FkID0gW107XG4gICAgZm9yIChjb25zdCBlbnRpdHkgb2YgZW50aXRpZXMpIHtcbiAgICAgICAgY29uc3QgbmV3RW50aXR5ID0ge1xuICAgICAgICAgICAgaWQ6IGVudGl0eS5pZFxuICAgICAgICB9O1xuICAgICAgICBmb3IgKGNvbnN0IGNyaXRlcmlhIG9mIGNyaXRlcmlhTGlzdCkge1xuICAgICAgICAgICAgaWYgKGNyaXRlcmlhLmlzVmFsaWQoZW50aXR5KSkge1xuICAgICAgICAgICAgICAgIGNyaXRlcmlhLmFwcGx5Q2hhbmdlcyhuZXdFbnRpdHksIGVudGl0eSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoT2JqZWN0LmtleXMobmV3RW50aXR5KS5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICB1cGRhdGVQYXlsb2FkLnB1c2gobmV3RW50a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m11bHRpRmluZChpZHNGaWx0ZXIpO1xuICAgIGlmIChmaW5kRXJyb3JzLmxlbmd0aCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgc3VjY2VzczogW10sXG4gICAgICAgICAgICBlcnJvcnM6IGZpbmRFcnJvcnNcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGVudGl0aWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIGlmIChza2lwSW5kZXhbaV0pIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgZW50aXR5ID0gZW50aXRpZXNbaV07XG4gICAgICAgIGNvbnN0IGV4aXN0aW5nRW50aXR5ID0gY3VycmVudEVudGl0aWVzW2ldWzBdO1xuXG4gICAgICAgIGlmIChleGlzdGluZ0VudGl0eSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBjcmVhdGVQYXlsb2FkLnB1c2goZW50aXR5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IGVudGl0eVVwZGF0ZSA9IGNyZWF0ZVVwZGF0ZVBheWxvYWQoZXhpc3RpbmdFbnRpdHksIGVudGl0eSwgdGhpcy5sb2dnZXIpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzKGVudGl0eVVwZGF0ZSkubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgIHVwZGF0ZVBheWxvYWQucHVzaChlbnRpdHlVcGRhdGUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBub3RoaW5nIGhhcyBjaGFuZ2VkXG4gICAgICAgICAgICAgICAgaWYgKHJldHVyblJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm5lZEVudGl0aWVzLnB1c2goZW50aXR5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1c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qL1xuICAgICAgICAgICAgaWYgKCh0eXBlb2Ygc3RyLnZhbHVlKSAhPT0gJ251bWJlcicpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICAnY2xvbmVlIFxcJ3ZhbHVlXFwnIHByb3BlcnR5IG11c3QgYmUgYSBudW1iZXInKTtcblxuICAgICAgICAgICAgaWYgKHN0ci51bml0ICYmICgodHlwZW9mIHN0ci51bml0KSAhPT0gJ3N0cmluZycpKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgJ2Nsb25lZSBcXCd1bml0XFwnIHByb3BlcnR5IG11c3QgYmUgYSBzdHJpbmcgb3IgdW5kZWZpbmVkJ1xuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIHRoaXMudmFsdWUgPSBzdHIudmFsdWU7XG4gICAgICAgICAgICB0aGlzLnVuaXQgPSBzdHIudW5pdDtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2Ygc3RyID09PSAnbnVtYmVyJykge1xuICAgICAgICAgICAgLyogQ2FzdCBjb25zdHJ1Y3RvciAqL1xuICAgICAgICAgICAgdGhpcy52YWx1ZSA9IHN0cjtcbiAgICAgICAgICAgIHRoaXMudW5pdCA9IHVuaXQgfHwgdW5kZWZpbmVkO1xuICAgICAgICB9IGVsc2UgaWYgKHN0ci5zdGFydHNXaXRoKCduOicpKSB7XG4gICAgICAgICAgICBjb25zdCBzcGFjZSA9IHN0ci5pbmRleE9mKCcgJyk7XG4gICAgICAgICAgICBsZXQgc3RyTnVtID0gbnVsbDtcbiAgICAgICAgICAgIGxldCB1bml0ID0gdW5kZWZpbmVkO1xuXG4gICAgICAgICAgICBpZiAoc3BhY2UgPj0gMCkge1xuICAgICAgICAgICAgICAgIHN0ck51bSA9IHN0ci5zdWJzdHJpbmcoMixzcGFjZSk7XG4gICAgICAgICAgICAgICAgdW5pdCA9IHN0ci5zdWJzdHJpbmcoc3BhY2UrMSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHN0ck51bSA9IHN0ci5zdWJzdHJpbmcoMik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChzdHJOdW0uaW5kZXhPZignLicpID49IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZhbHVlID0gTnVtYmVyLnBhcnNlRmxvYXQoc3RyTnVtKTtcbiAgICAgICAgICAgICAgICB0aGlzLnVuaXQgPSB1bml0O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZhbHVlID0gTnVtYmVyLnBhcnNlSW50KHN0ck51bSk7XG4gICAgICAgICAgICAgICAgdGhpcy51bml0ID0gdW5pdDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBtID0gc3RyLm1hdGNoKEhTX1pJTkNfTlVNKTtcbiAgICAgICAgICAgIGlmIChtWzFdLmluZGV4T2YoJy4nKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy52YWx1ZSA9IE51bWJlci5wYXJzZUZsb2F0KG1bMV0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZhbHVlID0gTnVtYmVyLnBhcnNlSW50KG1bMV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy51bml0ID0gKG1bMl0gfHwgdW5kZWZpbmVkKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEVtaXQgUHJvamVjdCBIYXlzdGFjayBKU09OLlxuICAgICAqL1xuICAgIHRvSFNKU09OKCkge1xuICAgICAgICBsZXQgcmVzID0gJ246JyArIHRoaXMudmFsdWUudG9TdHJpbmcoKTtcbiAgICAgICAgaWYgKHRoaXMudW5pdCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXMgKz0gJyAnIC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PSB1bmRlZmluZWQpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjbG9uZSBjb25zdHJ1Y3RvciB0YWtlcyBhIFJlZiBvbmx5Jyk7XG5cbiAgICAgICAgICAgIGlmICgodHlwZW9mIGlkLmlkKSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICAnY2xvbmVlIG9iamVjdCBcXCdpZFxcJyBwcm9wZXJ0eSBtdXN0IGJlIGEgc3RyaW5nJ1xuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIGlmIChpZC5kaXMgJiYgKCh0eXBlb2YgaWQuZGlzKSAhPT0gJ3N0cmluZycpKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgJ2Nsb25lZSBvYmplY3QgXFwnZGlzXFwnIHByb3BlcnR5IG11c3QgYmUgbnVsbCBvciBhIHN0cmluZydcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICB0aGlzLmlkID0gaWQuaWQ7XG4gICAgICAgICAgICB0aGlzLmRpcyA9IGlkLmRpcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8qIGlkIG11c3QgYmUgYSBzdHJpbmcgKi9cbiAgICAgICAgICAgIGlmICgodHlwZW9mIGlkKSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdpZCBpcyBub3QgYSBzdHJpbmcnKTtcblxuICAgICAgICAgICAgdmFyIHNwYWNlID0gaWQuaW5kZXhPZignICcpO1xuICAgICAgICAgICAgaWYgKHNwYWNlID49IDApIHtcbiAgICAgICAgICAgICAgICBpZiAoZGlzICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdpZCBtYXkgbm90IGNvbnRhaW4gc3BhY2VzJyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLyogU3BsaXQgb24gdGhlIHNwYWNlICovXG4gICAgICAgICAgICAgICAgZGlzID0gaWQuc3Vic3RyaW5nKHNwYWNlKzEpO1xuICAgICAgICAgICAgICAgIGlkID0gaWQuc3Vic3RyaW5nKDAsIHNwYWNlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGlkLnN0YXJ0c1dpdGgodGhpcy5IU19KU09OX1BSRUZJWCkpIHtcbiAgICAgICAgICAgICAgICAvKiBKU09OIFJlZiAqL1xuICAgICAgICAgICAgICAgIHRoaXMuaWQgPSBpZC5zdWJzdHJpbmcoMik7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlkLnN0YXJ0c1dpdGgodGhpcy5IU19aSU5DX1BSRUZJWCkpIHtcbiAgICAgICAgICAgICAgICAvKiBaSU5DIFJlZiAqL1xuICAgICAgICAgICAgICAgIHRoaXMuaWQgPSBpZC5zdWJzdHJpbmcoMSk7XG4gICAgICAgICAgICAgICAgaWYgKGRpcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIShkaXMuc3RhcnRzV2l0aCgnXCInKSAmJiBkaXMuZW5kc1dpdGgoJ1wiJykpKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdkaXMgbXVzdCBiZSBhIHZhbGlkIFpJTkMgc3RyaW5nJyk7XG4gICAgICAgICAgICAgICAgICAgIGRpcyA9IEpTT04ucGFyc2UoZGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8qIFJhdyBJRCAqL1xuICAgICAgICAgICAgICAgIHRoaXMuaWQgPSBpZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyogRGVzY3JpcHRpdmUgdGV4dCAqL1xuICAgICAgICAgICAgdGhpcy5kaXMgPSBkaXMgfHwgbnVsbDtcbiAgICAgICAg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F0ZXRpbWVFeHByLFxuICAgICAgICB0aW1lem9uZSkge1xuICAgICAgICBtb21lbnQuc3VwcHJlc3NEZXByZWNhdGlvbldhcm5pbmdzID0gdHJ1ZTtcbiAgICAgICAgbGV0IGVwb2NoO1xuICAgICAgICBsZXQgbW9tZW50RGF0ZSA9IG1vbWVudChkYXRldGltZUV4cHIpO1xuXG4gICAgICAgIGlmIChtb21lbnREYXRlLmlzVmFsaWQoKSkge1xuICAgICAgICAgICAgZXBvY2ggPSBtb21lbnREYXRlXG4gICAgICAgICAgICAgICAgICAgICAgLnR6KHRpbWV6b25lKVxuICAgICAgICAgICAgICAgICAgICAgIC50b0lTT1N0cmluZygpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgZXBvY2ggPSBFeHByUGFyc2VyLmFzV2lkZXNreURUKFxuICAgICAgICAgICAgICAgIGRhdGV0aW1lRXhwcixcbiAgICAgICAgICAgICAgICB0aW1lem9uZSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZXBvY2g7XG4gICAgfVxuXG4gICAgLy8gUmV0dXJucyBhbiBlcG9jaCB0aW1lIGJhc2VkIG9uIGFcbiAgICAvLyBnaXZlbiBXaWRlc2t5IGRhdGV0aW1lIGV4cHJlc3Npb24uXG4gICAgLy9cbiAgICAvLyBFeGFtcGxlIHN5bnRheFxuICAgIC8vIG5vdyAtIDFkXG4gICAgLy9cbiAgICAvLyBGaXJzdCBrZXl3b3JkIG11c3QgYmUgbm93LlxuICAgIC8vIEZvbGxvd2VkIGJ5IGVpdGhlclxuICAgIC8vIDEpICsgb3IgLSBzaWduXG4gICAgLy8gMikgLyBzaWduIChzdWZmaXggaW5wdXQpXG4gICAgLy9cbiAgICAvLyBpZiArLy0gc2lnbiB0aGVuIGl0IG11c3QgYmUgZm9sbG93ZWQgYnlcbiAgICAvLyBhIG51bWJlciBhbmQgYSAncycsIGQnLCAnbScgb3IgJ00nXG4gICAgLy8gJ3MnIC0gc2Vjb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tZW50RHQgPSBtb21lbnQoKS50eih0aW1lem9uZSk7XG5cbiAgICAgICAgICAgIHdoaWxlIChFeHByUGFyc2VyLmhhc0NoYXIoY2hhckFyciwgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgICAgaWYgKEV4cHJQYXJzZXIuaXNLZXl3b3JkQWRkKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFycixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICAgICAgICBFeHByUGFyc2VyLmNvbnN1bWVDaGFyKHBvc2l0aW9uKTsgLy8gK1xuICAgICAgICAgICAgICAgICAgICBFeHByUGFyc2VyLmNvbnN1bWVXaGl0ZXNwYWNlcyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIGxldCBudW1iZXJTdHIgPSBFeHByUGFyc2VyLmNvbnN1bWVOdW1iZXJzKFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFyciwgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICghbnVtYmVyU3RyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG5gSW52YWxpZCBkYXRldGltZSBleHByZXNzaW9uICR7ZXhwcn0uXG5FeHBlY3RpbmcgbnVtYmVycyBmb2xsb3dlZCBieSB0aGUgKyBzaWduLmApO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lV2hpdGVzcGFjZXMoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCB1bml0ID0gRXhwclBhcnNlci5jb25zdW1lRGF0ZXRpbWVVbml0KFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFyciwgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICghdW5pdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuYEludmFsaWQgZGF0ZXRpbWUgZXhwcmVzc2lvbiAke2V4cHJ9LlxuTWlzc2luZyB1bml0IGFmdGVyICcrJHtudW1iZXJTdHJ9J2ApO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IG1vbWVudFVuaXQgPSBFeHByUGFyc2VyLnRvTW9tZW50VW5pdCh1bml0KTtcbiAgICAgICAgICAgICAgICAgICAgbW9tZW50RHQuYWRkKFxuICAgICAgICAgICAgICAgICAgICAgICAgTnVtYmVyLnBhcnNlSW50KG51bWJlclN0ciksIG1vbWVudFVuaXQpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChFeHByUGFyc2VyLmhhc0NoYXIoY2hhckFyciwgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoRXhwclBhcnNlci5pc0tleXdvcmRTdWZmaXhJbmQoY2hhckFyciwgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lQ2hhcihwb3NpdGlvbik7IC8vIHRoZSAvIGNoYXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHByUGFyc2VyLmNvbnN1bWVXaGl0ZXNwYWNlcyhjaGFyQXJyLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN1ZmZpeFVuaXQgPSBFeHByUGFyc2VyLmNvbnN1bWVEYXRldGltZVVuaXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChFeHByUGFyc2VyLmhhc0NoYXIoY2hhckFyciwgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbmBJbnZhbGlkIGRhdGV0aW1lIGV4cHJlc3Npb24gJHtleHByfS5cblVuZXhwZWN0ZWQgdmFsdWUgZm91bmQgYWZ0ZXIgLyR7c3VmZml4VW5pdH0uYCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN1ZmZpeE1Vbml0ID0gRXhwclBhcnNlci50b01vbWVudFVuaXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1ZmZpeFVuaXQpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9tZW50RHQuc3RhcnRPZihzdWZmaXhNVW5pdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG5gSW52YWxpZCBkYXRldGltZSBleHByZXNzaW9uICR7ZXhwcn0uXG5FeHBlY3RpbmcgYSBkYXRldGltZSB1bml0IGFmdGVyIHRoZSAnLycgY2hhci5gKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChFeHByUGFyc2VyLmlzS2V5d29yZFN1YihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lQ2hhcihwb3NpdGlvbik7IC8vIC1cbiAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lV2hpdGVzcGFjZXMoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBudW1iZXJTdHIgPSBFeHByUGFyc2VyLmNvbnN1bWVOdW1iZXJzKFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFyciwgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICghbnVtYmVyU3RyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG5gSW52YWxpZCBkYXRldGltZSBleHByZXNzaW9uICR7ZXhwcn0uXG5FeHBlY3RpbmcgbnVtYmVycyBmb2xsb3dlZCBieSB0aGUgLSBzaWduLmApO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lV2hpdGVzcGFjZXMoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCB1bml0ID0gRXhwclBhcnNlci5jb25zdW1lRGF0ZXRpbWVVbml0KFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFyciwgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICghdW5pdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuYEludmFsaWQgZGF0ZXRpbWUgZXhwcmVzc2lvbiAke2V4cHJ9LlxuTWlzc2luZyB1bml0IGFmdGVyICctJHtudW1iZXJTdHJ9J2ApO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IG1vbWVudFVuaXQgPSBFeHByUGFyc2VyLnRvTW9tZW50VW5pdCh1bml0KTtcbiAgICAgICAgICAgICAgICAgICAgbW9tZW50RHQuc3VidHJhY3QoXG4gICAgICAgICAgICAgICAgICAgICAgICBOdW1iZXIucGFyc2VJbnQobnVtYmVyU3RyKSwgbW9tZW50VW5pdCk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKEV4cHJQYXJzZXIuaGFzQ2hhcihjaGFyQXJyLCBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChFeHByUGFyc2VyLmlzS2V5d29yZFN1ZmZpeEluZChjaGFyQXJyLCBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHByUGFyc2VyLmNvbnN1bWVDaGFyKHBvc2l0aW9uKTsgLy8gdGhlIC8gY2hhclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4cHJQYXJzZXIuY29uc3VtZVdoaXRlc3BhY2VzKGNoYXJBcnIsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3VmZml4VW5pdCA9IEV4cHJQYXJzZXIuY29uc3VtZURhdGV0aW1lVW5pdChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFycixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEV4cHJQYXJzZXIuaGFzQ2hhcihjaGFyQXJyLCBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuYEludmFsaWQgZGF0ZXRpbWUgZXhwcmVzc2lvbiAke2V4cHJ9LlxuVW5leHBlY3RlZCB2YWx1ZSBmb3VuZCBhZnRlciAvJHtzdWZmaXhVbml0fS5gKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3VmZml4TVVuaXQgPSBFeHByUGFyc2VyLnRvTW9tZW50VW5pdChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VmZml4VW5pdCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb21lbnREdC5zdGFydE9mKHN1ZmZpeE1Vbml0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbmBJbnZhbGlkIGRhdGV0aW1lIGV4cHJlc3Npb24gJHtleHByfS5cbkV4cGVjdGluZyBhIGRhdGV0aW1lIHVuaXQgYWZ0ZXIgdGhlICcvJyBjaGFyLmApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKEV4cHJQYXJzZXIuaXNLZXl3b3JkU3VmZml4SW5kKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFycixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICAgICAgICBFeHByUGFyc2VyLmNvbnN1bWVDaGFyKHBvc2l0aW9uKTsgLy8gL1xuICAgICAgICAgICAgICAgICAgICBFeHByUGFyc2VyLmNvbnN1bWVXaGl0ZXNwYWNlcyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWZmaXhVbml0ID0gRXhwclBhcnNlci5jb25zdW1lRGF0ZXRpbWVVbml0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbik7XG5cbiAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lV2hpdGVzcGFjZXMoXG4gICAgICAgICAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWZmaXhNVW5pdCA9IEV4cHJQYXJzZXIudG9Nb21lbnRVbml0KFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VmZml4VW5pdCk7XG5cbiAgICAgICAgICAgICAgICAgICAgbW9tZW50RHQuc3RhcnRPZihzdWZmaXhNVW5pdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG5gSW52YWxpZCBkYXRldGltZSBleHByZXNzaW9uICR7ZXhwcn0uXG5FeHBlY3RpbmcgJysnLCctJyBvciAnLycgc2lnbiBhZnRlciBub3cuYCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gbW9tZW50RHQudG9JU09TdHJpbmcoKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbmBJbnZhbGlkIGRhdGUgdGltZSBleHByZXNzaW9uKCR7ZXhwcn0pLCBpdCBtdXN0IHN0YXJ0IHdpdGgga2V5d29yZCAnbm93J2ApO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgc3RhdGljIGhhc0NoYXIoY2hhckFyciwgcG9zKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSB0cnVlO1xuXG4gICAgICAgIGlmIChjaGFyQXJyW3Bvcy5jdXJyZW50XSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAvLyBubyBtb3JlIGxlZnRcbiAgICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBzdGF0aWMgdG9Nb21lbnRVbml0KGV4cHJVbml0KSB7XG4gICAgICAgIGxldCBtVW5pdDtcblxuICAgICAgICBpZiAoZXhwclVuaXQgPT09ICdtJykge1xuICAgICAgICAgICAgbVVuaXQgPSAnbWludXRlcyc7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoZXhwclVuaXQgPT09ICdzJykge1xuICAgICAgICAgICAgbVVuaXQgPSAnc2Vjb25kcydcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChleHByVW5pdCA9PT0gJ2QnKSB7XG4gICAgICAgICAgICBtVW5pdCA9ICdkYXlzJ1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGV4cHJVbml0ID09PSAnaCcpIHtcbiAgICAgICAgICAgIG1Vbml0ID0gJ2hvdXJzJ1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGV4cHJVbml0ID09PSAnTScpIHtcbiAgICAgICAgICAgIG1Vbml0ID0gJ21vbnRocydcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBtVW5pdDtcbiAgICB9XG5cbiAgICBzdGF0aWMgY29uc3VtZURhdGV0aW1lVW5pdChjaGFyQXJyLCBwb3MpIHtcbiAgICAgICAgbGV0IHVuaXQgPSBudWxsO1xuXG4gICAgICAgIGxldCBjdXJyQ2hhciA9IGNoYXJBcnJbcG9zLmN1cnJlbnRdO1xuXG4gICAgICAgIGlmIChFeHByUGFyc2VyLmlzS2V5d29yZFNlYyhjdXJyQ2hhcikpIHtcbiAgICAgICAgICAgIHVuaXQgPSAncyc7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoRXhwclBhcnNlci5pc0tleXdvcmRNaW4oY3VyckNoYXIpKSB7XG4gICAgICAgICAgICB1bml0ID0gJ20nO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKEV4cHJQYXJzZXIuaXNLZXl3b3JkSG91cihjdXJyQ2hhcikpIHtcbiAgICAgICAgICAgIHVuaXQgPSAnaCc7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoRXhwclBhcnNlci5pc0tleXdvcmREYXkoY3VyckNoYXIpKSB7XG4gICAgICAgICAgICB1bml0ID0gJ2QnO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKEV4cHJQYXJzZXIuaXNLZXl3b3JkTW9udGgoY3VyckNoYXIpKSB7XG4gICAgICAgICAgICB1bml0ID0gJ00nO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLy8gTm9uZSBvZiB0aGUgYWJvdmVcbiAgICAgICAgICAgIHJldHVybiB1bml0O1xuICAgICAgICB9XG5cbiAgICAgICAgRXhwclBhcnNlci5jb25zdW1lQ2hhcihwb3MpO1xuICAgICAgICByZXR1cm4gdW5pdDtcbiAgICB9XG5cbiAgICAvLyByZXR1cm5zIGEgc3RyaW5nIG9mIG51bWJlcnNcbiAgICBzdGF0aWMgY29uc3VtZU51bWJlcnMoY2hhckFyciwgcG9zKSB7XG4gICAgICAgIGxldCBudW1iZXJTdHIgPSAnJztcbiAgICAgICAgbGV0IGNvbnN1bWVkID0gMDtcblxuICAgICAgICBmb3IgKGxldCBpbmRleCA9IHBvcy5jdXJyZW50O1xuICAgICAgICAgICAgaW5kZXggPCBjaGFyQXJyLmxlbmd0aDtcbiAgICAgICAgICAgIGluZGV4ICsrKSB7XG4gICAgICAgICAgICBsZXQgY3VyckNoYXIgPSBjaGFyQXJyW2luZGV4XTtcblxuICAgICAgICAgICAgaWYgKCFpc05hTihjdXJyQ2hhcikpIHtcbiAgICAgICAgICAgICAgICBudW1iZXJTdHIgPSBudW1iZXJTdHIgKyBjdXJyQ2hhcjtcbiAgICAgICAgICAgICAgICBjb25zdW1lZCArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gTm8gbW9yZSBudW1iZXJzXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBwb3MuY3VycmVudCArPSBjb25zdW1lZDtcbiAgICAgICAgcmV0dXJuIG51bWJlclN0cjtcbiAgICB9XG5cbiAgICBzdGF0aWMgY29uc3VtZUNoYXIocG9zaXRpb24pIHtcbiAgICAgICAgcG9zaXRpb24uY3VycmVudCArPSAxO1xuICAgIH1cblxuICAgIHN0YXRpYyBjb25zdW1lV2hpdGVzcGFjZXMoY2hhckFyciwgcG9zKSB7XG4gICAgICAgIGxldCBjb25zdW1lZCA9IDA7XG5cbiAgICAgICAgZm9yIChsZXQgaW5kZXggPSBwb3MuY3VycmVudDtcbiAgICAgICAgICAgIGluZGV4IDwgY2hhckFyci5sZW5ndGg7XG4gICAgICAgICAgICBpbmRleCArKykge1xuICAgICAgICAgICAgbGV0IGN1cnJDaGFyID0gY2hhckFycltpbmRleF07XG5cbiAgICAgICAgICAgIGlmIChjdXJyQ2hhciA9PT0gV0hJVEVTUEFDRSkge1xuICAgICAgICAgICAgICAgIGNvbnN1bWVkICs9IDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBObyBtb3JlIHdoaXRlc3BhY2VcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHBvcy5jdXJyZW50ICs9IGNvbnN1bWVkO1xuICAgIH1cblxuICAgIHN0YXRpYyBpc0tleXdvcmREYXkoY2hhcikge1xuICAgICAgICByZXR1cm4gY2hhciA9PT0gJ2QnO1xuICAgIH1cblxuICAgIHN0YXRpYyBpc0tleXdvcmRTZWMoY2hhcikge1xuICAgICAgICByZXR1cm4gY2hhciA9PT0gJ3MnO1xuICAgIH1cblxuICAgIHN0YXRpYyBpc0tleXdvcmRNaW4oY2hhcikge1xuICAgICAgICByZXR1cm4gY2hhciA9PT0gJ20nO1xuICAgIH1cblxuICAgIHN0YXRpYyBpc0tleXdvcmRIb3VyKGNoYXIpIHtcbiAgICAgICAgcmV0dXJuIGNoYXIgPT09ICdoJztcbiAgICB9XG5cbiAgICBzdGF0aWMgaXNLZXl3b3JkTW9udGgoY2hhcikge1xuICAgICAgICByZXR1cm4gY2hhciA9PT0gJ00nO1xuICAgIH1cblxuICAgIHN0YXRpYyBpc0tleXdvcmRTdWZmaXhJbmQoY2hhckFyciwgcG9zKSB7XG4gICAgICAgIGxldCBpc1N1ZmZpeEluZCA9IGZhbHNlO1xuXG4gICAgICAgIGlmIChjaGFyQXJyW3Bvcy5jdXJyZW50XSA9PT0gJy8nKSB7XG4gICAgICAgICAgICBpc1N1ZmZpeEluZCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaXNTdWZmaXhJbmQ7XG4gICAgfVxuXG4gICAgc3RhdGljIGlzS2V5d29yZEFkZChjaGFyQXJyLCBwb3MpIHtcbiAgICAgICAgbGV0IGlzQWRkaXRpb24gPSBmYWxzZTtcblxuICAgICAgICBpZiAoY2hhckFycltwb3MuY3VycmVudF0gPT09ICcrJykge1xuICAgICAgICAgICAgaXNBZGRpdGlvbiA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaXNBZGRpdGlvbjtcbiAgICB9XG5cbiAgICBzdGF0aWMgaXNLZXl3b3JkU3ViKGNoYXJBcnIsIHBvcykge1xuICAgICAgICBsZXQgaXNTdWJ0cmFjdCA9IGZhbHNlO1xuXG4gICAgICAgIGlmIChjaGFyQXJyW3Bvcy5jdXJyZW50XSA9PT0gJy0nKSB7XG4gICAgICAgICAgICBpc1N1YnRyYWN0ID0gdHJ1ZTtcbiAgICAgICA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dyYXBocWxSZXNwKSkge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBncmFwaHFsUmVzcCA9IEpTT04ucGFyc2UoZ3JhcGhxbFJlc3ApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgLy8gSW52YWxpZCBncmFwaCByZXNwIC0gZG9udCBib3RoZXIgbG9va2luZyBmdXJ0aGVyXG4gICAgICAgICAgICAgICAgYWxpYXNOYW1lID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChhbGlhc05hbWUpIHtcbiAgICAgICAgICAgIGNvbnN0IGFsaWFzTm9kZSA9IHtcbiAgICAgICAgICAgICAgICB0YXJnZXQ6IG51bGwsXG4gICAgICAgICAgICAgICAgcGF0aDogJydcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB3YWxrR3JhcGgoZmFsc2UsIGFsaWFzTmFtZSwgZ3JhcGhxbFJlc3AsICcnLCBhbGlhc05vZGUpO1xuXG4gICAgICAgICAgICBpZiAoYWxpYXNOb2RlLnRhcmdldCkge1xuICAgICAgICAgICAgICAgIHdhbGtHcmFwaCh0cnVlLFxuICAgICAgICAgICAgICAgICAgICBUSU1FU0VSSUVTX05PREVfTkFNRSwgYWxpYXNOb2RlLnRhcmdldCwgJycsIGZvdW5kKTtcblxuICAgICAgICAgICAgICAgIGlmIChmb3VuZC50YXJnZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gQ29tYmluZSB0aGUgMiBmb3VuZCBwYXRocyB0b2dldGhlci5cbiAgICAgICAgICAgICAgICAgICAgZm91bmQucGF0aCA9IGFsaWFzTm9kZS5wYXRoLnJlcGxhY2UoYWxpYXNOYW1lLCAnJykgKyBmb3VuZC5wYXRoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBmb3VuZD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WUpO1xuICAgICAgICBpZiAoIV8uc3RhcnRzV2l0aCh2YXJuYW1lLCAnJCcpKSB7XG4gICAgICAgICAgICB2YXJuYW1lID0gYFxcJCR7dmFybmFtZX1gO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRm9yd2FyZCBzbGFzaCB0aGUgJCBjaGFyYWN0ZXIgZm9yIHJlZ2V4cHIsXG4gICAgICAgIHZhcm5hbWUgPSBcIlxcXFxcIiArIHZhcm5hbWU7XG4gICAgICAgIGNvbnN0IHBhdHRlcm4gPSBuZXcgUmVnRXhwKHZhcm5hbWUsICdnJyk7XG5cbiAgICAgICAgcmV0dXJuIHF1ZXJ5LnJlcGxhY2UocGF0dGVybiwgdmFydmFsKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBTdWJzdGl0dXRlIHRpbWUgdmFyaWFibGVzXG4gICAgICogJGZyb20gYW5kICR0b1xuICAgICAqKi9cbiAgICBzdGF0aWMgdGltZVZhcnMoXG4gICAgICAgIHF1ZXJ5LFxuICAgICAgICBmcm9tLFxuICAgICAgICB0bykge1xuICAgICAgICByZXR1cm4gXy5yZXBsYWNlKHF1ZXJ5LFxuICAgICAgICAgICAgRklORF9ISVNUT1JZX0lOUFVULFxuICAgICAgICAgICAgKGhpc3RJbnB1dCkgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChmcm9tKSB7XG4gICAgICAgICAgICAgICAgICAgIGhpc3RJbnB1dCA9IF8ucmVwbGFjZShcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpc3RJbnB1dCxcbiAgICAgICAgICAgICAgICAgICAgICAgICckZnJvbScsXG4gICAgICAgICAgICAgICAgICAgICAgICBmcm9tKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAodG8pIHtcbiAgICAgICAgICAgICAgICAgICAgaGlzdElucHV0ID0gXy5yZXBsYWNlKFxuICAgICAgICAgICAgICAgICAgICAgICAgaGlzdElucHV0LFxuICAgICAgICAgICAgICAgIC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BkZXJpdmVGcm9tRGVmYXVsdHMoZGVmYXVsdENvbmZpZywgcGFzc2VkQ29uZmlnKSB7XG4gICAgZm9yIChjb25zdCBba2V5LCB2YWx1ZV0gb2YgT2JqZWN0LmVudHJpZXMoZGVmYXVsdENvbmZpZykpIHtcbiAgICAgICAgaWYgKHBhc3NlZENvbmZpZ1trZXldID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHBhc3NlZENvbmZpZ1trZXldID0gdmFsdWU7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcGFzc2VkQ29uZmlnO1xufVxuXG4vLyBQcm9wZXJ0aWVzXG5jb25zdCBMSU1JVF9QUk9QRVJUWSA9IHtcbiAgICBsaW1pdDogeXVwLm51bWJlcigpXG4gICAgICAgIC5udWxsYWJsZSgpXG4gICAgICAgIC5ub3RSZXF1aXJlZCgpXG4gICAgICAgIC5kZWZhdWx0KDApXG4gICAgICAgIC5zdHJpY3QoKVxuICAgICAgICAubWluKDApXG59O1xuXG5jb25zdCBnZXRCYXRjaFByb3AgPSAoZGVmYXVsdFNpemUsIG1heFNpemU9ZGVmYXVsdFNpemUsIG5hbWU9XCJiYXRjaFNpemVcIikgPT4ge1xuICAgIHJldHVybiB7XG4gICAgICAgIFtuYW1lXTogeXVwLm51bWJlcigpXG4gICAgICAgICAgICAubm90UmVxdWlyZWQoKVxuICAgICAgICAgICAgLm51bGxhYmxlKClcbiAgICAgICAgICAgIC5zdHJpY3QoKVxuICAgICAgICAgICAgLm1pbigxKVxuICAgICAgICAgICAgLm1heChtYXhTaXplKVxuICAgICAgICAgICAgLmRlZmF1bHQoZGVmYXVsdFNpemUpXG4gICAgfVxufTtcblxuY29uc3QgZ2V0UmV0dXJuUmVzdWx0UHJvcCA9IChkZWZhdWx0VmFsKSA9PiB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgcmV0dXJuUmVzdWx0OiB5dXAuYm9vbGVhbigpXG4gICAgICAgICAgICAuc3RyaWN0KClcbi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JcIjpcbiAgICAgICAgICAgIHJldHVybiBgbjoke3ZhbHVlfWA7XG4gICAgICAgIGNhc2UgXCJNYXJrZXJcIjpcbiAgICAgICAgICAgIHJldHVybiBcIm06XCI7XG4gICAgICAgIGNhc2UgXCJDb29yZFwiOlxuICAgICAgICAgICAgcmV0dXJuIGBjOiR7dmFsdWV9YDtcbiAgICAgICAgY2FzZSBcIlRpbWVcIjpcbiAgICAgICAgICAgIHJldHVybiBgaDoke3ZhbHVlfWA7XG4gICAgICAgIGNhc2UgXCJEYXRlXCI6XG4gICAgICAgICAgICByZXR1cm4gYGQ6JHt2YWx1ZX1gO1xuICAgICAgICBjYXNlIFwiRGF0ZVRpbWVcIjpcbiAgICAgICAgICAgIHJldHVybiBgdDoke3ZhbHVlfWA7XG4gICAgICAgIGNhc2UgXCJaZXJvXCI6XG4gICAgICAgICAgICByZXR1cm4gXCJ6OlwiO1xuICAgICAgICBjYXNlIFwiQm9vbFwiOlxuICAgICAgICAgICAgcmV0dXJuIGAke3ZhbHVlfWA7XG4gICAgICAgIGNhc2UgXCJVcmlcIjpcbiAgICAgICAgICAgIHJldHVybiBgdToke3ZhbHVlfWA7XG4gICAgICAgIGNhc2UgXCJMaXN0XCI6XG4gICAgICAgICAgICByZXR1cm4gdmFsdWUuc3Vic3RyaW5nKDEsIHZhbHVlLmxlbmd0aCAtIDEpXG4gICAgICAgICAgICAgICAgLnNwbGl0KFwiLFwiKVxuICAgICAgICAgICAgICAgIC5tYXAoKHZhbCkgPT4gdmFsLnRyaW0oKSlcbiAgICAgICAgICAgICAgICAubWFwKCh2YWwpID0+IHV1aWRWYWxpZGF0ZSh2YWwpID9cbiAgICAgICAgICAgICAgICAgICAgdG9IYXlzdGFjayh2YWwsIFwiUmVmXCIpIDogdG9IYXlzdGFjayh2YWwsIFwiU3RyXCIpKTtcbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgVW5rbm93biBraW5kICR7a2luZH0gZm9y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NpbmcgJ3RzJyBwcm9wZXJ0eVwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHZhbCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiUm93IGluIGRhdGEgbWlzc2luZyAndmFsJyBwcm9wZXJ0eVwiKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHRoaXMucGF5bG9hZFt0c10gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRoaXMucGF5bG9hZFt0c10gPSB7fTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbGV0IHBhcnNlZFZhbCA9IHZhbDtcbiAgICAgICAgICAgIGlmICh2YWwuc3Vic3RyaW5nKDAsIDIpID09PSBcIm46XCIgJiYgdmFsLmluY2x1ZGVzKFwiIFwiKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGluZGV4PSB2YWwuaW5kZXhPZihcIiBcIik7XG4gICAgICAgICAgICAgICAgaWYgKGluZGV4ICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAvLyB2YWwgaGFzIHVuaXQgYXBwbGllZCwgcmVtb3ZlXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlZFZhbCA9IHZhbC5zdWJzdHJpbmcoMCwgdmFsLmluZGV4T2YoXCIgXCIpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLiNwYXlsb2FkW3RzXVtpZF0gPSBwYXJzZWRWYWw7XG4gICAgICAgICAgICB0aGlzLiNyb3dzKys7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXNldCgpIHtcbiAgICAgICAgdGhpcy4jcGF5bG9hZCA9IHt9O1xuICAgICAgICB0aGlzLiNyb3dzID0gMDtcbiAgICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gSGlzV3JpdGVQYXlsb2FkOyIsImZ1bmN0a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FpbHMucHVzaChpbmRlbnQoc3R5bGl6ZShyZWMubXNnLCAnY3lhbicpKSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIG9uZWxpbmVNc2cgPSAnICcgKyBzdHlsaXplKHJlYy5tc2csICdjeWFuJyk7XG4gICAgfVxuICAgIGRlbGV0ZSByZWMubXNnO1xuXG4gICAgaWYgKHJlYy5yZXEgJiYgdHlwZW9mIChyZWMucmVxKSA9PT0gJ29iamVjdCcpIHtcbiAgICAgIHZhciByZXEgPSByZWMucmVxO1xuICAgICAgZGVsZXRlIHJlYy5yZXE7XG4gICAgICBoZWFkZXJzID0gcmVxLmhlYWRlcnM7XG4gICAgICBzID0gZm9ybWF0KCclcyAlcyBIVFRQLyVzJXMnLCByZXEubWV0aG9kLFxuICAgICAgICByZXEudXJsLFxuICAgICAgICByZXEuaHR0cFZlcnNpb24gfHwgJzEuMScsXG4gICAgICAgIChoZWFkZXJzID9cbiAgICAgICAgICAnXFxuJyArIE9iamVjdC5rZXlzKGhlYWRlcnMpLm1hcChmdW5jdGlvbiAoaCkge1xuICAgICAgICAgICAgcmV0dXJuIGggKyAnOiAnICsgaGVhZGVyc1toXTtcbiAgICAgICAgICB9KS5qb2luKCdcXG4nKSA6XG4gICAgICAgICAgJycpXG4gICAgICApO1xuICAgICAgZGVsZXRlIHJlcS51cmw7XG4gICAgICBkZWxldGUgcmVxLm1ldGhvZDtcbiAgICAgIGRlbGV0ZSByZXEuaHR0cFZlcnNpb247XG4gICAgICBkZWxldGUgcmVxLmhlYWRlcnM7XG4gICAgICBpZiAocmVxLmJvZHkpIHtcbiAgICAgICAgcyArPSAnXFxuXFxuJyArICh0eXBlb2YgKHJlcS5ib2R5KSA9PT0gJ29iamVjdCdcbiAgICAgICAgICA/IEpTT04uc3RyaW5naWZ5KHJlcS5ib2R5LCBudWxsLCAyKSA6IHJlcS5ib2R5KTtcbiAgICAgICAgZGVsZXRlIHJlcS5ib2R5O1xuICAgICAgfVxuICAgICAgaWYgKHJlcS50cmFpbGVycyAmJiBPYmplY3Qua2V5cyhyZXEudHJhaWxlcnMpID4gMCkge1xuICAgICAgICBzICs9ICdcXG4nICsgT2JqZWN0LmtleXMocmVxLnRyYWlsZXJzKS5tYXAoZnVuY3Rpb24gKHQpIHtcbiAgICAgICAgICByZXR1cm4gdCArICc6ICcgKyByZXEudHJhaWxlcnNbdF07XG4gICAgICAgIH0pLmpvaW4oJ1xcbicpO1xuICAgICAgfVxuICAgICAgZGVsZXRlIHJlcS50cmFpbGVycztcbiAgICAgIGRldGFpbHMucHVzaChpbmRlbnQocykpO1xuICAgICAgLy8gRS5nLiBmb3IgZXh0cmEgJ2ZvbycgZmllbGQgb24gJ3JlcScsIGFkZCAncmVxLmZvbycgYXRcbiAgICAgIC8vIHRvcC1sZXZlbC4gVGhpcyAqZG9lcyogaGF2ZSB0aGUgcG90ZW50aWFsIHRvIHN0b21wIG9uIGFcbiAgICAgIC8vIGxpdGVyYWwgJ3JlcS5mb28nIGtleS5cbiAgICAgIE9iamVjdC5rZXlzKHJlcSkuZm9yRWFjaChmdW5jdGlvbiAoaykge1xuICAgICAgICByZWNbJ3JlcS4nICsga10gPSByZXFba107XG4gICAgICB9KVxuICAgIH1cblxuICAgIGlmIChyZWMuY2xpZW50X3JlcSAmJiB0eXBlb2YgKHJlYy5jbGllbnRfcmVxKSA9PT0gJ29iamVjdCcpIHtcbiAgICAgIHZhciBjbGllbnRfcmVxID0gcmVjLmNsaWVudF9yZXE7XG4gICAgICBkZWxldGUgcmVjLmNsaWVudF9yZXE7XG4gICAgICBoZWFkZXJzID0gY2xpZW50X3JlcS5oZWFkZXJzO1xuICAgICAgcyA9ICcnO1xuICAgICAgaWYgKGNsaWVudF9yZXEuYWRkcmVzcykge1xuICAgICAgICBob3N0SGVhZGVyTGluZSA9ICdIb3N0OiAnICsgY2xpZW50X3JlcS5hZGRyZXNzO1xuICAgICAgICBpZiAoY2xpZW50X3JlcS5wb3J0KVxuICAgICAgICAgIGhvc3RIZWFkZXJM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ykge1xuICAgICAgICAgICAgdmFyIHMgPSBvYmpDb3B5KHBhcmVudC5zdHJlYW1zW2ldKTtcbiAgICAgICAgICAgIHMuY2xvc2VPbkV4aXQgPSBmYWxzZTsgLy8gRG9uJ3Qgb3duIHBhcmVudCBzdHJlYW0uXG4gICAgICAgICAgICB0aGlzLnN0cmVhbXMucHVzaChzKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNlcmlhbGl6ZXJzID0gb2JqQ29weShwYXJlbnQuc2VyaWFsaXplcnMpO1xuICAgICAgICB0aGlzLnNyYyA9IHBhcmVudC5zcmM7XG4gICAgICAgIHRoaXMuZmllbGRzID0gb2JqQ29weShwYXJlbnQuZmllbGRzKTtcbiAgICAgICAgaWYgKG9wdGlvbnMubGV2ZWwpIHtcbiAgICAgICAgICAgIHRoaXMubGV2ZWwob3B0aW9ucy5sZXZlbCk7XG4gICAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLl9sZXZlbCA9IE51bWJlci5QT1NJVElWRV9JTkZJTklUWTtcbiAgICAgICAgdGhpcy5zdHJlYW1zID0gW107XG4gICAgICAgIHRoaXMuc2VyaWFsaXplcnMgPSBudWxsO1xuICAgICAgICB0aGlzLnNyYyA9IGZhbHNlO1xuICAgICAgICB0aGlzLmZpZWxkcyA9IHt9O1xuICAgIH1cblxuICAgIGlmICghZHRwICYmIGR0cmFjZSkge1xuICAgICAgICBkdHAgPSBkdHJhY2UuY3JlYXRlRFRyYWNlUHJvdmlkZXIoJ2J1bnlhbicpO1xuXG4gICAgICAgIGZvciAodmFyIGxldmVsIGluIGxldmVsRnJvbU5hbWUpIHtcbiAgICAgICAgICAgIHZhciBwcm9iZTtcblxuICAgICAgICAgICAgcHJvYmVzW2xldmVsRnJvbU5hbWVbbGV2ZWxdXSA9IHByb2JlID1cbiAgICAgICAgICAgICAgICBkdHAuYWRkUHJvYmUoJ2xvZy0nICsgbGV2ZWwsICdjaGFyIConKTtcblxuICAgICAgICAgICAgLy8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GNvbnNvbGUubG9nIHdvcnRoIGl0cyBzYWx0IHRoZXNlIGRheXMgY2FuIG5pY2VseSByZW5kZXJcbiAgICAgICAgICAgICAqIGFuZCBpbnRyb3NwZWN0IG9iamVjdHMgKGUuZy4gdGhlIEZpcmVmb3ggYW5kIENocm9tZSBjb25zb2xlKVxuICAgICAgICAgICAgICogc28gbGV0J3MgZW1pdCB0aGUgcmF3IGxvZyByZWNvcmQuIEFyZSB0aGVyZSBicm93c2VycyBmb3Igd2hpY2hcbiAgICAgICAgICAgICAqIHRoYXQgYnJlYWtzIHRoaW5ncz9cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgc2VsZi5hZGRTdHJlYW0oe1xuICAgICAgICAgICAgICAgIHR5cGU6ICdyYXcnLFxuICAgICAgICAgICAgICAgIHN0cmVhbTogbmV3IENvbnNvbGVSYXdTdHJlYW0oKSxcbiAgICAgICAgICAgICAgICBjbG9zZU9uRXhpdDogZmFsc2UsXG4gICAgICAgICAgICAgICAgbGV2ZWw6IG9wdGlvbnMubGV2ZWxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc2VsZi5hZGRTdHJlYW0oe1xuICAgICAgICAgICAgICAgIHR5cGU6ICdzdHJlYW0nLFxuICAgICAgICAgICAgICAgIHN0cmVhbTogcHJvY2Vzcy5zdGRvdXQsXG4gICAgICAgICAgICAgICAgY2xvc2VPbkV4aXQ6IGZhbHNlLFxuICAgICAgICAgICAgICAgIGxldmVsOiBvcHRpb25zLmxldmVsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBpZiAob3B0aW9ucy5zZXJpYWxpemVycykge1xuICAgICAgICBzZWxmLmFkZFNlcmlhbGl6ZXJzKG9wdGlvbnMuc2VyaWFsaXplcnMpO1xuICAgIH1cbiAgICBpZiAob3B0aW9ucy5zcmMpIHtcbiAgICAgICAgdGhpcy5zcmMgPSB0cnVlO1xuICAgIH1cbiAgICB4e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dCB3cml0YWJsZTogJyArIHV0aWwuaW5zcGVjdChzLnN0cmVhbSkpO1xuXG4gICAgICAgIGlmICghcy5jbG9zZU9uRXhpdCkge1xuICAgICAgICAgICAgcy5jbG9zZU9uRXhpdCA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgIGNhc2UgJ2ZpbGUnOlxuICAgICAgICBpZiAocy5yZWVtaXRFcnJvckV2ZW50cyA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBzLnJlZW1pdEVycm9yRXZlbnRzID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXMuc3RyZWFtKSB7XG4gICAgICAgICAgICBzLnN0cmVhbSA9IGZzLmNyZWF0ZVdyaXRlU3RyZWFtKHMucGF0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge2ZsYWdzOiAnYScsIGVuY29kaW5nOiAndXRmOCd9KTtcbiAgICAgICAgICAgIGlmICghcy5jbG9zZU9uRXhpdCkge1xuICAgICAgICAgICAgICAgIHMuY2xvc2VPbkV4aXQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFzLmNsb3NlT25FeGl0KSB7XG4gICAgICAgICAgICAgICAgcy5jbG9zZU9uRXhpdCA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgIGNhc2UgJ3JvdGF0aW5nLWZpbGUnOlxuICAgICAgICBhc3NlcnQub2soIXMuc3RyZWFtLFxuICAgICAgICAgICAgICAgICAgJ1wicm90YXRpbmctZmlsZVwiIHN0cmVhbSBzaG91bGQgbm90IGdpdmUgYSBcInN0cmVhbVwiJyk7XG4gICAgICAgIGFzc2VydC5vayhzLnBhdGgpO1xuICAgICAgICBhc3NlcnQub2sobXYsICdcInJvdGF0aW5nLWZpbGVcIiBzdHJlYW0gdHlwZSBp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ICAgICAgLypcbiAgICAgICAgICAgICAqIFNob3cgdGhpcyBpbnZhbGlkIEJ1bnlhbiB1c2FnZSB3YXJuaW5nICpvbmNlKi5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBTZWUgPGh0dHBzOi8vZ2l0aHViLmNvbS90cmVudG0vbm9kZS1idW55YW4vaXNzdWVzLzEwMD4gZm9yXG4gICAgICAgICAgICAgKiBhbiBleGFtcGxlIG9mIGhvdyB0aGlzIGNhbiBoYXBwZW4uXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHZhciBkZWR1cEtleSA9ICd1bmJvdW5kJztcbiAgICAgICAgICAgIGlmICghX2hhdmVXYXJuZWRbZGVkdXBLZXldKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNhbGxlciA9IGdldENhbGxlcjNJbmZvKCk7XG4gICAgICAgICAgICAgICAgX3dhcm4oZm9ybWF0KCdidW55YW4gdXNhZ2UgZXJyb3I6ICVzOiVzOiBhdHRlbXB0IHRvIGxvZyAnXG4gICAgICAgICAgICAgICAgICAgICsgJ3dpdGggYW4gdW5ib3VuZCBsb2cgbWV0aG9kOiBgdGhpc2AgaXM6ICVzJyxcbiAgICAgICAgICAgICAgICAgICAgY2FsbGVyLmZpbGUsIGNhbGxlci5saW5lLCB1dGlsLmluc3BlY3QodGhpcykpLFxuICAgICAgICAgICAgICAgICAgICBkZWR1cEtleSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH0gZWxzZSBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMCkgeyAgIC8vIGBsb2cuPGxldmVsPigpYFxuICAgICAgICAgICAgcmV0dXJuICh0aGlzLl9sZXZlbCA8PSBtaW5MZXZlbCk7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbXNnQXJncyA9IG5ldyBBcnJheShhcmd1bWVudHMubGVuZ3RoKTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBtc2dBcm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m1hdCgncm90YXRpbmctZmlsZSBzdHJlYW0gXCJjb3VudFwiIGlzIG5vdCA+PSAwOiAlaiBpbiAlaicsXG4gICAgICAgICAgICB0aGlzLmNvdW50LCB0aGlzKSk7XG5cbiAgICAvLyBQYXJzZSBgb3B0aW9ucy5wZXJpb2RgLlxuICAgIGlmIChvcHRpb25zLnBlcmlvZCkge1xuICAgICAgICAvLyA8bnVtYmVyPjxzY29wZT4gd2hlcmUgc2NvcGUgaXM6XG4gICAgICAgIC8vICAgIGggICBob3VycyAoYXQgdGhlIHN0YXJ0IG9mIHRoZSBob3VyKVxuICAgICAgICAvLyAgICBkICAgZGF5cyAoYXQgdGhlIHN0YXJ0IG9mIHRoZSBkYXksIGkuZS4ganVzdCBhZnRlciBtaWRuaWdodClcbiAgICAgICAgLy8gICAgdyAgIHdlZWtzIChhdCB0aGUgc3RhcnQgb2YgU3VuZGF5KVxuICAgICAgICAvLyAgICBtICAgbW9udGhzIChvbiB0aGUgZmlyc3Qgb2YgdGhlIG1vbnRoKVxuICAgICAgICAvLyAgICB5ICAgeWVhcnMgKGF0IHRoZSBzdGFydCBvZiBKYW4gMXN0KVxuICAgICAgICAvLyB3aXRoIHNwZWNpYWwgdmFsdWVzICdob3VybHknICgxaCksICdkYWlseScgKDFkKSwgXCJ3ZWVrbHlcIiAoMXcpLFxuICAgICAgICAvLyAnbW9udGhseScgKDFtKSBhbmQgJ3llYXJseScgKDF5KVxuICAgICAgICB2YXIgcGVyaW9kID0ge1xuICAgICAgICAgICAgJ2hvdXJseSc6ICcxaCcsXG4gICAgICAgICAgICAnZGFpbHknOiAnMWQnLFxuICAgICAgICAgICAgJ3dlZWtseSc6ICcxdycsXG4gICAgICAgICAgICAnbW9udGhseSc6ICcxbScsXG4gICAgICAgICAgICAneWVhcmx5JzogJzF5J1xuICAgICAgICB9W29wdGlvbnMucGVyaW9kXSB8fCBvcHRpb25zLnBlcmlvZDtcbiAgICAgICAgdmFyIG0gPSAvXihbMS05XVswLTldKikoW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IC09IDE7XG4gICAgICAgIGZzLmV4aXN0cyhiZWZvcmUsIGZ1bmN0aW9uIChleGlzdHMpIHtcbiAgICAgICAgICAgIGlmICghZXhpc3RzKSB7XG4gICAgICAgICAgICAgICAgbW92ZXMoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc2VsZi5fZGVidWcoJyAgbXYgJXMgJXMnLCBiZWZvcmUsIGFmdGVyKTtcbiAgICAgICAgICAgICAgICBtdihiZWZvcmUsIGFmdGVyLCBmdW5jdGlvbiAobXZFcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG12RXJyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmVtaXQoJ2Vycm9yJywgbXZFcnIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoKCk7IC8vIFhYWCBmaW5pc2ggaGVyZT9cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1vdmVzKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBmaW5pc2goKSB7XG4gICAgICAgIHNlbGYuX2RlYnVnKCcgIG9wZW4gJXMnLCBzZWxmLnBhdGgpO1xuICAgICAgICBzZWxmLnN0cmVhbSA9IGZzLmNyZWF0ZVdyaXRlU3RyZWFtKHNlbGYucGF0aCxcbiAgICAgICAgICAgIHtmbGFnczogJ2EnLCBlbmNvZGluZzogJ3V0ZjgnfSk7XG4gICAgICAgIHZhciBxID0gc2VsZi5yb3RRdWV1ZSwgbGVuID0gcS5sZW5ndGg7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgICAgIHNlbGYuc3RyZWFtLndyaXRlKHFbaV0pO1xuICAgICAgICB9XG4gICAgICAgIHNlbGYucm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fHwgdGhpcy5vcHRpb25zLmZvcmNlUmVkcmF3XG4gICAgICAgICAgICAvLyBmb3JjZSByZWRyYXcgaW4gbm90dHktbW9kZSFcbiAgICAgICAgICAgIHx8ICh0aGlzLm9wdGlvbnMubm9UVFlPdXRwdXQgJiYgIXRoaXMudGVybWluYWwuaXNUVFkoKSk7XG5cbiAgICAgICAgLy8gc3RyaW5nIGNoYW5nZWQgPyBvbmx5IHRyaWdnZXIgcmVkcmF3IG9uIGNoYW5nZSFcbiAgICAgICAgaWYgKGZvcmNlUmVkcmF3IHx8IHRoaXMubGFzdERyYXduU3RyaW5nICE9IHMpe1xuICAgICAgICAgICAgLy8gdHJpZ2dlciBldmVudFxuICAgICAgICAgICAgdGhpcy5lbWl0KCdyZWRyYXctcHJlJyk7XG5cbiAgICAgICAgICAgIC8vIHNldCBjdXJzb3IgdG8gc3RhcnQgb2YgbGluZVxuICAgICAgICAgICAgdGhpcy50ZXJtaW5hbC5jdXJzb3JUbygwLCBudWxsKTtcblxuICAgICAgICAgICAgLy8gd3JpdGUgb3V0cHV0XG4gICAgICAgICAgICB0aGlzLnRlcm1pbmFsLndyaXRlKHMpO1xuXG4gICAgICAgICAgICAvLyBjbGVhciB0byB0aGUgcmlnaHQgZnJvbSBjdXJzb3JcbiAgICAgICAgICAgIHRoaXMudGVybWluYWwuY2xlYXJSaWdodCgpO1xuXG4gICAgICAgICAgICAvLyBzdG9yZSBzdHJpbmdcbiAgICAgICAgICAgIHRoaXMubGFzdERyYXduU3RyaW5nID0gcztcblxuICAgICAgICAgICAgLy8gc2V0IGxhc3QgcmVkcmF3IHRpbWVcbiAgICAgICAgICAgIHRoaXMubGFzdFJlZHJhdyA9IERhdGUubm93KCk7XG5cbiAgICAgICAgICAgIC8vIHRyaWdnZXIgZXZlbnRcbiAgICAgICAgICAgIHRoaXMuZW1pdCgncmVkcmF3LXBvc3QnKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIHN0YXJ0IHRoZSBwcm9ncmV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AmJiB0aGlzLnRlcm1pbmFsLmlzVFRZKCkgPT09IGZhbHNlKXtcbiAgICAgICAgICAgIHJldHVybiBiYXI7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBhZGQgaGFuZGxlciB0byByZXN0b3JlIGN1cnNvciBzZXR0aW5ncyAoc3RvcCB0aGUgYmFyKSBvbiBTSUdJTlQvU0lHVEVSTSA/XG4gICAgICAgIGlmICh0aGlzLnNpZ2ludENhbGxiYWNrID09PSBudWxsICYmIHRoaXMub3B0aW9ucy5ncmFjZWZ1bEV4aXQpe1xuICAgICAgICAgICAgdGhpcy5zaWdpbnRDYWxsYmFjayA9IHRoaXMuc3RvcC5iaW5kKHRoaXMpO1xuICAgICAgICAgICAgcHJvY2Vzcy5vbmNlKCdTSUdJTlQnLCB0aGlzLnNpZ2ludENhbGxiYWNrKTtcbiAgICAgICAgICAgIHByb2Nlc3Mub25jZSgnU0lHVEVSTScsIHRoaXMuc2lnaW50Q2FsbGJhY2spO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICAvLyBtdWx0aXByb2dyZXNzIGFscmVhZHkgYWN0aXZlID9cbiAgICAgICAgaWYgKCF0aGlzLmlzQWN0aXZlKXtcbiAgICAgICAgICAgIC8vIGhpZGUgdGhlIGN1cnNvciA/XG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmhpZGVDdXJzb3IgPT09IHRydWUpe1xuICAgICAgICAgICAgICAgIHRoaXMudGVybWluYWwuY3Vyc29yKGZhbHNlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gZGlzYWJsZSBsaW5lIHdyYXBwaW5nID9cbiAgICAgICAgICAgIGlmICh0aGlzLm9wdGlvbnMubGluZXdyYXAgPT09IGZhbHNlKXtcbiAgICAgICAgICAgICAgICB0aGlzLnRlcm1pbmFsLmxpbmVXcmFwcGluZyhmYWxzZSk7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICAvLyBpbml0aWFsaXplIHVwZGF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GV0ZSl7XG4gICAgICAgICAgICAvLyBjbGVhciBhbGwgYmFyc1xuICAgICAgICAgICAgdGhpcy50ZXJtaW5hbC5jbGVhckJvdHRvbSgpO1xuICAgICAgICAgICAgXG4gICAgICAgIC8vIG9yIHNob3cgZmluYWwgcHJvZ3Jlc3MgP1xuICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgIC8vIHVwZGF0ZSBlYWNoIGJhclxuICAgICAgICAgICAgZm9yIChsZXQgaT0wOyBpPCB0aGlzLmJhcnMubGVuZ3RoOyBpKyspe1xuICAgICAgICAgICAgICAgIC8vIGFkZCBuZXcgbGluZSA/XG4gICAgICAgICAgICAgICAgaWYgKGkgPiAwKXtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy50ZXJtaW5hbC5uZXdsaW5lKCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy8gdHJpZ2dlciBmaW5hbCByZW5kZXJpbmdcbiAgICAgICAgICAgICAgICB0aGlzLmJhcnNbaV0ucmVuZGVyKCk7XG5cbiAgICAgICAgICAgICAgICAvLyBzdG9wXG4gICAgICAgICAgICAgICAgdGhpcy5iYXJzW2ldLnN0b3AoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gbmV3IGxpbmUgb24gY29tcGxldGVcbiAgICAgICAgICAgIHRoaXMudGVybWluYWwubmV3bGluZSgpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gdHJpZ2dlciBldmVudFxuICAgICAgICB0aGlzLmVtaXQoJ3N0b3AnKTtcbiAgICB9XG5cbiAgICBsb2cocyl7XG4gICAgICAgIC8vIHB1c2ggY29udGVudCBpbnRvIGxvZ2dpbmcgYnVmZmVyXG4gICAgICAgIHRoaXMubG9nZ2luZ0J1ZmZlci5wdXNoKHMpO1xuICAgIH1cbn1cbiIsIi8vIHV0aWxpdHkgdG8gbWVyZ2UgZGVmYXVsdHNcbmZ1bmN0aW9uIG1lcmdlT3B0aW9uKHYsIGRlZm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ltZXJcbiAgICAgICAgaWYgKHRoaXMudGltZXIpe1xuICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHRoaXMudGltZXIpO1xuICAgICAgICAgICAgdGhpcy50aW1lciA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBydW4gaW50ZXJuYWwgcmVuZGVyaW5nXG4gICAgICAgIHN1cGVyLnJlbmRlcigpO1xuXG4gICAgICAgIC8vIGFkZCBuZXcgbGluZSBpbiBub3R0eSBtb2RlIVxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLm5vVFRZT3V0cHV0ICYmIHRoaXMudGVybWluYWwuaXNUVFkoKSA9PT0gZmFsc2Upe1xuICAgICAgICAgICAgdGhpcy50ZXJtaW5hbC5uZXdsaW5lKCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBuZXh0IHVwZGF0ZVxuICAgICAgICB0aGlzLnRpbWVyID0gc2V0VGltZW91dCh0aGlzLnJlbmRlci5iaW5kKHRoaXMpLCB0aGlzLnNjaGVkdWxpbmdSYXRlKTtcbiAgICB9XG5cbiAgICB1cGRhdGUoY3VycmVudCwgcGF5bG9hZCl7XG4gICAgICAgIC8vIHRpbWVyIGluYWN0aXZlID9cbiAgICAgICAgaWYgKCF0aGlzLnRpbWVyKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBzdXBlci51cGRhdGUoY3VycmVudCwgcGF5bG9hZCk7XG5cbiAgICAgICAgLy8gdHJpZ2dlciBzeW5jaHJvbm91cyB1cGRhdGUgP1xuICAgICAgICAvLyBjaGVjayBmb3IgdGhyb3R0bGUgdGltZSBcbiAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5zeW5jaHJvbm91c1VwZGF0ZSAmJiAodGhpcy5sYXN0UmVkcmF3ICsgdGhpcy5vcHRpb25zLnRocm90dGxlVGltZSoyKSA8IERhdGUubm93KCkpe1xuICAgICAgICAgICAgLy8gZm9yY2UgdXBkYXRlXG4gICAgICAgICAgICB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dUQ4M0NcXHVEREYwKD86XFx1RDgzQ1tcXHVEREVBXFx1RERFQy1cXHVEREVFXFx1RERGMlxcdURERjNcXHVEREY1XFx1RERGN1xcdURERkNcXHVEREZFXFx1RERGRl0pfFxcdUQ4M0NcXHVEREVEKD86XFx1RDgzQ1tcXHVEREYwXFx1RERGMlxcdURERjNcXHVEREY3XFx1RERGOVxcdURERkFdKXxcXHVEODNDXFx1RERFOSg/OlxcdUQ4M0NbXFx1RERFQVxcdURERUNcXHVEREVGXFx1RERGMFxcdURERjJcXHVEREY0XFx1RERGRl0pfFxcdUQ4M0NcXHVEREZFKD86XFx1RDgzQ1tcXHVEREVBXFx1RERGOV0pfFxcdUQ4M0NcXHVEREVDKD86XFx1RDgzQ1tcXHVEREU2XFx1RERFN1xcdURERTktXFx1RERFRVxcdURERjEtXFx1RERGM1xcdURERjUtXFx1RERGQVxcdURERkNcXHVEREZFXSl8XFx1RDgzQ1xcdURERjgoPzpcXHVEODNDW1xcdURERTYtXFx1RERFQVxcdURERUMtXFx1RERGNFxcdURERjctXFx1RERGOVxcdURERkJcXHVEREZELVxcdURERkZdKXxcXHVEODNDXFx1RERFQig/OlxcdUQ4M0NbXFx1RERFRS1cXHVEREYwXFx1RERGMlxcdURERjRcXHVEREY3XSl8XFx1RDgzQ1xcdURERjUoPzpcXHVEODNDW1xcdURERTZcXHVEREVBLVxcdURERURcXHVEREYwLVxcdURERjNcXHVEREY3LVxcdURERjlcXHVEREZDXFx1RERGRV0pfFxcdUQ4M0NcXHVEREZCKD86XFx1RDgzQ1tcXHVEREU2XFx1RERFOFxcdURERUFcXHVEREVDXFx1RERFRVxcdURERjNcXHVEREZBXSl8XFx1RDgzQ1xcdURERjMoPzpcXHVEODNDW1xcdURERTZcXHVEREU4XFx1RERFQS1cXHVEREVDXFx1RERFRVxcdURERjFcXHVEREY0XFx1RERGNVxcdURERjdcXHVEREZBXFx1RERGRl0pfFxcdUQ4M0NcXHVEREU4KD86XFx1RDgzQ1tcXHVEREU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HVERjk5LVxcdURGOUJcXHVERjlFLVxcdURGRjBcXHVERkYzLVxcdURGRjVcXHVERkY3LVxcdURGRkZdfFxcdUQ4M0RbXFx1REMwMC1cXHVEQ0ZEXFx1RENGRi1cXHVERDNEXFx1REQ0OS1cXHVERDRFXFx1REQ1MC1cXHVERDY3XFx1REQ2RlxcdURENzBcXHVERDczLVxcdUREN0FcXHVERDg3XFx1REQ4QS1cXHVERDhEXFx1REQ5MFxcdUREOTVcXHVERDk2XFx1RERBNFxcdUREQTVcXHVEREE4XFx1RERCMVxcdUREQjJcXHVEREJDXFx1RERDMi1cXHVEREM0XFx1REREMS1cXHVEREQzXFx1REREQy1cXHVERERFXFx1RERFMVxcdURERTNcXHVEREU4XFx1RERFRlxcdURERjNcXHVEREZBLVxcdURFNEZcXHVERTgwLVxcdURFQzVcXHVERUNCLVxcdURFRDJcXHVERUQ1XFx1REVFMC1cXHVERUU1XFx1REVFOVxcdURFRUJcXHVERUVDXFx1REVGMFxcdURFRjMtXFx1REVGQVxcdURGRTAtXFx1REZFQl18XFx1RDgzRVtcXHVERDBELVxcdUREM0FcXHVERDNDLVxcdURENDVcXHVERDQ3LVxcdURENzFcXHVERDczLVxcdURENzZcXHVERDdBLVxcdUREQTJcXHVEREE1LVxcdUREQUFcXHVEREFFLVxcdUREQ0FcXHVERENELVxcdURERkZcXHVERTcwLVxcdURFNzNcXHVERTc4LVxcdURFN0FcXHVERTgwLVxcdURFODJcXHVERTkwLVxcdURFOTVdKVxcdUZFMEZ8KD86W1xcdTI2MURcXHUyNkY5XFx1MjcwQS1cXHUyNzBEXXxcXHVEODNDW1xcdURGODVcXHVERkMyLVxcdURGQzRcXHVERkM3XFx1REZDQS1cXHVERkNDXXxcXHVEODNEW1xcdURDNDJcXHVEQzQzXFx1REM0Ni1cXHVEQzUwXFx1REM2Ni1cXHVEQzc4XFx1REM3Q1xcdURDODEtXFx1REM4M1xcdURDODUtXFx1REM4N1xcdURDOEZcXHVEQzkxXFx1RENBQVxcd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JldHVybiBhcnI7XG59O1xuXG52YXIgam9pbnkgPSBmdW5jdGlvbiAoYXJyLCBqb2luZXIpIHtcbiAgICB2YXIgc3RyID0gJyc7XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgc3RyICs9IGFycltpXTtcbiAgICAgICAgaWYgKGkgKyAxIDwgYXJyLmxlbmd0aCkge1xuICAgICAgICAgICAgc3RyICs9IGpvaW5lcjtcbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gc3RyO1xufTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBiaW5kKHRoYXQpIHtcbiAgICB2YXIgdGFyZ2V0ID0gdGhpcztcbiAgICBpZiAodHlwZW9mIHRhcmdldCAhPT0gJ2Z1bmN0aW9uJyB8fCB0b1N0ci5hcHBseSh0YXJnZXQpICE9PSBmdW5jVHlwZSkge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKEVSUk9SX01FU1NBR0UgKyB0YXJnZXQpO1xuICAgIH1cbiAgICB2YXIgYXJncyA9IHNsaWN5KGFyZ3VtZW50cywgMSk7XG5cbiAgICB2YXIgYm91bmQ7XG4gICAgdmFyIGJpbmRlciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgaWYgKHRoaXMgaW5zdGFuY2VvZiBib3VuZCkge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IHRhcmdldC5hcHBseShcbiAgICAgICAgICAgICAgICB0aGlzLFxuICAgICAgICAgICAgICAgIGNvbmNhdHR5KGFyZ3MsIGFyZ3VtZW50cylcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0KHJlc3VsdCkgPT09IHJlc3VsdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gd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ID0gaW5kZXgsXG4gICAgICAgICAgbm9DdXN0b21pemVyID0gIWN1c3RvbWl6ZXI7XG5cbiAgICAgIGlmIChvYmplY3QgPT0gbnVsbCkge1xuICAgICAgICByZXR1cm4gIWxlbmd0aDtcbiAgICAgIH1cbiAgICAgIG9iamVjdCA9IE9iamVjdChvYmplY3QpO1xuICAgICAgd2hpbGUgKGluZGV4LS0pIHtcbiAgICAgICAgdmFyIGRhdGEgPSBtYXRjaERhdGFbaW5kZXhdO1xuICAgICAgICBpZiAoKG5vQ3VzdG9taXplciAmJiBkYXRhWzJdKVxuICAgICAgICAgICAgICA/IGRhdGFbMV0gIT09IG9iamVjdFtkYXRhWzBdXVxuICAgICAgICAgICAgICA6ICEoZGF0YVswXSBpbiBvYmplY3QpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgIGRhdGEgPSBtYXRjaERhdGFbaW5kZXhdO1xuICAgICAgICB2YXIga2V5ID0gZGF0YVswXSxcbiAgICAgICAgICAgIG9ialZhbHVlID0gb2JqZWN0W2tleV0sXG4gICAgICAgICAgICBzcmNWYWx1ZSA9IGRhdGFbMV07XG5cbiAgICAgICAgaWYgKG5vQ3VzdG9taXplciAmJiBkYXRhWzJdKSB7XG4gICAgICAgICAgaWYgKG9ialZhbHVlID09PSB1bmRlZmluZWQgJiYgIShrZXkgaW4gb2JqZWN0KSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YXIgc3RhY2sgPSBuZXcgU3RhY2s7XG4gICAgICAgICAgaWYgKGN1c3RvbWl6ZXIpIHtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSBjdXN0b21pemVyKG9ialZhbHVlLCBzcmNWYWx1ZSwga2V5LCBvYmplY3QsI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ICAgICAgICAgICB2YWxJc1JlZmxleGl2ZSA9IHZhbHVlID09PSB2YWx1ZSxcbiAgICAgICAgICAgIHZhbElzU3ltYm9sID0gaXNTeW1ib2wodmFsdWUpO1xuXG4gICAgICAgIHZhciBvdGhJc0RlZmluZWQgPSBvdGhlciAhPT0gdW5kZWZpbmVkLFxuICAgICAgICAgICAgb3RoSXNOdWxsID0gb3RoZXIgPT09IG51bGwsXG4gICAgICAgICAgICBvdGhJc1JlZmxleGl2ZSA9IG90aGVyID09PSBvdGhlcixcbiAgICAgICAgICAgIG90aElzU3ltYm9sID0gaXNTeW1ib2wob3RoZXIpO1xuXG4gICAgICAgIGlmICgoIW90aElzTnVsbCAmJiAhb3RoSXNTeW1ib2wgJiYgIXZhbElzU3ltYm9sICYmIHZhbHVlID4gb3RoZXIpIHx8XG4gICAgICAgICAgICAodmFsSXNTeW1ib2wgJiYgb3RoSXNEZWZpbmVkICYmIG90aElzUmVmbGV4aXZlICYmICFvdGhJc051bGwgJiYgIW90aElzU3ltYm9sKSB8fFxuICAgICAgICAgICAgKHZhbElzTnVsbCAmJiBvdGhJc0RlZmluZWQgJiYgb3RoSXNSZWZsZXhpdmUpIHx8XG4gICAgICAgICAgICAoIXZhbElzRGVmaW5lZCAmJiBvdGhJc1JlZmxleGl2ZSkgfHxcbiAgICAgICAgICAgICF2YWxJc1JlZmxleGl2ZSkge1xuICAgICAgICAgIHJldHVybiAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICgoIXZhbElzTnVsbCAmJiAhdmFsSXNTeW1ib2wgJiYgIW90aElzU3ltYm9sICYmIHZhbHVlIDwgb3RoZXIpIHx8XG4gICAgICAgICAgICAob3RoSXNTeW1ib2wgJiYgdmFsSXNEZWZpbmVkICYmIHZhbElzUmVmbGV4aXZlICYmICF2YWxJc051bGwgJiYgIXZhbElzU3ltYm9sKSB8fFxuICAgICAgICAgICAgKG90aElzTnVsbCAmJiB2YWxJc0RlZmluZWQgJiYgdmFsSXNSZWZsZXhpdm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BrZXkgPSBwcm9wc1tpbmRleF07XG5cbiAgICAgICAgdmFyIG5ld1ZhbHVlID0gY3VzdG9taXplclxuICAgICAgICAgID8gY3VzdG9taXplcihvYmplY3Rba2V5XSwgc291cmNlW2tleV0sIGtleSwgb2JqZWN0LCBzb3VyY2UpXG4gICAgICAgICAgOiB1bmRlZmluZWQ7XG5cbiAgICAgICAgaWYgKG5ld1ZhbHVlID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBuZXdWYWx1ZSA9IHNvdXJjZVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc05ldykge1xuICAgICAgICAgIGJhc2VBc3NpZ25WYWx1ZShvYmplY3QsIGtleSwgbmV3VmFsdWUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGFzc2lnblZhbHVlKG9iamVjdCwga2V5LCBuZXdWYWx1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ29waWVzIG93biBzeW1ib2xzIG9mIGBzb3VyY2VgIHRvIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gc291cmNlIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIGZyb20uXG4gICAgICogQHBhcmFtIHtPYmplY3R9IFtvYmplY3Q9e31dIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIHRvLlxuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgYG9iamVjdGAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gY29weVN5bWJvbHMoc291cmNlLCBvYmplY3QpIHtcbiAgICAgIHJldHVybiBjb3B5T2JqZWN0KHNvdXJjZSwgZ2V0U3ltYm9scyhzb3VyY2UpLCBvYmplY3QpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENvcGllcyBvd24gYW5kIGluaGVyaXRlZCBz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VSUk9SX1RFWFQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocHJlcmVxICYmICF3cmFwcGVyICYmIGdldEZ1bmNOYW1lKGZ1bmMpID09ICd3cmFwcGVyJykge1xuICAgICAgICAgICAgdmFyIHdyYXBwZXIgPSBuZXcgTG9kYXNoV3JhcHBlcihbXSwgdHJ1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGluZGV4ID0gd3JhcHBlciA/IGluZGV4IDogbGVuZ3RoO1xuICAgICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgIGZ1bmMgPSBmdW5jc1tpbmRleF07XG5cbiAgICAgICAgICB2YXIgZnVuY05hbWUgPSBnZXRGdW5jTmFtZShmdW5jKSxcbiAgICAgICAgICAgICAgZGF0YSA9IGZ1bmNOYW1lID09ICd3cmFwcGVyJyA/IGdldERhdGEoZnVuYykgOiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICBpZiAoZGF0YSAmJiBpc0xhemlhYmxlKGRhdGFbMF0pICYmXG4gICAgICAgICAgICAgICAgZGF0YVsxXSA9PSAoV1JBUF9BUllfRkxBRyB8IFdSQVBfQ1VSUllfRkxBRyB8IFdSQVBfUEFSVElBTF9GTEFHIHwgV1JBUF9SRUFSR19GTEFHKSAmJlxuICAgICAgICAgICAgICAgICFkYXRhWzRdLmxlbmd0aCAmJiBkYXRhWzldID09IDFcbiAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICB3cmFwcGVyID0gd3JhcHBlcltnZXRGdW5jTmFtZShkYXRhWzBdKV0uYXBwbHkod3JhcHBlciwgZGF0YVszXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHdyYXBwZXIgPSAoZnVuYy5sZW5ndGggPT0gMSAmJiBpc0xhemlhYmxlKGZ1bmMpKVxuICAgICAgICAgICAgICA/IHdyYXBwZXJbZnVuY05hbWVdKClcbiAgICAgICAgICAgICAgOiB3cmFwcG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B2YXIgYXJyU3RhY2tlZCA9IHN0YWNrLmdldChhcnJheSk7XG4gICAgICB2YXIgb3RoU3RhY2tlZCA9IHN0YWNrLmdldChvdGhlcik7XG4gICAgICBpZiAoYXJyU3RhY2tlZCAmJiBvdGhTdGFja2VkKSB7XG4gICAgICAgIHJldHVybiBhcnJTdGFja2VkID09IG90aGVyICYmIG90aFN0YWNrZWQgPT0gYXJyYXk7XG4gICAgICB9XG4gICAgICB2YXIgaW5kZXggPSAtMSxcbiAgICAgICAgICByZXN1bHQgPSB0cnVlLFxuICAgICAgICAgIHNlZW4gPSAoYml0bWFzayAmIENPTVBBUkVfVU5PUkRFUkVEX0ZMQUcpID8gbmV3IFNldENhY2hlIDogdW5kZWZpbmVkO1xuXG4gICAgICBzdGFjay5zZXQoYXJyYXksIG90aGVyKTtcbiAgICAgIHN0YWNrLnNldChvdGhlciwgYXJyYXkpO1xuXG4gICAgICAvLyBJZ25vcmUgbm9uLWluZGV4IHByb3BlcnRpZXMuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGFyckxlbmd0aCkge1xuICAgICAgICB2YXIgYXJyVmFsdWUgPSBhcnJheVtpbmRleF0sXG4gICAgICAgICAgICBvdGhWYWx1ZSA9IG90aGVyW2luZGV4XTtcblxuICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgIHZhciBjb21wYXJlZCA9IGlzUGFydGlhbFxuICAgICAgICAgICAgPyBjdXN0b21pemVyKG90aFZhbHVlLCBhcnJWYWx1ZSwgaW5kZXgsIG90aGVyLCBhcnJheSwgc3RhY2spXG4gICAgICAgICAgICA6IGN1c3RvbWl6ZXIoYXJyVmFsdWUsIG90aFZhbHVlLCBpbmRleCwgYXJyYXksIG90aGVyLCBzdGFjayk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbXBhcmVkICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBpZiAoY29tcGFyZWQpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIGFycmF5cyAoc3VzY2VwdGlibGUgdG8gY2FsbCBzdGFjayBsaW1pdHMpLlxuICAgICAgICBpZiAoc2Vlbikge1xuICAgICAgICAgIGlmICghYXJyYXlTb21lKG90aGVyLCBmdW5jdGlvbihvdGhWYWx1ZSwgb3RoSW5kZXgpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWNhY2hlSGFzKHNlZW4sIG90aEluZGV4KSAmJlxuICAgICAgICAgICAgICAgICAgICAoYXJyVmFsdWUgPT09IG90aFZhbHVlIHx8IGVxdWFsRnVuYyhhcnJWYWx1ZSwgb3RoVmFsdWUsIGJpdG1hc2ssIGN1c3RvbWl6ZXIsIHN0YWNrKSkpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiBzZWVuLnB1c2gob3RoSW5kZXgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSkpIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKCEoXG4gICAgICAgICAgICAgIGFyclZhbHVlID09PSBvdGhWYWx1ZSB8fFxuICAgICAgICAgICAgICAgIGVxdWFsRnVuYyhhcnJWYWx1ZSwgb3RoVmFsdWUsIGJpdG1hc2ssIGN1c3RvbWl6ZXIsIHN0YWNrKVxuICAgICAgICAgICAgKSkge1xuICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBzdGFja1snZGVsZXRlJ10oYXJyYXkpO1xuICAgICAgc3RhY2tbJ2RlbGV0ZSddKG90aGVyKTtcbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICA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TGVuZ3RoICYmICFpc1BhcnRpYWwpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgfVxuICAgICAgdmFyIGluZGV4ID0gb2JqTGVuZ3RoO1xuICAgICAgd2hpbGUgKGluZGV4LS0pIHtcbiAgICAgICAgdmFyIGtleSA9IG9ialByb3BzW2luZGV4XTtcbiAgICAgICAgaWYgKCEoaXNQYXJ0aWFsID8ga2V5IGluIG90aGVyIDogaGFzT3duUHJvcGVydHkuY2FsbChvdGhlciwga2V5KSkpIHtcbiAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIC8vIENoZWNrIHRoYXQgY3ljbGljIHZhbHVlcyBhcmUgZXF1YWwuXG4gICAgICB2YXIgb2JqU3RhY2tlZCA9IHN0YWNrLmdldChvYmplY3QpO1xuICAgICAgdmFyIG90aFN0YWNrZWQgPSBzdGFjay5nZXQob3RoZXIpO1xuICAgICAgaWYgKG9ialN0YWNrZWQgJiYgb3RoU3RhY2tlZCkge1xuICAgICAgICByZXR1cm4gb2JqU3RhY2tlZCA9PSBvdGhlciAmJiBvdGhTdGFja2VkID09IG9iamVjdDtcbiAgICAgIH1cbiAgICAgIHZhciByZXN1bHQgPSB0cnVlO1xuICAgICAgc3RhY2suc2V0KG9iamVjdCwgb3RoZXIpO1xuICAgICAgc3RhY2suc2V0KG90aGVyLCBvYmplY3QpO1xuXG4gICAgICB2YXIgc2tpcEN0b3IgPSBpc1BhcnRpYWw7XG4gICAgICB3aGlsZSAoKytpbmRleCA8IG9iakxlbmd0aCkge1xuICAgICAgICBrZXkgPSBvYmpQcm9wc1tpbmRleF07XG4gICAgICAgIHZhciBvYmpWYWx1ZSA9IG9iamVjdFtrZXldLFxuICAgICAgICAgICAgb3RoVmFsdWUgPSBvdGhlcltrZXldO1xuXG4gICAgICAgIGlmIChjdXN0b21pemVyKSB7XG4gICAgICAgICAgdmFyIGNvbXBhcmVkID0gaXNQYXJ0aWFsXG4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ZSwgMyk7XG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIgdmFsdWUgPSBhcnJheVtpbmRleF07XG4gICAgICAgIGlmIChwcmVkaWNhdGUodmFsdWUsIGluZGV4LCBhcnJheSkpIHtcbiAgICAgICAgICByZXN1bHQucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgaW5kZXhlcy5wdXNoKGluZGV4KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgYmFzZVB1bGxBdChhcnJheSwgaW5kZXhlcyk7XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldmVyc2VzIGBhcnJheWAgc28gdGhhdCB0aGUgZmlyc3QgZWxlbWVudCBiZWNvbWVzIHRoZSBsYXN0LCB0aGUgc2Vjb25kXG4gICAgICogZWxlbWVudCBiZWNvbWVzIHRoZSBzZWNvbmQgdG8gbGFzdCwgYW5kIHNvIG9uLlxuICAgICAqXG4gICAgICogKipOb3RlOioqIFRoaXMgbWV0aG9kIG11dGF0ZXMgYGFycmF5YCBhbmQgaXMgYmFzZWQgb25cbiAgICAgKiBbYEFycmF5I3JldmVyc2VgXShodHRwczovL21kbi5pby9BcnJheS9yZXZlcnNlKS5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjAuMFxuICAgICAqIEBjYXRlZ29yeSBBcnJheVxuICAgICAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBtb2RpZnkuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIGBhcnJheWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBhcnJheSA9IFsxLCAyLCAzXTtcbiAgICAgKlxuICAgICAqIF8ucmV2ZXJzZShhcnJheSk7XG4gICAgICogLy8gPT4gWzMsIDIsIDFdXG4gICAgICpcbiA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gZGVib3VuY2VkKTtcbiAgICAgKlxuICAgICAqIC8vIENhbmNlbCB0aGUgdHJhaWxpbmcgZGVib3VuY2VkIGludm9jYXRpb24uXG4gICAgICogalF1ZXJ5KHdpbmRvdykub24oJ3BvcHN0YXRlJywgZGVib3VuY2VkLmNhbmNlbCk7XG4gICAgICovXG4gICAgZnVuY3Rpb24gZGVib3VuY2UoZnVuYywgd2FpdCwgb3B0aW9ucykge1xuICAgICAgdmFyIGxhc3RBcmdzLFxuICAgICAgICAgIGxhc3RUaGlzLFxuICAgICAgICAgIG1heFdhaXQsXG4gICAgICAgICAgcmVzdWx0LFxuICAgICAgICAgIHRpbWVySWQsXG4gICAgICAgICAgbGFzdENhbGxUaW1lLFxuICAgICAgICAgIGxhc3RJbnZva2VUaW1lID0gMCxcbiAgICAgICAgICBsZWFkaW5nID0gZmFsc2UsXG4gICAgICAgICAgbWF4aW5nID0gZmFsc2UsXG4gICAgICAgICAgdHJhaWxpbmcgPSB0cnVlO1xuXG4gICAgICBpZiAodHlwZW9mIGZ1bmMgIT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKEZVTkNfRVJST1JfVEVYVCk7XG4gICAgICB9XG4gICAgICB3YWl0ID0gdG9OdW1iZXIod2FpdCkgfHwgMDtcbiAgICAgIGlmIChpc09iamVjdChvcHRpb25zKSkge1xuICAgICAgICBsZWFkaW5nID0gISFvcHRpb25zLmxlYWRpbmc7XG4gICAgICAgIG1heGluZyA9ICdtYXhXYWl0JyBpbiBvcHRpb25zO1xuICAgICAgICBtYXhXYWl0ID0gbWF4aW5nID8gbmF0aXZlTWF4KHRvTnVtYmVyKG9wdGlvbnMubWF4V2FpdCkgfHwgMCwgd2FpdCkgOiBtYXhXYWl0O1xuICAgICAgICB0cmFpbGluZyA9ICd0cmFpbGluZycgaW4gb3B0aW9ucyA/ICEhb3B0aW9ucy50cmFpbGluZyA6IHRyYWlsaW5nO1xuICAgICAgfVxuXG4gICAg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gIGxhc3RUaGlzID0gdGhpcztcbiAgICAgICAgbGFzdENhbGxUaW1lID0gdGltZTtcblxuICAgICAgICBpZiAoaXNJbnZva2luZykge1xuICAgICAgICAgIGlmICh0aW1lcklkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBsZWFkaW5nRWRnZShsYXN0Q2FsbFRpbWUpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAobWF4aW5nKSB7XG4gICAgICAgICAgICAvLyBIYW5kbGUgaW52b2NhdGlvbnMgaW4gYSB0aWdodCBsb29wLlxuICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHRpbWVySWQpO1xuICAgICAgICAgICAgdGltZXJJZCA9IHNldFRpbWVvdXQodGltZXJFeHBpcmVkLCB3YWl0KTtcbiAgICAgICAgICAgIHJldHVybiBpbnZva2VGdW5jKGxhc3RDYWxsVGltZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICh0aW1lcklkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICB0aW1lcklkID0gc2V0VGltZW91dCh0aW1lckV4cGlyZWQsIHdhaXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICB9XG4gICAgICBkZWJvdW5jZWQuY2FuY2VsID0gY2FuY2VsO1xuICAgICAgZGVib3VuY2VkLmZsdXNoID0gZmx1c2g7XG4gICAgICByZXR1cm4gZGVib3VuY2VkO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIERlZmVycyBpbnZva2luZyB0aGUgYGZ1bmNgIHVudGlsIHRoZSBjdXJyZW50IGNhbGwgc3RhY2sgaGFzIGNsZWFyZWQuIEFueVxuICAgICAqIGFkZGl0aW9uYWwgYXJndW1lbnRzIGFyZSBwcm92aWRlZCB0byBgZnVuY2Agd2hlbiBpdCdzIGludm9rZWQuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc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GljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgMC4xMC4wXG4gICAgICogQGNhdGVnb3J5IE9iamVjdFxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIGRlc3RpbmF0aW9uIG9iamVjdC5cbiAgICAgKiBAcGFyYW0gey4uLk9iamVjdH0gW3NvdXJjZXNdIFRoZSBzb3VyY2Ugb2JqZWN0cy5cbiAgICAgKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIGBvYmplY3RgLlxuICAgICAqIEBzZWUgXy5hc3NpZ25JblxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBmdW5jdGlvbiBGb28oKSB7XG4gICAgICogICB0aGlzLmEgPSAxO1xuICAgICAqIH1cbiAgICAgKlxuICAgICAqIGZ1bmN0aW9uIEJhcigpIHtcbiAgICAgKiAgIHRoaXMuYyA9IDM7XG4gICAgICogfVxuICAgICAqXG4gICAgICogRm9vLnByb3RvdHlwZS5iID0gMjtcbiAgICAgKiBCYXIucHJvdG90eXBlLmQgPSA0O1xuICAgICAqXG4gICAgICogXy5hc3NpZ24oeyAnYSc6IDAgfSwgbmV3IEZvbywgbmV3IEJhcik7XG4gICAgICogLy8gPT4geyAnYSc6IDEsICdjJzogMyB9XG4gICAgICovXG4gICAgdmFyIGFzc2lnbiA9IGNyZWF0ZUFzc2lnbmVyKGZ1bmN0aW9uKG9iamVjdCwgc291cmNlKSB7XG4gICAgICBpZiAoaXNQcm90b3R5cGUoc291cmNlKSB8fCBpc0FycmF5TGlrZShzb3VyY2UpKSB7XG4gICAgICAgIGNvcHlPYmplY3Qoc291cmNlLCBrZXlzKHNvdXJjZSksIG9iamVjdCk7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cbiAgICAgIGZvciAodmFyIGtleSBpbiBzb3VyY2UpIHtcbiAgICAgICAgaWYgKGhhc093blByb3BlcnR5LmNhbGwoc291cmNlLCBrZXkpKSB7XG4gICAgICAg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gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8uZGVmYXVsdHMoeyAnYSc6IDEgfSwgeyAnYic6IDIgfSwgeyAnYSc6IDMgfSk7XG4gICAgICogLy8gPT4geyAnYSc6IDEsICdiJzogMiB9XG4gICAgICovXG4gICAgdmFyIGRlZmF1bHRzID0gYmFzZVJlc3QoZnVuY3Rpb24ob2JqZWN0LCBzb3VyY2VzKSB7XG4gICAgICBvYmplY3QgPSBPYmplY3Qob2JqZWN0KTtcblxuICAgICAgdmFyIGluZGV4ID0gLTE7XG4gICAgICB2YXIgbGVuZ3RoID0gc291cmNlcy5sZW5ndGg7XG4gICAgICB2YXIgZ3VhcmQgPSBsZW5ndGggPiAyID8gc291cmNlc1syXSA6IHVuZGVmaW5lZDtcblxuICAgICAgaWYgKGd1YXJkICYmIGlzSXRlcmF0ZWVDYWxsKHNvdXJjZXNbMF0sIHNvdXJjZXNbMV0sIGd1YXJkKSkge1xuICAgICAgICBsZW5ndGggPSAxO1xuICAgICAgfVxuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIgc291cmNlID0gc291cmNlc1tpbmRleF07XG4gICAgICAgIHZhciBwcm9wcyA9IGtleXNJbihzb3VyY2UpO1xuICAgICAgICB2YXIgcHJvcHNJbmRleCA9IC0xO1xuICAgICAgICB2YXIgcHJvcHNMZW5ndGggPSBwcm9wcy5sZW5ndGg7XG5cbiAgICAgICAgd2hpbGUgKCsrcHJvcHNJbmRleCA8IHByb3BzTGVuZ3RoKSB7XG4gICAgICAgICAgdmFyIGtleSA9IHByb3BzW3Byb3BzSW5kZXhdO1xuICAgICAgICAgIHZhciB2YWx1ZSA9IG9iamVjdFtrZXldO1xuXG4gICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHxcbiAgICAgICAgICAgICAgKGVxKHZhbHVlLCBvYmplY3RQcm90b1trZXldKSAmJiAhaGFzT3duUHJvcGVydHkuY2FsbChvYmpl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kZSBhcyB0aGUgZnVuY3Rpb24gYm9keS5cbiAgICAgIHNvdXJjZSA9ICdmdW5jdGlvbignICsgKHZhcmlhYmxlIHx8ICdvYmonKSArICcpIHtcXG4nICtcbiAgICAgICAgKHZhcmlhYmxlXG4gICAgICAgICAgPyAnJ1xuICAgICAgICAgIDogJ29iaiB8fCAob2JqID0ge30pO1xcbidcbiAgICAgICAgKSArXG4gICAgICAgIFwidmFyIF9fdCwgX19wID0gJydcIiArXG4gICAgICAgIChpc0VzY2FwaW5nXG4gICAgICAgICAgID8gJywgX19lID0gXy5lc2NhcGUnXG4gICAgICAgICAgIDogJydcbiAgICAgICAgKSArXG4gICAgICAgIChpc0V2YWx1YXRpbmdcbiAgICAgICAgICA/ICcsIF9faiA9IEFycmF5LnByb3RvdHlwZS5qb2luO1xcbicgK1xuICAgICAgICAgICAgXCJmdW5jdGlvbiBwcmludCgpIHsgX19wICs9IF9fai5jYWxsKGFyZ3VtZW50cywgJycpIH1cXG5cIlxuICAgICAgICAgIDogJztcXG4nXG4gICAgICAgICkgK1xuICAgICAgICBzb3VyY2UgK1xuICAgICAgICAncmV0dXJuIF9fcFxcbn0nO1xuXG4gICAgICB2YXIgcmVzdWx0ID0gYXR0ZW1wdChmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIEZ1bmN0aW9uKGltcG9ydHNLZXlzLCBzb3VyY2VVUkwgKyAncmV0dXJuICcgKyBzb3VyY2UpXG4gICAgICAgICAgLmFwcGx5KHVuZGVmaW5lZCwgaW1wb3J0c1ZhbHVlcyk7XG4gICAgICB9KTtcblxuICAgICAgLy8gUHJvdmlkZSB0aGUgY29tcGlsZWQgZnVuY3Rpb24ncyBzb3VyY2UgYnkgaXRzIGB0b1N0cmluZ2AgbWV0aG9kIG9yXG4gICAgICAvLyB0aGUgYHNvdXJjZWAgcHJvcGVydHkgYXMgYSBjb252ZW5pZW5jZSBmb3IgaW5saW5pbmcgY29tcGlsZWQgdGVtcGxhdGVzLlxuICAgICAg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LFxuICAgICAgICAgICAgICAgICAgYWN0aW9ucyA9IHJlc3VsdC5fX2FjdGlvbnNfXyA9IGNvcHlBcnJheSh0aGlzLl9fYWN0aW9uc19fKTtcblxuICAgICAgICAgICAgICBhY3Rpb25zLnB1c2goeyAnZnVuYyc6IGZ1bmMsICdhcmdzJzogYXJndW1lbnRzLCAndGhpc0FyZyc6IG9iamVjdCB9KTtcbiAgICAgICAgICAgICAgcmVzdWx0Ll9fY2hhaW5fXyA9IGNoYWluQWxsO1xuICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGZ1bmMuYXBwbHkob2JqZWN0LCBhcnJheVB1c2goW3RoaXMudmFsdWUoKV0sIGFyZ3VtZW50cykpO1xuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICByZXR1cm4gb2JqZWN0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldmVydHMgdGhlIGBfYCB2YXJpYWJsZSB0byBpdHMgcHJldmlvdXMgdmFsdWUgYW5kIHJldHVybnMgYSByZWZlcmVuY2UgdG9cbiAgICAgKiB0aGUgYGxvZGFzaGAgZnVuY3Rpb24uXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQHNpbmNlIDAuMS4wXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAY2F0ZWdvcnkgVXRpbFxuICAgICAqIEByZXR1cm5zIHtGdW5jdGlvbn0gUmV0dXJucyB0aGUgYGxvZGFzaGAgZnVuY3Rpb24uXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBsb2Rhc2ggPSBfLm5vQ29uZmxpY3QoKTtcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBub0NvbmZsaWN0KCkge1xuICAgICAgaWYgKHJvb3QuXyA9PT0gdGhpcykge1xuICAgICAgICByb290Ll8gPSBvbGREYXNoO1xuICAgICAgfVxuICAgICA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hdGVSYW5nZSh0cnVlKTtcblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYSBuZXcgZW1wdHkgYXJyYXkuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgNC4xMy4wXG4gICAgICogQGNhdGVnb3J5IFV0aWxcbiAgICAgKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIG5ldyBlbXB0eSBhcnJheS5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIGFycmF5cyA9IF8udGltZXMoMiwgXy5zdHViQXJyYXkpO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzKTtcbiAgICAgKiAvLyA9PiBbW10sIFtdXVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzWzBdID09PSBhcnJheXNbMV0pO1xuICAgICAqIC8vID0+IGZhbHNlXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkFycmF5KCkge1xuICAgICAgcmV0dXJuIFtdO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYGZhbHNlYC5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjEzLjBcbiAgICAgKiBAY2F0ZWdvcnkgVXRpbFxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGBmYWxzZWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udGltZXMoMiwgXy5zdHViRmFsc2UpO1xuICAgICAqIC8vID0+IFtmYWxzZSwgZmFsc2VdXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkZhbHNlKCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYSBuZXcgZW1wdHkgb2JqZWN0LlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgbmV3IGVtcHR5IG9iamVjdC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIG9iamVjdHMgPSBfLnRpbWVzKDIsIF8uc3R1Yk9iamVjdCk7XG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhvYmplY3RzKTtcbiAgICAgKiAvLyA9PiBbe30sIHt9XVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2cob2JqZWN0c1swXSA9PT0gb2JqZWN0c1sxXSk7XG4gICAgICogLy8gPT4gZmFsc2VcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViT2JqZWN0KCkge1xuICAgICAgcmV0dXJuIHt9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYW4gZW1wdHkgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge3N0cmluZ30gUmV0dXJucyB0aGUgZW1wdHkgc3RyaW5nLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBfLnRpbWVzKDIsIF8uc3R1YlN0cmluZyk7XG4gICAgICogLy8gPT4gWycnLCAnJ11cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViU3RyaW5nKCkge1xuICAgICAgcmV0dXJuICcnO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYHRydWVgLlxuICAgICAqXG4gICAgICogQHN0YX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XJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91cnMgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0xvd2VyID8gJ3ZtJyA6ICdWTSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0xvd2VyID8gJ25tJyA6ICdOTSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbVmFuZGFnIG9tXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW03DtHJlIG9tXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW29tXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0dpc3RlciBvbV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbTGFhc10gZGRkZCBbb21dIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnb29yICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBnZWxlZGUnLFxuICAgICAgICAgICAgczogXCInbiBwYWFyIHNla29uZGVzXCIsXG4gICAgICAgICAgICBzczogJyVkIHNla29uZGVzJyxcbiAgICAgICAgICAgIG06IFwiJ24gbWludXV0XCIsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZScsXG4gICAgICAgICAgICBoOiBcIiduIHV1clwiLFxuICAgICAgICAgICAgaGg6ICclZCB1cmUnLFxuICAgICAgICAgICAgZDogXCInbiBkYWdcIixcbiAgICAgICAgICAgIGRkOiAnJWQgZGFlJyxcbiAgICAgICAgICAgIE06IFwiJ24gbWFhbmRcIixcbiAgICAgICAgICAgIE1NOiAnJWQgbWFhbmRlJyxcbiAgICAgICAgICAgIHk6IFwiJ24gamFhclwiLFxuICAgICAgICAgICAgeXk6ICclZCBqYWFyJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0ZXxkZSkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIG51bWJlciArXG4gICAgICAgICAgICAgICAgKG51bWJlciA9PT0gMSB8fCBudW1iZXIgPT09IDggfHwgbnVtYmVyID49IDIwID8gJ3N0ZScgOiAnZGUnKVxuICAgICAgICAgICAgKTsgLy8gVGhhbmtzIHRvIEpvcmlzIFLDtmxpbmcgOiBodHRwczovL2dpdGh1Yi5jb20vamp1cGl0ZXJcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNYWFuZGFnIGlzIGRpZSBlZXJzdGUgZGFnIHZhbiBkaWUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gRGllIHdlZWsgd2F0IGRpZSA0ZGUgSmFudWFyaWUgYmV2YXQgaXMgZGllIGVlcnN0ZSB3ZWVrIHZhbiBkaWUgamFhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBhZjtcblxufSkpKTtcbiIsIi8vISBtb21l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ICAgICAgICAgICAgICAgIDogbiA9PT0gMlxuICAgICAgICAgICAgICAgICAgICA/IDJcbiAgICAgICAgICAgICAgICAgICAgOiBuICUgMTAwID49IDMgJiYgbiAlIDEwMCA8PSAxMFxuICAgICAgICAgICAgICAgICAgICAgID8gM1xuICAgICAgICAgICAgICAgICAgICAgIDogbiAlIDEwMCA+PSAxMVxuICAgICAgICAgICAgICAgICAgICAgICAgPyA0XG4gICAgICAgICAgICAgICAgICAgICAgICA6IDU7XG4gICAgICAgIH0sXG4gICAgICAgIHBsdXJhbHMgPSB7XG4gICAgICAgICAgICBzOiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINir2KfZhtmK2KknLFxuICAgICAgICAgICAgICAgICfYq9in2YbZitipINmI2KfYrdiv2KknLFxuICAgICAgICAgICAgICAgIFsn2KvYp9mG2YrYqtin2YYnLCAn2KvYp9mG2YrYqtmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2KvZiNin2YYnLFxuICAgICAgICAgICAgICAgICclZCDYq9in2YbZitipJyxcbiAgICAgICAgICAgICAgICAnJWQg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgbTogW1xuICAgICAgICAgICAgICAgICfYo9mC2YQg2YXZhiDYr9mC2YrZgtipJyxcbiAgICAgICAgICAgICAgICAn2K/ZgtmK2YLYqSDZiNin2K3Yr9ipJyxcbiAgICAgICAgICAgICAgICBbJ9iv2YLZitmC2KrYp9mGJywgJ9iv2YLZitmC2KrZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINiv2YLYp9im2YInLFxuICAgICAgICAgICAgICAgICclZCDYr9mC2YrZgtipJyxcbiAgICAgICAgICAgICAgICAnJWQg2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgaDogW1xuICAgICAgICAgICAgICAgICfYo9mC2YQg2YXZhiDYs9in2LnYqScsXG4gICAgICAgICAgICAgICAgJ9iz2KfYudipINmI2KfYrdiv2KknLFxuICAgICAgICAgICAgICAgIFsn2LPYp9i52KrYp9mGJywgJ9iz2KfYudiq2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYs9in2LnYp9iqJyxcbiAgICAgICAgICAgICAgICAnJWQg2LPYp9i52KknLFxuICAgICAgICAgICAgICAgICclZCDYs9in2LnYqScsXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgZDogW1xuICAgICAgICAgICAgICAgICfYo9mC2YQg2YXZhiDZitmI2YUnLFxuICAgICAgICAgICAgICAgICfZitmI2YUg2YjYp9it2K8nLFxuICAgICAgICAgICAgICAgIFsn2YrZiNmF2KfZhicsICfZitmI2YXZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINij2YrYp9mFJyxcbiAgICAgICAgICAgICAgICAnJWQg2YrZiNmF2YvYpycsXG4gICAgICAgICAgICAgICAgJyVkINmK2YjZhScsXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgTTogW1xuICAgICAgICAgICAgICAgICfYo9mC2YQg2YXZhiDYtNmH2LEnLFxuICAgICAgICAgICAgICAgICfYtNmH2LEg2YjYp9it2K8nLFxuICAgICAgICAgICAgICAgIFsn2LTZh9ix2KfZhicsICfYtNmH2LHZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINij2LTZh9ixJyxcbiAgICAgICAgICAgICAgICAnJWQg2LTZh9ix2KcnLFxuICAgICAgICAgICAgICAgICclZCDYtNmH2LEnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHk6IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2LnYp9mFJyxcbiAgICAgICAgICAgICAgICAn2LnYp9mFINmI2KfYrdivJyxcbiAgICAgICAgICAgICAgICBbJ9i52KfZhdin2YYnLCAn2LnYp9mF2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYo9i52YjYp9mFJyxcbiAgICAgICAgICAgICAgICAnJWQg2LnYp9mF2YvYpycsXG4gICAgICAgICAgICAgICAgJyVkINi52KfZhScsXG4gICAgICAgICAgICBdLFxuICAgICAgICB9LFxuICAgICAgICBwbHVyYWxpemUgPSBmdW5jdGlvbiAodSkge1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChudW1iZXIsIHdpdGhvdXRTdWZmaXgsIHN0cmluZywgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgICAgICB2YXIgZiA9IHBsdXJhbEZvcm0obnVtYmVyKSxcbiAgICAgICAgICAgICAgICAgICAgc3RyID0gcGx1cmFsc1t1XVtwbHVyYWxGb3JtKG51bWJlcildO1xuICAgICAgICAgICAgICAgIGlmIChmID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0ciA9IHN0clt3aXRob3V0U3VmZml4ID8gMCA6IDFdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gc3RyLnJlcGxhY2UoLyVkL2ksIG51bWJlcik7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9LFxuICAgICAgICBtb250aHMgPSBbXG4gICAgICAgICAgICAn2KzYp9mG2YHZiicsXG4gICAgICAgICAgICAn2YHZitmB2LHZiicsXG4gICAgICAgICAgICAn2YXYp9ix2LMnLFxuICAgICAgICAgICAgJ9ij2YHYsdmK2YQnLFxuICAgICAgICAgICAgJ9mF2KfZiicsXG4gICAgICAgICAgICAn2KzZiNin2YYnLFxuICAgICAgICAgICAgJ9is2YjZitmE2YrYqScsXG4gICAgICAgICAgICAn2KPZiNiqJyxcbiAgICAgICAgICAgICfYs9io2KrZhdio2LEnLFxuICAgICAgICAgICAgJ9ij2YPYqtmI2KjYsScsXG4gICAgICAgICAgICAn2YbZiNmB2YXYqNixJyxcbiAgICAgICAgICAgICfYr9mK2LPZhdio2LEnLFxuICAgICAgICBdO1xuXG4gICAgdmFyIGFyRHogPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdhci1keicsIHtcbiAgICAgICAgbW9udGhzOiBtb250aHMsXG4gICAgICAgIG1vbnRoc1Nob3J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IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9mFJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb2KfZhNmK2YjZhSDYudmG2K8g2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9i62K/Zi9inINi52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vYo9mF2LMg2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFvYudmG2K8g2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ9io2LnYryAlcycsXG4gICAgICAgICAgICBwYXN0OiAn2YXZhtiwICVzJyxcbiAgICAgICAgICAgIHM6IHBsdXJhbGl6ZSgncycpLFxuICAgICAgICAgICAgc3M6IHBsdXJhbGl6ZSgncycpLFxuICAgICAgICAgICAgbTogcGx1cmFsaXplKCdtJyksXG4gICAgICAgICAgICBtbTogcGx1cmFsaXplKCdtJyksXG4gICAgICAgICAgICBoOiBwbHVyYWxpemUoJ2gnKSxcbiAgICAgICAgICAgIGhoOiBwbHVyYWxpemUoJ2gnKSxcbiAgICAgICAgICAgIGQ6IHBsdXJhbGl6ZSgnZCcpLFxuICAgICAgICAgICAgZGQ6IHBsdXJhbGl6ZSgnZCcpLFxuICAgICAgICAgICAgTTogcGx1cmFsaXplKCdNJyksXG4gICAgICAgICAgICBNTTogcGx1cmFsaXplKCdNJyksXG4gICAgICAgICAgICB5OiBwbHVyYWxpemUoJ3knKSxcbiAgICAg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vcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb2KfZhNmK2YjZhSDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9i62K/YpyDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9i52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2KPZhdizINi52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfZgdmKICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICfZhdmG2LAgJXMnLFxuICAgICAgICAgICAgczogJ9ir2YjYp9mGJyxcbiAgICAgICAgICAgIHNzOiAnJWQg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICBtOiAn2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICBtbTogJyVkINiv2YLYp9im2YInLFxuICAgICAgICAgICAgaDogJ9iz2KfYudipJyxcbiAgICAgICAgICAgIGhoOiAnJWQg2LPYp9i52KfYqicsXG4gICAgICAgICAgICB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J3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHN5bWJvbE1hcCA9IHtcbiAgICAgICAgICAgIDE6ICcxJyxcbiAgICAgICAgICAgIDI6ICcyJyxcbiAgICAgICAgICAgIDM6ICczJyxcbiAgICAgICAgICAgIDQ6ICc0JyxcbiAgICAgICAgICAgIDU6ICc1JyxcbiAgICAgICAgICAgIDY6ICc2JyxcbiAgICAgICAgICAgIDc6ICc3JyxcbiAgICAgICAgICAgIDg6ICc4JyxcbiAgICAgICAgICAgIDk6ICc5JyxcbiAgICAgICAgICAgIDA6ICcwJyxcbiAgICAgICAgfSxcbiAgICAgICAgcGx1cmFsRm9ybSA9IGZ1bmN0aW9uIChuKSB7XG4gICAgICAgICAgICByZXR1cm4gbiA9PT0gMFxuICAgICAgICAgICAgICAgID8gMFxuICAgICAgICAgICAgICAgIDogbiA9PT0gMVxuICAgICAgICAgICAgICAgICAgPyAxXG4gICAgICAgICAgICAgICAgICA6IG4gPT09IDJcbiAgICAgICAgICAgICAgICAgICAgPyAyXG4gICAgICAgICAgICAgICAgICAgIDogbiAlIDEwMCA+PSAzICYmIG4gJSAxMDAgPD0gMTBcbiAgICAgICAgICAgICAgICAgICAgICA/IDNcbiAgICAgICAgICAgICAgICAgICAgICA6IG4gJSAxMDAgPj0gMTFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gNFxuICAgICAgICAgICAgICAgICAgICAgICAgOiA1O1xuICAgICAgICB9LFxuICAgICAgICBwbHVyYWxzID0ge1xuICAgICAgICAgICAgczogW1xuICAgICAgICAgICAgICAgICfYo9mC2YQg2YXZhiDYq9in2YbZitipJyxcbiAgICAgICAgICAgICAgICAn2KvYp9mG2YrYqSDZiNin2K3Yr9ipJyxcbiAgICAgICAgICAgICAgICBbJ9ir2KfZhtmK2KrYp9mGJywgJ9ir2KfZhtmK2KrZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINir2YjYp9mGJyxcbiAgICAgICAgICAgICAgICAnJWQg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICAgICAgJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIG06IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICAgICAgJ9iv2YLZitmC2Kkg2YjYp9it2K/YqScsXG4gICAgICAgICAgICAgICAgWyfYr9mC2YrZgtiq2KfZhicsICfYr9mC2YrZgtiq2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYr9mC2KfYptmCJyxcbiAgICAgICAgICAgICAgICAnJWQg2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICAgICAgJyVkINiv2YLZitmC2KknLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIGg6IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2LPYp9i52KknLFxuICAgICAgICAgICAgICAgICfYs9in2LnYqSDZiNin2K3Yr9ipJyxcbiAgICAgICAgICAgICAgICBbJ9iz2KfYudiq2KfZhicsICfYs9in2LnYqtmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2LPYp9i52KfYqicsXG4gICAgICAgICAgICAgICAgJyVkINiz2KfYudipJyxcbiAgICAgICAgICAgICAgICAnJWQg2LPYp9i52KknLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIGQ6IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2YrZiNmFJyxcbiAgICAgICAgICAgICAgICAn2YrZiNmFINmI2KfYrdivJyxcbiAgICAgICAgICAgICAgICBbJ9mK2YjZhdin2YYnLCAn2YrZiNmF2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYo9mK2KfZhScsXG4gICAgICAgICAgICAgICAgJyVkINmK2YjZhdmL2KcnLFxuICAgICAgICAgICAgICAgICclZCDZitmI2YUnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIE06IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2LTZh9ixJyxcbiAgICAgICAgICAgICAgICAn2LTZh9ixINmI2KfYrdivJyxcbiAgICAgICAgICAgICAgICBbJ9i02YfYsdin2YYnLCAn2LTZh9ix2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYo9i02YfYsScsXG4gICAgICAgICAgICAgICAgJyVkINi02YfYsdinJyxcbiAgICAgICAgICAgICAgICAnJWQg2LTZh9ixJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB5OiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINi52KfZhScsXG4gICAgICAgICAgICAgICAgJ9i52KfZhSDZiNin2K3YrycsXG4gICAgICAgICAgICAgICAgWyfYudin2YXYp9mGJywgJ9i52KfZhdmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2KPYudmI2KfZhScsXG4gICAgICAgICAgICAgICAgJyVkINi52KfZhdmL2KcnLFxuICAgICAgICAgICAgICAgICclZCDYudin2YUnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgfSxcbiAgICAgICAgcGx1cmFsaXplID0gZnVuY3Rpb24gKHUpIHtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAobnVtYmVyLCB3aXRob3V0U3VmZml4LCBzdHJpbmcsIGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSBwbHVyYWxGb3JtKG51bWJlciksXG4gICAgICAgICAgICAgICAgICAgIHN0ciA9IHBsdXJhbHNbdV1bcGx1cmFsRm9ybShudW1iZXIpXTtcbiAgICAgICAgICAgICAgICBpZiAoZiA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICBzdHIgPSBzdHJbd2l0aG91dFN1ZmZpeCA/IDAgOiAxXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0ci5yZXBsYWNlKC8lZC9pLCBudW1iZXIpO1xuICAg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HtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0QvXFx1MjAwRk0vXFx1MjAwRllZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/YtXzZhS8sXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuICfZhScgPT09IGlucHV0O1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn2LUnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9mFJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb2KfZhNmK2YjZhSDYudmG2K8g2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9i62K/Zi9inINi52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vYo9mF2LMg2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFvYudmG2K8g2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ9io2LnYryAlcycsXG4gICAgICAgICAgICBwYXN0OiAn2YXZhtiwICVzJyxcbiAgICAgICAgICAgIHM6IHBsdXJhbGl6ZSgncycpLFxuICAgICAgICAgICAgc3M6IHBsdXJhbGl6ZSgncycpLFxuICAgICAgICAgICAgbTogcGx1cmFsaXplKCdtJyksXG4gICAgICAgICAgICBtbTogcGx1cmFsaXplKCdtJyksXG4gICAgICAgICAgICBoOiBwbHVyYWxpemUoJ2gnKSxcbiAgICAgICAgICAgIGhoOiBwbHVyYWxpemUoJ2gnKSxcbiAgICAgICAgICAgIGQ6IHBsdXJhbGl6ZSgnZCcpLFxuICAgICAgICAgICAgZGQ6IHBsdXJhbGl6ZSgnZCcpLFxuICAgICAgICAgICAgTTogcGx1cmFsaXplKCdNJyksXG4gICAgICAgICAgICBNTTogcGx1cmFsaXplKCdNJyksXG4gICAgICAgICAgICB5OiBwbHVyYWxpemUoJ3knKSxcbiAgICAgICAgICAgIHl5OiBwbHVyYWxpemUoJ3knKSxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgv2IwvZywgJywnKTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZ1xuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXGQvZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoLywvZywgJ9iMJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6I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gICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2YTZitmI2YUg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYutiv2Kcg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9ij2YXYsyDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW9i52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn2YHZiiAlcycsXG4gICAgICAgICAgICBwYXN0OiAn2YXZhtiwICVzJyxcbiAgICAgICAgICAgIHM6ICfYq9mI2KfZhicsXG4gICAgICAgICAgICBzczogJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgbTogJ9iv2YLZitmC2KknLFxuICAgICAgICAgICAgbW06ICclZCDYr9mC2KfYptmCJyxcbiAgICAgICAgICAgIGg6ICfYs9in2LnYqScsXG4gICAgICAgICAgICBoaDogJyVkINiz2KfYudin2KonLFxuICAgICAgICAgICAgZDogJ9mK2YjZhScsXG4gICAgICAgICAgICBkZDogJyVkINij2YrYp9mFJyxcbiAgICAgICAgICAgIE06ICfYtNmH2LEnLFxuICAgICAgICAgICAgTU06ICclZCDYo9i02YfYsScsXG4gICAgICAgICAgICB5O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fZoScsXG4gICAgICAgICAgICAyOiAn2aInLFxuICAgICAgICAgICAgMzogJ9mjJyxcbiAgICAgICAgICAgIDQ6ICfZpCcsXG4gICAgICAgICAgICA1OiAn2aUnLFxuICAgICAgICAgICAgNjogJ9mmJyxcbiAgICAgICAgICAgIDc6ICfZpycsXG4gICAgICAgICAgICA4OiAn2agnLFxuICAgICAgICAgICAgOTogJ9mpJyxcbiAgICAgICAgICAgIDA6ICfZoCcsXG4gICAgICAgIH0sXG4gICAgICAgIG51bWJlck1hcCA9IHtcbiAgICAgICAgICAgICfZoSc6ICcxJyxcbiAgICAgICAgICAgICfZoic6ICcyJyxcbiAgICAgICAgICAgICfZoyc6ICczJyxcbiAgICAgICAgICAgICfZpCc6ICc0JyxcbiAgICAgICAgICAgICfZpSc6ICc1JyxcbiAgICAgICAgICAgICfZpic6ICc2JyxcbiAgICAgICAgICAgICfZpyc6ICc3JyxcbiAgICAgICAgICAgICfZqCc6ICc4JyxcbiAgICAgICAgICAgICfZqSc6ICc5JyxcbiAgICAgICAgICAgICfZoCc6ICcwJyxcbiAgICAgICAgfTtcblxuICAgIHZhciBhclBzID0gbW9tZW50LmRlZmluZUxvY2FsZSgnYXItcHMnLCB7XG4gICAgICAgIG1vbnRoczogJ9mD2KfZhtmI2YYg2KfZhNir2KfZhtmKX9i02KjYp9i3X9ii2LDYp9ixX9mG2YrYs9in2YZf2KPZitmR2KfYsV/Yrdiy2YrYsdin2YZf2KrZhdmR2YjYsl/YotioX9ij2YrZhNmI2YRf2KrYtNix2Yog2KfZhNij2YjZkdmEX9iq2LTYsdmK2YYg2KfZhNir2KfZhtmKX9mD2KfZhtmI2YYg2KfZhNij2YjZkdmEJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICfZg9miX9i02KjYp9i3X9ii2LDYp9ixX9mG2YrYs9in2YZf2KPZitmR2KfYsV/Yrdiy2YrYsdin2YZf2Kr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IHJldHVybiAn2LUnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9mFJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb2KfZhNmK2YjZhSDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9i62K/YpyDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9i52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2KPZhdizINi52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfZgdmKICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICfZhdmG2LAgJXMnLFxuICAgICAgICAgICAgczogJ9ir2YjYp9mGJyxcbiAgICAgICAgICAgIHNzOiAnJWQg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICBtOiAn2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICBtbTogJyVkINiv2YLYp9im2YInLFxuICAgICAgICAgICAgaDogJ9iz2KfYudipJyxcbiAgICAgICAgICAgIGhoOiAnJWQg2LPYp9i52KfYqicsXG4gICAgICAgICAgICBkOiAn2YrZiNmFJyxcbiAgICAgICAgICAgIGRkOiAnJWQg2KPZitin2YUnLFxuICAgICAgICAgICAgTTogJ9i02YfYsScsXG4gICAgICAgICAgICBNTTogJyVkINij2LTZh9ixJyxcbiAgICAgICAgICAgIHk6ICfYs9mG2KknLFxuICAgICAgICAgICAgeXk6ICclZCDYs9mG2YjYp9iqJyxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmdcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvW9mj2aTZpdmm2afZqNmp2aBdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTWFwW21hdGNoXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5zcGxpdCgnJykgLy8gcmV2ZXJzZWQgc2luY2UgbmVnYXRpdmUgbG9va2JlaGluZCBub3Qgc3VwcG9ydGVkIGV2ZXJ5d2hlcmVcbiAgICAgICAgICAgICAgICAucmV2ZXJzZSgpXG4gICAgICAgICAgICAgICAgLmpvaW4oJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL1vZodmiXSg/IVtcXHUwNjJhXFx1MDY0M10pL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTWFwW21hdGNoXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5zcGxpdCgnJylcbiAgICAgICAgICAgICAgICAucmV2ZXJzZSgpXG4gICAgICAgICAgICAgICAgLmpvaW4oJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL9iML2csICcsJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmdcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sTWFwW21hdGNoXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5yZ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gICAgICAgICAgICAzOiAn2aMnLFxuICAgICAgICAgICAgNDogJ9mkJyxcbiAgICAgICAgICAgIDU6ICfZpScsXG4gICAgICAgICAgICA2OiAn2aYnLFxuICAgICAgICAgICAgNzogJ9mnJyxcbiAgICAgICAgICAgIDg6ICfZqCcsXG4gICAgICAgICAgICA5OiAn2aknLFxuICAgICAgICAgICAgMDogJ9mgJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ9mhJzogJzEnLFxuICAgICAgICAgICAgJ9miJzogJzInLFxuICAgICAgICAgICAgJ9mjJzogJzMnLFxuICAgICAgICAgICAgJ9mkJzogJzQnLFxuICAgICAgICAgICAgJ9mlJzogJzUnLFxuICAgICAgICAgICAgJ9mmJzogJzYnLFxuICAgICAgICAgICAgJ9mnJzogJzcnLFxuICAgICAgICAgICAgJ9moJzogJzgnLFxuICAgICAgICAgICAgJ9mpJzogJzknLFxuICAgICAgICAgICAgJ9mgJzogJzAnLFxuICAgICAgICB9O1xuXG4gICAgdmFyIGFyU2EgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdhci1zYScsIHtcbiAgICAgICAgbW9udGhzOiAn2YrZhtin2YrYsV/Zgdio2LHYp9mK2LFf2YXYp9ix2LNf2KPYqNix2YrZhF/Zhdin2YrZiF/ZitmI2YbZitmIX9mK2YjZhNmK2Yhf2KPYutiz2LfYs1/Ys9io2KrZhdio2LFf2KPZg9iq2YjYqNixX9mG2YjZgdmF2KjYsV/Yr9mK2LPZhdio2LEnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ9mK2YbYp9mK2LFf2YHYqNix2KfZitixX9mF2KfYsdizX9ij2KjYsdmK2YRf2YXYp9mK2Yhf2YrZiNmG2YrZiF/ZitmI2YTZitmIX9ij2LrYs9i32LNf2LPYqNiq2YXYqNixX9ij2YPYqtmI2KjYsV/Zh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AgICAgICAgICAgIHJldHVybiAn2LUnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9mFJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb2KfZhNmK2YjZhSDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9i62K/YpyDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9i52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2KPZhdizINi52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfZgdmKICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICfZhdmG2LAgJXMnLFxuICAgICAgICAgICAgczogJ9ir2YjYp9mGJyxcbiAgICAgICAgICAgIHNzOiAnJWQg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICBtOiAn2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICBtbTogJyVkINiv2YLYp9im2YInLFxuICAgICAgICAgICAgaDogJ9iz2KfYudipJyxcbiAgICAgICAgICAgIGhoOiAnJWQg2LPYp9i52KfYqicsXG4gICAgICAgICAgICBkOiAn2YrZiNmFJyxcbiAgICAgICAgICAgIGRkOiAnJWQg2KPZitin2YUnLFxuICAgICAgICAgICAgTTogJ9i02YfYsScsXG4gICAgICAgICAgICBNTTogJyVkINij2LTZh9ixJyxcbiAgICAgICAgICAgIHk6ICfYs9mG2KknLFxuICAgICAgICAgICAgeXk6ICclZCDYs9mG2YjYp9iqJyxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmdcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvW9mh2aLZo9mk2aXZptmn2ajZqdmgXS9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgv2IwvZywgJywnKTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZ1xuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXGQvZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoLywvZywgJ9iMJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMCwgLy8gU3VuZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDYsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDZ0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBhclNhO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSAgOiAgQXJhYmljIChUdW5pc2lhKSBbYXItdG5dXG4vLyEgYXV0aG9yIDog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l0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXM6ICfYp9mE2KPYrdivX9in2YTYpdir2YbZitmGX9in2YTYq9mE2KfYq9in2KFf2KfZhNij2LHYqNi52KfYoV/Yp9mE2K7ZhdmK2LNf2KfZhNis2YXYudipX9in2YTYs9io2KonLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfYo9it2K9f2KXYq9mG2YrZhl/Yq9mE2KfYq9in2KFf2KPYsdio2LnYp9ihX9iu2YXZitizX9is2YXYudipX9iz2KjYqicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfYrV/Zhl/Yq1/YsV/Yrl/YrF/Ysycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb2KfZhNmK2YjZhSDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9i62K/YpyDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9i52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2KPZhdizINi52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfZgdmKICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICfZhdmG2LAgJXMnLFxuICAgICAgICAgICAgczogJ9ir2YjYp9mGJyxcbiAgICAgICAgICAgIHNzOiAnJWQg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICBtOiAn2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICBtbTogJyVkINiv2YLYp9im2YInLFxuICAgICAgICAgICAgaDogJ9iz2KfYudipJyxcbiAgICAgICAgICAgIGhoOiAnJWQg2LPYp9i52KfYqicsXG4gICAgICAgICAgICBkOiAn2YrZiNmFJyxcbiAgICAgICAgICAgIGRkOiAnJWQg2KPZitin2YUnLFxuICAgICAgICAgICAgTTogJ9i02YfYsScsXG4gICAgICAgICAgICBNTTogJyVkINij2LTZh9ixJyxcbiAgICAgICAgICAgIHk6ICfYs9mG2KknLFxuICAgICAgICAgICAgeXk6ICclZCDYs9mG2YjYp9iqJyxcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGFyVG47XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogQXJhYmljIFthcl1c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ICAgICfZoyc6ICczJyxcbiAgICAgICAgICAgICfZpCc6ICc0JyxcbiAgICAgICAgICAgICfZpSc6ICc1JyxcbiAgICAgICAgICAgICfZpic6ICc2JyxcbiAgICAgICAgICAgICfZpyc6ICc3JyxcbiAgICAgICAgICAgICfZqCc6ICc4JyxcbiAgICAgICAgICAgICfZqSc6ICc5JyxcbiAgICAgICAgICAgICfZoCc6ICcwJyxcbiAgICAgICAgfSxcbiAgICAgICAgcGx1cmFsRm9ybSA9IGZ1bmN0aW9uIChuKSB7XG4gICAgICAgICAgICByZXR1cm4gbiA9PT0gMFxuICAgICAgICAgICAgICAgID8gMFxuICAgICAgICAgICAgICAgIDogbiA9PT0gMVxuICAgICAgICAgICAgICAgICAgPyAxXG4gICAgICAgICAgICAgICAgICA6IG4gPT09IDJcbiAgICAgICAgICAgICAgICAgICAgPyAyXG4gICAgICAgICAgICAgICAgICAgIDogbiAlIDEwMCA+PSAzICYmIG4gJSAxMDAgPD0gMTBcbiAgICAgICAgICAgICAgICAgICAgICA/IDNcbiAgICAgICAgICAgICAgICAgICAgICA6IG4gJSAxMDAgPj0gMTFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gNFxuICAgICAgICAgICAgICAgICAgICAgICAgOiA1O1xuICAgICAgICB9LFxuICAgICAgICBwbHVyYWxzID0ge1xuICAgICAgICAgICAgczogW1xuICAgICAgICAgICAgICAgICfYo9mC2YQg2YXZhiDYq9in2YbZitipJyxcbiAgICAgICAgICAgICAgICAn2KvYp9mG2YrYqSDZiNin2K3Yr9ipJyxcbiAgICAgICAgICAgICAgICBbJ9ir2KfZhtmK2KrYp9mGJywgJ9ir2KfZhtmK2KrZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINir2YjYp9mGJyxcbiAgICAgICAgICAgICAgICAnJWQg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICAgICAgJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIG06IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICAgICAgJ9iv2YLZitmC2Kkg2YjYp9it2K/YqScsXG4gICAgICAgICAgICAgICAgWyfYr9mC2YrZgtiq2KfZhicsICfYr9mC2YrZgtiq2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYr9mC2KfYptmCJyxcbiAgICAgICAgICAgICAgICAnJWQg2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICAgICAgJyVkINiv2YLZitmC2KknLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIGg6IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2LPYp9i52KknLFxuICAgICAgICAgICAgICAgICfYs9in2LnYqSDZiNin2K3Yr9ipJyxcbiAgICAgICAgICAgICAgICBbJ9iz2KfYudiq2KfZhicsICfYs9in2LnYqtmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2LPYp9i52KfYqicsXG4gICAgICAgICAgICAgICAgJyVkINiz2KfYudipJyxcbiAgICAgICAgICAgICAgICAnJWQg2LPYp9i52KknLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIGQ6IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2YrZiNmFJyxcbiAgICAgICAgICAgICAgICAn2YrZiNmFINmI2KfYrdivJyxcbiAgICAgICAgICAgICAgICBbJ9mK2YjZhdin2YYnLCAn2YrZiNmF2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYo9mK2KfZhScsXG4gICAgICAgICAgICAgICAgJyVkINmK2YjZhdmL2KcnLFxuICAgICAgICAgICAgICAgICclZCDZitmI2YUnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIE06IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2LTZh9ixJyxcbiAgICAgICAgICAgICAgICAn2LTZh9ixINmI2KfYrdivJyxcbiAgICAgICAgICAgICAgICBbJ9i02YfYsdin2YYnLCAn2LTZh9ix2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYo9i02YfYsScsXG4gICAgICAgICAgICAgICAgJyVkINi02YfYsdinJyxcbiAgICAgICAgICAgICAgICAnJWQg2LTZh9ixJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB5OiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINi52KfZhScsXG4gICAgICAgICAgICAgICAgJ9i52KfZhSDZiNin2K3YrycsXG4gICAgICAgICAgICAgICAgWyfYudin2YXYp9mGJywgJ9i52KfZhdmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2KPYudmI2KfZhScsXG4gICAgICAgICAgICAgICAgJyVkINi52KfZhdmL2KcnLFxuICAgICAgICAgICAgICAgICclZCDYudin2YUnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgfSxcbiAgICAgICAgcGx1cmFsaXplID0gZnVuY3Rpb24gKHUpIHtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAobnVtYmVyLCB3aXRob3V0U3VmZml4LCBzdHJpbmcsIGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSBwbHVyYWxGb3JtKG51bWJlciksXG4gICAgICAgICAgICAgICAgICAgIHN0ciA9IHBsdXJhbHNbdV1bcGx1cmFsRm9ybShudW1iZXIpXTtcbiAgICAgICAgICAgICAgICBpZiAoZiA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICBzdHIgPSBzdHJbd2l0aG91dFN1ZmZpeCA/IDAgOiAxXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0ci5yZXBsYWNlKC8lZC9pLCBudW1iZXIpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzID0gW1xuICAgICAgICAgICAgJ9mK2YbYp9mK2LEnLFxuICAgICAgICAgICAgJ9mB2KjYsdin2YrYsScsXG4gICAgICAgICAgICAn2YXYp9ix2LMnLFxuICAgICAgICAgICAgJ9ij2KjYsdmK2YQnLFxuICAgICAgICAgICAgJ9mF2KfZitmIJyxcbiAgICAgICAgICAgICfZitmI2YbZitmIJyxcbiAgICAgICAgICAgICfZitmI2YTZitmIJyxcbiAgICAgICAgICAgICfYo9i62LPYt9izJyxcbiAgICAgICAgICAgICfYs9io2KrZhdio2LEnLFxuICAgICAgICAgICAgJ9ij2YPYqtmI2KjYsScsXG4gICAgICAgICAgICAn2YbZiNmB2YXYqNixJyxcbiAgICAgICAgICAgICfYr9mK2LPZhdio2LEnLFxuICAgICAgICBdO1xuXG4gICAgdmFyIGFyID0gbW9tZW50LmRlZmluZUxvY2FsZSgnYXInLCB7XG4gICAgICAgIG1vbnRoczogbW9udGhzLFxuICAgICAgICBtb250aHNTaG9ydDogbW9udGhzLFxuICAgICAgICB3ZWVrZGF5czogJ9in2YTYo9it2K9f2KfZhNil2KvZhtmK2YZf2KfZhNir2YTYp9ir2KfYoV/Yp9mE2KPYsdio2LnYp9ihX9in2YTYrtmF2YrYs1/Yp9mE2KzZhdi52Klf2KfZhNiz2KjYqicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ9ij2K3Yr1/Ypdir2YbZitmGX9ir2YTYp9ir2KfYoV/Yo9ix2KjYudin2KFf2K7ZhdmK2LNf2KzZhdi52Klf2LPYqNiqJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ9itX9mGX9irX9ixX9iuX9isX9izJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdEL1xcdTIwMEZNL1xcdTIwMEZZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv2LV82YUvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAn2YUnID09PSBpbnB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9i1JztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfZhSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2YTZitmI2YUg2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYutiv2YvYpyDYudmG2K8g2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9i52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2KPZhdizINi52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfYqNi52K8gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ9mF2YbYsCAlcycsXG4gICAgICAgICAgICBzOiBwbHVyYWxpemUoJ3MnKSxcbiAgICAgICAgICAgIHNzOiBwbHVyYWxpemUoJ3MnKSxcbiAgICAgICAgICAgIG06IHBsdXJhbGl6ZSgnbScpLFxuICAgICAgICAgICAgbW06IHBsdXJhbGl6ZSgnbScpLFxuICAgICAgICAgICAgaDogcGx1cmFsaXplKCdoJyksXG4gICAgICAgICAgICBoaDogcGx1cmFsaXplKCdoJyksXG4gICAgICAgICAgICBkOiBwbHVyYWxpemUoJ2QnKSxcbiAgICAgICAgICAgIGRkOiBwbHVyYWxpemUoJ2QnKSxcbiAgICAgICAgICAgIE06IHBsdXJhbGl6ZSgnTScpLFxuICAgICAgICAgICAgTU06IHBsdXJhbGl6ZSgnTScpLFxuICAgICAgICAgICAgeTogcGx1cmFsaXplKCd5JyksXG4gICAgICAgICAgICB5eTogcGx1cmFsaXplKCd5JyksXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL1vZodmi2aPZpNml2abZp9mo2anZoF0vZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL9iML2csICcsJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmdcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sTWFwW21hdGNoXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8sL2csICfYjCcpO1xuICAgICAgIC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knLFxuICAgICAgICAgICAgaDogJ2JpciBzYWF0JyxcbiAgICAgICAgICAgIGhoOiAnJWQgc2FhdCcsXG4gICAgICAgICAgICBkOiAnYmlyIGfDvG4nLFxuICAgICAgICAgICAgZGQ6ICclZCBnw7xuJyxcbiAgICAgICAgICAgIE06ICdiaXIgYXknLFxuICAgICAgICAgICAgTU06ICclZCBheScsXG4gICAgICAgICAgICB5OiAnYmlyIGlsJyxcbiAgICAgICAgICAgIHl5OiAnJWQgaWwnLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvZ2VjyZl8c8mZaMmZcnxnw7xuZMO8enxheMWfYW0vLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAvXihnw7xuZMO8enxheMWfYW0pJC8udGVzdChpbnB1dCk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2dlY8mZJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdzyZloyZlyJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE3KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdnw7xuZMO8eic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAnYXjFn2FtJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9LSjEsW5jxLF8aW5jaXxuY2l8w7xuY8O8fG5jxLF8dW5jdSkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgIC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ExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb0KPRh9C+0YDQsCDRnl0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1vQo10gZGRkZCBb0Z5dIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vQoyDQvNGW0L3Rg9C70YPRjl0gZGRkZCBb0Z5dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9CjINC80ZbQvdGD0LvRi10gZGRkZCBb0Z5dIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfQv9GA0LDQtyAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMg0YLQsNC80YMnLFxuICAgICAgICAgICAgczogJ9C90LXQutCw0LvRjNC60ZYg0YHQtdC60YPQvdC0JyxcbiAgICAgICAgICAgIG06IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBtbTogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIGg6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBoaDogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIGQ6ICfQtNC30LXQvdGMJyxcbiAgICAgICAgICAgIGRkOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgTTogJ9C80LXRgdGP0YYnLFxuICAgICAgICAgICAgTU06IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICB5OiAn0LPQvtC0JyxcbiAgICAgICAgICAgIHl5OiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv0L3QvtGH0Yt80YDQsNC90ZbRhtGLfNC00L3Rj3zQstC10YfQsNGA0LAvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAvXijQtNC90Y980LLQtdGH0LDRgNCwKSQvLnRlc3QoaW5wdXQpO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfQvdC+0YfRiyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0YDQsNC90ZbRhtGLJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE3KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfQtNC90Y8nO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9Cy0LXRh9Cw0YDQsCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfS0o0ZZ80Yt80LPQsCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChudW1iZXIgJSAxMCA9PT0gMiB8fCBudW1iZXIgJSAxMCA9PT0gMykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bWJlciAlIDEwMCAhPT0gMTIgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bWJlciAlIDEwMCAhPT0gMTNcbiAgICAgICAgICAgICAgICAgICAgICAgID8gbnVtYmVyICsgJy3RlidcbiAgICAgICAgICAgICAgICAgICAgICAgIDogbnVtYmVyICsgJy3Riyc7XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdCz0LAnO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDcsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDd0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBiZTtcblxufSkpKTtcbiIsIi8vISBtb21lb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aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JzQuNC90LDQu9Cw0YLQsF0gZGRkZCBb0LJdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JzQuNC90LDQu9C40Y9dIGRkZGQgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn0YHQu9C10LQgJXMnLFxuICAgICAgICAgICAgcGFzdDogJ9C/0YDQtdC00LggJXMnLFxuICAgICAgICAgICAgczogJ9C90Y/QutC+0LvQutC+INGB0LXQutGD0L3QtNC4JyxcbiAgICAgICAgICAgIHNzOiAnJWQg0YHQtdC60YPQvdC00LgnLFxuICAgICAgICAgICAgbTogJ9C80LjQvdGD0YLQsCcsXG4gICAgICAgICAgICBtbTogJyVkINC80LjQvdGD0YLQuCcsXG4gICAgICAgICAgICBoOiAn0YfQsNGBJyxcbiAgICAgICAgICAgIGhoOiAnJWQg0YfQsNGB0LAnLFxuICAgICAgICAgICAgZDogJ9C00LXQvScsXG4gICAgICAgICAgICBkZDogJyVkINC00LXQvdCwJyxcbiAgICAgICAgICAgIHc6ICfRgdC10LTQvNC40YbQsCcsXG4gICAgICAgICAgICB3dzogJyVkINGB0LXQtNC80LjRhtC4JyxcbiAgICAgICAgICAgIE06ICfQvNC10YHQtdGGJyxcbiAgICAgICAgICAgIE1NOiAnJWQg0LzQtdGB0LXRhtCwJyxcbiAgICAgICAgICAgIHk6ICfQs9C+0LTQuNC90LAnLFxuICAgICAgICAgICAgeXk6ICclZCDQs9C+0LTQuNC90LgnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0tKNC10LJ80LXQvXzRgtC4fNCy0Lh80YDQuHzQvNC4KS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBsYXN0RGlnaXQgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBsYXN0MkRpZ2l0cyA9IG51bWJlciAlIDEwMDtcbiAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3QtdCyJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdDJEaWdpdHMgPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3QtdC9JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdDJEaWdpdHMgPiAxMCAmJiBsYXN0MkRpZ2l0cyA8IDIwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct0YLQuCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGxhc3REaWdpdCA9PT0gMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdCy0LgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChsYXN0RGlnaXQgPT09IDIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3RgNC4JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdERpZ2l0ID09PSA3IHx8IGxhc3REaWdpdCA9PT0gOCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZ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Y2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbQmkgbMmbcsmbXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW1NpbmkgbMmbcsmbXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2RvbiBsyZtyyZtdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbS3VudSBsyZtyyZtdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbdMmbbcmbbmVuIGzJm3LJm10gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyBryZRuyZQnLFxuICAgICAgICAgICAgcGFzdDogJ2EgYsmbICVzIGLJlCcsXG4gICAgICAgICAgICBzOiAnc2FuZ2EgZGFtYSBkYW1hJyxcbiAgICAgICAgICAgIHNzOiAnc2Vrb25kaSAlZCcsXG4gICAgICAgICAgICBtOiAnbWluaXRpIGtlbGVuJyxcbiAgICAgICAgICAgIG1tOiAnbWluaXRpICVkJyxcbiAgICAgICAgICAgIGg6ICdsyZtyyZsga2VsZW4nLFxuICAgICAgICAgICAgaGg6ICdsyZtyyZsgJWQnLFxuICAgICAgICAgICAgZDogJ3RpbGUga2VsZW4nLFxuICAgICAgICAgICAgZGQ6ICd0aWxlICVkJyxcbiAgICAgICAgICAgIE06ICdrYWxvIGtlbGVuJyxcbiAgICAgICAgICAgIE1NOiAna2FsbyAlZCcsXG4gICAgICAgICAgICB5OiAnc2FuIGtlbGVuJyxcbiAgICAgICAgICAgIHl5OiAnc2FuICVkJyxcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhl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g6ICfgp64nLFxuICAgICAgICAgICAgOTogJ+CnrycsXG4gICAgICAgICAgICAwOiAn4KemJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ+Cnpyc6ICcxJyxcbiAgICAgICAgICAgICfgp6gnOiAnMicsXG4gICAgICAgICAgICAn4KepJzogJzMnLFxuICAgICAgICAgICAgJ+Cnqic6ICc0JyxcbiAgICAgICAgICAgICfgp6snOiAnNScsXG4gICAgICAgICAgICAn4KesJzogJzYnLFxuICAgICAgICAgICAgJ+CnrSc6ICc3JyxcbiAgICAgICAgICAgICfgp64nOiAnOCcsXG4gICAgICAgICAgICAn4KevJzogJzknLFxuICAgICAgICAgICAgJ+Cnpic6ICcwJyxcbiAgICAgICAgfTtcblxuICAgIHZhciBibkJkID0gbW9tZW50LmRlZmluZUxvY2FsZSgnYm4tYmQnLCB7XG4gICAgICAgIG1vbnRoczogJ+CmnOCmvuCmqOCngeCnn+CmvuCmsOCmv1/gpqvgp4fgpqzgp43gprDgp4Hgp5/gpr7gprDgpr9f4Kau4Ka+4Kaw4KeN4KaaX+Cmj+CmquCnjeCmsOCmv+Cmsl/gpq7gp4df4Kac4KeB4KaoX+CmnOCngeCmsuCmvuCmh1/gpobgppfgprjgp43gpp9f4Ka44KeH4Kaq4KeN4Kaf4KeH4Kau4KeN4Kas4KawX+CmheCmleCnjeCmn+Cni+CmrOCmsF/gpqjgpq3gp4fgpq7gp43gpqzgprBf4Kah4Ka/4Ka44KeH4Kau4KeN4Kas4KawJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICfgppzgpr7gpqjgp4Ff4Kar4KeH4Kas4KeN4Kaw4KeBX+CmruCmvuCmsOCnjeCmml/gpo/gpqrgp43gprDgpr/gprJf4Kau4KeHX+CmnOCngeCmqF/gppzgp4HgprLgpr7gpodf4KaG4KaX4Ka44KeN4KafX+C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m1tIOCmuOCmruCnnycsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+CmhuCmnF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vgpobgppfgpr7gpq7gp4DgppXgpr7gprJdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCwgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vgppfgpqTgppXgpr7gprJdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+Cml+CmpF0gZGRkZCwgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDgpqrgprDgp4cnLFxuICAgICAgICAgICAgcGFzdDogJyVzIOCmhuCml+CnhycsXG4gICAgICAgICAgICBzOiAn4KaV4Kef4KeH4KaVIOCmuOCnh+CmleCnh+CmqOCnjeCmoScsXG4gICAgICAgICAgICBzczogJyVkIOCmuOCnh+CmleCnh+CmqOCnjeCmoScsXG4gICAgICAgICAgICBtOiAn4KaP4KaVIOCmruCmv+CmqOCmv+CmnycsXG4gICAgICAgICAgICBtbTogJyVkIOCmruCmv+CmqOCmv+CmnycsXG4gICAgICAgICAgICBoOiAn4KaP4KaVIOCmmOCmqOCnjeCmn+CmvicsXG4gICAgICAgICAgICBoaDogJyVkIOCmmOCmqOCnjeCmn+CmvicsXG4gICAgICAgICAgICBkOiAn4KaP4KaVIOCmpuCmv+CmqCcsXG4gICAgICAgICAgICBkZDogJyVkIOCmpuCmv+CmqCcsXG4gICAgICAgICAgICBNOiAn4KaP4KaVIOCmruCmvuCmuCcsXG4gICAgICAgICAgICBNTTogJyVkIOCmruCmvuCmuCcsXG4gICAgICAgICAgICB5OiAn4KaP4KaVIOCmrOCmm+CmsCcsXG4gICAgICAgICAgICB5eTogJyVkIOCmrOCmm+CmsCcsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1vgp6fgp6jgp6ngp6rgp6vgp6zgp63gp67gp6/gp6ZdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+CmsOCmvuCmpHzgpq3gp4vgprB84Ka44KaV4Ka+4KayfOCmpuCngeCmquCngeCmsHzgpqzgpr/gppXgpr7gprJ84Ka44Kao4KeN4Kan4KeN4Kav4Ka+fOCmsOCmvuCmpC8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+CmsOCmvuCmpCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA8IDQgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CmreCni+CmsCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgprjgppXgpr7gprInKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4Kam4KeB4Kaq4KeB4KawJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDMgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CmrOCmv+CmleCmvuCmsicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CmuOCmqOCnjeCmp+CnjeCmr+CmvicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CmsOCmvuCmpCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCA2KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgpq3gp4vgprAnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CmuOCmleCmvuCmsic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Kam4KeB4Kaq4KeB4KawJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE4KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgpqzgpr/gppXgpr7gprInO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMjApIHtcbiAgICAgICAgICAgIC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GUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHN5bWJvbE1hcCA9IHtcbiAgICAgICAgICAgIDE6ICfgp6cnLFxuICAgICAgICAgICAgMjogJ+CnqCcsXG4gICAgICAgICAgICAzOiAn4KepJyxcbiAgICAgICAgICAgIDQ6ICfgp6onLFxuICAgICAgICAgICAgNTogJ+CnqycsXG4gICAgICAgICAgICA2OiAn4KesJyxcbiAgICAgICAgICAgIDc6ICfgp60nLFxuICAgICAgICAgICAgODogJ+CnricsXG4gICAgICAgICAgICA5OiAn4KevJyxcbiAgICAgICAgICAgIDA6ICfgp6YnLFxuICAgICAgICB9LFxuICAgICAgICBudW1iZXJNYXAgPSB7XG4gICAgICAgICAgICAn4KenJzogJzEnLFxuICAgICAgICAgICAgJ+CnqCc6ICcyJyxcbiAgICAgICAgICAgICfgp6knOiAnMycsXG4gICAgICAgICAgICAn4KeqJzogJzQnLFxuICAgICAgICAgICAgJ+Cnqyc6ICc1JyxcbiAgICAgICAgICAgICfgp6wnOiAnNicsXG4gICAgICAgICAgICAn4KetJzogJzcnLFxuICAgICAgICAgICAgJ+Cnric6ICc4JyxcbiAgICAgICAgICAgICfgp68nOiAnOScsXG4gICAgICAgICAgICAn4KemJzogJzAnLFxuICAgICAgICB9O1xuXG4gICAgdmFyIGJuID0gbW9tZW50LmRlZmluZUxvY2FsZSgnYm4nLCB7XG4gICAgICAgIG1vbnRoczogJ+CmnOCmvuCmqOCngeCnn+CmvuCmsOCmv1/gpqvgp4fgpqzgp43gprDgp4Hgp5/gpr7gprDgpr9f4Kau4Ka+4Kaw4KeN4KaaX+Cmj+CmquCnjeCmsOCmv+Cmsl/gpq7gp4df4Kac4KeB4KaoX+CmnOCngeCmsuCmvuCmh1/gpobgppfgprjgp43gpp9f4Ka44KeH4Kaq4KeN4Kaf4KeH4Kau4KeN4Kas4KawX+CmheCmleCnjeCmn+Cni+CmrOCmsF/gpqjgpq3gp4fgpq7gp43gpqzgprBf4Kah4Ka/4Ka44KeH4K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nLFxuICAgICAgICAgICAgTFRTOiAnQSBoOm1tOnNzIOCmuOCmruCnnycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZLCBBIGg6bW0g4Ka44Kau4KefJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSwgQSBoOm1tIOCmuOCmruCnnycsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+CmhuCmnF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vgpobgppfgpr7gpq7gp4DgppXgpr7gprJdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCwgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vgppfgpqTgppXgpr7gprJdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+Cml+CmpF0gZGRkZCwgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDgpqrgprDgp4cnLFxuICAgICAgICAgICAgcGFzdDogJyVzIOCmhuCml+CnhycsXG4gICAgICAgICAgICBzOiAn4KaV4Kef4KeH4KaVIOCmuOCnh+CmleCnh+CmqOCnjeCmoScsXG4gICAgICAgICAgICBzczogJyVkIOCmuOCnh+CmleCnh+CmqOCnjeCmoScsXG4gICAgICAgICAgICBtOiAn4KaP4KaVIOCmruCmv+CmqOCmv+CmnycsXG4gICAgICAgICAgICBtbTogJyVkIOCmruCmv+CmqOCmv+CmnycsXG4gICAgICAgICAgICBoOiAn4KaP4KaVIOCmmOCmqOCnjeCmn+CmvicsXG4gICAgICAgICAgICBoaDogJyVkIOCmmOCmqOCnjeCmn+CmvicsXG4gICAgICAgICAgICBkOiAn4KaP4KaVIOCmpuCmv+CmqCcsXG4gICAgICAgICAgICBkZDogJyVkIOCmpuCmv+CmqCcsXG4gICAgICAgICAgICBNOiAn4KaP4KaVIOCmruCmvuCmuCcsXG4gICAgICAgICAgICBNTTogJyVkIOCmruCmvuCmuCcsXG4gICAgICAgICAgICB5OiAn4KaP4KaVIOCmrOCmm+CmsCcsXG4gICAgICAgICAgICB5eTogJyVkIOCmrOCmm+CmsCcsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1vgp6fgp6jgp6ngp6rgp6vgp6zgp63gp67gp6/gp6ZdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gprDgpr7gpqR84Ka44KaV4Ka+4KayfOCmpuCngeCmquCngeCmsHzgpqzgpr/gppXgpr7gprJ84Kaw4Ka+4KakLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIChtZXJpZGllbSA9PT0gJ+CmsOCmvuCmpCcgJiYgaG91ciA+PSA0KSB8fFxuICAgICAgICAgICAgICAgIChtZXJpZGllbSA9PT0gJ+CmpuCngeCmquCngeCmsCcgJiYgaG91ciA8IDUpIHx8XG4gICAgICAgICAgICAgICAgbWVyaWRpZW0gPT09ICfgpqzgpr/gppXgpr7gprInXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgNCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Kaw4Ka+4KakJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgprjgppXgpr7gprInO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CmpuCngeCmquCngeCmsCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAyMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Kas4Ka/4KaV4Ka+4KayJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgprDgpr7gpqQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDAsIC8vIFN1bmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA2LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA2dGggaXMgdGhlIGZpcnN0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AgICAgbTogJ+C9puC+kOC9ouC8i+C9mOC8i+C9guC9heC9suC9gicsXG4gICAgICAgICAgICBtbTogJyVkIOC9puC+kOC9ouC8i+C9mCcsXG4gICAgICAgICAgICBoOiAn4L2G4L204LyL4L2a4L284L2R4LyL4L2C4L2F4L2y4L2CJyxcbiAgICAgICAgICAgIGhoOiAnJWQg4L2G4L204LyL4L2a4L284L2RJyxcbiAgICAgICAgICAgIGQ6ICfgvYngvbLgvZPgvIvgvYLgvYXgvbLgvYInLFxuICAgICAgICAgICAgZGQ6ICclZCDgvYngvbLgvZPgvIsnLFxuICAgICAgICAgICAgTTogJ+C9n+C+s+C8i+C9luC8i+C9guC9heC9suC9gicsXG4gICAgICAgICAgICBNTTogJyVkIOC9n+C+s+C8i+C9licsXG4gICAgICAgICAgICB5OiAn4L2j4L284LyL4L2C4L2F4L2y4L2CJyxcbiAgICAgICAgICAgIHl5OiAnJWQg4L2j4L28JyxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvW+C8oeC8ouC8o+C8pOC8peC8puC8p+C8qOC8qeC8oF0vZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC9cXGQvZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbE1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+C9mOC9muC9k+C8i+C9mOC9vHzgvZ7gvbzgvYLgvabgvIvgvYDgvaZ84L2J4L2y4L2T4LyL4L2C4L204L2EfOC9keC9guC9vOC9hOC8i+C9keC9gnzgvZjgvZrgvZPgvIvgvZjgvbwvLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgKG1lcmlkaWVtID09PSAn4L2Y4L2a4L2T4LyL4L2Y4L28JyAmJiBob3VyID49IDQpIHx8XG4gICAgICAgICAgICAgICAgKG1lcmlkaWVtID09PSAn4L2J4L2y4L2T4LyL4L2C4L204L2EJyAmJiBob3VyIDwgNSkgfHxcbiAgICAgICAgICAgICAgICBtZXJpZGllbSA9PT0gJ+C9keC9guC9vOC9hOC8i+C9keC9gidcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgvZjgvZrgvZPgvIvgvZjgvbwnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+C9nuC9vOC9guC9puC8i+C9gOC9pic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNykge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4L2J4L2y4L2T4LyL4L2C4L204L2EJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDIwKSB7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IC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIGZ1bmN0aW9uIHJlbGF0aXZlVGltZVdpdGhNdXRhdGlvbihudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSkge1xuICAgICAgICB2YXIgZm9ybWF0ID0ge1xuICAgICAgICAgICAgbW06ICdtdW51dGVubicsXG4gICAgICAgICAgICBNTTogJ21peicsXG4gICAgICAgICAgICBkZDogJ2RldmV6aCcsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBudW1iZXIgKyAnICcgKyBtdXRhdGlvbihmb3JtYXRba2V5XSwgbnVtYmVyKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gc3BlY2lhbE11dGF0aW9uRm9yWWVhcnMobnVtYmVyKSB7XG4gICAgICAgIHN3aXRjaCAobGFzdE51bWJlcihudW1iZXIpKSB7XG4gICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICBjYXNlIDk6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcgYmxvYXonO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJyB2bG9heic7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gbGFzdE51bWJlcihudW1iZXIpIHtcbiAgICAgICAgaWYgKG51bWJlciA+IDkpIHtcbiAgICAgICAgICAgIHJldHVybiBsYXN0TnVtYmVyKG51bWJlciAlIDEwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgIH1cbiAgICBmdW5jdGlvbiBtdXRhdGlvbih0ZXh0LCBudW1iZXIpIHtcbiAgICAgICAgaWYgKG51bWJlciA9PT0gMikge1xuICAgICAgICAgICAgcmV0dXJuIHNvZnRNdXRhdGlvbih0ZXh0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGV4dDtcbiAgICB9XG4gICAgZnVuY3Rpb24gc29mdE11dGF0aW9uKHRleHQpIHtcbiAgICAgICAgdmFyIG11dGF0aW9uVGFibGUgPSB7XG4gICAgICAgICAgICBtOiAndicsXG4gICAgICAgICAgICBiOiAndicsXG4gICAgICAgICAgICBkOiAneicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChtdXRhdGlvblRhYmxlW3RleHQuY2hhckF0KDApXSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXR1cm4gdGV4dDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbXV0YXRpb25UYWJsZVt0ZXh0LmNoYXJBdCgwKV0gKyB0ZXh0LnN1YnN0cmluZygxKTtcbiAgICB9XG5cbiAgICB2YXIgbW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXmdlbi9pLFxuICAgICAgICAgICAgL15jW8q8XFwnXWh3ZS9pLFxuICAgICAgICAgICAgL15tZXUvaSxcbiAgICAgICAgICAgIC9eZWJyL2ksXG4gICAgICAgICAgICAvXm1hZS9pLFxuICAgICAgICAgICAgL14obWV6fGV2ZSkvaSxcbiAgICAgICAgICAgIC9eZ291L2ksXG4gICAgICAgICAgICAvXmVvcy9pLFxuICAgICAgICAgICAgL15nd2UvaSxcbiAgICAgICAgICAgIC9eaGVyL2ksXG4gICAgICAgICAgICAvXmR1L2ksXG4gICAgICAgICAgICAvXmtlci9pLFxuICAgICAgICBdLFxuICAgICAgICBtb250aHNSZWdleCA9XG4gICAgICAgICAgICAvXihnZW52ZXJ8Y1vKvFxcJ11od2V2cmVyfG1ldXJ6aHxlYnJlbHxtYWV8bWV6aGV2ZW58Z291ZXJlfGVvc3R8Z3dlbmdvbG98aGVyZXxkdXxrZXJ6dXxnZW58Y1vKvFxcJ11od2V8bWV1fGVicnxtYWV8ZXZlfGdvdXxlb3N8Z3dlfGhlcnxkdXxrZXIpL2ksXG4gICAgICAgIG1vbnRoc1N0cmljdFJlZ2V4ID1cbiAgICAgICAgICAgIC9eKGdlbnZlcnxjW8q8XFwnXWh3ZXZyZXJ8bWV1cnpofGVicmVsfG1hZXxtZXpoZXZlbnxnb3VlcmV8ZW9zdHxnd2VuZ29sb3xoZXJlfGR1fGtlcnp1KS9pLFxuICAgICAgICBtb250aHNTaG9ydFN0cmljdFJlZ2V4ID1cbiAgICAgICAgICAgIC9eKGdlbnxjW8q8XFwnXWh3ZXxtZXV8ZWJyfG1hZXxldmV8Z291fGVvc3xnd2V8aGVyfGR1fGtlcikvaSxcbiAgICAgICAgZnVsbFdlZWtkYXlzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXnN1bC9pLFxuICAgICAgICAgICAgL15sdW4vaSxcbiAgICAgICAgICAgIC9ebWV1cnpoL2ksXG4gICAgICAgICAgICAvXm1lcmNbyrxcXCddaGVyL2ksXG4gICAgICAgICAgICAvXnlhb3UvaSxcbiAgICAgICAgICAgIC9eZ3dlbmVyL2ksXG4gICAgICAgICAgICAvXnNhZG9ybi9pLFxuICAgICAgICBdLFxuICAgICAgICBzaG9ydFdlZWtkYXlzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXlN1bC9pLFxuICAgICAgICAgICAgL15MdW4vaSxcbiAgICAgICAgICAgIC9eTWV1L2ksXG4gICAgICAgICAgICAvXk1lci9pLFxuICAgICAgICAgICAgL15ZYW8vaSxcbiAgICAgICAgICAgIC9eR3dlL2ksXG4gICAgICAgICAgICAvXlNhZC9pLFxuICAgICAgICBdLFxuICAgICAgICBtaW5XZWVrZGF5c1BhcnNlID0gW1xuICAgICAgICAgICAgL15TdS9pLFxuICAgICAgICAgICAgL15MdS9pLFxuICAgICAgICAgICAgL15NZShbXnJdfCQpL2ksXG4gICAgICAgICAgICAvXk1lci9pLFxuICAgICAgICAgICAgL15ZYS9pLFxuICAgICAgICAgICAgL15Hdy9pLFxuICAgICAgICAgICAgL15TYS9pLFxuICAgICAgICBdO1xuXG4gICAgdmFy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SZWdleCxcbiAgICAgICAgbW9udGhzUGFyc2U6IG1vbnRoc1BhcnNlLFxuICAgICAgICBsb25nTW9udGhzUGFyc2U6IG1vbnRoc1BhcnNlLFxuICAgICAgICBzaG9ydE1vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcblxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgW2Egdml6XSBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBbYSB2aXpdIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBbYSB2aXpdIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0hpeml2IGRhXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW1dhcmPKvGhvYXpoIGRhXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2RhXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0RlY8q8aCBkYV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFtwYXNldCBkYV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdhLWJlbm4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIMq8em8nLFxuICAgICAgICAgICAgczogJ3VuIG5lYmV1ZCBzZWdvbmRlbm5vw7knLFxuICAgICAgICAgICAgc3M6ICclZCBlaWxlbm4nLFxuICAgICAgICAgICAgbTogJ3VyIHZ1bnV0ZW5uJyxcbiAgICAgICAgICAgIG1tOiByZWxhdGl2ZVRpbWVXaXRoTXV0YXRpb24sXG4gICAgICAgICAgICBoOiAndW4gZXVyJyxcbiAgICAgICAgICAgIGhoOiAnJWQgZXVyJyxcbiAgICAgICAgICAgIGQ6ICd1biBkZXZlemgnLFxuICAgICAgICAgICAgZGQ6IHJlbGF0aXZlVGltZVdpdGhNdXRhdGlvbixcbiAgICAgICAgICAgIE06ICd1ciBtaXonLFxuICAgICAgICAgICAgTU06IHJlbGF0aXZlVGltZVdpdGhNdXRhdGlvbixcbiAgICAgICAgICAgIHk6ICd1ciBibG9heicsXG4gICAgICAgICAgICB5eTogc3BlY2lhbE11dGF0aW9uRm9yWWVhcnMsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShhw7F8dmV0KS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBvdXRwdXQgPSBudW1iZXIgPT09IDEgPyAnYcOxJyA6ICd2ZXQnO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvYS5tLnxnLm0uLywgLy8gZ291ZGUgbWVyZW5uIHwgYS1yYW9rIG1lcmVublxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgICAgICAgIHJldHVybiB0b2tlbiA9PT0gJ2cubS4nO1xuICAgICAgICB9LFxuICAgICAgICBtZXJp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G4gICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeFxuICAgICAgICAgICAgICAgICAgICA/ICdqZWRuYSBtaW51dGEnXG4gICAgICAgICAgICAgICAgICAgIDogaXNGdXR1cmVcbiAgICAgICAgICAgICAgICAgICAgICA/ICdqZWRudSBtaW51dHUnXG4gICAgICAgICAgICAgICAgICAgICAgOiAnamVkbmUgbWludXRlJztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHRyYW5zbGF0ZShudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSkge1xuICAgICAgICB2YXIgcmVzdWx0ID0gbnVtYmVyICsgJyAnO1xuICAgICAgICBzd2l0Y2ggKGtleSkge1xuICAgICAgICAgICAgY2FzZSAnc3MnOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdzZWt1bmRhJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMiB8fCBudW1iZXIgPT09IDMgfHwgbnVtYmVyID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnc2VrdW5kZSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdzZWt1bmRpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnbWludXRhJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMiB8fCBudW1iZXIgPT09IDMgfHwgbnVtYmVyID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnbWludXRlJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ21pbnV0YSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICdoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdqZWRhbiBzYXQnIDogJ2plZGFuIHNhdCc7XG4gICAgICAgICAgICBjYXNlICdoaCc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ3NhdCc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIgfHwgbnVtYmVyID09PSAzIHx8IG51bWJlciA9PT0gNCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ3NhdGEnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnc2F0aSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICdkZCc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ2Rhbic7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdkYW5hJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ01NJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnbWplc2VjJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMiB8fCBudW1iZXIgPT09IDMgfHwgbnVtYmVyID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnbWplc2VjYSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdtamVzZWNpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ3l5JzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnZ29kaW5hJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMiB8fCBudW1iZXIgPT09IDMgfHwgbnVtYmVyID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnZ29kaW5lJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ2dvZGluYSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIgYnMgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdicycsIHtcbiAgICAgICAgbW9udGhzOiAnamFudWFyX2ZlYnJ1YXJfbWFydF9hcHJpbF9tYWpfanVuaV9qdWxpX2F1Z3VzdF9zZXB0ZW1iYXJfb2t0b2Jhcl9ub3ZlbWJhcl9kZWNlbWJhcicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAnamFuLl9mZWIuX21hci5fYXByLl9tYWouX2p1bi5fanVsLl9hdWcuX3NlcC5fb2t0Ll9ub3YuX2RlYy4nLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgbW9udGhzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgd2Vla2RheXM6ICduZWRqZWxqYV9wb25lZGplbGpha191dG9yYWtfc3JpamVkYV/EjWV0dnJ0YWtfcGV0YWtfc3Vib3RhJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnbmVkLl9wb24uX3V0by5fc3JpLl/EjWV0Ll9wZXQuX3N1Yi4nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnbmVfcG9fdXRfc3JfxI1lX3BlX3N1Jy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QuIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdELiBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRC4gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tkYW5hcyB1XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW3N1dHJhIHVdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIFtuZWRqZWxqdV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdV0gW3NyaWplZHVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIFtzdWJvdHVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIGRkZGQgW3VdIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogJ1tqdcSNZXIgdV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1twcm/FoWx1XSBkZGRkIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3Byb8WhbGVdIFtzdWJvdGVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3Byb8WhbGldIGRkZGQgW3VdIExUJztcbiAgICAgICAgICAgICAgICB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wbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgICAgIGlzRm9ybWF0OiAvRFtvRF0/KFxccykrTU1NTS8sXG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ2dlbi5fZmVici5fbWFyw6dfYWJyLl9tYWlnX2p1bnlfanVsLl9hZy5fc2V0Ll9vY3QuX25vdi5fZGVzLicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICB3ZWVrZGF5czpcbiAgICAgICAgICAgICdkaXVtZW5nZV9kaWxsdW5zX2RpbWFydHNfZGltZWNyZXNfZGlqb3VzX2RpdmVuZHJlc19kaXNzYWJ0ZScuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnZGcuX2RsLl9kdC5fZGMuX2RqLl9kdi5fZHMuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ2RnX2RsX2R0X2RjX2RqX2R2X2RzJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBbZGVdIFlZWVknLFxuICAgICAgICAgICAgbGw6ICdEIE1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBbZGVdIFlZWVkgW2EgbGVzXSBIOm1tJyxcbiAgICAgICAgICAgIGxsbDogJ0QgTU1NIFlZWVksIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRCBNTU1NIFtkZV0gWVlZWSBbYSBsZXNdIEg6bW0nLFxuICAgICAgICAgICAgbGxsbDogJ2RkZCBEIE1NTSBZWVlZLCBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1thdnVpIGEgJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAnbGVzJyA6ICdsYScpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHREYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1tkZW3DoCBhICcgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ2xlcycgOiAnbGEnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZGRkZCBbYSAnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdsZXMnIDogJ2xhJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW2FoaXIgYSAnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdsZXMnIDogJ2xhJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAnW2VsXSBkZGRkIFtwYXNzYXQgYSAnICtcbiAgICAgICAgICAgICAgICAgICAgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdsZXMnIDogJ2xhJykgK1xuICAgICAgICAgICAgICAgICAgICAnXSBMVCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiBcImQnYXF1w60gJXNcIixcbiAgICAgICAgICAgIHBhc3Q6ICdmYSAlcycsXG4gICAgICAgICAgICBzOiAndW5zIHNlZ29ucycsXG4gICAgICAgICAgICBzczogJyVkIHNlZ29ucycsXG4gICAgICAgICAgICBtOiAndW4gbWludXQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dHMnLFxuICAgICAgICAgICAgaDogJ3VuYSBob3JhJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaG9yZXMnLFxuICAgICAgICAgICAgZDogJ3VuIGRpYScsXG4gICAgICAgICAgICBkZDogJyVkIGRpZXMnLFxuICAgICAgICAgICAgTTogJ3VuIG1lcycsXG4gICAgICAgICAgICBNTTogJyVkIG1lc29zJyxcbiAgICAgICAgICAgIHk6ICd1biBhbnknLFxuICAgICAgICAgICAgeXk6ICclZCBhbnlzJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHJ8bnx0fMOofGEpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICB2YXIgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICBudW1iZXIgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgPyAncidcbiAgICAgICAgICAgICAgICAgICAgOiBudW1iZXIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICA/ICduJ1xuICAgICAgICAgICAgICAgICAgICAgIDogbnVtYmVyID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICdyJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBudW1iZXIgPT09IDRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgP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pIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIG1vbnRocyA9IHtcbiAgICAgICAgICAgIHN0YW5kYWxvbmU6XG4gICAgICAgICAgICAgICAgJ2xlZGVuX8O6bm9yX2LFmWV6ZW5fZHViZW5fa3bEm3Rlbl/EjWVydmVuX8SNZXJ2ZW5lY19zcnBlbl96w6HFmcOtX8WZw61qZW5fbGlzdG9wYWRfcHJvc2luZWMnLnNwbGl0KFxuICAgICAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgZm9ybWF0OiAnbGVkbmFfw7pub3JhX2LFmWV6bmFfZHVibmFfa3bEm3RuYV/EjWVydm5hX8SNZXJ2ZW5jZV9zcnBuYV96w6HFmcOtX8WZw61qbmFfbGlzdG9wYWR1X3Byb3NpbmNlJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICBpc0Zvcm1hdDogL0REP1tvLl0/KFxcW1teXFxbXFxdXSpcXF18XFxzKStNTU1NLyxcbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzU2hvcnQgPSAnbGVkX8O6bm9fYsWZZV9kdWJfa3bEm1/EjXZuX8SNdmNfc3JwX3rDocWZX8WZw61qX2xpc19wcm8nLnNwbGl0KCdfJyksXG4gICAgICAgIG1vbnRoc1BhcnNlID0gW1xuICAgICAgICAgICAgL15sZWQvaSxcbiAgICAgICAgICAgIC9ew7puby9pLFxuICAgICAgICAgICAgL15ixZllL2ksXG4gICAgICAgICAgICAvXmR1Yi9pLFxuICAgICAgICAgICAgL15rdsSbL2ksXG4gICAgICAgICAgICAvXijEjXZufMSNZXJ2ZW4kfMSNZXJ2bmEpL2ksXG4gICAgICAgICAgICAvXijEjXZjfMSNZXJ2ZW5lY3zEjWVydmVuY2UpL2ksXG4gICAgICAgICAgICAvXnNycC9pLFx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iB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ3DDoXIgc2VrdW5kJyA6ICdww6FyIHNla3VuZGFtaSc7XG4gICAgICAgICAgICBjYXNlICdzcyc6IC8vIDkgc2Vjb25kcyAvIGluIDkgc2Vjb25kcyAvIDkgc2Vjb25kcyBhZ29cbiAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ3Nla3VuZHknIDogJ3Nla3VuZCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnc2VrdW5kYW1pJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlICdtJzogLy8gYSBtaW51dGUgLyBpbiBhIG1pbnV0ZSAvIGEgbWludXRlIGFnb1xuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4ID8gJ21pbnV0YScgOiBpc0Z1dHVyZSA/ICdtaW51dHUnIDogJ21pbnV0b3UnO1xuICAgICAgICAgICAgY2FzZSAnbW0nOiAvLyA5IG1pbnV0ZXMgLyBpbiA5IG1pbnV0ZXMgLyA5IG1pbnV0ZXMgYWdvXG4gICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdtaW51dHknIDogJ21pbnV0Jyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICdtaW51dGFtaSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSAnaCc6IC8vIGFuIGhvdXIgLyBpbiBhbiBob3VyIC8gYW4gaG91ciBhZ29cbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdob2RpbmEnIDogaXNGdXR1cmUgPyAnaG9kaW51JyA6ICdob2Rpbm91JztcbiAgICAgICAgICAgIGNhc2UgJ2hoJzogLy8gOSBob3VycyAvIGluIDkgaG91cnMgLyA5IGhvdXJzIGFnb1xuICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAnaG9kaW55JyA6ICdob2RpbicpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnaG9kaW5hbWknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgJ2QnOiAvLyBhIGRheSAvIGluIGEgZGF5IC8gYSBkYXkgYWdvXG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnZGVuJyA6ICdkbmVtJztcbiAgICAgICAgICAgIGNhc2UgJ2RkJzogLy8gOSBkYXlzIC8gaW4gOSBkYXlzIC8gOSBkYXlzIGFnb1xuICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAnZG55JyA6ICdkbsOtJyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICdkbnknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgJ00nOiAvLyBhIG1vbnRoIC8gaW4gYSBtb250aCAvIGEgbW9udGggYWdvXG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbcSbc8OtYycgOiAnbcSbc8OtY2VtJztcbiAgICAgICAgICAgIGNhc2UgJ01NJzogLy8gOSBtb250aHMgLyBpbiA5IG1vbnRocyAvIDkgbW9udGhzIGFnb1xuICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAnbcSbc8OtY2UnIDogJ23Em3PDrWPFrycpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnbcSbc8OtY2knO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgJ3knOiAvLyBhIHllYXIgLyBpbiBhIHllYXIgLyBhIHllYXIgYWdvXG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAncm9rJyA6ICdyb2tlbSc7XG4gICAgICAgICAgICBjYXNlICd5eSc6IC8vIDkgeWVhcnMgLyBpbiA5IHllYXJzIC8gOSB5ZWFycyBhZ29cbiAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ3Jva3knIDogJ2xldCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnbGV0eSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmFyIGNzID0gbW9tZW50LmRlZmluZUxvY2FsZSgnY3MnLCB7XG4gICAgICAgIG1vbnRoczogbW9udGhzLFxuICAgICAgICBtb250aHNTaG9ydDogbW9udGhzU2hvcnQsXG4gICAgICAgIG1vbnRoc1Jl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Agd2Vla2RheXNTaG9ydDogJ25lX3BvX8O6dF9zdF/EjXRfcMOhX3NvJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ25lX3BvX8O6dF9zdF/EjXRfcMOhX3NvJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdELiBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRC4gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRC4gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICAgICAgbDogJ0QuIE0uIFlZWVknLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tkbmVzIHZdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbesOtdHJhIHZdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3YgbmVkxJtsaSB2XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdl0gZGRkZCBbdl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2ZSBzdMWZZWR1IHZdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdmUgxI10dnJ0ZWsgdl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2IHDDoXRlayB2XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3Ygc29ib3R1IHZdIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogJ1t2xI1lcmEgdl0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbbWludWxvdSBuZWTEm2xpIHZdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1ttaW51bMOpXSBkZGRkIFt2XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW21pbnVsb3Ugc3TFmWVkdSB2XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbbWludWzDvV0gZGRkZCBbdl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1ttaW51bG91IHNvYm90dSB2XSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlO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lZWs6ICdb0qrQuNGC0LXRgV0gZGRkZCBMVCBb0YHQtdGF0LXRgtGA0LVdJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW9CY0YDRgtC905ddIGRkZGQgTFQgW9GB0LXRhdC10YLRgNC1XScsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogZnVuY3Rpb24gKG91dHB1dCkge1xuICAgICAgICAgICAgICAgIHZhciBhZmZpeCA9IC/RgdC10YXQtdGCJC9pLmV4ZWMob3V0cHV0KVxuICAgICAgICAgICAgICAgICAgICA/ICfRgNC10L0nXG4gICAgICAgICAgICAgICAgICAgIDogL9Kr0YPQuyQvaS5leGVjKG91dHB1dClcbiAgICAgICAgICAgICAgICAgICAgICA/ICfRgtCw0L0nXG4gICAgICAgICAgICAgICAgICAgICAgOiAn0YDQsNC9JztcbiAgICAgICAgICAgICAgICByZXR1cm4gb3V0cHV0ICsgYWZmaXg7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcGFzdDogJyVzINC60LDRj9C70LvQsCcsXG4gICAgICAgICAgICBzOiAn0L/Tl9GALdC40Log0qvQtdC60LrRg9C90YInLFxuICAgICAgICAgICAgc3M6ICclZCDSq9C10LrQutGD0L3RgicsXG4gICAgICAgICAgICBtOiAn0L/Tl9GAINC80LjQvdGD0YInLFxuICAgICAgICAgICAgbW06ICclZCDQvNC40L3Rg9GCJyxcbiAgICAgICAgICAgIGg6ICfQv9OX0YAg0YHQtdGF0LXRgicsXG4gICAgICAgICAgICBoaDogJyVkINGB0LXRhdC10YInLFxuICAgICAgICAgICAgZDogJ9C/05fRgCDQutGD0L0nLFxuICAgICAgICAgICAgZGQ6ICclZCDQutGD0L0nLFxuICAgICAgICAgICAgTTogJ9C/05fRgCDRg9C505HRhScsXG4gICAgICAgICAgICBNTTogJyVkINGD0LnTkdGFJyxcbiAgICAgIC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yxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSGVkZGl3IGFtXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW1lmb3J5IGFtXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2FtXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0Rkb2UgYW1dIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbZGl3ZXRoYWYgYW1dIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnbWV3biAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgeW4gw7RsJyxcbiAgICAgICAgICAgIHM6ICd5Y2h5ZGlnIGVpbGlhZGF1JyxcbiAgICAgICAgICAgIHNzOiAnJWQgZWlsaWFkJyxcbiAgICAgICAgICAgIG06ICdtdW51ZCcsXG4gICAgICAgICAgICBtbTogJyVkIG11bnVkJyxcbiAgICAgICAgICAgIGg6ICdhd3InLFxuICAgICAgICAgICAgaGg6ICclZCBhd3InLFxuICAgICAgICAgICAgZDogJ2Rpd3Jub2QnLFxuICAgICAgICAgICAgZGQ6ICclZCBkaXdybm9kJyxcbiAgICAgICAgICAgIE06ICdtaXMnLFxuICAgICAgICAgICAgTU06ICclZCBtaXMnLFxuICAgICAgICAgICAgeTogJ2Jsd3lkZHluJyxcbiAgICAgICAgICAgIHl5OiAnJWQgZmx5bmVkZCcsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShmZWR8YWlufGFmfGlsfHlkZHxlZHxlZykvLFxuICAgICAgICAvLyB0cmFkaXRpb25hbCBvcmRpbmFsIG51bWJlcnMgYWJvdmUgMzEgYXJlIG5vdCBjb21tb25seSB1c2VkIGluIGNvbGxvcXVpYWwgV2Vsc2hcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIGIgPSBudW1iZXIsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gJycsXG4gICAgICAgICAgICAgICAgbG9va3VwID0gW1xuICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICAgICAgJ2FmJyxcbiAgICAgICAgICAgICAgICAgICAgJ2lsJyxcbiAgICAgICAgICAgICAgICAgICAgJ3lkZCcsXG4gICAgICAgICAgICAgICAgICAgICd5ZGQnLFxuICAgICAgICAgICAgICAgICAgICAnZWQnLFxuICAgICAgICAgICAgICAgICAgICAnZWQnLFxuICAgICAgICAgICAgICAgICAgICAnZWQnLFxuICAgICAgICAgICAgICAgICAgICAnZmVkJyxcbiAgICAgICAgICAgICAgICAgICAgJ2ZlZCcsXG4gICAgICAgICAgICAgICAgICAgICdmZWQnLCAvLyAxYWYgdG8gMTBmZWRcbiAgICAgICAgICAgICAgICAgICAgJ2VnJyxcbiAgICAgICAgICAgICAgICAgICAgJ2ZlZCcsXG4gICAgICAgICAgICAgICAgICAgICdlZycsXG4gICAgICAgICAgICAgICAgICAgICdlZycsXG4gICAgICAgICAgICAgICAgICAgICdmZWQnLFxuICAgICAgICAgICAgICAgICAgICAnZWcnLFxuICAgICAgICAgICAgICAgICAgICAnZWcnLFxuICAgICAgICAgICAgICAgICAgICAnZmVkJyxcbiAgICAgICAgICAgICAgICAgICAgJ2VnJyxcbiAgICAgICAgICAgICAgICAgICAgJ2ZlZCcsIC8vIDExZWcgdG8gMjBmZWRcbiAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgaWYgKGIgPiAyMCkge1xuICAgICAgICAgICAgICAgIGlmIChiID09PSA0MCB8fCBiID09PSA1MCB8fCBiID09PSA2MCB8fCBiID09PSA4MCB8fCBiID09PSAxMDApIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ2ZlZCc7IC8vIG5vdCAzMGFpbiwgNzBhaW4gb3IgOTBhaW5cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAnYWluJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGIgPiAwKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gbG9va3VwW2JdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGN5O1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IERhbmlzaCBbZGFdXG4vLyEgYXV0aG9yIDogVWxyaWsgTmllbHNlbiA6IGh0dHBzOi8vZ2l0aHViLmNvbS9tcmJhc2VcblxuOyhmdW5jdGlvbiAoZ2xvYmFsLCBmYWN0b3J5KSB7XG4gICB0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZSAhPT0gJ3VuZG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ICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdELiBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRC4gTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIFtkLl0gRC4gTU1NTSBZWVlZIFtrbC5dIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbaSBkYWcga2wuXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2kgbW9yZ2VuIGtsLl0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdww6UgZGRkZCBba2wuXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2kgZ8OlciBrbC5dIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW2ldIGRkZGRbcyBrbC5dIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnb20gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIHNpZGVuJyxcbiAgICAgICAgICAgIHM6ICdmw6Ugc2VrdW5kZXInLFxuICAgICAgICAgICAgc3M6ICclZCBzZWt1bmRlcicsXG4gICAgICAgICAgICBtOiAnZXQgbWludXQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dHRlcicsXG4gICAgICAgICAgICBoOiAnZW4gdGltZScsXG4gICAgICAgICAgICBoaDogJyVkIHRpbWVyJyxcbiAgICAgICAgICAgIGQ6ICdlbiBkYWcnLFxuICAgICAgICAgICAgZGQ6ICclZCBkYWdlJyxcbiAgICAgICAgICAgIE06ICdlbiBtw6VuZWQnLFxuICAgICAgICAgICAgTU06ICclZCBtw6VuZWRlcicsXG4gICAgICAgICAgICB5O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ZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICBmdW5jdGlvbiBwcm9jZXNzUmVsYXRpdmVUaW1lKG51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5LCBpc0Z1dHVyZSkge1xuICAgICAgICB2YXIgZm9ybWF0ID0ge1xuICAgICAgICAgICAgbTogWydlaW5lIE1pbnV0ZScsICdlaW5lciBNaW51dGUnXSxcbiAgICAgICAgICAgIGg6IFsnZWluZSBTdHVuZGUnLCAnZWluZXIgU3R1bmRlJ10sXG4gICAgICAgICAgICBkOiBbJ2VpbiBUYWcnLCAnZWluZW0gVGFnJ10sXG4gICAgICAgICAgICBkZDogW251bWJlciArICcgVGFnZScsIG51bWJlciArICcgVGFnZW4nXSxcbiAgICAgICAgICAgIHc6IFsnZWluZSBXb2NoZScsICdlaW5lciBXb2NoZSddLFxuICAgICAgICAgICAgTTogWydlaW4gTW9uYXQnLCAnZWluZW0gTW9uYXQnXSxcbiAgICAgICAgICAgIE1NOiBbbnVtYmVyICsgJyBNb25hdGUnLCBudW1iZXIgKyAnIE1vbmF0ZW4nXSxcbiAgICAgICAgICAgIHk6IFsnZWluIEphaHInLCAnZWluZW0gSmFociddLFxuICAgICAgICAgICAgeXk6IFtudW1iZXIgKyAnIEphaHJlJywgbnVtYmVyICsgJyBKYWhyZW4nXSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyBmb3JtYXRba2V5XVswXSA6IGZvcm1hdFtrZXldWzFdO1xuICAgIH1cblxuICAgIHZhciBkZUF0ID0gbW9tZW50LmRlZmluZU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AvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICBmdW5jdGlvbiBwcm9jZXNzUmVsYXRpdmVUaW1lKG51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5LCBpc0Z1dHVyZSkge1xuICAgICAgICB2YXIgZm9ybWF0ID0ge1xuICAgICAgICAgICAgbTogWydlaW5lIE1pbnV0ZScsICdlaW5lciBNaW51dGUnXSxcbiAgICAgICAgICAgIGg6IFsnZWluZSBTdHVuZGUnLCAnZWluZXIgU3R1bmRlJ10sXG4gICAgICAgICAgICBkOiBbJ2VpbiBUYWcnLCAnZWluZW0gVGFnJ10sXG4gICAgICAgICAgICBkZDogW251bWJlciArICcgVGFnZScsIG51bWJlciArICcgVGFnZW4nXSxcbiAgICAgICAgICAgIHc6IFsnZWluZSBXb2NoZScsICdlaW5lciBXb2NoZSddLFxuICAgICAgICAgICAgTTogWydlaW4gTW9uYXQnLCAnZWluZW0gTW9uYXQnXSxcbiAgICAgICAgICAgIE1NOiBbbnVtYmVyICsgJyBNb25hdGUnLCBudW1iZXIgKyAnIE1vbmF0ZW4nXSxcbiAgICAgICAgICAgIHk6IFsnZWluIEphaHInLCAnZWluZW0gSmFociddLFxuICAgICAgICAgICAgeXk6IFtudW1iZXIgKyAnIEphaHJlJywgbnVtYmVyICsgJyBKYWhyZW4nXSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyBmb3JtYXRba2V5XVswXSA6IGZvcm1hdFtrZXldWzFdO1xuICAgIH1cblxuICAgIHZhciBkZUNoID0gbW9tZW50LmRlZmluZUxvY2FsZSgnZGUtY2gnLCB7XG4gICAgICAgIG1vbnRoczogJ0phbnVhcl9GZWJydWFyX03DpHJ6X0FwcmlsX01haV9KdW5pX0p1bGlfQXVndXN0X1NlcHRlbWJlcl9Pa3RvYmVyX05vdmVtYmVyX0RlemVtYmVyJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAg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51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5LCBpc0Z1dHVyZSkge1xuICAgICAgICB2YXIgZm9ybWF0ID0ge1xuICAgICAgICAgICAgbTogWydlaW5lIE1pbnV0ZScsICdlaW5lciBNaW51dGUnXSxcbiAgICAgICAgICAgIGg6IFsnZWluZSBTdHVuZGUnLCAnZWluZXIgU3R1bmRlJ10sXG4gICAgICAgICAgICBkOiBbJ2VpbiBUYWcnLCAnZWluZW0gVGFnJ10sXG4gICAgICAgICAgICBkZDogW251bWJlciArICcgVGFnZScsIG51bWJlciArICcgVGFnZW4nXSxcbiAgICAgICAgICAgIHc6IFsnZWluZSBXb2NoZScsICdlaW5lciBXb2NoZSddLFxuICAgICAgICAgICAgTTogWydlaW4gTW9uYXQnLCAnZWluZW0gTW9uYXQnXSxcbiAgICAgICAgICAgIE1NOiBbbnVtYmVyICsgJyBNb25hdGUnLCBudW1iZXIgKyAnIE1vbmF0ZW4nXSxcbiAgICAgICAgICAgIHk6IFsnZWluIEphaHInLCAnZWluZW0gSmFociddLFxuICAgICAgICAgICAgeXk6IFtudW1iZXIgKyAnIEphaHJlJywgbnVtYmVyICsgJyBKYWhyZW4nXSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyBmb3JtYXRba2V5XVswXSA6IGZvcm1hdFtrZXldWzFdO1xuICAgIH1cblxuICAgIHZhciBkZSA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2RlJywge1xuICAgICAgICBtb250aHM6ICdKYW51YXJfRmVicnVhcl9Nw6Ryel9BcHJpbF9NYWlfSnVuaV9KdWxpX0F1Z3VzdF9TZXB0ZW1iZXJfT2t0b2Jlcl9Ob3ZlbWJlcl9EZXplbWJlcicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAnSmFuLl9GZWIuX03DpHJ6X0Fwci5fTWFpX0p1bmlfS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ICAgICAgJ96H3q/ejt6m3pDesN6T3qonLFxuICAgICAgICAgICAgJ96Q3qzeld6w3pPerN6J3rDehN6m3oPeqicsXG4gICAgICAgICAgICAn3ofert6G3rDek96v3oTept6D3qonLFxuICAgICAgICAgICAgJ96C3q7eiN6s3onesN6E3qbeg96qJyxcbiAgICAgICAgICAgICfekd6o3pDerN6J3rDehN6m3oPeqicsXG4gICAgICAgIF0sXG4gICAgICAgIHdlZWtkYXlzID0gW1xuICAgICAgICAgICAgJ96H3qfei96o3ofesN6M3qYnLFxuICAgICAgICAgICAgJ96A3q/eid6mJyxcbiAgICAgICAgICAgICfeh96m3oLesN6O3qfeg96mJyxcbiAgICAgICAgICAgICfehN6q3ovepicsXG4gICAgICAgICAgICAn3oTeqt6D3qfekN6w3orept6M3qgnLFxuICAgICAgICAgICAgJ96A3qreht6q3oPeqicsXG4gICAgICAgICAgICAn3oDert6C3qjegN6o3oPeqicsXG4gICAgICAgIF07XG5cbiAgICB2YXIgZHYgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdkdicsIHtcbiAgICAgICAgbW9udGhzOiBtb250aHMsXG4gICAgICAgIG1vbnRoc1Nob3J0OiBtb250aHMsXG4gICAgICAgIHdlZWtkYXlzOiB3ZWVrZGF5cyxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogd2Vla2RheXMsXG4gICAgICAgIHdlZWtkYXlzTWluOiAn3ofep96L3qhf3oDer96J3qZf3ofept6C3rBf3oTeqt6L3qZf3oTeqt6D3qdf3oDeqt6G3qpf3oDert6C3qgnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdEL00vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL96J3oZ83oneii8sXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuICfeid6KJyA9PT0gaW5wdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfeid6GJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfeid6KJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb3oneqN6H3qbei96qXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW96J3qfei96m3onep10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb3ofeqN6H3rDelN6sXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1veit6n3ofeqN6M3qreiN6oXSBkZGRkIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn3ozerN6D3q3ejt6m3ofeqCAlcycsXG4gICAgICAgICAgICBwYXN0OiAn3obeqt6D3qjegt6wICVzJyxcbiAgICAgICAgICAgIHM6ICfekN6o3obeqt6C3rDejN6q3obert6F3qzeh96wJyxcbiAgICAgICAgICAgIHNzOiAnZCUg3pDeqN6G3qregt6w3ozeqicsXG4gICAgICAgICAgICBtOiAn3oneqN6C3qjek96s3ofesCcsXG4gICAgICAgICAgICBtbTogJ96J3qjegt6o3pPeqiAlZCcsXG4gICAgICAgICAgICBoOiAn3o7ept6R3qjeh96o3oPerN6H3rAnLFxuICAgICAgICAgICAgaGg6ICfejt6m3pHeqN6H3qjeg96qICVkJyxcbiAgICAgICAgICAgIGQ6ICfei96q3ojept6A3qzeh96wJyxcbiAgICAgICAgICAgIGRkOiAn3oveqt6I3qbekN6wICVkJyxcbiAgICAgICAgICAgIE06ICfeid6m3oDerN6H3rAnLFxuICAgICAgICAgICAgTU06ICfeid6m3pDesCAlZCcsXG4gICAgICAgICAgICB5OiAn3ofept6A3qbeg96s3ofesCcsXG4gICAgICAgICAgICB5eTogJ96H3qbegN6m3oPeqiAlZCcsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL9iML2csICcsJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvLC9nLCAn2IwnKTtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiA3LCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogMTIsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDEydGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZHY7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogR3JlZWsgW2VsXVxuLy8hIGF1dGhvciA6IEFnZ2Vsb3MgS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mV0dXJuIHRoaXMuX21vbnRoc0dlbml0aXZlRWxbbW9tZW50VG9Gb3JtYXQubW9udGgoKV07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9tb250aHNOb21pbmF0aXZlRWxbbW9tZW50VG9Gb3JtYXQubW9udGgoKV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRoc1Nob3J0OiAnzpnOsc69X86mzrXOsl/OnM6xz4FfzpHPgM+BX86czrHPil/Omc6/z4XOvV/Omc6/z4XOu1/Okc+FzrNfzqPOtc+AX86fzrrPhF/Onc6/zrVfzpTOtc66Jy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5czogJ86az4XPgc65zrHOus6uX86UzrXPhc+Ezq3Pgc6xX86kz4HOr8+EzrdfzqTOtc+EzqzPgc+EzrdfzqDOrc68z4DPhM63X86gzrHPgc6xz4POus61z4XOrl/Oo86szrLOss6xz4TOvycuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ86az4XPgV/OlM61z4VfzqTPgc65X86kzrXPhF/OoM61zrxfzqDOsc+BX86jzrHOsicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfOms+FX86UzrVfzqTPgV/OpM61X86gzrVfzqDOsV/Oo86xJy5zcGxpdCgnXycpLFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91cnMgPiAxMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0xvd2VyID8gJ868zrwnIDogJ86czpwnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/ICfPgM68JyA6ICfOoM6cJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gKGlucHV0ICsgJycpLnRvTG93ZXJDYXNlKClbMF0gPT09ICfOvCc7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC9bzqDOnF1cXC4/zpw/XFwuPy9pLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdoOm1tIEEnLFxuICAgICAgICAgICAgTFRTOiAnaDptbTpzcyBBJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgaDptbSBBJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBoOm1tIEEnLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhckVsOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW86jzq7OvM61z4HOsSB7fV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vOkc+Nz4HOuc6/IHt9XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW3t9XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW86nzrjOtc+CIHt9XSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vPhM6/IM+Az4HOv863zrPOv8+NzrzOtc69zr9dIGRkZGQgW3t9XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vPhM63zr0gz4DPgc6/zrfOs86/z43OvM61zr3Ot10gZGRkZCBbe31dIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IGZ1bmN0aW9uIChrZXksIG1vbSkge1xuICAgICAgICAgICAgdmFyIG91dHB1dCA9IHRoaXMuX2NhbGVuZGFyRWxba2V5XSxcbiAgICAgICAgICAgICAgICBob3VycyA9IG1vbSAmJiBtb20uaG91cnMoKTtcbiAgICAgICAgICAgIGlmIChpc0Z1bmN0aW9uKG91dHB1dCkpIHtcbiAgICAgICAgICAgICAgICBvdXRwdXQgPSBvdXRwdXQuYXBwbHkobW9tKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBvdXRwdXQucmVwbGFjZSgne30nLCBob3VycyAlIDEyID09PSAxID8gJ8+Dz4TOtycgOiAnz4PPhM65z4InKTtcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfPg861ICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDPgM+BzrnOvScsXG4gICAgICAgICAgICBzOiAnzrvOr86zzrEgzrTOtc+Fz4TOtc+Bz4zOu861z4DPhM6xJyxcbiAgICAgICAgICAgIHNzOiAnJWQgzrTOtc+Fz4TOtc+Bz4zOu861z4DPhM6xJyxcbiAgICAgICAgICAgIG06ICfOrc69zrEgzrvOtc+Az4TPjCcsXG4gICAgICAgICAgICBtbTogJyVkIM67zrXPgM+EzqwnLFxuICAgICAgICAgICAgaDogJ868zq/OsSDPjs+BzrEnLFxuICAgICAgICAgICAgaGg6ICclZCDPjs+BzrXPgicsXG4gICAgICAgICAgICBkOiAnzrzOr86xIM68zq3Pgc6xJyxcbiAgICAgICAgICAgIGRkOiAnJWQgzrzOrc+BzrXPgicsXG4gICAgICAgICAgICBNOiAnzq3Ovc6xz4IgzrzOrs69zrHP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ZWVkgaDptbSBBJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbVG9kYXkgYXRdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbVG9tb3Jyb3cgYXRdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbYXRdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbWWVzdGVyZGF5IGF0XSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tMYXN0XSBkZGRkIFthdF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdpbiAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgYWdvJyxcbiAgICAgICAgICAgIHM6ICdhIGZldyBzZWNvbmRzJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vjb25kcycsXG4gICAgICAgICAgICBtOiAnYSBtaW51dGUnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGVzJyxcbiAgICAgICAgICAgIGg6ICdhbiBob3VyJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaG91cnMnLFxuICAgICAgICAgICAgZDogJ2EgZGF5JyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGF5cycsXG4gICAgICAgICAgICBNOiAnYSBtb250aCcsXG4gICAgICAgICAgICBNTTogJyVkIG1vbnRocycsXG4gICAgICAgICAgICB5OiAnYSB5ZWFyJyxcbiAgICAgICAgICAgIHl5OiAnJWQgeWVhcnMnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oc3R8bmR8cmR8dGgpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIGIgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBvdXRwdXQgPVxuICAgICAgICAgICAgICAgICAgICB+figobnVtYmVyICUgMTAwKSAvIDEwKSA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgPyAndGgnXG4gICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnc3QnXG4gICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ25kJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gM1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAncmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICd0aCc7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgb3V0cHV0O1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDAsIC8vIFN1bmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZW5BdTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBFbmdsaXNoIChDYW5hZGEpIFtlbi1jYV1cbi8vISBhdXRob3IgOiBKb25hdGhhbiBBYm91cmJpaCA6IGh0dHBzOi8vZ2l0aHViLmNvbS9qb25iY2FcblxuOyhmdW5jdGlvbiAoZ2xvYmFsLCBmYWN0b3J5KSB7XG4gICB0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZSAhPT0gJ3VuZGV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ICAgICBMVDogJ2g6bW0gQScsXG4gICAgICAgICAgICBMVFM6ICdoOm1tOnNzIEEnLFxuICAgICAgICAgICAgTDogJ1lZWVktTU0tREQnLFxuICAgICAgICAgICAgTEw6ICdNTU1NIEQsIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnTU1NTSBELCBZWVlZIGg6bW0gQScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgTU1NTSBELCBZWVlZIGg6bW0gQScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW1RvZGF5IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW1RvbW9ycm93IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW1llc3RlcmRheSBhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbTGFzdF0gZGRkZCBbYXRdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnaW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGFnbycsXG4gICAgICAgICAgICBzOiAnYSBmZXcgc2Vjb25kcycsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZHMnLFxuICAgICAgICAgICAgbTogJ2EgbWludXRlJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgICAgICBoOiAnYW4gaG91cicsXG4gICAgICAgICAgICBoaDogJyVkIGhvdXJzJyxcbiAgICAgICAgICAgIGQ6ICdhIGRheScsXG4gICAgICAgICAgICBkZDogJyVkIGRheXMnLFxuICAgICAgICAgICAgTTogJ2EgbW9udGgnLFxuICAgICAgICAgICAgTU06ICclZCBtb250aHMnLFxuICAgICAgICAgICAgeTogJ2EgeWVhcicsXG4gICAgICAgICAgICB5eTogJyVkIHllYXJzJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0fG5kfHJkfHRoKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICAgICAgfn4oKG51bWJlciAlIDEwMCkgLyAxMCkgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ3RoJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3N0J1xuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICduZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAndGgnO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBlbkNhO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IEVuZ2xpc2ggKFVuaXRlZCBLaW5nZG9tKSBbZW4tZ2JdXG4vLyEgYXV0aG9yIDogQ2hyaXMgR2VkcmltIDogaHR0cHM6Ly9naXRodWIuY29tL2NocmlzZ2VkcmltXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZm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gTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW1RvZGF5IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW1RvbW9ycm93IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW1llc3RlcmRheSBhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbTGFzdF0gZGRkZCBbYXRdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnaW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGFnbycsXG4gICAgICAgICAgICBzOiAnYSBmZXcgc2Vjb25kcycsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZHMnLFxuICAgICAgICAgICAgbTogJ2EgbWludXRlJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgICAgICBoOiAnYW4gaG91cicsXG4gICAgICAgICAgICBoaDogJyVkIGhvdXJzJyxcbiAgICAgICAgICAgIGQ6ICdhIGRheScsXG4gICAgICAgICAgICBkZDogJyVkIGRheXMnLFxuICAgICAgICAgICAgTTogJ2EgbW9udGgnLFxuICAgICAgICAgICAgTU06ICclZCBtb250aHMnLFxuICAgICAgICAgICAgeTogJ2EgeWVhcicsXG4gICAgICAgICAgICB5eTogJyVkIHllYXJzJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0fG5kfHJkfHRoKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICAgICAgfn4oKG51bWJlciAlIDEwMCkgLyAxMCkgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ3RoJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3N0J1xuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICduZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAndGgnO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGVuR2I7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogRW5nbGlzaCAoSXJlbGFuZCkgW2VuLWllXV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ydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ1N1bl9Nb25fVHVlX1dlZF9UaHVfRnJpX1NhdCcuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdTdV9Nb19UdV9XZV9UaF9Gcl9TYScuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW1RvZGF5IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW1RvbW9ycm93IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW1llc3RlcmRheSBhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbTGFzdF0gZGRkZCBbYXRdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnaW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGFnbycsXG4gICAgICAgICAgICBzOiAnYSBmZXcgc2Vjb25kcycsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZHMnLFxuICAgICAgICAgICAgbTogJ2EgbWludXRlJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgICAgICBoOiAnYW4gaG91cicsXG4gICAgICAgICAgICBoaDogJyVkIGhvdXJzJyxcbiAgICAgICAgICAgIGQ6ICdhIGRheScsXG4gICAgICAgICAgICBkZDogJyVkIGRheXMnLFxuICAgICAgICAgICAgTTogJ2EgbW9udGgnLFxuICAgICAgICAgICAgTU06ICclZCBtb250aHMnLFxuICAgICAgICAgICAgeTogJ2EgeWVhcicsXG4gICAgICAgICAgICB5eTogJyVkIHllYXJzJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0fG5kfHJkfHRoKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICAgICAgfn4oKG51bWJlciAlIDEwMCkgLyAxMCkgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ3RoJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3N0J1xuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICduZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAndGgnO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWl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XJlOiAnaW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGFnbycsXG4gICAgICAgICAgICBzOiAnYSBmZXcgc2Vjb25kcycsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZHMnLFxuICAgICAgICAgICAgbTogJ2EgbWludXRlJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgICAgICBoOiAnYW4gaG91cicsXG4gICAgICAgICAgICBoaDogJyVkIGhvdXJzJyxcbiAgICAgICAgICAgIGQ6ICdhIGRheScsXG4gICAgICAgICAgICBkZDogJyVkIGRheXMnLFxuICAgICAgICAgICAgTTogJ2EgbW9udGgnLFxuICAgICAgICAgICAgTU06ICclZCBtb250aHMnLFxuICAgICAgICAgICAgeTogJ2EgeWVhcicsXG4gICAgICAgICAgICB5eTogJyVkIHllYXJzJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0fG5kfHJkfHRoKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICAgICAgfn4oKG51bWJlciAlIDEwMCkgLyAxMCkgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ3RoJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3N0J1xuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICduZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAndGgnO1xuICAgICAgIC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MnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGFnbycsXG4gICAgICAgICAgICBzOiAnYSBmZXcgc2Vjb25kcycsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZHMnLFxuICAgICAgICAgICAgbTogJ2EgbWludXRlJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgICAgICBoOiAnYW4gaG91cicsXG4gICAgICAgICAgICBoaDogJyVkIGhvdXJzJyxcbiAgICAgICAgICAgIGQ6ICdhIGRheScsXG4gICAgICAgICAgICBkZDogJyVkIGRheXMnLFxuICAgICAgICAgICAgTTogJ2EgbW9udGgnLFxuICAgICAgICAgICAgTU06ICclZCBtb250aHMnLFxuICAgICAgICAgICAgeTogJ2EgeWVhcicsXG4gICAgICAgICAgICB5eTogJyVkIHllYXJzJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0fG5kfHJkfHRoKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICAgICAgfn4oKG51bWJlciAlIDEwMCkgLyAxMCkgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ3RoJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3N0J1xuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICduZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAndGgnO1xuICAgICAgICAgICAgcmV0dXJu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RdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbWWVzdGVyZGF5IGF0XSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tMYXN0XSBkZGRkIFthdF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdpbiAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgYWdvJyxcbiAgICAgICAgICAgIHM6ICdhIGZldyBzZWNvbmRzJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vjb25kcycsXG4gICAgICAgICAgICBtOiAnYSBtaW51dGUnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGVzJyxcbiAgICAgICAgICAgIGg6ICdhbiBob3VyJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaG91cnMnLFxuICAgICAgICAgICAgZDogJ2EgZGF5JyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGF5cycsXG4gICAgICAgICAgICBNOiAnYSBtb250aCcsXG4gICAgICAgICAgICBNTTogJyVkIG1vbnRocycsXG4gICAgICAgICAgICB5OiAnYSB5ZWFyJyxcbiAgICAgICAgICAgIHl5OiAnJWQgeWVhcnMnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oc3R8bmR8cmR8dGgpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIGIgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBvdXRwdXQgPVxuICAgICAgICAgICAgICAgICAgICB+figobnVtYmVyICUgMTAwKSAvIDEwKSA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgPyAndGgnXG4gICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnc3QnXG4gICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ25kJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gM1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAncmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICd0aCc7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgb3V0cHV0O1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZW5OejtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBFbmdsaXNoIChTaW5nYXBvcmUpIFtlbi1zZ11cbi8vISBhdXRob3IgOiBNYXR0aGV3IENhc3RyaWxsb24tTWFkcmlnYWwgOiBodHRwczovL2dpdGh1Yi5jb20vdGVjaGRpbWVuc2lvblxuXG47KGZ1bmN0aW9uIChnbG9iYWwsIGZhY3RvcnkpIHtcbiAgIHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJ1xuICAgICAgICYmIHR5cGVvZiByZXF1aXJlID09PSAnZnVuY3Rpb24nID8gZmFjdG9yeShyZXF1aXJlKCcuLi9tb21lbnQnKSkgOlxuICAgdHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKF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VlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tUb2RheSBhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tUb21vcnJvdyBhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFthdF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tZZXN0ZXJkYXkgYXRdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW0xhc3RdIGRkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2luICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBhZ28nLFxuICAgICAgICAgICAgczogJ2EgZmV3IHNlY29uZHMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRzJyxcbiAgICAgICAgICAgIG06ICdhIG1pbnV0ZScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZXMnLFxuICAgICAgICAgICAgaDogJ2FuIGhvdXInLFxuICAgICAgICAgICAgaGg6ICclZCBob3VycycsXG4gICAgICAgICAgICBkOiAnYSBkYXknLFxuICAgICAgICAgICAgZGQ6ICclZCBkYXlzJyxcbiAgICAgICAgICAgIE06ICdhIG1vbnRoJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbW9udGhzJyxcbiAgICAgICAgICAgIHk6ICdhIHllYXInLFxuICAgICAgICAgICAgeXk6ICclZCB5ZWFycycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShzdHxuZHxyZHx0aCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYiA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgICAgIH5+KChudW1iZXIgJSAxMDApIC8gMTApID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICd0aCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdzdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnbmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdyZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ3RoJztcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBlblNnO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IEVzcGVyYW50byBbZW9dXG4vLyEgYXV0aG9yIDogQ29saW4gRGVhbiA6IGh0dHBzOi8vZ2l0aHViLmNvbS9jb2xpbmRlYW5cbi8vISBhdXRob3IgOiBNaWEgTm9yZGVudG9mdCBJbXBlcmF0b3JpIDogaHR0cHM6Ly9naXRodWIuY29tL21pZXN0YXNtaWFcbi8vISB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ByZXR1cm4gaXNMb3dlciA/ICdhLnQubS4nIDogJ0EuVC5NLic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0hvZGlhxa0gamVdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbTW9yZ2HFrSBqZV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkW24gamVdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbSGllcmHFrSBqZV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbcGFzaW50YW5dIGRkZGRbbiBqZV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdwb3N0ICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdhbnRhxa0gJXMnLFxuICAgICAgICAgICAgczogJ2tlbGthaiBzZWt1bmRvaicsXG4gICAgICAgICAgICBzczogJyVkIHNla3VuZG9qJyxcbiAgICAgICAgICAgIG06ICd1bnUgbWludXRvJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRvaicsXG4gICAgICAgICAgICBoOiAndW51IGhvcm8nLFxuICAgICAgICAgICAgaGg6ICclZCBob3JvaicsXG4gICAgICAgICAgICBkOiAndW51IHRhZ28nLCAvL25lICdkaXVybm8nLCDEiWFyIGVzdGFzIHV6aXRhIHBvciBwcm9rc2ltdW1vXG4gICAgICAgICAgICBkZDogJyVkIHRhZ29qJyxcbiAgICAgICAgICAgIE06ICd1bnUgbW9uYXRvJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbW9uYXRvaicsXG4gICAgICAgICAgICB5OiAndW51IGphcm8nLFxuICAgICAgICAgICAgeXk6ICclZCBqYXJvaicsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhP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fZGljLicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydCA9ICdlbmVfZmViX21hcl9hYnJfbWF5X2p1bl9qdWxfYWdvX3NlcF9vY3Rfbm92X2RpYycuc3BsaXQoJ18nKSxcbiAgICAgICAgbW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXmVuZS9pLFxuICAgICAgICAgICAgL15mZWIvaSxcbiAgICAgICAgICAgIC9ebWFyL2ksXG4gICAgICAgICAgICAvXmFici9pLFxuICAgICAgICAgICAgL15tYXkvaSxcbiAgICAgICAgICAgIC9eanVuL2ksXG4gICAgICAgICAgICAvXmp1bC9pLFxuICAgICAgICAgICAgL15hZ28vaSxcbiAgICAgICAgICAgIC9ec2VwL2ksXG4gICAgICAgICAgICAvXm9jdC9pLFxuICAgICAgICAgICAgL15ub3YvaSxcbiAgICAgICAgICAgIC9eZGljL2ksXG4gICAgICAgIF0sXG4gICAgICAgIG1vbnRoc1JlZ2V4ID1cbiAgICAgICAgICAgIC9eKGVuZXJvfGZlYnJlcm98bWFyem98YWJyaWx8bWF5b3xqdW5pb3xqdWxpb3xhZ29zdG98c2VwdGllbWJyZXxvY3R1YnJlfG5vdmllbWJyZXxkaWNpZW1icmV8ZW5lXFwuP3xmZWJcXC4/fG1hclxcLj98YWJyXFwuP3xtYXlcXC4/fGp1blxcLj98anVsXFwuP3xhZ29cXC4/fHNlcFxcLj98b2N0XFwuP3xub3ZcXC4/fGRpY1xcLj8pL2k7XG5cbiAgICB2YXIgZXNEbyA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2VzLWRvJywge1xuICAgICAgICBtb250aHM6ICdlbmVyb19mZWJyZXJvX21hcnpvX2FicmlsX21heW9fanVuaW9fanVsaW9fYWdvc3RvX3NlcHRpZW1icmVfb2N0dWJyZV9ub3ZpZW1icmVfZGljaWVtYnJlJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDogZnVuY3Rpb24gKG0sIGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFtKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0RG90O1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvLU1NTS0vLnRlc3QoZm9ybWF0KSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydFttLm1vbnRoKCldO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU2hvcnREb3RbbS5tb250aCgpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzUmVnZXg6IG1vbnRoc1JlZ2V4LFxuICAgICAgICBtb250aHNTaG9ydFJlZ2V4OiBtb250aHNSZWdleCxcbiAgICAgICAgbW9udGhzU3RyaWN0UmVnZXg6XG4gICAgICAgICAgICAvXihlbmVyb3xmZWJyZXJvfG1hcnpvfGFicmlsfG1heW98anVuaW98anVsaW98YWdvc3RvfHNlcHRpZW1icmV8b2N0dWJyZXxub3ZpZW1icmV8ZGljaWVtYnJlKS9pLFxuICAgICAgICBtb250aHNTaG9ydFN0cmljdFJlZ2V4OlxuICAgICAgICAgICAgL14oZW5lXFwuP3xmZWJcXC4/fG1hclxcLj98YWJyXFwuP3xtYXlcXC4/fGp1blxcLj98anVsXFwuP3xhZ29cXC4/fHNlcFxcLj98b2N0XFwuP3xub3ZcXC4/fGRpY1xcLj8pL2ksXG4gICAgICAgIG1vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgbG9uZ01vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgc2hvcnRNb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG4gICAgICAgIHdlZWtkYXlzOiAnZG9taW5nb19sdW5lc19tYXJ0ZXNfbWnDqXJjb2xlc19qdWV2ZXNfdmllcm5lc19zw6FiYWRvJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnZG9tLl9sdW4uX21hci5fbWnDqS5fanVlLl92aWUuX3PDoWIuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ2RvX2x1X21hX21pX2p1X3ZpX3PDoScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdoOm1tIEEnLFxuICAgICAgICAgICAgTFRTOiAnaDptbTpzcyBBJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBbZGVdIE1NTU0gW2RlXSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgW2RlXSBNTU1NIFtkZV0gWVlZWSBoOm1tIEEnLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgW2RlXSBNTU1NIFtkZV0gWVlZWSBoOm1tIEEnLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW2hveSBhIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW21hw7FhbmEgYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdkZGRkIFthIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW2F5ZXIgYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgJ1tlbF0gZGRkZCBbcGFzYWRvIGEgbGEnICtcbiAgICAgICAgICAgICAgICAgICAgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArXG4gICAgICAgICAgICAgICAgICAgICddIExUJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdlbiAlcycsXG4gICAgICAgICAgICBwYXN0OiAnaGFjZSAlcycsXG4gICAgICAgICAgICBzOiAndW5vcyBzZWd1bmRvcycsXG4gICAgICAgICAgICBzczogJyVkIHNlZ3VuZG9zJyxcbiAgICAgICAgICAgIG06ICd1biBtaW51dG8nLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dG9zJyxcbiAgICAgICAgICAgIGg6ICd1bmEgaG9yYScsXG4gICAgICAgICAgICBoaDogJyVkIGhvcmFzJyxcbiAgICAgICAgICAgIGQ6ICd1biBkw61hJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZMOtYXMnLFxuICAgICAgICAgICAgdzogJ3VuYSBzZW1hbmEnLFxuICAgICAgICAgICAgd3c6ICclZCBzZW1hbmFzJyxcbiAgICAgICAgICAgIE06ICd1biBtZXMnLFxuICAgICAgICAgICAgTU06ICclZCBtZXNlcycsXG4gICAgICAgICAgICB5OiAndW4g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hbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIG1vbnRoc1Nob3J0RG90ID1cbiAgICAgICAgICAgICdlbmUuX2ZlYi5fbWFyLl9hYnIuX21heS5fanVuLl9qdWwuX2Fnby5fc2VwLl9vY3QuX25vdi5fZGljLicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydCA9ICdlbmVfZmViX21hcl9hYnJfbWF5X2p1bl9qdWxfYWdvX3NlcF9vY3Rfbm92X2RpYycuc3BsaXQoJ18nKSxcbiAgICAgICAgbW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXmVuZS9pLFxuICAgICAgICAgICAgL15mZWIvaSxcbiAgICAgICAgICAgIC9ebWFyL2ksXG4gICAgICAgICAgICAvXmFici9pLFxuICAgICAgICAgICAgL15tYXkvaSxcbiAgICAgICAgICAgIC9eanVuL2ksXG4gICAgICAgICAgICAvXmp1bC9pLFxuICAgICAgICAgICAgL15hZ28vaSxcbiAgICAgICAgICAgIC9ec2VwL2ksXG4gICAgICAgICAgICAvXm9jdC9pLFxuICAgICAgICAgICAgL15ub3YvaSxcbiAgICAgICAgICAgIC9eZGljL2ksXG4gICAgICAgIF0sXG4gICAgICAgIG1vbnRoc1JlZ2V4ID1cbiAgICAgICAgICAgIC9eKGVuZXJvfGZlYnJlcm98bWFyem98YWJyaWx8bWF5b3xqdW5pb3xqdWxpb3xhZ29zdG98c2VwdGllbWJyZXxvY3R1YnJlfG5vdmllbWJyZXxkaWNpZW1icmV8ZW5lXFwuP3xmZWJcXC4/fG1hclxcLj98YWJyXFwuP3xtYXlcXC4/fGp1blxcLj98anVsXFwuP3xhZ29cXC4/fHNlcFxcLj98b2N0XFwuP3xub3ZcXC4/fGRpY1xcLj8pL2k7XG5cbiAgICB2YXIgZXNNeCA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2VzLW14Jywge1xuICAgICAgICBtb250aHM6ICdlbmVyb19mZWJyZXJvX21hcnpvX2FicmlsX21heW9fanVuaW9fanVsaW9fYWdvc3RvX3NlcHRpZW1icmVfb2N0dWJyZV9ub3ZpZW1icmVfZGljaWVtYnJlJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDogZnVuY3Rpb24gKG0sIGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFtKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0RG90O1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvLU1NTS0vLnRlc3QoZm9ybWF0KSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydFttLm1vbnRoKCldO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU2hvcnREb3RbbS5tb250aCgpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzUmVnZXg6IG1vbnRoc1JlZ2V4LFxuICAgICAgICBtb250aHNTaG9ydFJlZ2V4OiBtb250aHNSZWdleCxcbiAgICAgICAgbW9udGhzU3RyaWN0UmVnZXg6XG4gICAgICAgICAgICAvXihlbmVyb3xmZWJyZXJvfG1hcnpvfGFicmlsfG1heW98anVuaW98anVsaW98YWdvc3RvfHNlcHRpZW1icmV8b2N0dWJyZXxub3ZpZW1icmV8ZGljaWVtYnJlKS9pLFxuICAgICAgICBtb250aHNTaG9ydFN0cmljdFJlZ2V4OlxuICAgICAgICAgICAgL14oZW5lXFwuP3xmZWJcXC4/fG1hclxcLj98YWJyXFwuP3xtYXlcXC4/fGp1blxcLj98anVsXFwuP3xhZ29cXC4/fHNlcFxcLj98b2N0XFwuP3xub3ZcXC4/fGRpY1xcLj8pL2ksXG4gICAgICAgIG1vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgbG9uZ01vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgc2hvcnRNb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG4gICAgICAgIHdlZWtkYXlzOiAnZG9taW5nb19sdW5lc19tYXJ0ZXNfbWnDqXJjb2xlc19qdWV2ZXNfdmllcm5lc19zw6FiYWRvJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnZG9tLl9sdW4uX21hci5fbWnDqS5fanVlLl92aWUuX3PDoWIuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ2RvX2x1X21hX21pX2p1X3ZpX3PDoScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIFtkZV0gTU1NTSBbZGVdIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBbZGVdIE1NTU0gW2RlXSBZWVlZIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgW2RlXSBNTU1NIFtkZV0gWVlZWSBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1tob3kgYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHREYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1ttYcOxYW5hIGEgbGEnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZGRkZCBbYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1theWVyIGEgbGEnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICdbZWxdIGRkZGQgW3Bhc2FkbyBhIGxhJyArXG4gICAgICAgICAgICAgICAgICAgICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgK1xuICAgICAgICAgICAgICAgICAgICAnXSBMVCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnZW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ2hhY2UgJXMnLFxuICAgICAgICAgICAgczogJ3Vub3Mgc2VndW5kb3MnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWd1bmRvcycsXG4gICAgICAgICAgICBtOiAndW4gbWludXRvJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRvcycsXG4gICAgICAgICAgICBoOiAndW5hIGhvcmEnLFxuICAgICAgICAgICAgaGg6ICclZCBob3JhcycsXG4gICAgICAgICAgICBkOiAndW4gZMOtYScsXG4gICAgICAgICAgICBkZDogJyVkIGTDrWFzJyxcbiAgICAgICAgICAgIHc6ICd1bmEgc2VtYW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tb21lbnQnKSkgOlxuICAgdHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIG1vbnRoc1Nob3J0RG90ID1cbiAgICAgICAgICAgICdlbmUuX2ZlYi5fbWFyLl9hYnIuX21heS5fanVuLl9qdWwuX2Fnby5fc2VwLl9vY3QuX25vdi5fZGljLicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydCA9ICdlbmVfZmViX21hcl9hYnJfbWF5X2p1bl9qdWxfYWdvX3NlcF9vY3Rfbm92X2RpYycuc3BsaXQoJ18nKSxcbiAgICAgICAgbW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXmVuZS9pLFxuICAgICAgICAgICAgL15mZWIvaSxcbiAgICAgICAgICAgIC9ebWFyL2ksXG4gICAgICAgICAgICAvXmFici9pLFxuICAgICAgICAgICAgL15tYXkvaSxcbiAgICAgICAgICAgIC9eanVuL2ksXG4gICAgICAgICAgICAvXmp1bC9pLFxuICAgICAgICAgICAgL15hZ28vaSxcbiAgICAgICAgICAgIC9ec2VwL2ksXG4gICAgICAgICAgICAvXm9jdC9pLFxuICAgICAgICAgICAgL15ub3YvaSxcbiAgICAgICAgICAgIC9eZGljL2ksXG4gICAgICAgIF0sXG4gICAgICAgIG1vbnRoc1JlZ2V4ID1cbiAgICAgICAgICAgIC9eKGVuZXJvfGZlYnJlcm98bWFyem98YWJyaWx8bWF5b3xqdW5pb3xqdWxpb3xhZ29zdG98c2VwdGllbWJyZXxvY3R1YnJlfG5vdmllbWJyZXxkaWNpZW1icmV8ZW5lXFwuP3xmZWJcXC4/fG1hclxcLj98YWJyXFwuP3xtYXlcXC4/fGp1blxcLj98anVsXFwuP3xhZ29cXC4/fHNlcFxcLj98b2N0XFwuP3xub3ZcXC4/fGRpY1xcLj8pL2k7XG5cbiAgICB2YXIgZXNVcyA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2VzLXVzJywge1xuICAgICAgICBtb250aHM6ICdlbmVyb19mZWJyZXJvX21hcnpvX2FicmlsX21heW9fanVuaW9fanVsaW9fYWdvc3RvX3NlcHRpZW1icmVfb2N0dWJyZV9ub3ZpZW1icmVfZGljaWVtYnJlJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDogZnVuY3Rpb24gKG0sIGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFtKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0RG90O1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvLU1NTS0vLnRlc3QoZm9ybWF0KSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydFttLm1vbnRoKCldO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU2hvcnREb3RbbS5tb250aCgpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzUmVnZXg6IG1vbnRoc1JlZ2V4LFxuICAgICAgICBtb250aHNTaG9ydFJlZ2V4OiBtb250aHNSZWdleCxcbiAgICAgICAgbW9udGhzU3RyaWN0UmVnZXg6XG4gICAgICAgICAgICAvXihlbmVyb3xmZWJyZXJvfG1hcnpvfGFicmlsfG1heW98anVuaW98anVsaW98YWdvc3RvfHNlcHRpZW1icmV8b2N0dWJyZXxub3ZpZW1icmV8ZGljaWVtYnJlKS9pLFxuICAgICAgICBtb250aHNTaG9ydFN0cmljdFJ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AgICAgIHJldHVybiAnW2hveSBhIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW21hw7FhbmEgYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdkZGRkIFthIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW2F5ZXIgYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgJ1tlbF0gZGRkZCBbcGFzYWRvIGEgbGEnICtcbiAgICAgICAgICAgICAgICAgICAgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArXG4gICAgICAgICAgICAgICAgICAgICddIExUJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdlbiAlcycsXG4gICAgICAgICAgICBwYXN0OiAnaGFjZSAlcycsXG4gICAgICAgICAgICBzOiAndW5vcyBzZWd1bmRvcycsXG4gICAgICAgICAgICBzczogJyVkIHNlZ3VuZG9zJyxcbiAgICAgICAgICAgIG06ICd1biBtaW51dG8nLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dG9zJyxcbiAgICAgICAgICAgIGg6ICd1bmEgaG9yYScsXG4gICAgICAgICAgICBoaDogJyVkIGhvcmFzJyxcbiAgICAgICAgICAgIGQ6ICd1biBkw61hJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZMOtYXMnLFxuICAgICAgICAgICAgdzogJ3VuYSBzZW1hbmEnLFxuICAgICAgICAgICAgd3c6ICclZCBzZW1hbmFzJyxcbiAgICAgICAgICAgIE06ICd1biBtZXMnLFxuICAgICAgICAgICAgTU06ICclZCBtZXNlcycsXG4gICAgICAgICAgICB5OiAndW4gYcOxbycsXG4gICAgICAgICAgICB5eTogJyVkIGHDsW9zJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9wrovLFxuICAgICAgICBvcmRpbmFsOiAnJWTCuicsXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMCwgLy8gU3VuZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDYsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDZ0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBlc1VzO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IFNwYW5pc2ggW2VzXVxuLy8hIGF1dGhvciA6IEp1bGlvIE5hcHVyw60gOiBodHRwczovL2dpdGh1Yi5jb20vanVsaW9uY1xuXG47KGZ1bmN0aW9uIChnbG9iYWwsIGZhY3RvcnkpIHtcbiAgIHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJ1xuICAgICAgICYmIHR5cGVvZiByZXF1aXJlID09PSAnZnVuY3Rpb24nID8gZmFjdG9yeShyZXF1aXJlKCcuLi9tb21lbnQnKSkgOlxuICAgdHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIG1vbnRoc1Nob3J0RG90ID1cbiAgICAgICAgICAgICdlbmUuX2ZlYi5fbWFyLl9hYnIuX21heS5fanVuLl9qdWwuX2Fnby5fc2VwLl9vY3QuX25vdi5fZGljLicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydCA9ICdlbmVfZmViX21hcl9hYnJfbWF5X2p1bl9qdWxfYWdvX3NlcF9vY3Rfbm92X2RpYycuc3BsaXQoJ18nKSxcbiAgICAgICAgbW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXmVuZS9pLFxuICAgICAgICAgICAgL15mZWIvaSxcbiAgICAgICAgICAgIC9ebWFyL2ksXG4gICAgICAgICAgICAvXmFici9pLFxuICAgICAgICAgICAgL15tYXkvaSxcbiAgICAgICAgICAgIC9eanVuL2ksXG4gICAgICAgICAgICAvXmp1bC9pLFxuICAgICAgICAgICAgL15hZ28vaSxcbiAgICAgICAgICAgIC9ec2VwL2ksXG4gICAgICAgICAgICAvXm9jdC9pLFxuICAgICAgICAgICAgL15ub3YvaSxcbiAgICAgICAgICAgIC9eZGljL2ksXG4gICAgICAgIF0sXG4gICAgICA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EIFtkZV0gTU1NTSBbZGVdIFlZWVkgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbaG95IGEgbGEnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXh0RGF5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbbWHDsWFuYSBhIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2RkZGQgW2EgbGEnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbYXllciBhIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAnW2VsXSBkZGRkIFtwYXNhZG8gYSBsYScgK1xuICAgICAgICAgICAgICAgICAgICAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICtcbiAgICAgICAgICAgICAgICAgICAgJ10gTFQnXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2VuICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdoYWNlICVzJyxcbiAgICAgICAgICAgIHM6ICd1bm9zIHNlZ3VuZG9zJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VndW5kb3MnLFxuICAgICAgICAgICAgbTogJ3VuIG1pbnV0bycsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0b3MnLFxuICAgICAgICAgICAgaDogJ3VuYSBob3JhJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaG9yYXMnLFxuICAgICAgICAgICAgZDogJ3VuIGTDrWEnLFxuICAgICAgICAgICAgZGQ6ICclZCBkw61hcycsXG4gICAgICAgICAgICB3OiAndW5hIHNlbWFuYScsXG4gICAgICAgICAgICB3dzogJyVkIHNlbWFuYXMnLFxuICAgICAgICAgICAgTTogJ3VuIG1lcycsXG4gICAgICAgICAgICBNTTogJyVkIG1lc2VzJyxcbiAgICAgICAgICAgIHk6ICd1biBhw7FvJyxcbiAgICAgICAgICAgIHl5OiAnJWQgYcOxb3MnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn3Cui8sXG4gICAgICAgIG9yZGluYWw6ICclZMK6JyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgICAgICBpbnZhbGlkRGF0ZTogJ0ZlY2hhIGludsOhbGlkYScsXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZXM7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZ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bTogW251bWJlciArICcgbWludXRpJywgbnVtYmVyICsgJyBtaW51dGl0J10sXG4gICAgICAgICAgICBoOiBbJ8O8aGUgdHVubmknLCAndHVuZCBhZWdhJywgJ8O8a3MgdHVuZCddLFxuICAgICAgICAgICAgaGg6IFtudW1iZXIgKyAnIHR1bm5pJywgbnVtYmVyICsgJyB0dW5kaSddLFxuICAgICAgICAgICAgZDogWyfDvGhlIHDDpGV2YScsICfDvGtzIHDDpGV2J10sXG4gICAgICAgICAgICBNOiBbJ2t1dSBhamEnLCAna3V1IGFlZ2EnLCAnw7xrcyBrdXUnXSxcbiAgICAgICAgICAgIE1NOiBbbnVtYmVyICsgJyBrdXUnLCBudW1iZXIgKyAnIGt1dWQnXSxcbiAgICAgICAgICAgIHk6IFsnw7xoZSBhYXN0YScsICdhYXN0YScsICfDvGtzIGFhc3RhJ10sXG4gICAgICAgICAgICB5eTogW251bWJlciArICcgYWFzdGEnLCBudW1iZXIgKyAnIGFhc3RhdCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCkge1xuICAgICAgICAgICAgcmV0dXJuIGZvcm1hdFtrZXldWzJdID8gZm9ybWF0W2tleV1bMl0gOiBmb3JtYXRba2V5XVsxXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaXNGdXR1cmUgPyBmb3JtYXRba2V5XVswXSA6IGZvcm1hdFtrZXldWzFdO1xuICAgIH1cblxuICAgIHZhciBldCA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2V0Jywge1xuICAgICAgICBtb250aHM6ICdqYWFudWFyX3ZlZWJydWFyX23DpHJ0c19hcHJpbGxfbWFpX2p1dW5pX2p1dWxpX2F1Z3VzdF9zZXB0ZW1iZXJfb2t0b29iZXJfbm92ZW1iZXJfZGV0c2VtYmVyJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICdqYWFuX3ZlZWJyX23DpHJ0c19hcHJfbWFpX2p1dW5pX2p1dWxpX2F1Z19zZXB0X29rdF9ub3ZfZGV0cycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXM6XG4gICAgICAgICAgICAncMO8aGFww6Rldl9lc21hc3DDpGV2X3RlaXNpcMOkZXZfa29sbWFww6Rldl9uZWxqYXDDpGV2X3JlZWRlX2xhdXDDpGV2Jy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICdQX0VfVF9LX05fUl9MJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ1BfRV9UX0tfTl9SX0wnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QuIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdELiBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRC4gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tUw6RuYSxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbSG9tbWUsXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1tKw6RyZ21pbmVdIGRkZGQgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tFaWxlLF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbRWVsbWluZV0gZGRkZCBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ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ICAgICAgIG5leHRXZWVrOiAnZGRkZCBMVFtldGFuXScsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2F0em9dIExUW2V0YW5dJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW2F1cnJla29dIGRkZGQgTFRbZXRhbl0nLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyBiYXJydScsXG4gICAgICAgICAgICBwYXN0OiAnZHVlbGEgJXMnLFxuICAgICAgICAgICAgczogJ3NlZ3VuZG8gYmF0enVrJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VndW5kbycsXG4gICAgICAgICAgICBtOiAnbWludXR1IGJhdCcsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0dScsXG4gICAgICAgICAgICBoOiAnb3JkdSBiYXQnLFxuICAgICAgICAgICAgaGg6ICclZCBvcmR1JyxcbiAgICAgICAgICAgIGQ6ICdlZ3VuIGJhdCcsXG4gICAgICAgICAgICBkZDogJyVkIGVndW4nLFxuICAgICAgICAgICAgTTogJ2hpbGFiZXRlIGJhdCcsXG4gICAgICAgICAgICBNTTogJyVkIGhpbGFiZXRlJyxcbiAgICAgICAgICAgIHk6ICd1cnRlIGJhdCcsXG4gICAgICAgICAgICB5eTogJyVkIHVydGUnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn1cXC4vLFxuICAgICAgICBvcmRpbmFsOiAnJWQuJyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN3RoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZW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ICAn27EnOiAnMScsXG4gICAgICAgICAgICAn27InOiAnMicsXG4gICAgICAgICAgICAn27MnOiAnMycsXG4gICAgICAgICAgICAn27QnOiAnNCcsXG4gICAgICAgICAgICAn27UnOiAnNScsXG4gICAgICAgICAgICAn27YnOiAnNicsXG4gICAgICAgICAgICAn27cnOiAnNycsXG4gICAgICAgICAgICAn27gnOiAnOCcsXG4gICAgICAgICAgICAn27knOiAnOScsXG4gICAgICAgICAgICAn27AnOiAnMCcsXG4gICAgICAgIH07XG5cbiAgICB2YXIgZmEgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdmYScsIHtcbiAgICAgICAgbW9udGhzOiAn2pjYp9mG2YjbjNmHX9mB2YjYsduM2Ydf2YXYp9ix2LNf2KLZiNix24zZhF/ZhdmHX9qY2YjYptmGX9qY2YjYptuM2Ydf2KfZiNiqX9iz2b7Yqtin2YXYqNixX9in2qnYqtio2LFf2YbZiNin2YXYqNixX9iv2LPYp9mF2KjYsScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAn2pjYp9mG2YjbjNmHX9mB2YjYsduM2Ydf2YXYp9ix2LNf2KLZiNix24zZhF/ZhdmHX9qY2YjYptmGX9qY2YjYptuM2Ydf2KfZiNiqX9iz2b7Yqtin2YXYqNixX9in2qnYqtio2LFf2YbZiNin2YXYqNixX9iv2LPYp9mF2KjYsScuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5czpcbiAgICAgICAgICAgICfbjNqpXFx1MjAwY9i02YbYqNmHX9iv2YjYtNmG2KjZh1/Ys9mHXFx1MjAwY9i02YbYqNmHX9qG2YfYp9ix2LTZhtio2Ydf2b7ZhtisXFx1MjAwY9i02YbYqNmHX9is2YXYudmHX9i02YbYqNmHJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICks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c2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn2KjYudivINin2LIg2LjZh9ixJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb2KfZhdix2YjYsiDYs9in2LnYql0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vZgdix2K/YpyDYs9in2LnYql0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvYs9in2LnYql0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vYr9uM2LHZiNiyINiz2KfYudiqXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW9m+24zYtF0gW9iz2KfYudiqXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ9iv2LEgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzINm+24zYtCcsXG4gICAgICAgICAgICBzOiAn2obZhtivINir2KfZhtuM2YcnLFxuICAgICAgICAgICAgc3M6ICclZCDYq9in2YbbjNmHJyxcbiAgICAgICAgICAgIG06ICfbjNqpINiv2YLbjNmC2YcnLFxuICAgICAgICAgICAgbW06ICclZCDYr9mC24zZgtmHJyxcbiAgICAgICAgICAgIGg6ICfbjNqpINiz2KfYudiqJyxcbiAgICAgICAgICAgIGhoOiAnJWQg2LPYp9i52KonLFxuICAgICAgICAgICAgZDogJ9uM2qkg2LHZiNiyJyxcbiAgICAgICAgICAgIGRkOiAnJWQg2LHZiNiyJyxcbiAgICAgICAgICAgIE06ICfbjNqpINmF2KfZhycsXG4gICAgICAgICAgICBNTTogJyVkINmF2KfZhycsXG4gICAgICAgICAgICB5OiAn24zaqSDYs9in2YQnLFxuICAgICAgICAgICAgeXk6ICclZCDYs9in2YQnLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZ1xuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9b27At27ldL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTWFwW21hdGNoXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC/YjC9nLCAnLCcpO1xuICAgICAgICB9LFxuICAgICAgICBwb3N0Zm9ybWF0OiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL1xcZC9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbE1hcFttYXRjaF07XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvLC9nLCAn2IwnKTtcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ92YUvLFxuICAgICAgICBvcmRpbmFsOiAnJWTZhScsXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogNiwgLy8gU2F0dXJkYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogMTIsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDEydGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZmE7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogRmlubmlzaCBbZmldXG4vLyEgYXV0aG9yIDogVGFybW8gQWl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gICAgICAgIF07XG4gICAgZnVuY3Rpb24gdHJhbnNsYXRlKG51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5LCBpc0Z1dHVyZSkge1xuICAgICAgICB2YXIgcmVzdWx0ID0gJyc7XG4gICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgPyAnbXV1dGFtYW4gc2VrdW5uaW4nIDogJ211dXRhbWEgc2VrdW50aSc7XG4gICAgICAgICAgICBjYXNlICdzcyc6XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gaXNGdXR1cmUgPyAnc2VrdW5uaW4nIDogJ3Nla3VudGlhJztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ20nOlxuICAgICAgICAgICAgICAgIHJldHVybiBpc0Z1dHVyZSA/ICdtaW51dXRpbicgOiAnbWludXV0dGknO1xuICAgICAgICAgICAgY2FzZSAnbW0nOlxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGlzRnV0dXJlID8gJ21pbnV1dGluJyA6ICdtaW51dXR0aWEnO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnaCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzRnV0dXJlID8gJ3R1bm5pbicgOiAndHVudGknO1xuICAgICAgICAgICAgY2FzZSAnaGgnOlxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGlzRnV0dXJlID8gJ3R1bm5pbicgOiAndHVudGlhJztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIHJldHVybiBpc0Z1dHVyZSA/ICdww6RpdsOkbicgOiAncMOkaXbDpCc7XG4gICAgICAgICAgICBjYXNlICdkZCc6XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gaXNGdXR1cmUgPyAncMOkaXbDpG4nIDogJ3DDpGl2w6TDpCc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgPyAna3V1a2F1ZGVuJyA6ICdrdXVrYXVzaSc7XG4gICAgICAgICAgICBjYXNlICdNTSc6XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gaXNGdXR1cmUgPyAna3V1a2F1ZGVuJyA6ICdrdXVrYXV0dGEnO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAneSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzRnV0dXJlID8gJ3Z1b2RlbicgOiAndnVvc2knO1xuICAgICAgICAgICAgY2FzZSAneXknOlxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGlzRnV0dXJlID8gJ3Z1b2RlbicgOiAndnVvdHRhJztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQgPSB2ZXJiYWxOdW1iZXIobnVtYmVyLCBpc0Z1dHVyZSkgKyAnICcgKyByZXN1bHQ7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHZlcmJhbE51bWJlcihudW1iZXIsIGlzRnV0dXJlKSB7XG4gICAgICAgIHJldHVybiBudW1iZXIgPCAxMFxuICAgICAgICAgICAgPyBpc0Z1dHVyZVxuICAgICAgICAgICAgICAgID8gbnVtYmVyc0Z1dHVyZVtudW1iZXJdXG4gICAgICAgICAgICAgICAgOiBudW1iZXJzUGFzdFtudW1iZXJdXG4gICAgICAgICAgICA6IG51bWJlcjtcbiAgICB9XG5cbiAgICB2YXIgZmkgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdmaScsIHtcbiAgICAgICAgbW9udGhzOiAndGFtbWlrdXVfaGVsbWlrdXVfbWFhbGlza3V1X2h1aHRpa3V1X3RvdWtva3V1X2tlc8Oka3V1X2hlaW7DpGt1dV9lbG9rdXVfc3l5c2t1dV9sb2tha3V1X21hcnJhc2t1dV9qb3VsdWt1dScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAndGFtbWlfaGVsbWlfbWFhbGlzX2h1aHRpX3RvdWtvX2tlc8OkX2hlaW7DpF9lbG9fc3l5c19sb2thX21hcnJhc19qb3VsdScuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5czpcbiAgICAgICAgICAgICdzdW5udW50YWlfbWFhbmFudGFpX3RpaXN0YWlfa2Vza2l2aWlra29fdG9yc3RhaV9wZXJqYW50YWlfbGF1YW50YWknLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ3N1X21hX3RpX2tlX3RvX3BlX2xhJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ3N1X21hX3RpX2tlX3RvX3BlX2xhJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISC5tbScsXG4gICAgICAgICAgICBMVFM6ICdISC5tbS5zcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0RvIE1NTU1bdGFdIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRG8gTU1NTVt0YV0gWVlZWSwgW2tsb10gSEgubW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIERvIE1NTU1bdGFdIFlZWVksIFtrbG9dIEhILm1tJyxcbiAgICAgICAgICAgIGw6ICdELk0uWVlZWScsXG4gICAgICAgICAgICBsbDogJ0RvIE1NTSBZWVlZJyxcbiAgICAgICAgICAgIGxsbDogJ0RvIE1NTSBZWVlZLCBba2xvXSBISC5tbScsXG4gICAgICAgICAgICBsbGxsOiAnZGRkLCBEbyBNTU0gWVlZWSwgW2tsb10gSEgubW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1t0w6Ruw6TDpG5dIFtrbG9dIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbaHVvbWVubmFdIFtrbG9dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBba2xvXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2VpbGVuXSBba2xvXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1t2aWltZV0gZGRkZFtuYV0gW2tsb10gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyBww6TDpHN0w6QnLFxuICAgICAgICAgICAgcGFzdDogJyVzIHNpdHRlbicsXG4gICAgICAgICAgICBzOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBzczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbW06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGg6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGhoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBkOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBkZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTU06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIHk6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIHl5OiB0cmFuc2xhdGUsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfVxcLi8sXG4gICAgICAgIG9yZGluYWw6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gICBtb250aHM6ICdFbmVyb19QZWJyZXJvX01hcnNvX0FicmlsX01heW9fSHVueW9fSHVseW9fQWdvc3RvX1NldHllbWJyZV9Pa3R1YnJlX05vYnllbWJyZV9EaXN5ZW1icmUnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OiAnRW5lX1BlYl9NYXJfQWJyX01heV9IdW5fSHVsX0Fnb19TZXRfT2t0X05vYl9EaXMnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzOiAnTGluZ2dvX0x1bmVzX01hcnRlc19NaXllcmt1bGVzX0h1d2ViZXNfQml5ZXJuZXNfU2FiYWRvJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnTGluX0x1bl9NYXJfTWl5X0h1d19CaXlfU2FiJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ0xpX0x1X01hX01pX0h1X0JpX1NhYicuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ01NL0QvWVlZWScsXG4gICAgICAgICAgICBMTDogJ01NTU0gRCwgWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdNTU1NIEQsIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIE1NTU0gREQsIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ0xUIFtuZ2F5b25nIGFyYXddJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbQnVrYXMgbmddIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnTFQgW3NhIHN1c3Vub2QgbmFdIGRkZGQnLFxuICAgICAgICAgICAgbGFzdERheTogJ0xUIFtrYWhhcG9uXScsXG4gICAgICAgICAgICBsYXN0V2VlazogJ0xUIFtub29uZyBuYWthcmFhbmddIGRkZGQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdzYSBsb29iIG5nICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBhbmcgbmFrYWxpcGFzJyxcbiAgICAgICAgICAgIHM6ICdpbGFuZyBzZWd1bmRvJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VndW5kbycsXG4gICAgICAgICAgICBtOiAnaXNhbmcgbWludXRvJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRvJyxcbiAgICAgICAgICAgIGg6ICdpc2FuZyBvcmFzJyxcbiAgICAgICAgICAgIGhoOiAnJWQgb3JhcycsXG4gICAgICAgICAgICBkOiAnaXNhbmcgYXJhdycsXG4gICAgICAgICAgICBkZDogJyVkIGFyYXcnLFxuICAgICAgICAgICAgTTogJ2lzYW5nIGJ1d2FuJyxcbiAgICAgICAgICAgIE1NOiAnJWQgYnV3YW4nLFxuICAgICAgICAgICAgeTogJ2lzYW5nIHRhb24nLFxuICAgICAgICAgICAgeXk6ICclZCB0YW9uJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9LyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBK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XN0V2VlazogJ1tzw63DsHN0dV0gZGRkZCBba2xdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAndW0gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIHPDrcOwYW5pJyxcbiAgICAgICAgICAgIHM6ICdmw6Egc2VrdW5kJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VrdW5kaXInLFxuICAgICAgICAgICAgbTogJ2VpbiBtaW51dHR1cicsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0dGlyJyxcbiAgICAgICAgICAgIGg6ICdlaW4gdMOtbWknLFxuICAgICAgICAgICAgaGg6ICclZCB0w61tYXInLFxuICAgICAgICAgICAgZDogJ2VpbiBkYWd1cicsXG4gICAgICAgICAgICBkZDogJyVkIGRhZ2FyJyxcbiAgICAgICAgICAgIE06ICdlaW4gbcOhbmHDsHVyJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbcOhbmHDsGlyJyxcbiAgICAgICAgICAgIHk6ICdlaXR0IMOhcicsXG4gICAgICAgICAgICB5eTogJyVkIMOhcicsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfVxcLi8sXG4gICAgICAgIG9yZGluYWw6ICclZC4nLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZm87XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBj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AnZGFucyAlcycsXG4gICAgICAgICAgICBwYXN0OiAnaWwgeSBhICVzJyxcbiAgICAgICAgICAgIHM6ICdxdWVscXVlcyBzZWNvbmRlcycsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZGVzJyxcbiAgICAgICAgICAgIG06ICd1bmUgbWludXRlJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgICAgICBoOiAndW5lIGhldXJlJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaGV1cmVzJyxcbiAgICAgICAgICAgIGQ6ICd1biBqb3VyJyxcbiAgICAgICAgICAgIGRkOiAnJWQgam91cnMnLFxuICAgICAgICAgICAgTTogJ3VuIG1vaXMnLFxuICAgICAgICAgICAgTU06ICclZCBtb2lzJyxcbiAgICAgICAgICAgIHk6ICd1biBhbicsXG4gICAgICAgICAgICB5eTogJyVkIGFucycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShlcnxlKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICAvLyBXb3JkcyB3aXRoIG1hc2N1bGluZSBncmFtbWF0aWNhbCBnZW5kZXI6IG1vaXMsIHRyaW1lc3RyZSwgam91clxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgY2FzZSAnUSc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIChudW1iZXIgPT09IDEgPyAnZXInIDogJ2UnKTtcblxuICAgICAgICAgICAgICAgIC8vIFdvcmRzIHdpdG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lsX21haV9qdWluX2p1aWxsZXRfYW/Du3Rfc2VwdGVtYnJlX29jdG9icmVfbm92ZW1icmVfZMOpY2VtYnJlJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICdqYW52Ll9mw6l2ci5fbWFyc19hdnIuX21haV9qdWluX2p1aWwuX2Fvw7t0X3NlcHQuX29jdC5fbm92Ll9kw6ljLicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICB3ZWVrZGF5czogJ2RpbWFuY2hlX2x1bmRpX21hcmRpX21lcmNyZWRpX2pldWRpX3ZlbmRyZWRpX3NhbWVkaScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ2RpbS5fbHVuLl9tYXIuX21lci5famV1Ll92ZW4uX3NhbS4nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnZGlfbHVfbWFfbWVfamVfdmVfc2EnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0F1am91cmTigJlodWkgw6BdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbRGVtYWluIMOgXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW8OgXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0hpZXIgw6BdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbZGVybmllciDDoF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdkYW5zICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdpbCB5IGEgJXMnLFxuICAgICAgICAgICAgczogJ3F1ZWxxdWVzIHNlY29uZGVzJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vjb25kZXMnLFxuICAgICAgICAgICAgbTogJ3VuZSBtaW51dGUnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGVzJyxcbiAgICAgICAgICAgIGg6ICd1bmUgaGV1cmUnLFxuICAgICAgICAgICAgaGg6ICclZCBoZXVyZXMnLFxuICAgICAgICAgICAgZDogJ3VuIGpvdXInLFxuICAgICAgICAgICAgZGQ6ICclZCBqb3VycycsXG4gICAgICAgICAgICBNOiAndW4gbW9pcycsXG4gICAgICAgICAgICBNTTogJyVkIG1vaXMnLFxuICAgICAgICAgICAgeTogJ3VuIGFuJyxcbiAgICAgICAgICAgIHl5OiAnJWQgYW5zJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KGVyfGUpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIC8vIFdvcmRzIHdpdGggbWFzY3VsaW5lIGdyYW1tYXRpY2FsIGdlbmRlcjogbW9pcywgdHJpbWVzdHJlLCBqb3VyXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICBjYXNlICdRJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgKG51bWJlciA9PT0gMSA/ICdlcicgOiAnZScpO1xuXG4gICAgICAgICAgICAgICAgLy8gV29yZHMgd2l0aCBmZW1pbmluZSBncmFtbWF0aWNhbCBnZW5kZXI6IHNlbWFpbmVcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIChudW1iZXIgPT09IDEgPyAncmUnIDogJ2UnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGZyQ2g7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogRnJlbmNoIFtmcl1cbi8vISBhdXRob3IgOiBKb2huIEZpc2NoZXIgOiBodHRwczovL2dpdGh1Yi5jb20vamZyb2ZmaWNlXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZ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AgICAgICAgICAgIC9eamFudi9pLFxuICAgICAgICAgICAgL15mw6l2ci9pLFxuICAgICAgICAgICAgL15tYXJzL2ksXG4gICAgICAgICAgICAvXmF2ci9pLFxuICAgICAgICAgICAgL15tYWkvaSxcbiAgICAgICAgICAgIC9eanVpbi9pLFxuICAgICAgICAgICAgL15qdWlsL2ksXG4gICAgICAgICAgICAvXmFvw7t0L2ksXG4gICAgICAgICAgICAvXnNlcHQvaSxcbiAgICAgICAgICAgIC9eb2N0L2ksXG4gICAgICAgICAgICAvXm5vdi9pLFxuICAgICAgICAgICAgL15kw6ljL2ksXG4gICAgICAgIF07XG5cbiAgICB2YXIgZnIgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdmcicsIHtcbiAgICAgICAgbW9udGhzOiAnamFudmllcl9mw6l2cmllcl9tYXJzX2F2cmlsX21haV9qdWluX2p1aWxsZXRfYW/Du3Rfc2VwdGVtYnJlX29jdG9icmVfbm92ZW1icmVfZMOpY2VtYnJlJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICdqYW52Ll9mw6l2ci5fbWFyc19hdnIuX21haV9qdWluX2p1aWwuX2Fvw7t0X3NlcHQuX29jdC5fbm92Ll9kw6ljLicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNSZWdleDogbW9udGhzUmVnZXgsXG4gICAgICAgIG1vbnRoc1Nob3J0UmVnZXg6IG1vbnRoc1JlZ2V4LFxuICAgICAgICBtb250aHNTdHJpY3RSZWdleDogbW9udGhzU3RyaWN0UmVnZXgsXG4gICAgICAgIG1vbnRoc1Nob3J0U3RyaWN0UmVnZXg6IG1vbnRoc1Nob3J0U3RyaWN0UmVnZXgsXG4gICAgICAgIG1vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgbG9uZ01vbnRoc1BhcnNlOiBtb250aHNQ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ICAgIGZ1dHVyZTogJ2RhbnMgJXMnLFxuICAgICAgICAgICAgcGFzdDogJ2lsIHkgYSAlcycsXG4gICAgICAgICAgICBzOiAncXVlbHF1ZXMgc2Vjb25kZXMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRlcycsXG4gICAgICAgICAgICBtOiAndW5lIG1pbnV0ZScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZXMnLFxuICAgICAgICAgICAgaDogJ3VuZSBoZXVyZScsXG4gICAgICAgICAgICBoaDogJyVkIGhldXJlcycsXG4gICAgICAgICAgICBkOiAndW4gam91cicsXG4gICAgICAgICAgICBkZDogJyVkIGpvdXJzJyxcbiAgICAgICAgICAgIHc6ICd1bmUgc2VtYWluZScsXG4gICAgICAgICAgICB3dzogJyVkIHNlbWFpbmVzJyxcbiAgICAgICAgICAgIE06ICd1biBtb2lzJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbW9pcycsXG4gICAgICAgICAgICB5OiAndW4gYW4nLFxuICAgICAgICAgICAgeXk6ICclZCBhbnMnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oZXJ8KS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICAvLyBUT0RPOiBSZXR1cm4gJ2UnIHdoZW4gZGF5IG9mIG1vbnRoID4gMS4gTW92ZSB0aGlzIGNhc2UgaW5zaWRlXG4gICAgICAgICAgICAgICAgLy8gYmxvY2sgZm9yIG1hc2N1bGluZSB3b3JkcyBiZWxvdy5cbiAgICAgICAgICAgICAgICAvLyBTZWUgaHR0cHM6Ly9naXRodWIuY29tL21vbWVudC9tb21lbnQvaXNzdWVzLzMzNzVcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIChudW1iZXIgPT09IDEgPyAnZXInIDogJycpO1xuXG4gICAgICAgICAgICAgICAgLy8gV29yZHMgd2l0aCBtYXNjdWxpbmUgZ3JhbW1hdGljYWwgZ2VuZGVyOiBtb2lzLCB0cmltZXN0cmUsIGpvdXJcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgIGNhc2UgJ1EnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RERCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAobnVtYmVyID09PSAxID8gJ2VyJyA6ICdlJyk7XG5cbiAgICAgICAgICAgICAgICAvLyBXb3JkcyB3aXRoIGZlbWluaW5lIGdyYW1tYXRpY2FsIGdlbmRlcjogc2VtYWluZVxuICAgICAgICAgICAgICAgIGNhc2UgJ3cnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ1cnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgKG51bWJlciA9PT0gMSA/ICdyZScgOiAnZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZnI7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogRnJpc2lhbiBbZnldXG4vLyEgYXV0aG9yIDogUm9iaW4gdmFuIGRlciBWb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dfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDogZnVuY3Rpb24gKG0sIGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFtKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0V2l0aERvdHM7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKC8tTU1NLS8udGVzdChmb3JtYXQpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0V2l0aG91dERvdHNbbS5tb250aCgpXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0V2l0aERvdHNbbS5tb250aCgpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgd2Vla2RheXM6ICdzbmVpbl9tb2FuZGVpX3RpaXNkZWlfd29hbnNkZWlfdG9uZ2Vyc2RlaV9mcmVlZF9zbmVvbicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ3NpLl9tby5fdGkuX3dvLl90by5fZnIuX3NvLicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdTaV9Nb19UaV9Xb19Ub19Gcl9Tbycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQtTU0tWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbaGpvZWQgb21dIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbbW9hcm4gb21dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbb21dIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbanVzdGVyIG9tXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vDtGZyw7tuZV0gZGRkZCBbb21dIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnb2VyICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBseW4nLFxuICAgICAgICAgICAgczogJ2luIHBlYXIgc2Vrb25kZW4nLFxuICAgICAgICAgICAgc3M6ICclZCBzZWtvbmRlbicsXG4gICAgICAgICAgICBtOiAnaWVuIG1pbsO6dCcsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZW4nLFxuICAgICAgICAgICAgaDogJ2llbiBvZXJlJyxcbiAgICAgICAgICAgIGhoOiAnJWQgb2VyZW4nLFxuICAgICAgICAgICAgZDogJ2llbiBkZWknLFxuICAgICAgICAgICAgZGQ6ICclZCBkYWdlbicsXG4gICAgICAgICAgICBNOiAnaWVuIG1vYW5uZScsXG4gICAgICAgICAgICBNTTogJyVkIG1vYW5uZW4nLFxuICAgICAgICAgICAgeTogJ2llbiBqaWVyJyxcbiAgICAgICAgICAgIHl5OiAnJWQgamllcnJlbicsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShzdGV8ZGUpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgcm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G1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIG1vbnRocyA9IFtcbiAgICAgICAgICAgICdFYW7DoWlyJyxcbiAgICAgICAgICAgICdGZWFiaHJhJyxcbiAgICAgICAgICAgICdNw6FydGEnLFxuICAgICAgICAgICAgJ0FpYnJlw6FuJyxcbiAgICAgICAgICAgICdCZWFsdGFpbmUnLFxuICAgICAgICAgICAgJ01laXRoZWFtaCcsXG4gICAgICAgICAgICAnScO6aWwnLFxuICAgICAgICAgICAgJ0zDum5hc2EnLFxuICAgICAgICAgICAgJ01lw6FuIEbDs21oYWlyJyxcbiAgICAgICAgICAgICdEZWlyZWFkaCBGw7NtaGFpcicsXG4gICAgICAgICAgICAnU2FtaGFpbicsXG4gICAgICAgICAgICAnTm9sbGFpZycsXG4gICAgICAgIF0sXG4gICAgICAgIG1vbnRoc1Nob3J0ID0gW1xuICAgICAgICAgICAgJ0VhbicsXG4gICAgICAgICAgICAnRmVhYmgnLFxuICAgICAgICAgICAgJ03DoXJ0JyxcbiAgICAgICAgICAgICdBaWInLFxuICAgICAgICAgICAgJ0JlYWwnLFxuICAgICAgICAgICAgJ01laXRoJyxcbiAgICAgICAgICAgICdJw7ppbCcsXG4gICAgICAgICAgICAnTMO6bicsXG4gICAgICAgICAgICAnTS5GLicsXG4gICAgICAgICAgICAnRC5GLicsXG4gICAgICAgICAgICAnU2FtaCcsXG4gICAgICAgICAgICAnTm9sbCcsXG4gICAgICAgIF0sXG4gICAgICAgIHdlZWtkYXlzID0gW1xuICAgICAgICAgICAgJ0TDqSBEb21obmFpZ2gnLFxuICAgICAgICAgICAgJ0TDqSBMdWFpbicsXG4gICAgICAgICAgICAnRMOpIE3DoWlydCcsXG4gICAgICAgICAgICAnRMOpIEPDqWFkYW9pbicsXG4gICAgICAgICAgICAnRMOpYXJkYW9pbicsXG4gICAgICAgICAgICAnRMOpIGhBb2luZScsXG4gICAgICAgICAgICAnRMOpIFNhdGhhaXJuJyxcbiAgICAgICAgXSxcbiAgICAgICAgd2Vla2RheXNTaG9ydCA9IFsnRG9taCcsICdMdWFuJywgJ03DoWlydCcsICdDw6lhZCcsICdEw6lhcicsICdBb2luZScsICdTYXRoJ10sXG4gICAgICAgIHdlZWtkYXlzTWluID0gWydEbycsICdMdScsICdNw6EnLCAnQ8OpJywgJ0TDqScsICdBJywgJ1NhJ107XG5cbiAgICB2YXIgZ2EgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdnYScsIHtcbiAgICAgICAgbW9udGhzOiBtb250aHMsXG4gICAgICAgIG1vbnRoc1Nob3J0OiBtb250aHNTaG9ydCxcbiAgICAgICAgbW9udGhzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgd2Vla2RheXM6IHdlZWtkYXlzLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiB3ZWVrZGF5c1Nob3J0LFxuICAgICAgICB3ZWVrZGF5c01pbjogd2Vla2RheXNNaW4sXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSW5uaXUgYWddIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbQW3DoXJhY2ggYWddIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbYWddIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbSW5uw6kgYWddIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbc2VvIGNhaXRlXSBbYWddIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnaSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgw7Mgc2hpbicsXG4gICAgICAgICAgICBzOiAnY8O6cGxhIHNvaWNpbmQnLFxuICAgICAgICAgICAgc3M6ICclZCBzb2ljaW5kJyxcbiAgICAgICAgICAgIG06ICduw7NpbcOpYWQnLFxuICAgICAgICAgICAgbW06ICclZCBuw7NpbcOpYWQnLFxuICAgICAgICAgICAgaDogJ3VhaXIgYW4gY2hsb2lnJyxcbiAgICAgICAgICAgIGhoOiAnJWQgdWFpciBhbiBjaGxvaWcnLFxuICAgICAgICAgICAgZDogJ2zDoScsXG4gICAgICAgICAgICBkZDogJyVkIGzDoScsXG4gICAgICAgICAgICBNOiAnbcOtJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbcOtb25uYScsXG4gICAgICAgICAgICB5OiAnYmxpYWluJyxcbiAgICAgICAgICAgIHl5OiAnJWQgYmxpYWluJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KGR8bmF8bWgpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIG91dHB1dCA9IG51bWJlciA9PT0gMSA/ICdkJyA6IG51bWJlciAlIDEwID09PSAyID8gJ25hJyA6ICdtaCc7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgb3V0cHV0O1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2Vl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AgJ0FuIEzDuW5hc3RhbCcsXG4gICAgICAgICAgICAnQW4gdC1TdWx0YWluJyxcbiAgICAgICAgICAgICdBbiBEw6BtaGFpcicsXG4gICAgICAgICAgICAnQW4gdC1TYW1oYWluJyxcbiAgICAgICAgICAgICdBbiBEw7liaGxhY2hkJyxcbiAgICAgICAgXSxcbiAgICAgICAgbW9udGhzU2hvcnQgPSBbXG4gICAgICAgICAgICAnRmFvaScsXG4gICAgICAgICAgICAnR2VhcicsXG4gICAgICAgICAgICAnTcOgcnQnLFxuICAgICAgICAgICAgJ0dpYmwnLFxuICAgICAgICAgICAgJ0PDqGl0JyxcbiAgICAgICAgICAgICfDkmdtaCcsXG4gICAgICAgICAgICAnSXVjaCcsXG4gICAgICAgICAgICAnTMO5bicsXG4gICAgICAgICAgICAnU3VsdCcsXG4gICAgICAgICAgICAnRMOgbWgnLFxuICAgICAgICAgICAgJ1NhbWgnLFxuICAgICAgICAgICAgJ0TDuWJoJyxcbiAgICAgICAgXSxcbiAgICAgICAgd2Vla2RheXMgPSBbXG4gICAgICAgICAgICAnRGlkw7JtaG5haWNoJyxcbiAgICAgICAgICAgICdEaWx1YWluJyxcbiAgICAgICAgICAgICdEaW3DoGlydCcsXG4gICAgICAgICAgICAnRGljaWFkYWluJyxcbiAgICAgICAgICAgICdEaWFyZGFvaW4nLFxuICAgICAgICAgICAgJ0RpaGFvaW5lJyxcbiAgICAgICAgICAgICdEaXNhdGhhaXJuZScsXG4gICAgICAgIF0sXG4gICAgICAgIHdlZWtkYXlzU2hvcnQgPSBbJ0RpZCcsICdEaWwnLCAnRGltJywgJ0RpYycsICdEaWEnLCAnRGloJywgJ0RpcyddLFxuICAgICAgICB3ZWVrZGF5c01pbiA9IFsnRMOyJywgJ0x1JywgJ03DoCcsICdDaScsICdBcicsICdIYScsICdTYSddO1xuXG4gICAgdmFyIGdkID0gbW9tZW50LmRlZmluZUxvY2FsZSgnZ2QnLCB7XG4gICAgICAgIG1vbnRoczogbW9udGhzLFxuICAgICAgICBtb250aHNTaG9ydDogbW9udGhzU2hvcnQsXG4gICAgICAgIG1vbnRoc1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIHdlZWtkYXlzOiB3ZWVrZGF5cyxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogd2Vla2RheXNTaG9ydCxcbiAgICAgICAgd2Vla2RheXNNaW46IHdlZWtkYXlzTWluLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0FuLWRpdWdoIGFpZ10gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tBLW3DoGlyZWFjaCBhaWddIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbYWlnXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0FuLWTDqCBhaWddIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbc2VvIGNoYWlkaF0gW2FpZ10gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdhbm4gYW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ2JobyBjaGlvbm4gJXMnLFxuICAgICAgICAgICAgczogJ2JlYWdhbiBkaW9nYW4nLFxuICAgICAgICAgICAgc3M6ICclZCBkaW9nYW4nLFxuICAgICAgICAgICAgbTogJ21pb25haWQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW9uYWlkZWFuJyxcbiAgICAgICAgICAgIGg6ICd1YWlyJyxcbiAgICAgICAgICAgIGhoOiAnJWQgdWFpcmVhbicsXG4gICAgICAgICAgICBkOiAnbGF0aGEnLFxuICAgICAgICAgICAgZGQ6ICclZCBsYXRoYScsXG4gICAgICAgICAgICBNOiAnbcOsb3MnLFxuICAgICAgICAgICAgTU06ICclZCBtw6xvc2FuJyxcbiAgICAgICAgICAgIHk6ICdibGlhZGhuYScsXG4gICAgICAgICAgICB5eTogJyVkIGJsaWFkaG5hJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KGR8bmF8bWgpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIG91dHB1dCA9IG51bWJlciA9PT0gMSA/ICdkJyA6IG51bWJlciAlIDEwID09PSAyID8gJ25hJyA6ICdtaCc7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgb3V0cHV0O1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZ2Q7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogR2FsaWNpYW4gW2dsXVxuLy8hIGF1dGhvciA6IEp1YW4gRy4gSHVydGFkbyA6IGh0dHBzOi8vZ2l0aHViLmNv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LFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnZG9tLl9sdW4uX21hci5fbcOpci5feG92Ll92ZW4uX3PDoWIuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ2RvX2x1X21hX23DqV94b192ZV9zw6EnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSDptbScsXG4gICAgICAgICAgICBMVFM6ICdIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBbZGVdIE1NTU0gW2RlXSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgW2RlXSBNTU1NIFtkZV0gWVlZWSBIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIFtkZV0gTU1NTSBbZGVdIFlZWVkgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbaG94ZSAnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICfDoXMnIDogJ8OhJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW21hw7HDoSAnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICfDoXMnIDogJ8OhJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2RkZGQgWycgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ8OhcycgOiAnYScpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1tvbnRlICcgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ8OhJyA6ICdhJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAnW29dIGRkZGQgW3Bhc2FkbyAnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICfDoXMnIDogJ2EnKSArICddIExUJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6IGZ1bmN0aW9uIChzdHIpIHtcbiAgICAgICAgICAgICAgICBpZiAoc3RyLmluZGV4T2YoJ3VuJykgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICduJyArIHN0cjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICdlbiAnICsgc3RyO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHBhc3Q6ICdoYWkgJXMnLFxuICAgICAgICAgICAgczogJ3VucyBzZWd1bmRvcycsXG4gICAgICAgICAgICBzczogJyVkIHNlZ3VuZG9zJyxcbiAgICAgICAgICAgIG06ICd1biBtaW51dG8nLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dG9zJyxcbiAgICAgICAgICAgIGg6ICd1bmhhIGhvcmEnLFxuICAgICAgICAgICAgaGg6ICclZCBob3JhcycsXG4gICAgICAgICAgICBkOiAndW4gZMOtYScsXG4gICAgICAgICAgICBkZDogJyVkIGTDrWFzJyxcbiAgICAgICAgICAgIE06ICd1biBtZ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G59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIGZ1bmN0aW9uIHByb2Nlc3NSZWxhdGl2ZVRpbWUobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXksIGlzRnV0dXJlKSB7XG4gICAgICAgIHZhciBmb3JtYXQgPSB7XG4gICAgICAgICAgICBzOiBbJ+CkpeCli+CkoeCkr+CkviDgpLjgpYXgpJXgpILgpKHgpL7gpILgpKjgpYAnLCAn4KSl4KWL4KSh4KWHIOCkuOClheCkleCkguCkoSddLFxuICAgICAgICAgICAgc3M6IFtudW1iZXIgKyAnIOCkuOClheCkleCkguCkoeCkvuCkguCkqOClgCcsIG51bWJlciArICcg4KS44KWF4KSV4KSC4KShJ10sXG4gICAgICAgICAgICBtOiBbJ+Ckj+CkleCkviDgpK7gpL/gpKPgpJ/gpL7gpKgnLCAn4KSP4KSVIOCkruCkv+CkqOClguCknyddLFxuICAgICAgICAgICAgbW06IFtudW1iZXIgKyAnIOCkruCkv+Cko+Ckn+CkvuCkguCkqOClgCcsIG51bWJlciArICcg4KSu4KS/4KSj4KSf4KS+4KSCJ10sXG4gICAgICAgICAgICBoOiBbJ+Ckj+CkleCkviDgpLXgpLDgpL7gpKgnLCAn4KSP4KSVIOCkteCksCddLFxuICAgICAgICAgICAgaGg6IFtudW1iZXIgKyAnIOCkteCksOCkvuCkguCkqOClgCcsIG51bWJlciArICcg4KS14KSw4KS+4KSCJ10sXG4gICAgICAgICAgICBkOiBbJ+Ckj+CkleCkviDgpKbgpL/gpLjgpL7gpKgnLCAn4KSP4KSVIOCkpuClgOCkuCddLFxuICAgICAgICAgICAgZGQ6IFtudW1iZXIgKyAnIOCkpuCkv+CkuOCkvuCkguCkqOClgCcsIG51bWJlciArICcg4KSm4KWA4KS4J10sXG4gICAgICAgICAgICBNOiBbJ+Ckj+CkleCkviDgpK7gpY3gpLngpK/gpKjgpY3gpK/gpL7gpKgnLCAn4KSP4KSVIOCkruCljeCkueCkr+CkqOCliyddLFxuICAgICAgICAgICAgTU06IFtudW1iZXIgKyAnIOCkruCljeCkueCkr+CkqOCljeCkr+CkvuCkqOClgCcsIG51bWJlciArICcg4KSu4KWN4KS54KSv4KSo4KWHJ10sXG4gICAgICAgICAgICB5OiBbJ+Ckj+CkleCkviDgpLXgpLDgpY3gpLjgpL7gpKgnLCAn4KSP4KSVIOCkteCksOCljeCkuCddLFxuICAgICAgICAgICAgeXk6IFtudW1iZXIgKyAnIOCkteCksOCljeCkuOCkvuCkguCkqOClgCcsIG51bWJlciArICcg4KS14KSw4KWN4KS44KS+4KSCJ10sXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBpc0Z1dHVyZSA/IGZvcm1hdFtrZXldWzBdIDogZm9ybWF0W2tleV1bMV07XG4gICAgfVxuXG4gICAgdmFyIGdvbURldmEgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdnb20tZGV2YScsIHtcbiAgICAgICAgbW9udGhzOiB7XG4gICAgICAgICAgICBzdGFuZGFsb25lOlxuICAgICAgICAgICAgICAgICfgpJzgpL7gpKjgpYfgpLXgpL7gpLDgpYBf4KSr4KWH4KSs4KWN4KSw4KWB4KS14KS+4KSw4KWAX+CkruCkvuCksOCljeCkml/gpI/gpKrgpY3gpLDgpYDgpLJf4KSu4KWHX+CknOClguCkqF/gpJzgpYHgpLLgpK9f4KSR4KSX4KS44KWN4KSfX+CkuOCkquCljeCkn+Clh+CkguCkrOCksF/gpJHgpJXgpY3gpJ/gpYvgpKzgpLBf4KSo4KWL4KS14KWN4KS54KWH4KSC4KSs4KSwX+CkoeCkv+CkuOClh+CkguCkrOCksCcuc3BsaXQoXG4gICAgICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICBmb3JtYXQ6ICfgpJzgpL7gpKjgpYfgpLXgpL7gpLDgpYDgpJrgpY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gZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KOCkteClh+CksCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgLy8gdGhlIG9yZGluYWwgJ+CkteClh+CksCcgb25seSBhcHBsaWVzIHRvIGRheSBvZiB0aGUgbW9udGhcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfgpLXgpYfgpLAnO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgY2FzZSAnUSc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAwLCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vla1xuICAgICAgICAgICAgZG95OiAzLCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIgKDcgKyAwIC0gNClcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+CksOCkvuCkpOClgHzgpLjgpJXgpL7gpLPgpYDgpIJ84KSm4KSo4KSq4KS+4KSw4KS+4KSCfOCkuOCkvuCkguCknOClhy8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+CksOCkvuCkpOClgCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA8IDQgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CkuOCkleCkvuCks+ClgOCkgicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgpKbgpKjgpKrgpL7gpLDgpL7gpIInKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPiAxMiA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4KS44KS+4KSC4KSc4KWHJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CksOCkvuCkpOClgCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4KS44KSV4KS+4KSz4KWA4KSCJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE2KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgpKbgpKjgpKrgpL7gpLDgpL7gpIInO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMjApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CkuOCkvuCkguCkn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IHNzOiBbbnVtYmVyICsgJyBzZWtvbmRhbW5pJywgbnVtYmVyICsgJyBzZWtvbmQnXSxcbiAgICAgICAgICAgIG06IFsnZWthIG1pbnRhbicsICdlayBtaW51dCddLFxuICAgICAgICAgICAgbW06IFtudW1iZXIgKyAnIG1pbnRhbW5pJywgbnVtYmVyICsgJyBtaW50YW0nXSxcbiAgICAgICAgICAgIGg6IFsnZWthIHZvcmFuJywgJ2VrIHZvciddLFxuICAgICAgICAgICAgaGg6IFtudW1iZXIgKyAnIHZvcmFtbmknLCBudW1iZXIgKyAnIHZvcmFtJ10sXG4gICAgICAgICAgICBkOiBbJ2VrYSBkaXNhbicsICdlayBkaXMnXSxcbiAgICAgICAgICAgIGRkOiBbbnVtYmVyICsgJyBkaXNhbW5pJywgbnVtYmVyICsgJyBkaXMnXSxcbiAgICAgICAgICAgIE06IFsnZWthIG1ob2luZWFuJywgJ2VrIG1ob2lubyddLFxuICAgICAgICAgICAgTU06IFtudW1iZXIgKyAnIG1ob2luZWFtbmknLCBudW1iZXIgKyAnIG1ob2luZSddLFxuICAgICAgICAgICAgeTogWydla2Egdm9yc2FuJywgJ2VrIHZvcm9zJ10sXG4gICAgICAgICAgICB5eTogW251bWJlciArICcgdm9yc2FtbmknLCBudW1iZXIgKyAnIHZvcnNhbSddLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gaXNGdXR1cmUgPyBmb3JtYXRba2V5XVswXSA6IGZvcm1hdFtrZXldWzFdO1xuICAgIH1cblxuICAgIHZhciBnb21MYXRuID0gbW9tZW50LmRlZmluZUxvY2FsZSgnZ29tLWxhdG4nLCB7XG4gICAgICAgIG1vbnRoczoge1xuICAgICAgICAgICAgc3RhbmRhbG9uZTpcbiAgICAgICAgICAgICAgICAnSmFuZXJfRmVicmVyX01hcnNfQWJyaWxfTWFpX0p1bl9KdWxhaV9BZ29zdF9TZXRlbWJyX090dWJyX05vdmVtYnJfRGV6ZW1icicuc3BsaXQoXG4gICAgICAgICAgICAgICAg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c1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIE1NOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgeTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIHl5OiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oZXIpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIC8vIHRoZSBvcmRpbmFsICdlcicgb25seSBhcHBsaWVzIHRvIGRheSBvZiB0aGUgbW9udGhcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICdlcic7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICBjYXNlICdRJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ3cnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ1cnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDAsIC8vIFN1bmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrXG4gICAgICAgICAgICBkb3k6IDMsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhciAoNyArIDAgLSA0KVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvcmF0aXxzb2thbGxpbXxkb25wYXJhbXxzYW5qZS8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ3JhdGknKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPCA0ID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICdzb2thbGxpbScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICdkb25wYXJhbScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+IDEyID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICdzYW5qZScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdyYXRpJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdzb2thbGxpbSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNikge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZG9ucGFyYW0nO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMjApIHtcbiAgICAgICAgICAgICAgICByZXR1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CBEIE1NTU0gWVlZWSwgQSBoOm1tIOCqteCqvuCql+CrjeCqr+CrhycsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+CqhuCqnF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vgqpXgqr7gqrLgq4ddIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCwgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vgqpfgqofgqpXgqr7gqrLgq4ddIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+CqquCqvuCqm+CqsuCqvl0gZGRkZCwgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDgqq7gqr4nLFxuICAgICAgICAgICAgcGFzdDogJyVzIOCqquCqueCrh+CqsuCqvicsXG4gICAgICAgICAgICBzOiAn4KqF4Kqu4KuB4KqVIOCqquCqs+CriycsXG4gICAgICAgICAgICBzczogJyVkIOCquOCrh+CqleCqguCqoScsXG4gICAgICAgICAgICBtOiAn4KqP4KqVIOCqruCqv+CqqOCqv+CqnycsXG4gICAgICAgICAgICBtbTogJyVkIOCqruCqv+CqqOCqv+CqnycsXG4gICAgICAgICAgICBoOiAn4KqP4KqVIOCqleCqsuCqvuCqlScsXG4gICAgICAgICAgICBoaDogJyVkIOCqleCqsuCqvuCqlScsXG4gICAgICAgICAgICBkOiAn4KqP4KqVIOCqpuCqv+CqteCquCcsXG4gICAgICAgICAgICBkZDogJyVkIOCqpuCqv+CqteCquCcsXG4gICAgICAgICAgICBNOiAn4KqP4KqVIOCqruCqueCqv+CqqOCriycsXG4gICAgICAgICAgICBNTTogJyVkIOCqruCqueCqv+CqqOCriycsXG4gICAgICAgICAgICB5OiAn4KqP4KqVIOCqteCqsOCrjeCqtycsXG4gICA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Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyIDwgNCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4Kq44Kq14Kq+4KqwJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CqrOCqquCri+CqsCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4Kq44Kq+4KqC4KqcJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CqsOCqvuCqpCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Kq44Kq14Kq+4KqwJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE3KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgqqzgqqrgq4vgqrAnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMjApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CquOCqvuCqguCqnCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Kqw4Kq+4KqkJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAwLCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBv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16DXldeQ16hf16TXkdeo15XXkNeoX9ee16jXpV/XkNek16jXmdecX9ee15DXmV/XmdeV16DXmV/XmdeV15zXmV/XkNeV15LXldeh15hf16HXpNeY157XkdeoX9eQ15XXp9eY15XXkdeoX9eg15XXkdee15HXqF/Xk9em157XkdeoJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICfXmdeg15XXs1/XpNeR16jXs1/Xnteo16Vf15DXpNeo17Nf157XkNeZX9eZ15XXoNeZX9eZ15XXnNeZX9eQ15XXktezX9eh16TXmNezX9eQ15XXp9ezX9eg15XXkdezX9eT16bXntezJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5czogJ9eo15DXqdeV159f16nXoNeZX9ep15zXmdep15lf16jXkdeZ16LXmV/Xl9ee15nXqdeZX9ep15nXqdeZX9ep15HXqicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ9eQ17Nf15HXs1/XktezX9eT17Nf15TXs1/XldezX9ep17MnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn15Bf15Ff15Jf15Nf15Rf15Vf16knLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBb15FdTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgW9eRXU1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBb15FdTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIGw6ICdEL00vWVlZWScsXG4gICAgICAgICAgICBsbDogJ0QgTU1NIFlZWVknLFxuICAgICAgICAgICAgbGxsOiAnRCBNTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBsbGxsOiAnZGRkLCBEIE1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb15TXmdeV150g15HWvl1MVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9ee15fXqCDXkda+XUxUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb15HXqdei15RdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb15DXqtee15XXnCDXkda+XUxUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW9eR15nXldedXSBkZGRkIFvXlNeQ15fXqNeV158g15HXqdei15RdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn15HXoteV15MgJXMnLFxuICAgICAgICAgICAgcGFzdDogJ9ec16TXoNeZICVzJyxcbiAgICAgICAgICAgIHM6ICfXnteh16TXqCDXqdeg15nXldeqJyxcbiAgICAgICAgICAgIHNzOiAnJWQg16nXoNeZ15XXqicsXG4gICAgICAgICAgICBtOiAn15PXp9eUJyxcbiAgICAgICAgICAgIG1tOiAnJWQg15PXp9eV16onLFxuICAgICAgICAgICAgaDogJ9ep16LXlCcsXG4gICAgICAgICAgICBoaDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICfXqdei16rXmdeZ150nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJyDXqdei15XXqic7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZDogJ9eZ15XXnScsXG4gICAgICAgICAgICBkZDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICfXmdeV157XmdeZ150nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJyDXmdee15nXnSc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgTTogJ9eX15XXk9epJyxcbiAgICAgICAgICAgIE1NOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ9eX15XXk9ep15nXmdedJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcg15fXldeT16nXmdedJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB5OiAn16nXoNeUJyxcbiAgICAgICAgICAgIHl5OiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ9ep16DXqteZ15nXnSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgJSAxMCA9PT0gMCAmJiBudW1iZXIgIT09IDEwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnINep16DXlCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnINep16DXmdedJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6XG4gICAgICAgICAgICAv15DXl9eUXCLXpnzXnNek16DXlFwi16Z815DXl9eo15kg15TXpteU16jXmdeZ151815zXpNeg15kg15TXpteU16jXmdeZ151815zXpNeg15XXqiDXkdeV16fXqHzXkdeR15XXp9eofNeR16LXqNeRL2ksXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuIC9eKNeQ15fXlFwi16Z815DXl9eo15kg15TXpteU16jXmdeZ151815HXoteo15EpJC8udGVzdChpbnB1dCk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9ec16TXoNeV16og15HXlden16gnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9eR15HXlden16gnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/ICfXnNek16DXlFwi16YnIDogJ9ec16TXoNeZINeU16bXlNeo15nXmdedJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE4KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzTG93ZXIgPyAn15DXl9eUXCLXpicgOiAn15DXl9eo15kg15TXpteU16jXmdeZ150nO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9eR16LXqNeRJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBoZTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBIaW5kaSBbaGldXG4vLyEgYXV0aG9yIDogTWF5YW5rIFNpbmdoYWwgOiBodHRwczovL2dpdGh1Yi5jb20vbWF5YW5rc2luZ2hhbFxuXG47KGZ1bmN0aW9uIChnbG9iYWwsIGZhY3RvcnkpIHtcbiAgIHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJ1xuICAgICAgICYmIHR5cGVvZiByZXF1aXJlID09PSAnZnVuY3Rpb24nID8gZmFjdG9yeShyZXF1aXJlKCcuLi9tb21lbnQnKSkgOlxuICAgdHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHN5bWJvbE1hcCA9IHtcbiAgICAgICAgICAgIDE6ICfgpacnLFxuICAgICAgICAgICAgMjogJ+ClqCcsXG4gICAgICAgICAgICAzOiAn4KWpJyxcbiAgICAgICAgICAgIDQ6ICfgpaonLFxuICAgICAgICAgICAgNTogJ+ClqycsXG4gICAgICAgICAgICA2OiAn4KWsJyxcbiAgICAgICAgICAgIDc6ICfgpa0nLFxuICAgICAgICAgICAgODogJ+ClricsXG4gICAgICAgICAgICA5OiAn4KWvJyxcbiAgICAgICAgICAgIDA6ICfgpaYnLFxuICAgICAgICB9LFxuICAgICAgICBudW1iZXJNYXAgPSB7XG4gICAgICAgICAgICAn4KWnJzogJzEnLFxuICAgICAgICAgICAgJ+ClqCc6ICcyJyxcbiAgICAgICAgICAgICfgpaknOiAnMycsXG4gICAgICAgICAgICAn4KWqJzogJzQnLFxuICAgICAgICAgICAgJ+Clqyc6ICc1JyxcbiAgICAgICAgICAgICfgpawnOiAnNicsXG4gICAgICAgICAgICAn4KWtJzogJzcnLFxuICAgICAgICAgICAgJ+Clric6ICc4JyxcbiAgICAgICAgICAgICfgpa8nOiAnOScsXG4gICAgICAgICAgICAn4KWmJzogJzAnLFxuICAgICAgICB9LFxuICAgICAgICBtb250aHNQYXJzZSA9IFtcbiAgICAgICAgICAgIC9e4KSc4KSoL2ksXG4gICAgICAgICAgICAvXuCkq+CkvOCksHzgpKvgpLAvaSxcbiAgICAgICAgICAgIC9e4KSu4KS+4KSw4KWN4KSaL2ksXG4gICAgICAgICAgICAvXuCkheCkquCljeCksOCliC9pLFxuICAgICAgICAgICAgL17gpK7gpIgvaSxcbiAgICAgICAgICAgIC9e4KSc4KWC4KSoL2ksXG4gICAgICAgICAgICAvXuCknOClgeCksi9pLFxuICAgICAgICAgICAgL17gpIXgpJcvaSxcbiAgICAgICAgICAgIC9e4KS44KS/4KSk4KSCfOCkuOCkv+CkpC9pLFxuICAgICAgICAgICAgL17gpIXgpJXgpY3gpJ/gpYIvaSxcbiAgICAgICAgICAgIC9e4KSo4KS1fOCkqOCkteCkgi9pLFxuICAgICAgICAgICAgL17gpKbgpL/gpLjgpIJ84KSm4KS/4KS4L2ksXG4gICAgICAgIF0sXG4gICAgICAgIHNob3J0TW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXuCknOCkqC9pLFxuICAgICAgICAgICAgL17gpKvgpLzgpLAvaSxcbiAgICAgICAgICAgIC9e4KSu4KS+4KSw4KWN4KSaL2ksXG4gICAgICAgICAgICAvXuCkheCkquCljeCksOCliC9pLFxuICAgICAgICAgICAgL17gpK7gpIgvaSxcbiAgICAgICAgICAgIC9e4KSc4KWC4KSoL2ksXG4gICAgICAgICAgICAvXuCknOClgeCksi9pLFxuICAgICAgICAgICAgL17gpIXgpJcvaSxcbiAgICAgICAgICAgIC9e4KS44KS/4KSkL2ksXG4gICAgICAgICAgICAvXuCkheCkleCljeCkn+Clgi9pLFxuICAgICAgICAgICAgL17gpKjgpLUvaSxcbiAgICAgICAgICAgIC9e4KSm4KS/4KS4L2ksXG4gICAgICAgIF07XG5cbiAgICB2YXIgaGkgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdoaScsIHtcbiAgICAgICAgbW9udGhzOiB7XG4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fgpLXgpL7gpLBf4KSX4KWB4KSw4KWC4KS14KS+4KSwX+CktuClgeCkleCljeCksOCkteCkvuCksF/gpLbgpKjgpL/gpLXgpL7gpLAnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfgpLDgpLXgpL9f4KS44KWL4KSuX+CkruCkguCkl+Cksl/gpKzgpYHgpKdf4KSX4KWB4KSw4KWCX+CktuClgeCkleCljeCksF/gpLbgpKjgpL8nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn4KSwX+CkuOCli1/gpK7gpIJf4KSs4KWBX+Ckl+ClgV/gpLbgpYFf4KS2Jy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdBIGg6bW0g4KSs4KSc4KWHJyxcbiAgICAgICAgICAgIExUUzogJ0EgaDptbTpzcyDgpKzgpJzgpYcnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSwgQSBoOm1tIOCkrOCknOClhycsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVksIEEgaDptbSDgpKzgpJzgpYcnLFxuICAgICAgICB9LFxuXG4gICAgICAgIG1vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgbG9uZ01vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgc2hvcnRNb250aHNQYXJzZTogc2hvcnRNb250aHNQYXJzZSxcblxuICAgICAgICBtb250aHNSZWdleDpcbiAgICAgICAgICAgIC9eKOCknOCkqOCkteCksOClgHzgpJzgpKhcXC4/fOCkq+CkvOCksOCkteCksOClgHzgpKvgpLDgpLXgpLDgpYB84KSr4KS84KSwXFwuP3zgpK7gpL7gpLDgpY3gpJo/fOCkheCkquCljeCksOCli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AgICAgICAgIHBhc3Q6ICclcyDgpKrgpLngpLLgpYcnLFxuICAgICAgICAgICAgczogJ+CkleClgeCkmyDgpLngpYAg4KSV4KWN4KS34KSjJyxcbiAgICAgICAgICAgIHNzOiAnJWQg4KS44KWH4KSV4KSC4KShJyxcbiAgICAgICAgICAgIG06ICfgpI/gpJUg4KSu4KS/4KSo4KSfJyxcbiAgICAgICAgICAgIG1tOiAnJWQg4KSu4KS/4KSo4KSfJyxcbiAgICAgICAgICAgIGg6ICfgpI/gpJUg4KSY4KSC4KSf4KS+JyxcbiAgICAgICAgICAgIGhoOiAnJWQg4KSY4KSC4KSf4KWHJyxcbiAgICAgICAgICAgIGQ6ICfgpI/gpJUg4KSm4KS/4KSoJyxcbiAgICAgICAgICAgIGRkOiAnJWQg4KSm4KS/4KSoJyxcbiAgICAgICAgICAgIE06ICfgpI/gpJUg4KSu4KS54KWA4KSo4KWHJyxcbiAgICAgICAgICAgIE1NOiAnJWQg4KSu4KS54KWA4KSo4KWHJyxcbiAgICAgICAgICAgIHk6ICfgpI/gpJUg4KS14KSw4KWN4KS3JyxcbiAgICAgICAgICAgIHl5OiAnJWQg4KS14KSw4KWN4KS3JyxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvW+Clp+ClqOClqeClquClq+ClrOClreClruClr+Clpl0vZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC9cXGQvZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbE1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgLy8gSGluZGkgbm90YXRpb24gZm9yIG1lcmlkaWVtcyBhcmUgcXVpdGUgZnV6enkgaW4gcHJhY3RpY2UuIFdoaWxlIHRoZXJlIGV4aXN0c1xuICAgICAgICAvLyBhIHJpZ2lkIG5vdGlvbiBvZiBhICdQYWhhcicgaXQgaXMgbm90IHVzZWQgYXMgcmlnaWRseSBpbiBtb2Rlcm4gSGluZGkuXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gpLDgpL7gpKR84KS44KWB4KSs4KS5fOCkpuCli+CkquCkueCksHzgpLbgpL7gpK4vLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWVyaWRpZW0gPT09ICfgpLDgpL7gpKQnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPCA0ID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgpLjgpYHgpKzgpLknKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4KSm4KWL4KSq4KS54KSwJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDEwID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgpLbgpL7gpK4nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3V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cbiAgICAgICAmJiB0eXBlb2YgcmVxdWlyZSA9PT0gJ2Z1bmN0aW9uJyA/IGZhY3RvcnkocmVxdWlyZSgnLi4vbW9tZW50JykpIDpcbiAgIHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIGZ1bmN0aW9uIHRyYW5zbGF0ZShudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSkge1xuICAgICAgICB2YXIgcmVzdWx0ID0gbnVtYmVyICsgJyAnO1xuICAgICAgICBzd2l0Y2ggKGtleSkge1xuICAgICAgICAgICAgY2FzZSAnc3MnOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdzZWt1bmRhJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMiB8fCBudW1iZXIgPT09IDMgfHwgbnVtYmVyID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnc2VrdW5kZSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdzZWt1bmRpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ20nOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4ID8gJ2plZG5hIG1pbnV0YScgOiAnamVkbmUgbWludXRlJztcbiAgICAgICAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnbWludXRhJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMiB8fCBudW1iZXIgPT09IDMgfHwgbnVtYmVyID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnbWludXRlJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ21pbnV0YSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICdoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdqZWRhbiBzYXQnIDogJ2plZG5vZyBzYXRhJztcbiAgICAgICAgICAgIGNhc2UgJ2hoJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnc2F0JztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMiB8fCBudW1iZXIgPT09IDMgfHwgbnVtYmVyID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnc2F0YSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdzYXRpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ2RkJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnZGFuJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ2RhbmEnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdtamVzZWMnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyID09PSAyIHx8IG51bWJlciA9PT0gMyB8fCBudW1iZXIgPT09IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdtamVzZWNhJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ21qZXNlY2knO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgY2FzZSAneXknOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdnb2RpbmEnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyID09PSAyIHx8IG51bWJlciA9PT0gMyB8fCBudW1iZXIgPT09IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdnb2RpbmUnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnZ29kaW5hJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBociA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2hyJywge1xuICAgICAgICBtb250aHM6IHtcbiAgICAgICAgICAgIGZvcm1hdDogJ3NpamXEjW5qYV92ZWxqYcSNZV9vxb51amthX3RyYXZuamFfc3ZpYm5qYV9saXBuamFfc3JwbmphX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AgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0RvIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEbyBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRG8gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tkYW5hcyB1XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW3N1dHJhIHVdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIFtuZWRqZWxqdV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdV0gW3NyaWplZHVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIFtzdWJvdHVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIGRkZGQgW3VdIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogJ1tqdcSNZXIgdV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbcHJvxaFsdV0gW25lZGplbGp1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1twcm/FoWx1XSBbc3JpamVkdV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbcHJvxaFsZV0gW3N1Ym90ZV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbcHJvxaFsaV0gZGRkZCBbdV0gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ3phICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdwcmlqZSAlcycsXG4gICAgICAgICAgICBzOiAncGFyIHNla3VuZGknLFxuICAgICAgICAgICAgc3M6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG1tOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoaDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZDogJ2RhbicsXG4gICAgICAgICAgICBkZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTTogJ21qZXNlYycsXG4gICAgICAgICAgICBNTTogdHJhb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GlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgd2Vla0VuZGluZ3MgPVxuICAgICAgICAndmFzw6FybmFwIGjDqXRmxZFuIGtlZGRlbiBzemVyZMOhbiBjc8O8dMO2cnTDtmvDtm4gcMOpbnRla2VuIHN6b21iYXRvbicuc3BsaXQoJyAnKTtcbiAgICBmdW5jdGlvbiB0cmFuc2xhdGUobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXksIGlzRnV0dXJlKSB7XG4gICAgICAgIHZhciBudW0gPSBudW1iZXI7XG4gICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgfHwgd2l0aG91dFN1ZmZpeFxuICAgICAgICAgICAgICAgICAgICA/ICduw6low6FueSBtw6Fzb2RwZXJjJ1xuICAgICAgICAgICAgICAgICAgICA6ICduw6low6FueSBtw6Fzb2RwZXJjZSc7XG4gICAgICAgICAgICBjYXNlICdzcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bSArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4KVxuICAgICAgICAgICAgICAgICAgICA/ICcgbcOhc29kcGVyYydcbiAgICAgICAgICAgICAgICAgICAgOiAnIG3DoXNvZHBlcmNlJztcbiAgICAgICAgICAgIGNhc2UgJ20nOlxuICAgICAgICAgICAgICAgIHJldHVybiAnZWd5JyArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyBwZXJjJyA6ICcgcGVyY2UnKTtcbiAgICAgICAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtICsgKGlzRnV0dXJlIHx8IHdpdGhvdXRTdWZmaXggPyAnIHBlcmMnIDogJyBwZXJjZScpO1xuICAgICAgICAgICAgY2FzZSAnaCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdlZ3knICsgKGlzRnV0dXJlIHx8IHdpdGhvdXRTdWZmaXggPyAnIMOzcmEnIDogJyDDs3LDoWphJyk7XG4gICAgICAgICAgICBjYXNlICdoaCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bSArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyDDs3JhJyA6ICcgw7Nyw6FqYScpO1xuICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdlZ3knICsgKGlzRnV0dXJlIHx8IHdpdGhvdXRTdWZmaXggPyAnIG5hcCcgOiAnIG5hcGphJyk7XG4gICAgICAgICAgICBjYXNlICdkZCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bSArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyBuYXAnIDogJyBuYXBqYScpO1xuICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdlZ3knICsgKGlzRnV0dXJlIHx8IHdpdGhvdXRTdWZmaXggPyAnIGjDs25hcCcgOiAnIGjDs25hcGphJyk7XG4gICAgICAgICAgICBjYXNlICdNTSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bSArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyBow7NuYXAnIDogJyBow7NuYXBqYScpO1xuICAgICAgICAgICAgY2FzZSAneSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuICdlZ3knICsgKGlzRnV0dXJlIHx8IHdpdGhvdXRTdWZmaXggPyAnIMOpdicgOiAnIMOpdmUnKTtcbiAgICAgICAgICAgIGNhc2UgJ3l5JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtICsgKGlzRnV0dXJlIHx8IHdpdGhvdXRTdWZmaXggPyAnIMOpdicgOiAnIMOpdmUnKTtcbiAgICAgICAgfVxuICAgICAgICByZ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cm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ1lZWVkuTU0uREQuJyxcbiAgICAgICAgICAgIExMOiAnWVlZWS4gTU1NTSBELicsXG4gICAgICAgICAgICBMTEw6ICdZWVlZLiBNTU1NIEQuIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ1lZWVkuIE1NTU0gRC4sIGRkZGQgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC9kZXxkdS9pLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiBpbnB1dC5jaGFyQXQoMSkudG9Mb3dlckNhc2UoKSA9PT0gJ3UnO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91cnMgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0xvd2VyID09PSB0cnVlID8gJ2RlJyA6ICdERSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0xvd2VyID09PSB0cnVlID8gJ2R1JyA6ICdEVSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW21hXSBMVFsta29yXScsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2hvbG5hcF0gTFRbLWtvcl0nLFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gd2Vlay5jYWxsKHRoaXMsIHRydWUpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbdGVnbmFwXSBMVFsta29yXScsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB3ZWVrLmNhbGwodGhpcywgZmFsc2UpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMgbcO6bHZhJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcycsXG4gICAgICAgICAgICBzOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBzczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbW06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGg6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGhoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBkOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBkZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTU06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIHk6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIHl5OiB0cmFuc2xhdGUsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfVxcLi8sXG4gICAgICAgIG9yZGluYWw6ICclZC4nLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gaHU7XG5cbn0pKSk7XG4iLC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ISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZINWpLicsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSDVqS4sIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSDVqS4sIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb1aHVtdW91oXWgF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vVvtWh1bLVqF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vVpdaA1aXVr10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2RkZGQgW9aF1oDVqCDVqtWh1bTVqF0gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdb1aHVttaB1aHVrl0gZGRkZCBb1oXWgNWoINWq1aHVtNWoXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDVsNWl1b/VuCcsXG4gICAgICAgICAgICBwYXN0OiAnJXMg1aHVvNWh1bsnLFxuICAgICAgICAgICAgczogJ9W01asg1oTVodW21asg1b7VodW11oDVr9W11aHVticsXG4gICAgICAgICAgICBzczogJyVkINW+1aHVtdaA1a/VtdWh1bYnLFxuICAgICAgICAgICAgbTogJ9aA1bjVutWlJyxcbiAgICAgICAgICAgIG1tOiAnJWQg1oDVuNW61aUnLFxuICAgICAgICAgICAgaDogJ9Wq1aHVtCcsXG4gICAgICAgICAgICBoaDogJyVkINWq1aHVtCcsXG4gICAgICAgICAgICBkOiAn1oXWgCcsXG4gICAgICAgICAgICBkZDogJyVkINaF1oAnLFxuICAgICAgICAgICAgTTogJ9Wh1bTVq9W9JyxcbiAgICAgICAgICAgIE1NOiAnJWQg1aHVtNWr1b0nLFxuICAgICAgICAgICAgeTogJ9W/1aHWgNWrJyxcbiAgICAgICAgICAgIHl5OiAnJWQg1b/VodaA1asnLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv1aPVq9W31aXWgNW+1aF81aHVvNWh1b7VuNW/1b7VoXzWgdWl1oDVpdWv1b7VoXzVpdaA1aXVr9W41bXVodW2LyxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gL14o1oHVpdaA1aXVr9W+1aF81aXWgNWl1a/VuNW11aHVtikkLy50ZXN0KGlucHV0KTtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9Wj1avVt9Wl1oDVvtWhJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfVodW81aHVvtW41b/VvtWhJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE3KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfWgdWl1oDVpdWv1b7VoSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn1aXWgNWl1a/VuNW11aHVtic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfXxcXGR7MSwyfS0o1avVtnzWgNWkKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ3cnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ1cnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RERG8nOlxuICAgICAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3Vq9W2JztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3WgNWkJztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA3LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA3dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gaHlBbTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBJbmRvbmVzaWFuIFtpZF1cbi8vISBhdXRob3IgOiBNb2hhbW1hZCBTYXRyaW8gVXRvbW8gOiBodHRwczovL2dpdGh1Yi5jb20vdHlva1xuLy8hIHJlZmVyZW5jZTogaHR0cDovL2lkLndpa2lzb3VyY2Uub3JnL3dpa2kvUGVkb21hbl9VbXVtX0VqYWF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LFxuICAgICAgICB3ZWVrZGF5c01pbjogJ01nX1NuX1NsX1JiX0ttX0ptX1NiJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISC5tbScsXG4gICAgICAgICAgICBMVFM6ICdISC5tbS5zcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIFtwdWt1bF0gSEgubW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIFtwdWt1bF0gSEgubW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvcGFnaXxzaWFuZ3xzb3JlfG1hbGFtLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAncGFnaScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICdzaWFuZycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMSA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAnc29yZScgfHwgbWVyaWRpZW0gPT09ICdtYWxhbScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91cnMgPCAxMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAncGFnaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXJzIDwgMTUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3NpYW5nJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91cnMgPCAxOSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnc29yZSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAnbWFsYW0nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tIYXJpIGluaSBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tCZXNvayBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tLZW1hcmluIHB1a3VsXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW2xhbHUgcHVrdWxdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnZGFsYW0gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIHlhbmcgbGFsdScsXG4gICAgICAgICAgICBzOiAnYmViZXJhcGEgZGV0aWsnLFxuICAgICAgICAgICAgc3M6ICclZCBkZXRpaycsXG4gICAgICAgICAgICBtOiAnc2VtZW5pdCcsXG4gICAgICAgICAgICBtbTogJyVkIG1lbml0JyxcbiAgICAgICAgICAgIGg6ICdzZWphbScsXG4gICAgICAgICAgICBoaDogJyVkIGphbScsXG4gICAgICAgICAgICBkOiAnc2VoYXJpJyxcbiAgICAgICAgICAgIGRkOiAnJWQgaGFyaScsXG4gICAgICAgIC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mZpZ3VyYXRpb25cblxuICAgIGZ1bmN0aW9uIHBsdXJhbChuKSB7XG4gICAgICAgIGlmIChuICUgMTAwID09PSAxMSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH0gZWxzZSBpZiAobiAlIDEwID09PSAxKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHRyYW5zbGF0ZShudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSwgaXNGdXR1cmUpIHtcbiAgICAgICAgdmFyIHJlc3VsdCA9IG51bWJlciArICcgJztcbiAgICAgICAgc3dpdGNoIChrZXkpIHtcbiAgICAgICAgICAgIGNhc2UgJ3MnOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlXG4gICAgICAgICAgICAgICAgICAgID8gJ25va2tyYXIgc2Vrw7puZHVyJ1xuICAgICAgICAgICAgICAgICAgICA6ICdub2trcnVtIHNla8O6bmR1bSc7XG4gICAgICAgICAgICBjYXNlICdzcyc6XG4gICAgICAgICAgICAgICAgaWYgKHBsdXJhbChudW1iZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnc2Vrw7puZHVyJyA6ICdzZWvDum5kdW0nKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ3Nla8O6bmRhJztcbiAgICAgICAgICAgIGNhc2UgJ20nOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4ID8gJ23DrW7DunRhJyA6ICdtw61uw7p0dSc7XG4gICAgICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgICAgICAgaWYgKHBsdXJhbChudW1iZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgKyAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdtw61uw7p0dXInIDogJ23DrW7DunR1bScpXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aXRob3V0U3VmZml4KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnbcOtbsO6dGEnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ23DrW7DunR1JztcbiAgICAgICAgICAgIGNhc2UgJ2hoJzpcbiAgICAgICAgICAgICAgICBpZiAocGx1cmFsKG51bWJlcikpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCArXG4gICAgICAgICAgICAgICAgICAgICAgICAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ2tsdWtrdXN0dW5kaXInXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAna2x1a2t1c3R1bmR1bScpXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAna2x1a2t1c3R1bmQnO1xuICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkYWd1cic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBpc0Z1dHVyZSA/ICdkYWcnIDogJ2RlZ2knO1xuICAgICAgICAgICAgY2FzZSAnZGQnOlxuICAgICAgICAgICAgICAgIGlmIChwbHVyYWwobnVtYmVyKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICdkYWdhcic7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChpc0Z1dHVyZSA/ICdkYWdhJyA6ICdkw7ZndW0nKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHdpdGhvdXRTdWZmaXgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICdkYWd1cic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAoaXNGdXR1cmUgPyAnZGFnJyA6ICdkZWdpJyk7XG4gICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ23DoW51w7B1cic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBpc0Z1dHVyZSA/ICdtw6FudcOwJyA6ICdtw6FudcOwaSc7XG4gICAgICAgICAgICBjYXNlICdNTSc6XG4gICAgICAgICAgICAgICAgaWYgKHBsdXJhbChudW1iZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ23DoW51w7Bpcic7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChpc0Z1dHVyZSA/ICdtw6FudcOwaScgOiAnbcOhbnXDsHVtJyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aXRob3V0U3VmZml4KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnbcOhbnXDsHVyJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChpc0Z1dHVyZSA/ICdtw6FudcOwJyA6ICdtw6FudcOwaScpO1xuICAgICAgICAgICAgY2FzZSAneSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnw6FyJyA6ICfDoXJpJztcbiAgICAgICAgICAgIGNhc2UgJ3l5JzpcbiAgICAgICAgICAgICAgICBpZiAocGx1cmFsKG51bWJlcikpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ8OhcicgOiAnw6FydW0nKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ8OhcicgOiAnw6FyaScpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmFyIGlzID0gbW9tZW50LmRlZmluZUxvY2FsZSgnaXMnLCB7XG4gICAgICAgIG1vbnRoczogJ2phbsO6YXJfZmVicsO6YXJfbWFyc19hcHLDrWxfbWHDrV9qw7puw61fasO6bMOtX8OhZ8O6c3Rfc2VwdGVtYmVyX29rdMOzYmVyX27Ds3ZlbWJlcl9kZXNlbWJlcicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6ICdqYW5fZmViX21hcl9hcHJfbWHDrV9qw7puX2rDumxfw6Fnw7pfc2VwX29rdF9uw7N2X2Rlcycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXM6XG4gICAgICAgICAgICAnc3VubnVkYWd1cl9tw6FudWRhZ3VyX8O+cmnDsGp1ZGFndXJfb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aXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW09nZ2kgYWxsZV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tEb21hbmkgYWxsZV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFthbGxlXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0llcmkgYWxsZV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbbGEgc2NvcnNhXSBkZGRkIFthbGxlXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tsbyBzY29yc29dIGRkZGQgW2FsbGVdIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6IGZ1bmN0aW9uIChzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICgvXlswLTldLiskLy50ZXN0KHMpID8gJ3RyYScgOiAnaW4nKSArICcgJyArIHM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcGFzdDogJyVzIGZhJyxcbiAgICAgICAgICAgIHM6ICdhbGN1bmkgc2Vjb25kaScsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZGknLFxuICAgICAgICAgICAgbTogJ3VuIG1pbnV0bycsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0aScsXG4gICAgICAgICAgICBoOiBcInVuJ29yYVwiLFxuICAgICAgICAgICAgaGg6ICclZCBvcmUnLFxuICAgICAgICAgICAgZDogJ3VuIGdpb3JubycsXG4gICAgICAgICAgICBkZDogJyVkIGdpb3JuaScsXG4gICAgICAgICAgICBNOiAndW4gbWVzZScsXG4gICAgICAgICAgICBNTTogJyVkIG1lc2knLFxuICAgICAgICAgICAgeTogJ3VuIGFubm8nLFxuICAgICAgICAgICAgeXk6ICclZCBhbm5pJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9wrovLFxuICAgICAgICBvcmRpbmFsOiAnJWTCuicsXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBpdENoO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IEl0YWxpYW4gW2l0XVxuLy8hIGF1dGhvciA6IExvcmVuem8gOiBodHRwczovL2dpdGh1Yi5jb20vYWxpZW1cbi8vISBhdXRob3I6IE1hdHRpYSBM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xuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICdkb21fbHVuX21hcl9tZXJfZ2lvX3Zlbl9zYWInLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnZG9fbHVfbWFfbWVfZ2lfdmVfc2EnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICdbT2dnaSBhJyArXG4gICAgICAgICAgICAgICAgICAgICh0aGlzLmhvdXJzKCkgPiAxID8gJ2xsZSAnIDogdGhpcy5ob3VycygpID09PSAwID8gJyAnIDogXCJsbCdcIikgK1xuICAgICAgICAgICAgICAgICAgICAnXUxUJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICdbRG9tYW5pIGEnICtcbiAgICAgICAgICAgICAgICAgICAgKHRoaXMuaG91cnMoKSA+IDEgPyAnbGxlICcgOiB0aGlzLmhvdXJzKCkgPT09IDAgPyAnICcgOiBcImxsJ1wiKSArXG4gICAgICAgICAgICAgICAgICAgICddTFQnXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICdkZGRkIFthJyArXG4gICAgICAgICAgICAgICAgICAgICh0aGlzLmhvdXJzKCkgPiAxID8gJ2xsZSAnIDogdGhpcy5ob3VycygpID09PSAwID8gJyAnIDogXCJsbCdcIikgK1xuICAgICAgICAgICAgICAgICAgICAnXUxUJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICdbSWVyaSBhJyArXG4gICAgICAgICAgICAgICAgICAgICh0aGlzLmhvdXJzKCkgPiAxID8gJ2xsZSAnIDogdGhpcy5ob3VycygpID09PSAwID8gJyAnIDogXCJsbCdcIikgK1xuICAgICAgICAgICAgICAgICAgICAnXUxUJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnW0xhIHNjb3JzYV0gZGRkZCBbYScgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0aGlzLmhvdXJzKCkgPiAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ2xsZSAnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdGhpcy5ob3VycygpID09PSAwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnICdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFwibGwnXCIpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnXUxUJ1xuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1tMbyBzY29yc29dIGRkZGQgW2EnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGhpcy5ob3VycygpID4gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdsbGUgJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHRoaXMuaG91cnMoKSA9PT0gMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJyAnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBcImxsJ1wiKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ11MVCdcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAndHJhICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBmYScsXG4gICAgICAgICAgICBzOiAnYWxjdW5pIHNlY29uZGknLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRpJyxcbiAgICAgICAgICAgIG06ICd1biBtaW51dG8nLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGknLFxuICAgICAgICAgICAgaDogXCJ1bidvcmFcIixcbiAgICAgICAgICAgIGhoOiAnJWQgb3JlJyxcbiAgICAgICAgICAgIGQ6ICd1biBnaW9ybm8nLFxuICAgICAgICAgICAgZGQ6ICclZCBnaW9ybmknLFxuICAgICAgICAgICAgdzogJ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AgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgamEgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdqYScsIHtcbiAgICAgICAgZXJhczogW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHNpbmNlOiAnMjAxOS0wNS0wMScsXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAxLFxuICAgICAgICAgICAgICAgIG5hbWU6ICfku6TlkownLFxuICAgICAgICAgICAgICAgIG5hcnJvdzogJ+OLvycsXG4gICAgICAgICAgICAgICAgYWJicjogJ1InLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaW5jZTogJzE5ODktMDEtMDgnLFxuICAgICAgICAgICAgICAgIHVudGlsOiAnMjAxOS0wNC0zMCcsXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAxLFxuICAgICAgICAgICAgICAgIG5hbWU6ICflubPmiJAnLFxuICAgICAgICAgICAgICAgIG5hcnJvdzogJ+ONuycsXG4gICAgICAgICAgICAgICAgYWJicjogJ0gnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaW5jZTogJzE5MjYtMTItMjUnLFxuICAgICAgICAgICAgICAgIHVudGlsOiAnMTk4OS0wMS0wNycsXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAxLFxuICAgICAgICAgICAgICAgIG5hbWU6ICfmmK3lkownLFxuICAgICAgICAgICAgICAgIG5hcnJvdzogJ+ONvCcsXG4gICAgICAgICAgICAgICAgYWJicjogJ1MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaW5jZTogJzE5MTItMDctMzAnLFxuICAgICAgICAgICAgICAgIHVudGlsOiAnMTkyNi0xMi0yNCcsXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAxLFxuICAgICAgICAgICAgICAgIG5hbWU6ICflpKfmraMnLFxuICAgICAgICAgICAgICAgIG5hcnJvdzogJ+ONvScsXG4gICAgICAgICAgICAgICAgYWJicjogJ1QnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaW5jZTogJzE4NzMtMDEtMDEnLFxuICAgICAgICAgICAgICAgIHVudGlsOiAnMTkxMi0wNy0yOScsXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiA2LFxuICAgICAgICAgICAgICAgIG5hbWU6ICfmmI7msrsnLFxuICAgICAgICAgICAgICAgIG5hcnJvdzogJ+ONvicsXG4gICAgICAgICAgICAgICAgYWJicjogJ00nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaW5jZTogJzAwMDEtMDEtMDEnLFxuICAgICAgICAgICAgICAgIHVudGlsOiAnMTg3My0xMi0zMScsXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAxLFxuICAgICAgICAgICAgICAgIG5hbWU6ICfopb/mmqYnLFxuICAgICAgICAgICAgICAgIG5hcnJvdzogJ0FEJyxcbiAgICAgICAgICAgICAgICBhYmJyOiAnQUQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaW5jZTogJzAwMDAtMTItMzEnLFxuICAgICAgICAgICAgICAgIHVudGlsOiAtSW5maW5pdHksXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAxLFxuICAgICAgICAgICAgICAgIG5hbWU6ICfntIDlhYPliY0nLFxuICAgICAgICAgICAgICAgIG5hcnJvdzogJ0JDJyxcbiAgICAgICAgICAgICAgICBhYmJyOiAnQkMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgXSxcbiAgICAgICAgZXJhWWVhck9yZGluYWxSZWdleDogLyjlhYN8XFxkKynlubQvLFxuICAgICAgICBlcmFZZWFyT3JkaW5hbFBhcnNlOiBmdW5jdGlvbiAoaW5wdXQsIG1hdGNoKSB7XG4gICAgICAgICAgICByZXR1cm4gbWF0Y2hbMV0gPT09ICflhYMnID8gMSA6IHBhcnNlSW50KG1hdGNoWzFdIHx8IGlucHV0LCAxMCk7XG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRoczogJzHmnIhfMuaciF8z5pyIXzTmnIhfNeaciF825pyIXzfmnIhfOOaciF855pyIXzEw5pyIXzEx5pyIXzEy5pyIJy5zcGxpdCgnXycpLFxuICAgICAgICBtb250aHNTaG9ydDogJzHmnIhfMuaciF8z5pyIXzTmnIhfNeaciF825pyIXzfmnIhfOOaciF855pyIXzEw5pyIXzEx5pyIXzEy5pyIJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5czogJ+aXpeabnOaXpV/mnIjmm5zml6Vf54Gr5puc5pelX+awtOabnOaXpV/mnKjmm5zml6Vf6YeR5puc5pelX+Wcn+abnOaXpScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ+aXpV/mnIhf54GrX+awtF/mnKhf6YeRX+Wcnycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfml6Vf5pyIX+eBq1/msLRf5pyoX+mHkV/lnJ8nLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdZWVlZL01NL0REJyxcbiAgICAgICAgICAgIExMOiAnWVlZWeW5tE3mnIhE5pelJyxcbiAgICAgICAgICAgIExMTDogJ1lZWVnlubRN5pyIROaXpSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnWVlZWeW5tE3mnIhE5pelIGRkZGQgSEg6bW0nLFxuICAgICAgICAgICAgbDogJ1lZWVkvTU0vREQnLFxuICAgICAgICAgICAgbGw6ICdZWVlZ5bm0TeaciETml6UnLFxuICAgICAgICAgICAgbGxsOiAnWVlZWeW5tE3mnIhE5pelIEhIOm1tJyxcbiAgICAgICAgICAgIGxsbGw6ICdZWVlZ5bm0TeaciETml6UoZGRkKSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/ljYjliY185Y2I5b6ML2ksXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuIGlucHV0ID09PSAn5Y2I5b6MJztcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+WNiOWJjSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5Y2I5b6MJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb5LuK5pelXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+aYjuaXpV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uIChub3cpIHtcbiAgICAgICAgICAgICAgICBpZiAobm93LndlZWsoKSAhPT0gdGhpcy53ZWVrKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb5p2l6YCxXWRkZGQgTFQnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZGRkZCBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb5pio5pelXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKG5vdykge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLndlZWsoKSAhPT0gbm93LndlZWsoKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vlhYjpgLFdZGRkZCBMVCc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkZGRkIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ95pelLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ3knOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyID09PSAxID8gJ+WFg+W5tCcgOiBudW1iZXIgKyAn5bm0JztcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+aXpSc7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclc+W+jCcsXG4gICAgICAgICAgICBwYXN0OiAnJXPliY0nLFxuICAgICAgICAgICAgczogJ+aVsOenkicsXG4gICAgICAgICAgICBzczogJyVk56eSJyxcbiAgICAgICAgICAgIG06ICcx5YiGJyxcbiAgICAgICAgICAgI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gICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAnZW5qaW5nJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ3NpeWFuZycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMSA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAnc29udGVuJyB8fCBtZXJpZGllbSA9PT0gJ25kYWx1Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91cnMsIG1pbnV0ZXMsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VycyA8IDExKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdlbmppbmcnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VycyA8IDE1KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdzaXlhbmcnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VycyA8IDE5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdzb250ZW4nO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ25kYWx1JztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbRGludGVuIHB1bmlrbyBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tNYmVuamFuZyBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tLYWxhIHdpbmdpIHB1a3VsXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW2tlcGVuZ2tlciBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICd3b250ZW4gaW5nICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBpbmdrYW5nIGtlcGVuZ2tlcicsXG4gICAgICAgICAgICBzOiAnc2F3ZXRhd2lzIGRldGlrJyxcbiAgICAgICAgICAgIHNzOiAnJWQgZGV0aWsnLFxuICAgICAgICAgICAgbTogJ3NldHVuZ2dhbCBtZW5pdCcsXG4gICAgICAgICAgICBtbTogJyVkIG1lbml0JyxcbiAgICAgICAgICAgIGg6ICdzZXR1bmdnYWwgamFtJyxcbiAgICAgICAgICAgIGhoOiAnJWQgamFtJyxcbiAgICAgICAgICAgIGQ6ICdzZWRpbnRlbicsXG4gICAgICAgICAgICBkZDogJyVkIGRpbnRlbicsXG4gICAgICAgICAgICBNOiAnc2V3dWxhbicsXG4gICAgICAgICAgICBNTTogJyVkIHd1bGFuJyxcbiAgICAgICAgICAgIHk6ICdzZXRhdW4nLFxuICAgICAgICAgICAgeXk6ICclZCB0YXVuJyxcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN3RoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGp2O1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5q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4gICAgICAgICAgICBmdXR1cmU6IGZ1bmN0aW9uIChzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHMucmVwbGFjZShcbiAgICAgICAgICAgICAgICAgICAgLyjhg6zhg5Dhg5t84YOs4YOj4YOXfOGDoeGDkOGDkOGDl3zhg6zhg5Thg5p84YOT4YOmfOGDl+GDlSko4YOYfOGDlCkvLFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoJDAsICQxLCAkMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQyID09PSAn4YOYJyA/ICQxICsgJ+GDqOGDmCcgOiAkMSArICQyICsgJ+GDqOGDmCc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHBhc3Q6IGZ1bmN0aW9uIChzKSB7XG4gICAgICAgICAgICAgICAgaWYgKC8o4YOs4YOQ4YOb4YOYfOGDrOGDo+GDl+GDmHzhg6Hhg5Dhg5Dhg5fhg5h84YOT4YOm4YOUfOGDl+GDleGDlCkvLnRlc3QocykpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHMucmVwbGFjZSgvKOGDmHzhg5QpJC8sICfhg5jhg6Eg4YOs4YOY4YOcJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICgv4YOs4YOU4YOa4YOYLy50ZXN0KHMpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzLnJlcGxhY2UoL+GDrOGDlOGDmuGDmCQvLCAn4YOs4YOa4YOY4YOhIOGDrOGDmOGDnCcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzOiAn4YOg4YOQ4YOb4YOT4YOU4YOc4YOY4YOb4YOUIOGDrOGDkOGDm+GDmCcsXG4gICAgICAgICAgICBzczogJyVkIOGDrOGDkOGDm+GDmCcsXG4gICAgICAgICAgICBtOiAn4YOs4YOj4YOX4YOYJyxcbiAgICAgICAgICAgIG1tOiAnJWQg4YOs4YOj4YOX4YOYJyxcbiAgICAgICAgICAgIGg6ICfhg6Hhg5Dhg5Dhg5fhg5gnLFxuICAgICAgICAgICAgaGg6ICclZCDhg6Hhg5Dhg5Dhg5fhg5gnLFxuICAgICAgICAgICAgZDogJ+GDk+GDpuGDlCcsXG4gICAgICAgICAgICBkZDogJyVkIOGDk+GDpuGDlCcsXG4gICAgICAgICAgICBNOiAn4YOX4YOV4YOUJyxcbiAgICAgICAgICAgIE1NOiAnJWQg4YOX4YOV4YOUJyxcbiAgICAgICAgICAgIHk6ICfhg6zhg5Thg5rhg5gnLFxuICAgICAgICAgICAgeXk6ICclZCDhg6zhg5Thg5rhg5gnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvMHwxLeGDmuGDmHzhg5vhg5QtXFxkezEsMn18XFxkezEsMn0t4YOULyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct4YOa4YOYJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICBudW1iZXIgPCAyMCB8fFxuICAgICAgICAgICAgICAgIChudW1iZXIgPD0gMTAwICYmIG51bWJlciAlIDIwID09PSAwKSB8fFxuICAgICAgICAgICAgICAgIG51bWJlciAlIDEwMCA9PT0gMFxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfhg5vhg5QtJyArIG51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgI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C1INGB0LXQutGD0L3QtCcsXG4gICAgICAgICAgICBzczogJyVkINGB0LXQutGD0L3QtCcsXG4gICAgICAgICAgICBtOiAn0LHRltGAINC80LjQvdGD0YInLFxuICAgICAgICAgICAgbW06ICclZCDQvNC40L3Rg9GCJyxcbiAgICAgICAgICAgIGg6ICfQsdGW0YAg0YHQsNKT0LDRgicsXG4gICAgICAgICAgICBoaDogJyVkINGB0LDSk9Cw0YInLFxuICAgICAgICAgICAgZDogJ9Cx0ZbRgCDQutKv0L0nLFxuICAgICAgICAgICAgZGQ6ICclZCDQutKv0L0nLFxuICAgICAgICAgICAgTTogJ9Cx0ZbRgCDQsNC5JyxcbiAgICAgICAgICAgIE1NOiAnJWQg0LDQuScsXG4gICAgICAgICAgICB5OiAn0LHRltGAINC20YvQuycsXG4gICAgICAgICAgICB5eTogJyVkINC20YvQuycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfS0o0YjRlnzRiNGLKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBhID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgYiA9IG51bWJlciA+PSAxMDAgPyAxMDAgOiBudWxsO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIChzdWZmaXhlc1tudW1iZXJdIHx8IHN1ZmZpeGVzW2FdIHx8IHN1ZmZpeGVzW2JdKTtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN3RoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0d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ICAgICAgICB9LFxuICAgICAgICBudW1iZXJNYXAgPSB7XG4gICAgICAgICAgICAn4LOnJzogJzEnLFxuICAgICAgICAgICAgJ+CzqCc6ICcyJyxcbiAgICAgICAgICAgICfgs6knOiAnMycsXG4gICAgICAgICAgICAn4LOqJzogJzQnLFxuICAgICAgICAgICAgJ+Czqyc6ICc1JyxcbiAgICAgICAgICAgICfgs6wnOiAnNicsXG4gICAgICAgICAgICAn4LOtJzogJzcnLFxuICAgICAgICAgICAgJ+Czric6ICc4JyxcbiAgICAgICAgICAgICfgs68nOiAnOScsXG4gICAgICAgICAgICAn4LOmJzogJzAnLFxuICAgICAgICB9O1xuXG4gICAgdmFyIGtuID0gbW9tZW50LmRlZmluZUxvY2FsZSgna24nLCB7XG4gICAgICAgIG1vbnRoczogJ+CynOCyqOCyteCysOCyv1/gsqvgs4bgsqzgs43gsrDgsrXgsrDgsr9f4LKu4LK+4LKw4LON4LKa4LONX+Cyj+CyquCzjeCysOCyv+CysuCzjV/gsq7gs4bgs5Vf4LKc4LOC4LKo4LONX+CynOCzgeCysuCzhuCzll/gsobgspfgsrjgs43gsp/gs41f4LK44LOG4LKq4LON4LKf4LOG4LKC4LKs4LKw4LONX+CyheCyleCzjeCyn+CzhuCzguCzleCyrOCysOCzjV/gsqjgsrXgs4bgsoLgsqzgsrDgs41f4LKh4LK/4LK44LOG4LKC4LKs4LKw4LONJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICfgspzgsqhf4LKr4LOG4LKs4LON4LKwX+CyruCyvuCysOCzjeCymuCzjV/gso/gsqrgs43gsrDgsr/gsrLgs41f4LKu4LOG4LOVX+CynOCzguCyqOCzjV/gspzgs4HgsrLgs4bgs5Zf4LKG4LKX4LK44LON4LKf4LONX+CyuOCzhuCyquCzjeCyn+CzhuCygl/gsoXgspXgs43gsp/gs4bgs4Lgs5Vf4LKo4LK14LOG4LKCX+Cyoe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l5OiAnJWQg4LK14LKw4LON4LK3JyxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvW+Czp+CzqOCzqeCzquCzq+CzrOCzreCzruCzr+Czpl0vZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC9cXGQvZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbE1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+CysOCyvuCypOCzjeCysOCyv3zgsqzgs4bgsrPgsr/gspfgs43gspfgs4Z84LKu4LKn4LON4LKv4LK+4LK54LON4LKofOCyuOCyguCynOCzhi8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+CysOCyvuCypOCzjeCysOCyvycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA8IDQgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CyrOCzhuCys+Cyv+Cyl+CzjeCyl+CzhicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgsq7gsqfgs43gsq/gsr7gsrngs43gsqgnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPj0gMTAgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CyuOCyguCynOCzhicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgsrDgsr7gsqTgs43gsrDgsr8nO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CyrOCzhuCys+Cyv+Cyl+CzjeCyl+Czhic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNykge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4LKu4LKn4LON4LKv4LK+4LK54LON4LKoJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDIwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgsrjgsoLgspzgs4YnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CysOCyvuCypOCzjeCysOCyvyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSjgsqjgs4bgs5UpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfgsqjgs4bgs5UnO1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7X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F827JuUXzfsm5RfOOyblF857JuUXzEw7JuUXzEx7JuUXzEy7JuUJy5zcGxpdCgnXycpLFxuICAgICAgICBtb250aHNTaG9ydDogJzHsm5RfMuyblF8z7JuUXzTsm5RfNeyblF827JuUXzfsm5RfOOyblF857JuUXzEw7JuUXzEx7JuUXzEy7JuUJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5czogJ+ydvOyalOydvF/sm5TsmpTsnbxf7ZmU7JqU7J28X+yImOyalOydvF/rqqnsmpTsnbxf6riI7JqU7J28X+2GoOyalOydvCcuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ+ydvF/sm5Rf7ZmUX+yImF/rqqlf6riIX+2GoCcuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfsnbxf7JuUX+2ZlF/siJhf66qpX+q4iF/thqAnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0EgaDptbScsXG4gICAgICAgICAgICBMVFM6ICdBIGg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ1lZWVkuTU0uREQuJyxcbiAgICAgICAgICAgIExMOiAnWVlZWeuFhCBNTU1NIETsnbwnLFxuICAgICAgICAgICAgTExMOiAnWVlZWeuFhCBNTU1NIETsnbwgQSBoOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdZWVlZ64WEIE1NTU0gROydvCBkZGRkIEEgaDptbScsXG4gICAgICAgICAgICBsOiAnWVlZWS5NTS5ERC4nLFxuICAgICAgICAgICAgbGw6ICdZWVlZ64WEIE1NTU0gROydvCcsXG4gICAgICAgICAgICBsbGw6ICdZWVlZ64WEIE1NTU0gROydvCBBIGg6bW0nLFxuICAgICAgICAgICAgbGxsbDogJ1lZWVnrhYQgTU1NTSBE7J28IGRkZGQgQSBoOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICfsmKTripggTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ+uCtOydvCBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ+yWtOygnCBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ+yngOuCnOyjvCBkZGRkIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg7ZuEJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDsoIQnLFxuICAgICAgICAgICAgczogJ+uqhyDstIgnLFxuICAgICAgICAgICAgc3M6ICclZOy0iCcsXG4gICAgICAgICAgICBtOiAnMeu2hCcsXG4gICAgICAgICAgICBtbTogJyVk67aEJyxcbiAgICAgICAgICAgIGg6ICftlZwg7Iuc6rCEJyxcbiAgICAgICAgICAgIGhoOiAnJWTsi5zqsIQnLFxuICAgICAgICAgICAgZDogJ+2VmOujqCcsXG4gICAgICAgICAgICBkZDogJyVk7J28JyxcbiAgICAgICAgICAgIE06ICftlZwg64usJyxcbiAgICAgICAgICAgIE1NOiAnJWTri6wnLFxuICAgICAgICAgICAgeTogJ+ydvCDrhYQnLFxuICAgICAgICAgICAgeXk6ICclZOuFhCcsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSjsnbx87JuUfOyjvCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfsnbwnO1xuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+yblCc7XG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn7KO8JztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv7Jik7KCEfOyYpO2bhC8sXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uICh0b2tlbikge1xuICAgICAgICAgICAgcmV0dXJuIHRva2VuID09PSAn7Jik7ZuEJztcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzVXBwZXIpIHtcbiAgICAgICAgICAgIHJldHVybiBob3VyIDwgMTIgPyAn7Jik7KCEJyA6ICfsmKTtm4QnO1xuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGtvO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IE5vcnRoZXJuIEt1cmRpc2ggW2t1LWttcl1cbi8vISBhdXRob3JzIDogTWF6bHVtIMOWemRvZ2FuIDogaHR0cHM6Ly9naXRodWIuY29tL21lcmdlaGV6XG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnXG4gICAgICAgJiYgdHlwZW9mIHJlcXVpcmUgPT09ICdmdW5jdGlvbicgPyBmYWN0b3J5KHJlcXVpcmUoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICBmdW5jdGlvbiBwcm9jZXNzUmVsYXRpdmVUaW1lKG51bSwgd2l0aG91dFN1ZmZpeCwga2V5LCBpc0Z1dHVyZSkge1xuICAgICAgICB2YXIgZm9ybWF0ID0ge1xuICAgICAgICAgICAgczogWyfDp2VuZCBzYW7DrnllJywgJ8OnZW5kIHNhbsOueWV5YW4nXSxcbiAgICAgICAgICAgIHNzOiBbbnVtICsgJyBzYW7DrnllJywgbnVtICsgJyBzYW7DrnlleWFuJ10sXG4gICAgICAgICAgICBtOiBbJ2RlccOucWV5ZWsnLCAnZGVxw65xZXlla8OqJ10sXG4gICAgICAgICAgICBtbTogW251bSArICcgZGVxw65xZScsIG51bSArICcgZGVxw65xZXlhbiddLFxuICAgICAgICAgICAgaDogWydzYWV0ZWsnLCAnc2FldGVrw6onXSxcbiAgICAgICAgICAgIGhoOiBbbnVtICsgJyBzYWV0JywgbnVtICsgJyBzYWV0YW4nXSxcbiAgICAgICAgICAgIGQ6IFsncm9qZWsnLCAncm9qZWvDqiddLFxuICAgICAgICAgICAgZGQ6IFtudW0gKyAnIHJvaicsIG51bSArICcgcm9qYW4nXSxcbiAgICAgICAgICAgIHc6IFsnaGVmdGV5ZWsnLCAnaGVmdGV5ZWvDqiddLFxuICAgICAgICAgICAgd3c6IFtudW0gKyAnIGhlZnRlJywgbnVtICsgJyBoZWZ0ZXlhbiddLFxuICAgICAgICAgICAgTTogWydtZWhlaycsICdtZWhla8OqJ10sXG4gICAgICAgICAgICBNTTogW251bSArICcgbWVoJywgbnVtICsgJyBtZWhhbiddLFxuICAgICAgICAgICAgeTogWydzYWxlaycsICdzYWxla8OqJ10sXG4gICAgICAgICAgICB5eTogW251bSArICcgc2FsJywgbnVtICsgJyBzYWxhbiddLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/IGZvcm1hdFtrZXldWzBdIDogZm9ybWF0W2tleV1bMV07XG4gICAgfVxuICAgIC8vIGZ1bmN0aW9uIG9ibGlxdWVOdW1TdWZmaXgobnVtKSB7XG4gICAgLy8gICAgIGlmKG51bS5pbmNsdWRlcygnOicpKVxuICAgIC8vICAgICAgICAgbnVtID0gcGFyc2VJbnQobnVtLnNwbGl0KCc6JylbMF0pO1xuICAgIC8vICAgICBlbHNlXG4gICAgLy8gICAgICAgICBudW0gPSBwYXJzZUludChudW0pO1xuICAgIC8vICAgICByZXR1cm4gbnVtID09IDAgfHwgbnVtICUgMTAgPT0gMSA/ICfDqidcbiAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICA6IChudW0gPiAxMCAmJiBudW0gJSAxMCA9PSAwID8gJ8OuJyA6ICdhbicpO1xuICAgIC8vIH1cbiAgICBmdW5jdGlvbiBlemFmZU51bVN1ZmZpeChudW0pIHtcbiAgICAgICAgbnVtID0gJycgKyBudW07XG4gICAgICAgIHZhciBsID0gbnVtLnN1YnN0cmluZyhudW0ubGVuZ3RoIC0gMSksXG4gICAgICAgICAgICBsbCA9IG51bS5sZW5ndGggPiAxID8gbnVtLnN1YnN0cmluZyhudW0ubGVuZ3RoIC0gMikgOiAnJztcbiAgICAgICAgaWYgKFxuICAgICAgICAgICAgIShsbCA9PSAxMiB8fCBsbCA9PSAxMykgJiZcbiAgICAgICAgICAgIChsID09ICcyJyB8fCBsID09ICczJyB8fCBsbCA9PSAnNTAnIHx8IGwgPT0gJzcwJyB8fCBsID09ICc4MCcpXG4gICAgICAgIClcbiAgIC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Dh2FyX1DDqm5fw45uX8WeZW0nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnWWVfRHVfU8OqX8OHYV9Qw6pfw45uX8WeZScuc3BsaXQoJ18nKSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VycywgbWludXRlcywgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXJzIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/ICdibicgOiAnQk4nO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/ICdwbicgOiAnUE4nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvYm58Qk58cG58UE4vLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0RvIE1NTU1bYV0gWVlZWVthbl0nLFxuICAgICAgICAgICAgTExMOiAnRG8gTU1NTVthXSBZWVlZW2FuXSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRG8gTU1NTVthXSBZWVlZW2FuXSBISDptbScsXG4gICAgICAgICAgICBsbDogJ0RvIE1NTVsuXSBZWVlZW2FuXScsXG4gICAgICAgICAgICBsbGw6ICdEbyBNTU1bLl0gWVlZWVthbl0gSEg6bW0nLFxuICAgICAgICAgICAgbGxsbDogJ2RkZFsuXSwgRG8gTU1NWy5dIFlZWVlbYW5dIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbw45ybyBkaSBzYWV0XSBMVCBbZGVdJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbU2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JyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHN5bWJvbE1hcCA9IHtcbiAgICAgICAgICAgIDE6ICfZoScsXG4gICAgICAgICAgICAyOiAn2aInLFxuICAgICAgICAgICAgMzogJ9mjJyxcbiAgICAgICAgICAgIDQ6ICfZpCcsXG4gICAgICAgICAgICA1OiAn2aUnLFxuICAgICAgICAgICAgNjogJ9mmJyxcbiAgICAgICAgICAgIDc6ICfZpycsXG4gICAgICAgICAgICA4OiAn2agnLFxuICAgICAgICAgICAgOTogJ9mpJyxcbiAgICAgICAgICAgIDA6ICfZoCcsXG4gICAgICAgIH0sXG4gICAgICAgIG51bWJlck1hcCA9IHtcbiAgICAgICAgICAgICfZoSc6ICcxJyxcbiAgICAgICAgICAgICfZoic6ICcyJyxcbiAgICAgICAgICAgICfZoyc6ICczJyxcbiAgICAgICAgICAgICfZpCc6ICc0JyxcbiAgICAgICAgICAgICfZpSc6ICc1JyxcbiAgICAgICAgICAgICfZpic6ICc2JyxcbiAgICAgICAgICAgICfZpyc6ICc3JyxcbiAgICAgICAgICAgICfZqCc6ICc4JyxcbiAgICAgICAgICAgICfZqSc6ICc5JyxcbiAgICAgICAgICAgICfZoCc6ICcwJyxcbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzID0gW1xuICAgICAgICAgICAgJ9qp2KfZhtmI2YbbjCDYr9mI2YjbldmFJyxcbiAgICAgICAgICAgICfYtNmI2KjYp9iqJyxcbiAgICAgICAgICAgICfYptin2LLYp9ixJyxcbiAgICAgICAgICAgICfZhtuM2LPYp9mGJyxcbiAgICAgICAgICAgICfYptin24zYp9ixJyxcbiAgICAgICAgICAgICfYrdmI2LLblduM2LHYp9mGJyxcbiAgICAgICAgICAgICfYqtuV2YXZhdmI2LInLFxuICAgICAgICAgICAgJ9im2KfYqCcsXG4gICAgICAgICAgICAn2KbblduM2YTZiNmI2YQnLFxuICAgICAgICAgICAgJ9iq2LTYsduM2YbbjCDbjNuV2YPbldmFJyxcbiAgICAgICAgICAgICfYqti02LHbjNmG24wg2K/ZiNmI25XZhScsXG4gICAgICAgICAgICAn2YPYp9mG2YjZhtuMINuM25XaqduV2YUnLFxuICAgICAgICBdO1xuXG4gICAgdmFyIGt1ID0gbW9tZW50LmRlZmluZUxvY2FsZSgna3UnLCB7XG4gICAgICAgIG1vbnRoczogbW9udGhzLFxuICAgICAgICBtb250aHNTaG9ydDogbW9udGhzLFxuICAgICAgICB3ZWVrZGF5czpcbiAgICAgICAgICAgICfbjNmH4oCM2YPYtNmH4oCM2YXZhdmH4oCMX9iv2YjZiNi02YfigIzZhdmF2YfigIxf2LPbjti02YfigIzZhdmF2YfigIxf2obZiNin2LHYtNmH4oCM2YXZhdmH4oCMX9m+247Zhtis2LTZh+KAjNmF2YXZh+KAjF/Zh9mH4oCM24zZhtuMX9i02YfigIzZhdmF2YfigIwnLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDpcbiAgICAgICAgICAgICfbjNmH4oCM2YPYtNmH4oCM2YVf2K/ZiNmI2LTZh+KAjNmFX9iz247YtNmH4oCM2YVf2obZiNin2LHYtNmH4oCM2YVf2b7bjtmG2KzYtNmH4oCM2YVf2YfZh+KAjNuM2YbbjF/YtNmH4oCM2YXZhdmH4oCMJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ9uMX9ivX9izX9qGX9m+X9mHX9i0Jy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL9im247ZiNin2LHZh+KAjHzYqNmH4oCM24zYp9mG24wvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAv2KbbjtmI2KfYsdmH4oCMLy50ZXN0KGlucHV0KTtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9io2YfigIzbjNin2YbbjCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn2KbbjtmI2KfYsdmH4oCMJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb2KbZh+KAjNmF2LHbhiDZg9in2KramNmF247YsV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYqNmH4oCM24zYp9mG24wg2YPYp9iq2pjZhduO2LFdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb2YPYp9iq2pjZhduO2LFdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2K/ZiNuO2YbbjiDZg9in2KramNmF247YsV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFvZg9in2KramNmF247YsV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfZhNmH4oCMICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcycsXG4gICAgICAgICAgICBzOiAn2obZh+KAjNmG2K8g2obYsdmD2YfigIzbjNmH4oCM2YMnLFxuICAgICAgICAgICAgc3M6ICfahtix2YPZh+KAjCAlZCcsXG4gICAgICAgICAgICBtOiAn24zZh+KAjNmDINiu2YjZhNmH4oCM2YMnLFxuICAgICAgICAgICAgbW06ICclZCDYrtmI2YTZh+KAjNmDJyxcbiAgICAgICAgICAgIGg6ICfbjNmH4oCM2YMg2YPYp9iq2pjZhduO2LEnLFxuICAgICAgICAgICAgaGg6ICclZCDZg9in2KramNmF247YsScsXG4gICAgICAgICAgICBkOiAn24zZh+KAjNmDINqV24bamCcsXG4gICAgICAgICAgICBkZDogJyVkINqV24bamCcsXG4gICAgICAgICAgICBNOiAn24zZh+KAjNmDINmF2KfZhtqvJyxcbiAgICAgICAgICAgIE1NOiAnJWQg2YXYp9mG2q8nLFxuICAgICAgICAgICAgeTogJ9uM2YfigIzZgyDYs9in2rUnLFxuICAgICAgICAgICAgeXk6ICclZCDYs9in2rUnLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZ1xuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9b2aHZotmj2aTZpdmm2afZqNmp2aBdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTWFwW21hdGNoXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC/YjC9nLCAnLCcpO1xuIC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HQsNCw0YJdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb0YHQsNCw0YJdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb0JrQtdGH0Y3RjSDRgdCw0LDRgl0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb06jRgtC606nQvSDQsNC/0YLQsNC90YvQvV0gZGRkZCBb0LrSr9C90q9dIFvRgdCw0LDRgl0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDQuNGH0LjQvdC00LUnLFxuICAgICAgICAgICAgcGFzdDogJyVzINC80YPRgNGD0L0nLFxuICAgICAgICAgICAgczogJ9Cx0LjRgNC90LXRh9C1INGB0LXQutGD0L3QtCcsXG4gICAgICAgICAgICBzczogJyVkINGB0LXQutGD0L3QtCcsXG4gICAgICAgICAgICBtOiAn0LHQuNGAINC80q/QvdOp0YInLFxuICAgICAgICAgICAgbW06ICclZCDQvNKv0L3TqdGCJyxcbiAgICAgICAgICAgIGg6ICfQsdC40YAg0YHQsNCw0YInLFxuICAgICAgICAgICAgaGg6ICclZCDRgdCw0LDRgicsXG4gICAgICAgICAgICBkOiAn0LHQuNGAINC60q/QvScsXG4gICAgICAgICAgICBkZDogJyVkINC60q/QvScsXG4gICAgICAgICAgICBNOiAn0LHQuNGAINCw0LknLFxuICAgICAgICAgICAgTU06ICclZCDQsNC5JyxcbiAgICAgICAgICAgIHk6ICfQsdC40YAg0LbRi9C7JyxcbiAgICAgICAgICAgIHl5OiAnJWQg0LbRi9C7JyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9LSjRh9C4fNGH0Yt80YfSr3zRh9GDKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAg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wLCBzdHJpbmcuaW5kZXhPZignICcpKTtcbiAgICAgICAgaWYgKGVpZmVsZXJSZWdlbEFwcGxpZXNUb051bWJlcihudW1iZXIpKSB7XG4gICAgICAgICAgICByZXR1cm4gJ3ZpcnUgJyArIHN0cmluZztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gJ3ZpcnVuICcgKyBzdHJpbmc7XG4gICAgfVxuICAgIC8qKlxuICAgICAqIFJldHVybnMgdHJ1ZSBpZiB0aGUgd29yZCBiZWZvcmUgdGhlIGdpdmVuIG51bWJlciBsb3NlcyB0aGUgJy1uJyBlbmRpbmcuXG4gICAgICogZS5nLiAnYW4gMTAgRGVlZycgYnV0ICdhIDUgRGVlZydcbiAgICAgKlxuICAgICAqIEBwYXJhbSBudW1iZXIge2ludGVnZXJ9XG4gICAgICogQHJldHVybnMge2Jvb2xlYW59XG4gICAgICovXG4gICAgZnVuY3Rpb24gZWlmZWxlclJlZ2VsQXBwbGllc1RvTnVtYmVyKG51bWJlcikge1xuICAgICAgICBudW1iZXIgPSBwYXJzZUludChudW1iZXIsIDEwKTtcbiAgICAgICAgaWYgKGlzTmFOKG51bWJlcikpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobnVtYmVyIDwgMCkge1xuICAgICAgICAgICAgLy8gTmVnYXRpdmUgTnVtYmVyIC0tPiBhbHdheXMgdHJ1ZVxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH0gZWxzZSBpZiAobnVtYmVyIDwgMTApIHtcbiAgICAgICAgICAgIC8vIE9ubHkgMSBkaWdpdFxuICAgICAgICAgICAgaWYgKDQgPD0gbnVtYmVyICYmIG51bWJlciA8PSA3KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH0gZWxzZSBpZiAobnVtYmVyIDwgMTAwKSB7XG4gICAgICAgICAgICAvLyAyIGRpZ2l0c1xuICAgICAgICAgICAgdmFyIGxhc3REaWdpdCA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIGZpcnN0RGlnaXQgPSBudW1iZXIgLyAxMDtcbiAgICAgICAgICAgIGlmIChsYXN0RGlnaXQgPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZWlmZWxlclJlZ2VsQXBwbGllc1RvTnVtYmVyKGZpcnN0RGlnaXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGVpZmVsZXJSZWdlbEFwcGxpZXNUb051bWJlcihsYXN0RGlnaXQpO1xuICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA8IDEwMDAwKSB7XG4gICAgICAgICAgICAvLyAzIG9yIDQgZGlnaXRzIC0tPiByZWN1cnNpdmVseSBjaGVjayBmaXJzdCBkaWdpdFxuICAgICAgICAgICAgd2hpbGUgKG51bWJlciA+PSAxMCkge1xuICAgICAgICAgICAgICAgIG51bWJlciA9IG51bWJlciAvIDEwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGVpZmVsZXJSZWdlbEFwcGxpZXNUb051bWJlcihudW1iZXIpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gQW55dGhpbmcgbGFyZ2VyIHRoYW4gNCBkaWdpdHM6IHJlY3Vyc2l2ZWx5IGNoZWNrIGZpcnN0IG4tMyBkaWdpdHNcbiAgICAgICAgICAgIG51bWJlciA9IG51bWJlciAvIDEwMDA7XG4gICAgICAgICAgICByZXR1cm4gZWlmZWxlclJlZ2VsQXBwbGllc1RvTnVtYmVyKG51bWJlcik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIgbGIgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdsYicsIHtcbiAgICAgICAgbW9udGhzOiAnSmFudWFyX0ZlYnJ1YXJfTcOkZXJ6X0FicsOrbGxfTWVlX0p1bmlfSn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AgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tIYXV0IHVtXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tNdWVyIHVtXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW3VtXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0fDq3NjaHRlciB1bV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAvLyBEaWZmZXJlbnQgZGF0ZSBzdHJpbmcgZm9yICdEw6tuc2NoZGVnJyAoVHVlc2RheSkgYW5kICdEb25uZXNjaGRlZycgKFRodXJzZGF5KSBkdWUgdG8gcGhvbm9sb2dpY2FsIHJ1bGVcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tMZXNjaHRlbl0gZGRkZCBbdW1dIExUJztcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW0xlc2NodGVdIGRkZGQgW3VtXSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6IHByb2Nlc3NGdXR1cmVUaW1lLFxuICAgICAgICAgICAgcGFzdDogcHJvY2Vzc1Bhc3RUaW1lLFxuICAgICAgICAgICAgczogJ2UgcHVlciBTZWtvbm5lbicsXG4gICAgICAgICAgICBzczogJyVkIFNla29ubmVuJyxcbiAgICAgICAgICAgIG06IHByb2Nlc3NSZWxhdGl2ZVRpbWUs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lzOiAn4Lqt4Lqy4LqX4Lq04LqUX+C6iOC6seC6mV/guq3gurHguofguoTgurLguplf4Lqe4Lq44LqUX+C6nuC6sOC6q+C6seC6lF/guqrgurjguoFf4LuA4Lqq4Lq74LqyJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAn4LqX4Lq04LqUX+C6iOC6seC6mV/guq3gurHguofguoTgurLguplf4Lqe4Lq44LqUX+C6nuC6sOC6q+C6seC6lF/guqrgurjguoFf4LuA4Lqq4Lq74LqyJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ+C6l1/guohf4Lqt4LqEX+C6nl/gup7guqtf4Lqq4LqBX+C6qicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICfguqfgurHguplkZGRkIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+C6leC6reC6meC7gOC6iuC6u+C7ieC6snzgupXguq3gupngu4HguqXguocvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiBpbnB1dCA9PT0gJ+C6leC6reC6meC7geC6peC6hyc7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgupXguq3gupngu4Dguorgurvgu4ngurInO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+C6leC6reC6meC7geC6peC6hyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+C6oeC6t+C7ieC6meC6teC7ieC7gOC6p+C6peC6sl0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vguqHgurfgu4nguq3gurfgu4jgupngu4DguqfguqXgurJdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnW+C6p+C6seC6mV1kZGRkW+C7nOC7ieC6suC7gOC6p+C6peC6sl0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vguqHgurfgu4nguqfgurLgupngupngurXgu4ngu4DguqfguqXgurJdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+C6p+C6seC6mV1kZGRkW+C7geC6peC7ieC6p+C6meC6teC7ieC7gOC6p+C6peC6sl0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfguq3gurXguoEgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVz4Lqc4LuI4Lqy4LqZ4Lqh4LqyJyxcbiAgICAgICAgICAgIHM6ICfguprgu43gu4jgu4Dgupfgurvgu4jgurLgu4PgupTguqfgurTgupngurLgupfgurUnLFxuICAgICAgICAgICAgc3M6ICclZCDguqfgurTgupngurLgupfgurUnLFxuICAgICAgICAgICAgbTogJzEg4LqZ4Lqy4LqX4Lq1JyxcbiAgICAgICAgICAgIG1tOiAnJWQg4LqZ4Lqy4LqX4Lq1JyxcbiAgICAgICAgICAgIGg6ICcxIOC6iuC6u+C7iOC6p+C7guC6oeC6hycsXG4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3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHVuaXRzID0ge1xuICAgICAgICBzczogJ3Nla3VuZMSXX3Nla3VuZMW+acWzX3Nla3VuZGVzJyxcbiAgICAgICAgbTogJ21pbnV0xJdfbWludXTEl3NfbWludXTEmScsXG4gICAgICAgIG1tOiAnbWludXTEl3NfbWludcSNacWzX21pbnV0ZXMnLFxuICAgICAgICBoOiAndmFsYW5kYV92YWxhbmRvc192YWxhbmTEhScsXG4gICAgICAgIGhoOiAndmFsYW5kb3NfdmFsYW5kxbNfdmFsYW5kYXMnLFxuICAgICAgICBkOiAnZGllbmFfZGllbm9zX2RpZW7EhScsXG4gICAgICAgIGRkOiAnZGllbm9zX2RpZW7Fs19kaWVuYXMnLFxuICAgICAgICBNOiAnbcSXbnVvX23El25lc2lvX23El25lc8SvJyxcbiAgICAgICAgTU06ICdtxJduZXNpYWlfbcSXbmVzacWzX23El25lc2l1cycsXG4gICAgICAgIHk6ICdtZXRhaV9tZXTFs19tZXR1cycsXG4gICAgICAgIHl5OiAnbWV0YWlfbWV0xbNfbWV0dXMnLFxuICAgIH07XG4gICAgZnVuY3Rpb24gdHJhbnNsYXRlU2Vjb25kcyhudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSwgaXNGdXR1cmUpIHtcbiAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXgpIHtcbiAgICAgICAgICAgIHJldHVybiAna2VsaW9zIHNla3VuZMSXcyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgPyAna2VsacWzIHNla3VuZMW+acWzJyA6ICdrZWxpYXMgc2VrdW5kZXMnO1xuICAgICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIHRyYW5zbGF0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hbnRyYWRpZW7Er190cmXEjWlhZGllbsSvX2tldHZpcnRhZGllbsSvX3Blbmt0YWRpZW7Er1/FoWXFoXRhZGllbsSvJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICBzdGFuZGFsb25lOlxuICAgICAgICAgICAgICAgICdzZWttYWRpZW5pc19waXJtYWRpZW5pc19hbnRyYWRpZW5pc190cmXEjWlhZGllbmlzX2tldHZpcnRhZGllbmlzX3Blbmt0YWRpZW5pc1/FoWXFoXRhZGllbmlzJy5zcGxpdChcbiAgICAgICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgIGlzRm9ybWF0OiAvZGRkZCBISDptbS8sXG4gICAgICAgIH0sXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICdTZWtfUGlyX0FudF9UcmVfS2V0X1Blbl/FoGXFoScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdTX1BfQV9UX0tfUG5fxaAnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ1lZWVktTU0tREQnLFxuICAgICAgICAgICAgTEw6ICdZWVlZIFttLl0gTU1NTSBEIFtkLl0nLFxuICAgICAgICAgICAgTExMOiAnWVlZWSBbbS5dIE1NTU0gRCBbZC5dLCBISDptbSBbdmFsLl0nLFxuICAgICAgICAgICAgTExMTDogJ1lZWVkgW20uXSBNTU1NIEQgW2QuXSwgZGRkZCwgSEg6bW0gW3ZhbC5dJyxcbiAgICAgICAgICAgIGw6ICdZWVlZLU1NLUREJyxcbiAgICAgICAgICAgIGxsOiAnWVlZWSBbbS5dIE1NTU0gRCBbZ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mdW5jdGlvbiByZWxhdGl2ZVNlY29uZHMobnVtYmVyLCB3aXRob3V0U3VmZml4KSB7XG4gICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4ID8gJ2Rhxb5hcyBzZWt1bmRlcycgOiAnZGHFvsSBbSBzZWt1bmTEk20nO1xuICAgIH1cblxuICAgIHZhciBsdiA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2x2Jywge1xuICAgICAgICBtb250aHM6ICdqYW52xIFyaXNfZmVicnXEgXJpc19tYXJ0c19hcHLEq2xpc19tYWlqc19qxatuaWpzX2rFq2xpanNfYXVndXN0c19zZXB0ZW1icmlzX29rdG9icmlzX25vdmVtYnJpc19kZWNlbWJyaXMnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OiAnamFuX2ZlYl9tYXJfYXByX21haV9qxatuX2rFq2xfYXVnX3NlcF9va3Rfbm92X2RlYycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXM6XG4gICAgICAgICAgICAnc3bEk3RkaWVuYV9waXJtZGllbmFfb3RyZGllbmFfdHJlxaFkaWVuYV9jZXR1cnRkaWVuYV9waWVrdGRpZW5hX3Nlc3RkaWVuYScuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnU3ZfUF9PX1RfQ19Qa19TJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ1N2X1BfT19UX0NfUGtfUycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWS4nLFxuICAgICAgICAgICAgTEw6ICdZW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HR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciB0cmFuc2xhdG9yID0ge1xuICAgICAgICB3b3Jkczoge1xuICAgICAgICAgICAgLy9EaWZmZXJlbnQgZ3JhbW1hdGljYWwgY2FzZXNcbiAgICAgICAgICAgIHNzOiBbJ3Nla3VuZCcsICdzZWt1bmRhJywgJ3Nla3VuZGknXSxcbiAgICAgICAgICAgIG06IFsnamVkYW4gbWludXQnLCAnamVkbm9nIG1pbnV0YSddLFxuICAgICAgICAgICAgbW06IFsnbWludXQnLCAnbWludXRhJywgJ21pbnV0YSddLFxuICAgICAgICAgICAgaDogWydqZWRhbiBzYXQnLCAnamVkbm9nIHNhdGEnXSxcbiAgICAgICAgICAgIGhoOiBbJ3NhdCcsICdzYXRhJywgJ3NhdGknXSxcbiAgICAgICAgICAgIGRkOiBbJ2RhbicsICdkYW5hJywgJ2RhbmEnXSxcbiAgICAgICAgICAgIE1NOiBbJ21qZXNlYycsICdtamVzZWNhJywgJ21qZXNlY2knXSxcbiAgICAgICAgICAgIHl5OiBbJ2dvZGluYScsICdnb2RpbmUnLCAnZ29kaW5hJ10sXG4gICAgICAgIH0sXG4gICAgICAgIGNvcnJlY3RHcmFtbWF0aWNhbENhc2U6IGZ1bmN0aW9uIChudW1iZXIsIHdvcmRLZXkpIHtcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgPT09IDFcbiAgICAgICAgICAgICAgICA/IHdvcmRLZXlbMF1cbiAgICAgICAgICAgICAgICA6IG51bWJlciA+PSAyICYmIG51bWJlciA8PSA0XG4gICAgICAgICAgICAgICAgICA/IHdvcmRLZXlbMV1cbiAgICAgICAgICAgICAgICAgIDogd29yZEtleVsyXTtcbiAgICAgICAgfSxcbiAgICAgICAgdHJhbnNsYXRlOiBmdW5jdGlvbiAobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXkpIHtcbiAgICAgICAgICAgIHZhciB3b3JkS2V5ID0gdHJhbnNsYXRvci53b3Jkc1trZXldO1xuICAgICAgICAgICAgaWYgKGtleS5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/IHdvcmRLZXlbMF0gOiB3b3JkS2V5WzFdO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICBudW1iZXIgK1xuICAgICAgICAgICAgICAgICAgICAnICcgK1xuICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdG9yLmNvcnJlY3RHcmFtbWF0aWNhbENhc2UobnVtYmVyLCB3b3JkS2V5KVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgfTtcblxuICAgIHZhciBtZSA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ21lJywge1xuICAgICAgICBtb250aHM6ICdqYW51YXJfZmVicnVhcl9tYXJ0X2FwcmlsX21hal9qdW5fanVsX2F2Z3VzdF9zZXB0ZW1iYXJfb2t0b2Jhcl9ub3ZlbWJhcl9kZWNlbWJhcicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAnamFuLl9mZWIuX21hci5fYXByLl9tYWpfanVuX2p1bF9hdmcuX3NlcC5fb2t0Ll9ub3YuX2RlYy4nLnNwbGl0KCdfJyksXG4gICAgICAgIG1vbnRoc1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIHdlZWtkYXlzOiAnbmVkamVsamFfcG9uZWRqZWxqYWtfdXRvcmFrX3NyaWplZGFfxI1ldHZydGFrX3BldGFrX3N1Ym90YScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ25lZC5fcG9uLl91dG8uX3NyaS5fxI1ldC5fcGV0Ll9zdWIuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ25lX3BvX3V0X3NyX8SNZV9wZV9zdScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdELiBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRC4gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQuIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbZGFuYXMgdV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tzanV0cmEgdV0gTFQnLFxuXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBbbmVkamVsanVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIFtzcmlqZWR1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBbc3Vib3R1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBkZGRkIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbanXEjWUgdV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgbGFzdFdlZWtEYXlzID0gW1xuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbGVdIFtuZWRqZWxqZV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxvZ10gW3BvbmVkamVsamthXSBbdV0gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbG9nXSBbdXRvcmthXSBbdV0gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbGVdIFtzcmlqZWRlXSBbdV0gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbG9nXSBbxI1ldHZydGthXSBbdV0gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbG9nXSBbcGV0a2FdIFt1XSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdbcHJvxaFsZV0gW3N1Ym90ZV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgIHJldHVybiBsYXN0V2Vla0RheXNbdGhpcy5kYXkoKV07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICd6YSAlcycsXG4gICAgICAgICAgICBwYXN0OiAncHJpamUgJXMnLFxuICAgICAgICAgICAgczogJ25la29saWtvIHNla3VuZGknLFxuICAgICAgICAgICAgc3M6IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICAgbTogdHJhbnNsYXRvci50cmFuc2xhdGUsXG4gICAgICAgICAgICBtbTogdHJhbnNsYXRvci50cmFuc2xhdGUsXG4gICAgICAgICAgICBoOiB0cmFuc2xhdG9yLnRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGhoOiB0cmFuc2xhdG9yLnRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGQ6ICdkYW4nLFxuICAgICAgICAgICAgZGQ6IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICAgTTogJ21qZXNlYycsXG4gICAgICAgICAgICBNTTogdHJhbnNsYXRvci50cmFuc2xhdGUsXG4gICAgICAgICAgICB5OiAnZ29kaW51JyxcbiAgICAgICAgICAgIHl5OiB0cmFuc2xhdG9yLnRyYW5zbGF0ZSxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9XFwuLyxcbiAgICAgICAgb3JkaW5hbDogJyVkLicsXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDcsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDd0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBtZTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBNYW9y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pZSBtYWhhbmEsIGldIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbYXBvcG8gaV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtpXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2luYW5haGkgaV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFt3aGFrYW11dHVuZ2EgaV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdpIHJvdG8gaSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgaSBtdWEnLFxuICAgICAgICAgICAgczogJ3RlIGjEk2tvbmEgcnVhcnVhJyxcbiAgICAgICAgICAgIHNzOiAnJWQgaMSTa29uYScsXG4gICAgICAgICAgICBtOiAnaGUgbWVuZXRpJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWVuZXRpJyxcbiAgICAgICAgICAgIGg6ICd0ZSBoYW9yYScsXG4gICAgICAgICAgICBoaDogJyVkIGhhb3JhJyxcbiAgICAgICAgICAgIGQ6ICdoZSByYScsXG4gICAgICAgICAgICBkZDogJyVkIHJhJyxcbiAgICAgICAgICAgIE06ICdoZSBtYXJhbWEnLFxuICAgICAgICAgICAgTU06ICclZCBtYXJhbWEnLFxuICAgICAgICAgICAgeTogJ2hlIHRhdScsXG4gICAgICAgICAgICB5eTogJyVkIHRhdScsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfcK6LyxcbiAgICAgICAgb3JkaW5hbDogJyVkwronLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaG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tdC90LXRgSDQstC+XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9Cj0YLRgNC1INCy0L5dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnW9CS0L5dIGRkZGQgW9Cy0L5dIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb0JLRh9C10YDQsCDQstC+XSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JjQt9C80LjQvdCw0YLQsNGC0LBdIGRkZGQgW9Cy0L5dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JjQt9C80LjQvdCw0YLQuNC+0YJdIGRkZGQgW9Cy0L5dIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfQt9CwICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICfQv9GA0LXQtCAlcycsXG4gICAgICAgICAgICBzOiAn0L3QtdC60L7Qu9C60YMg0YHQtdC60YPQvdC00LgnLFxuICAgICAgICAgICAgc3M6ICclZCDRgdC10LrRg9C90LTQuCcsXG4gICAgICAgICAgICBtOiAn0LXQtNC90LAg0LzQuNC90YPRgtCwJyxcbiAgICAgICAgICAgIG1tOiAnJWQg0LzQuNC90YPRgtC4JyxcbiAgICAgICAgICAgIGg6ICfQtdC00LXQvSDRh9Cw0YEnLFxuICAgICAgICAgICAgaGg6ICclZCDRh9Cw0YHQsCcsXG4gICAgICAgICAgICBkOiAn0LXQtNC10L0g0LTQtdC9JyxcbiAgICAgICAgICAgIGRkOiAnJWQg0LTQtdC90LAnLFxuICAgICAgICAgICAgTTogJ9C10LTQtdC9INC80LXRgdC10YYnLFxuICAgICAgICAgICAgTU06ICclZCDQvNC10YHQtdGG0LgnLFxuICAgICAgICAgICAgeTogJ9C10LTQvdCwINCz0L7QtNC40L3QsCcsXG4gICAgICAgICAgICB5eTogJyVkINCz0L7QtNC40L3QuCcsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfS0o0LXQsnzQtdC9fNGC0Lh80LLQuHzRgNC4fNC80LgpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIGxhc3REaWdpdCA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIGxhc3QyRGlnaXRzID0gbnVtYmVyICUgMTAwO1xuICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdC10LInO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChsYXN0MkRpZ2l0cyA9PT0gMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdC10L0nO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChsYXN0MkRpZ2l0cyA+IDEwICYmIGxhc3QyRGlnaXRzIDwgMjApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3RgtC4JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdERpZ2l0ID09PSAxKSB7XG4gICAgICAgICAgICAgICAgc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gtJLgtLDgtYEg4LS14LW84LS34LSCJyxcbiAgICAgICAgICAgIHl5OiAnJWQg4LS14LW84LS34LSCJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+C0sOC0vuC0pOC1jeC0sOC0v3zgtLDgtL7gtLXgtL/gtLLgtYZ84LSJ4LSa4LWN4LSaIOC0leC0tOC0v+C0nuC1jeC0nuC1jXzgtLXgtYjgtJXgtYHgtKjgtY3gtKjgtYfgtLDgtIJ84LSw4LS+4LSk4LWN4LSw4LS/L2ksXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAobWVyaWRpZW0gPT09ICfgtLDgtL7gtKTgtY3gtLDgtL8nICYmIGhvdXIgPj0gNCkgfHxcbiAgICAgICAgICAgICAgICBtZXJpZGllbSA9PT0gJ+C0ieC0muC1jeC0miDgtJXgtLTgtL/gtJ7gtY3gtJ7gtY0nIHx8XG4gICAgICAgICAgICAgICAgbWVyaWRpZW0gPT09ICfgtLXgtYjgtJXgtYHgtKjgtY3gtKjgtYfgtLDgtIInXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgNCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4LSw4LS+4LSk4LWN4LSw4LS/JztcbiAgICAgICAgICAgIH0gZWxzZSB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IHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICBmdW5jdGlvbiB0cmFuc2xhdGUobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXksIGlzRnV0dXJlKSB7XG4gICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICfRhdGN0LTRhdGN0L0g0YHQtdC60YPQvdC0JyA6ICfRhdGN0LTRhdGN0L0g0YHQtdC60YPQvdC00YvQvSc7XG4gICAgICAgICAgICBjYXNlICdzcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICh3aXRob3V0U3VmZml4ID8gJyDRgdC10LrRg9C90LQnIDogJyDRgdC10LrRg9C90LTRi9C9Jyk7XG4gICAgICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgKHdpdGhvdXRTdWZmaXggPyAnINC80LjQvdGD0YInIDogJyDQvNC40L3Rg9GC0YvQvScpO1xuICAgICAgICAgICAgY2FzZSAnaCc6XG4gICAgICAgICAgICBjYXNlICdoaCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICh3aXRob3V0U3VmZml4ID8gJyDRhtCw0LMnIDogJyDRhtCw0LPQuNC50L0nKTtcbiAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgY2FzZSAnZGQnOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAod2l0aG91dFN1ZmZpeCA/ICcg06nQtNOp0YAnIDogJyDTqdC00YDQuNC50L0nKTtcbiAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAod2l0aG91dFN1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tOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfSrtOoJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfSrtClJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb06jQvdOp06nQtNOp0YBdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb0JzQsNGA0LPQsNCw0YhdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnW9CY0YDRjdGFXSBkZGRkIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb06jRh9C40LPQtNOp0YBdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW9Oo0L3Qs9Op0YDRgdOp0L1dIGRkZGQgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDQtNCw0YDQsNCwJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDTqdC80L3TqScsXG4gICAgICAgICAgICBzOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBzczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbW06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGg6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGhoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBkOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBkZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTU06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAg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5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBzeW1ib2xNYXAgPSB7XG4gICAgICAgICAgICAxOiAn4KWnJyxcbiAgICAgICAgICAgIDI6ICfgpagnLFxuICAgICAgICAgICAgMzogJ+ClqScsXG4gICAgICAgICAgICA0OiAn4KWqJyxcbiAgICAgICAgICAgIDU6ICfgpasnLFxuICAgICAgICAgICAgNjogJ+ClrCcsXG4gICAgICAgICAgICA3OiAn4KWtJyxcbiAgICAgICAgICAgIDg6ICfgpa4nLFxuICAgICAgICAgICAgOTogJ+ClrycsXG4gICAgICAgICAgICAwOiAn4KWmJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ+Clpyc6ICcxJyxcbiAgICAgICAgICAgICfgpagnOiAnMicsXG4gICAgICAgICAgICAn4KWpJzogJzMnLFxuICAgICAgICAgICAgJ+Clqic6ICc0JyxcbiAgICAgICAgICAgICfgpasnOiAnNScsXG4gICAgICAgICAgICAn4KWsJzogJzYnLFxuICAgICAgICAgICAgJ+ClrSc6ICc3JyxcbiAgICAgICAgICAgICfgpa4nOiAnOCcsXG4gICAgICAgICAgICAn4KWvJzogJzknLFxuICAgICAgICAgICAgJ+Clpic6ICcwJyxcbiAgICAgICAgfTtcblxuICAgIGZ1bmN0aW9uIHJlbGF0aXZlVGltZU1yKG51bWJlciwgd2l0aG91dFN1ZmZpeCwgc3RyaW5nLCBpc0Z1dHVyZSkge1xuICAgICAgICB2YXIgb3V0cHV0ID0gJyc7XG4gICAgICAgIGlmICh3aXRob3V0U3VmZml4KSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHN0cmluZykge1xuICAgICAgICAgICAgICAgIGNhc2UgJ3MnOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAn4KSV4KS+4KS54KWAIOCkuOClh+CkleCkguCkpic7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3NzJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJyVkIOCkuOClh+CkleCkguCkpic7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ20nOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAn4KSP4KSVIOCkruCkv+CkqOCkv+Cknyc7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJyVkIOCkruCkv+CkqOCkv+Ckn+Clhyc7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2gnOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAn4KSP4KSVIOCkpOCkvuCkuCc7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2hoJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJyVkIOCkpOCkvuCkuCc7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAn4KSP4KSVIOCkpuCkv+CkteCkuCc7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2RkJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJyVkIOCkpuCkv+CkteCkuCc7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAn4KSP4KSVIOCkruCkueCkv+CkqOCkvic7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ01NJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJyVkIOCkruCkueCkv+CkqOClhyc7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3knOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAn4KSP4KSVIOCkteCksOCljeCktyc7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3l5JzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJyVkIOCkteCksOCljeCkt+Clhyc7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc3dpdGNoIChzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+CkleCkvuCkueClgCDgpLjgpYfgpJXgpILgpKbgpL7gpIInO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdzcyc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpLjgpYfgpJXgpILgpKbgpL7gpIInO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CkleCkviDgpK7gpL/gpKjgpL/gpJ/gpL4nO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpK7gpL/gpKjgpL/gpJ/gpL7gpIInO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdoJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CkleCkviDgpKTgpL7gpLjgpL4nO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdoaCc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpKTgpL7gpLjgpL7gpIInO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CkleCkviDgpKbgpL/gpLXgpLjgpL4nO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdkZCc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpKbgpL/gpLXgpLjgpL7gpIInO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CkleCkviDgpK7gpLngpL/gpKjgpY3gpK/gpL4nO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdNTSc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpK7gpLngpL/gpKjgpY3gpK/gpL7gpIInO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICd5JzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CkleCkviDgpLXgpLDgpY3gpLfgpL4nO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICd5eSc6XG4gICAgICAgICAgICAgICAgICAgIG91d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ZGRkZCwgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclc+CkruCkp+CljeCkr+ClhycsXG4gICAgICAgICAgICBwYXN0OiAnJXPgpKrgpYLgpLDgpY3gpLXgpYAnLFxuICAgICAgICAgICAgczogcmVsYXRpdmVUaW1lTXIsXG4gICAgICAgICAgICBzczogcmVsYXRpdmVUaW1lTXIsXG4gICAgICAgICAgICBtOiByZWxhdGl2ZVRpbWVNcixcbiAgICAgICAgICAgIG1tOiByZWxhdGl2ZVRpbWVNcixcbiAgICAgICAgICAgIGg6IHJlbGF0aXZlVGltZU1yLFxuICAgICAgICAgICAgaGg6IHJlbGF0aXZlVGltZU1yLFxuICAgICAgICAgICAgZDogcmVsYXRpdmVUaW1lTXIsXG4gICAgICAgICAgICBkZDogcmVsYXRpdmVUaW1lTXIsXG4gICAgICAgICAgICBNOiByZWxhdGl2ZVRpbWVNcixcbiAgICAgICAgICAgIE1NOiByZWxhdGl2ZVRpbWVNcixcbiAgICAgICAgICAgIHk6IHJlbGF0aXZlVGltZU1yLFxuICAgICAgICAgICAgeXk6IHJlbGF0aXZlVGltZU1yLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC9b4KWn4KWo4KWp4KWq4KWr4KWs4KWt4KWu4KWv4KWmXS9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTWFwW21hdGNoXTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBwb3N0Zm9ybWF0OiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1xcZC9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sTWFwW21hdGNoXTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv4KSq4KS54KS+4KSf4KWHfOCkuOCkleCkvuCks+ClgHzgpKbgpYHgpKrgpL7gpLDgpYB84KS44KS+4KSv4KSC4KSV4KS+4KSz4KWAfOCksOCkvuCkpOCljeCksOClgC8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+CkquCkueCkvuCkn+ClhycgfHwgbWVyaWRpZW0gPT09ICfgpLjgpJXgpL7gpLPgpYAnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKFxuICAgICAgICAgICAgICAgIG1lcmlkaWVtID09PSAn4KSm4KWB4KSq4KS+4KSw4KWAJyB8fFxuICAgICAgICAgICAgICAgIG1lcmlkaWVtID09PSAn4KS44KS+4KSv4KSC4KSV4KS+4KSz4KWAJyB8fFxuICAgICAgICAgICAgICAgIG1lcmlkaWVtID09PSAn4KSw4KS+4KSk4KWN4KSw4KWAJ1xuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPj0gMTIgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPj0gMCAmJiBob3VyIDwgNikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4KSq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gICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIFtwdWt1bF0gSEgubW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIFtwdWt1bF0gSEgubW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvcGFnaXx0ZW5nYWhhcml8cGV0YW5nfG1hbGFtLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAncGFnaScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICd0ZW5nYWhhcmknKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPj0gMTEgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ3BldGFuZycgfHwgbWVyaWRpZW0gPT09ICdtYWxhbScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91cnMgPCAxMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAncGFnaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXJzIDwgMTUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RlbmdhaGFyaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXJzIDwgMTkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3BldGFuZyc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAnbWFsYW0nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tIYXJpIGluaSBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tFc29rIHB1a3VsXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW3B1a3VsXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0tlbG1hcmluIHB1a3VsXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW2xlcGFzIHB1a3VsXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2RhbGFtICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyB5YW5nIGxlcGFzJyxcbiAgICAgICAgICAgIHM6ICdiZWJlcmFwYSBzYWF0JyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2FhdCcsXG4gICAgICAgICAgICBtOiAnc2VtaW5pdCcsXG4gICAgICAgICAgICBtbTogJyVkIG1pbml0JyxcbiAgICAgICAgICAgIGg6ICdzZWphbScsXG4gICAgICAgICAgICBoaDogJyVkIGphbScsXG4gICAgICAgICAgICBkOiAnc2VoYXJpJyxcbiAgICAgICAgICAgIGRkOiAnJWQgaGFyaScsXG4gICAgICAgICAgICBNOiAnc2VidWxhbicsXG4gICAgICAgICAgICBNTTogJyVkIGJ1bGFuJyxcbiAgICAgICAgICAgIHk6ICdzZXRhaHVuJyxcbiAgICAgICAgICAgIHl5OiAnJWQgdGFodW4nLFxuICAgICAgICB9L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GVtYmVyX09rdG9iZXJfTm92ZW1iZXJfRGlzZW1iZXInLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OiAnSmFuX0ZlYl9NYWNfQXByX01laV9KdW5fSnVsX09nc19TZXBfT2t0X05vdl9EaXMnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzOiAnQWhhZF9Jc25pbl9TZWxhc2FfUmFidV9LaGFtaXNfSnVtYWF0X1NhYnR1Jy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnQWhkX0lzbl9TZWxfUmFiX0toYV9KdW1fU2FiJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ0FoX0lzX1NsX1JiX0ttX0ptX1NiJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISC5tbScsXG4gICAgICAgICAgICBMVFM6ICdISC5tbS5zcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIFtwdWt1bF0gSEgubW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIFtwdWt1bF0gSEgubW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvcGFnaXx0ZW5nYWhhcml8cGV0YW5nfG1hbGFtLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAncGFnaScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICd0ZW5nYWhhcmknKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPj0gMTEgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ3BldGFuZycgfHwgbWVyaWRpZW0gPT09ICdtYWxhbScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91cnMgPCAxMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAncGFnaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXJzIDwgMTUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RlbmdhaGFyaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXJzIDwgMTkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3BldGFuZyc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAnbWFsYW0nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tIYXJpIGluaSBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tFc29rIHB1a3VsXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW3B1a3VsXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0tlbG1hcmluIHB1a3VsXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW2xlcGFzIHB1a3VsXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ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ICAgICAgIHdlZWtkYXlzTWluOiAnxKZhX1RuX1RsX0VyX8SmYV/EoGlfU2knLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSWxsdW0gZmlsLV1MVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW0fEp2FkYSBmaWwtXUxUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbZmlsLV1MVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0lsLWJpZXJhxKcgZmlsLV1MVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW2xpIGfEp2FkZGFdIFtmaWwtXUxUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnZuKAmSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgaWx1JyxcbiAgICAgICAgICAgIHM6ICdmdGl0IHNla29uZGknLFxuICAgICAgICAgICAgc3M6ICclZCBzZWtvbmRpJyxcbiAgICAgICAgICAgIG06ICdtaW51dGEnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGknLFxuICAgICAgICAgICAgaDogJ3NpZWfEp2EnLFxuICAgICAgICAgICAgaGg6ICclZCBzaWVnxKdhdCcsXG4gICAgICA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i9tb21lbnQnKSkgOlxuICAgdHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHN5bWJvbE1hcCA9IHtcbiAgICAgICAgICAgIDE6ICfhgYEnLFxuICAgICAgICAgICAgMjogJ+GBgicsXG4gICAgICAgICAgICAzOiAn4YGDJyxcbiAgICAgICAgICAgIDQ6ICfhgYQnLFxuICAgICAgICAgICAgNTogJ+GBhScsXG4gICAgICAgICAgICA2OiAn4YGGJyxcbiAgICAgICAgICAgIDc6ICfhgYcnLFxuICAgICAgICAgICAgODogJ+GBiCcsXG4gICAgICAgICAgICA5OiAn4YGJJyxcbiAgICAgICAgICAgIDA6ICfhgYAnLFxuICAgICAgICB9LFxuICAgICAgICBudW1iZXJNYXAgPSB7XG4gICAgICAgICAgICAn4YGBJzogJzEnLFxuICAgICAgICAgICAgJ+GBgic6ICcyJyxcbiAgICAgICAgICAgICfhgYMnOiAnMycsXG4gICAgICAgICAgICAn4YGEJzogJzQnLFxuICAgICAgICAgICAgJ+GBhSc6ICc1JyxcbiAgICAgICAgICAgICfhgYYnOiAnNicsXG4gICAgICAgICAgICAn4YGHJzogJzcnLFxuICAgICAgICAgICAgJ+GBiCc6ICc4JyxcbiAgICAgICAgICAgICfhgYknOiAnOScsXG4gICAgICAgICAgICAn4YGAJzogJzAnLFxuICAgICAgICB9O1xuXG4gICAgdmFyIG15ID0gbW9tZW50LmRlZmluZUxvY2FsZSgnbXknLCB7XG4gICAgICAgIG1vbnRoczogJ+GAh+GAlOGAuuGAlOGAneGAq+GAm+GArl/hgJbhgLHhgJ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YC6JyxcbiAgICAgICAgICAgIG06ICfhgJDhgIXhgLrhgJnhgK3hgJThgIXhgLonLFxuICAgICAgICAgICAgbW06ICclZCDhgJnhgK3hgJThgIXhgLonLFxuICAgICAgICAgICAgaDogJ+GAkOGAheGAuuGAlOGArOGAm+GAricsXG4gICAgICAgICAgICBoaDogJyVkIOGAlOGArOGAm+GAricsXG4gICAgICAgICAgICBkOiAn4YCQ4YCF4YC64YCb4YCA4YC6JyxcbiAgICAgICAgICAgIGRkOiAnJWQg4YCb4YCA4YC6JyxcbiAgICAgICAgICAgIE06ICfhgJDhgIXhgLrhgJwnLFxuICAgICAgICAgICAgTU06ICclZCDhgJwnLFxuICAgICAgICAgICAgeTogJ+GAkOGAheGAuuGAlOGAvuGAheGAuicsXG4gICAgICAgICAgICB5eTogJyVkIOGAlOGAvuGAheGAuicsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1vhgYHhgYLhgYPhgYThgYXhgYbhgYfhgYjhgYnhgYBdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6ID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AgICAgbmV4dERheTogJ1tpIG1vcmdlbiBrbC5dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBba2wuXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2kgZ8OlciBrbC5dIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW2ZvcnJpZ2VdIGRkZGQgW2tsLl0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdvbSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgc2lkZW4nLFxuICAgICAgICAgICAgczogJ25vZW4gc2VrdW5kZXInLFxuICAgICAgICAgICAgc3M6ICclZCBzZWt1bmRlcicsXG4gICAgICAgICAgICBtOiAnZXR0IG1pbnV0dCcsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0dGVyJyxcbiAgICAgICAgICAgIGg6ICfDqW4gdGltZScsXG4gICAgICAgICAgICBoaDogJyVkIHRpbWVyJyxcbiAgICAgICAgICAgIGQ6ICfDqW4gZGFnJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGFnZXInLFxuICAgICAgICAgICAgdzogJ8OpbiB1a2UnLFxuICAgICAgICAgICAgd3c6ICclZCB1a2VyJyxcbiAgICAgICAgICAgIE06ICfDqW4gbcOlbmVkJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbcOlbmVkZXInLFxuICAgICAgICAgICAgeTogJ2V0dCDDpXInLFxuICAgICAgICAgICAgeXk6ICclZCDDpXInLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn1cXC4vLFxuICAgICAgICBvcmRpbmFsOiAnJWQuJyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0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0gWVlZWSwgQeCkleCliyBoOm1tIOCkrOCknOClhycsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1vgpafgpajgpangpargpavgpazgpa3gpa7gpa/gpaZdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gpLDgpL7gpKTgpL984KSs4KS/4KS54KS+4KSofOCkpuCkv+CkieCkgeCkuOCli3zgpLjgpL7gpIHgpJ0vLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWVyaWRpZW0gPT09ICfgpLDgpL7gpKTgpL8nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPCA0ID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgpKzgpL/gpLngpL7gpKgnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4KSm4KS/4KSJ4KSB4KS44KWLJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDEwID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgpLjgpL7gpIHgpJ0nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMykge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4KSw4KS+4KSk4KS/JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgpKzgpL/gpLngpL7gpKgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTYpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CkpuCkv+CkieCkgeCkuOCliyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAyMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4KS44KS+4KSB4KSdJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgpLDgpL7gpKTgpL8nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vgpIbgpJxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb4KSt4KWL4KSy4KS/XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1vgpIbgpIngpIHgpKbgpYtdIGRkZGRbLF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vgpLngpL/gpJzgpYtdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZ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XQoJ18nKSxcbiAgICAgICAgbW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXmphbi9pLFxuICAgICAgICAgICAgL15mZWIvaSxcbiAgICAgICAgICAgIC9eKG1hYXJ0fG1ydFxcLj8pJC9pLFxuICAgICAgICAgICAgL15hcHIvaSxcbiAgICAgICAgICAgIC9ebWVpJC9pLFxuICAgICAgICAgICAgL15qdW5baS5dPyQvaSxcbiAgICAgICAgICAgIC9eanVsW2kuXT8kL2ksXG4gICAgICAgICAgICAvXmF1Zy9pLFxuICAgICAgICAgICAgL15zZXAvaSxcbiAgICAgICAgICAgIC9eb2t0L2ksXG4gICAgICAgICAgICAvXm5vdi9pLFxuICAgICAgICAgICAgL15kZWMvaSxcbiAgICAgICAgXSxcbiAgICAgICAgbW9udGhzUmVnZXggPVxuICAgICAgICAgICAgL14oamFudWFyaXxmZWJydWFyaXxtYWFydHxhcHJpbHxtZWl8anVbbmxdaXxhdWd1c3R1c3xzZXB0ZW1iZXJ8b2t0b2Jlcnxub3ZlbWJlcnxkZWNlbWJlcnxqYW5cXC4/fGZlYlxcLj98bXJ0XFwuP3xhcHJcXC4/fGp1W25sXVxcLj98YXVnXFwuP3xzZXBcXC4/fG9rdFxcLj98bm92XFwuP3xkZWNcXC4/KS9pO1xuXG4gICAgdmFyIG5sQmUgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdubC1iZScsIHtcbiAgICAgICAgbW9udGhzOiAnamFudWFyaV9mZWJydWFyaV9tYWFydF9hcHJpbF9tZWlfanVuaV9qdWxpX2F1Z3VzdHVzX3NlcHRlbWJlcl9va3RvYmVyX25vdmVtYmVyX2RlY2VtYmVyJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDogZnVuY3Rpb24gKG0sIGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFtKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0V2l0aERvd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Ll96YS4nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnem9fbWFfZGlfd29fZG9fdnJfemEnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW3ZhbmRhYWcgb21dIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbbW9yZ2VuIG9tXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW29tXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2dpc3RlcmVuIG9tXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1thZmdlbG9wZW5dIGRkZGQgW29tXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ292ZXIgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGdlbGVkZW4nLFxuICAgICAgICAgICAgczogJ2VlbiBwYWFyIHNlY29uZGVuJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vjb25kZW4nLFxuICAgICAgICAgICAgbTogJ8Opw6luIG1pbnV1dCcsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZW4nLFxuICAgICAgICAgICAgaDogJ8Opw6luIHV1cicsXG4gICAgICAgICAgICBoaDogJyVkIHV1cicsXG4gICAgICAgICAgICBkOiAnw6nDqW4gZGFnJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGFnZW4nLFxuICAgICAgICAgICAgTTogJ8Opw6luIG1hYW5kJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbWFhbmRlbicsXG4gICAgICAgICAgICB5OiAnw6nDqW4gamFhcicsXG4gICAgICAgICAgICB5eTogJyVkIGphYXInLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oc3RlfGRlKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgbnVtYmVyICtcbiAgICAgICAgICAgICAgICAobnVtYmVyID09PSAxIHx8IG51bWJlciA9PT0gOCB8fCBudW1iZXIgPj0gMjAgPyAnc3RlJyA6ICdkZScpXG4gICAgICAgICAgICApO1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gbmxCZTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBEdXRjaCBbbmxdXG4vLyEgYXV0aG9yIDogSm9yaXMgUsO2bGluZyA6IGh0dHBzOi8vZ2l0aHViLmNvbS9qb3Jpc3JvbGluZ1xuLy8hIGF1dGhvciA6IEphY29iIE1pZGRhZ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ICAgL15hdWcvaSxcbiAgICAgICAgICAgIC9ec2VwL2ksXG4gICAgICAgICAgICAvXm9rdC9pLFxuICAgICAgICAgICAgL15ub3YvaSxcbiAgICAgICAgICAgIC9eZGVjL2ksXG4gICAgICAgIF0sXG4gICAgICAgIG1vbnRoc1JlZ2V4ID1cbiAgICAgICAgICAgIC9eKGphbnVhcml8ZmVicnVhcml8bWFhcnR8YXByaWx8bWVpfGp1W25sXWl8YXVndXN0dXN8c2VwdGVtYmVyfG9rdG9iZXJ8bm92ZW1iZXJ8ZGVjZW1iZXJ8amFuXFwuP3xmZWJcXC4/fG1ydFxcLj98YXByXFwuP3xqdVtubF1cXC4/fGF1Z1xcLj98c2VwXFwuP3xva3RcXC4/fG5vdlxcLj98ZGVjXFwuPykvaTtcblxuICAgIHZhciBubCA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ25sJywge1xuICAgICAgICBtb250aHM6ICdqYW51YXJpX2ZlYnJ1YXJpX21hYXJ0X2FwcmlsX21laV9qdW5pX2p1bGlfYXVndXN0dXNfc2VwdGVtYmVyX29rdG9iZXJfbm92ZW1iZXJfZGVjZW1iZXInLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OiBmdW5jdGlvbiAobSwgZm9ybWF0KSB7XG4gICAgICAgICAgICBpZiAoIW0pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU2hvcnRXaXRoRG90cztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoLy1NTU0tLy50ZXN0KGZvcm1hdCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU2hvcnRXaXRob3V0RG90c1ttLm1vbnRoKCldO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU2hvcnRXaXRoRG90c1ttLm1vbnRoKCldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIG1vbnRoc1JlZ2V4OiBtb250aHNSZWdleCxcbiAgICAgICAgbW9udGhzU2hvcnRSZWdleDogbW9udGhzUmVnZXgsXG4gICAgICAgIG1vbnRoc1N0cmljdFJlZ2V4OlxuICAgICAgICAgICAgL14oamFudWFyaXxmZWJydWFyaXxtYWFydHxhcHJpbHxtZWl8anVbbmxdaXxhdWd1c3R1c3xzZXB0ZW1iZXJ8b2t0b2Jlcnxub3ZlbWJlcnxkZWNlbWJlcikvaSxcbiAgICAgICAgbW9udGhzU2hvcnRTdHJpY3RSZWdleDpcbiAgICAgICAgICAgIC9eKGphblxcLj98ZmViXFwuP3xtcnRcXC4/fGFwclxcLj98bWVpfGp1W25sXVxcLj98YXVnXFwuP3xzZXBcXC4/fG9rdFxcLj98bm92XFwuP3xkZWNcXC4/KS9pLFxuXG4gICAgICAgIG1vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgbG9uZ01vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgc2hvcnRNb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG5cbiAgICAgICAgd2Vla2RheXM6XG4gICAgICAgICAgICAnem9uZGFnX21hYW5kYWdfZGluc2RhZ193b2Vuc2RhZ19kb25kZXJkYWdfdnJpamRhZ196YXRlcmRhZycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ3pvLl9tYS5fZGkuX3dvLl9kby5fdnIuX3phLicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICd6b19tYV9kaV93b19kb192cl96YScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQtTU0tWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbdmFuZGFhZyBvbV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1ttb3JnZW4gb21dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbb21dIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbZ2lzdGVyZW4gb21dIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW2FmZ2Vsb3Blbl0gZGRkZCBbb21dIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnb3ZlciAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgZ2VsZWRlbicsXG4gICAgICAgICAgICBzOiAnZWVuIHBhYXIgc2Vjb25kZW4nLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRlbicsXG4gICAgICAgICAgICBtOiAnw6nDqW4gbWludXV0JyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlbicsXG4gICAgICAgICAgICBoOiAnw6nDqW4gdXVyJyxcbiAgICAgICAgICAgIGhoOiAnJWQgdXVyJyxcbiAgICAgICAgICAgIGQ6ICfDqcOpbiBkYWcnLFxuICAgICAgICAgICAgZGQ6ICclZCBkYWdlbicsXG4gICAgICAgICAgICB3OiAnw6nDqW4gd2VlaycsXG4gICAgICAgICAgICB3dzogJyVkIHdla2VuJyxcbiAgICAgICAgICAgIE06ICfDqcOpbiBtYWFuZCcsXG4gICAgICAgICAgICBNTTogJyVkIG1hYW5kZW4nLFxuICAgICAgICAgICA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B7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRC4gTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QuIE1NTU0gWVlZWSBba2wuXSBIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQuIE1NTU0gWVlZWSBba2wuXSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0kgZGFnIGtsb2trYV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tJIG1vcmdvbiBrbG9ra2FdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBba2xva2thXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0kgZ8OlciBrbG9ra2FdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW0bDuHJlZ8OlYW5kZV0gZGRkZCBba2xva2thXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ29tICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBzaWRhbicsXG4gICAgICAgICAgICBzOiAnbm9rcmUgc2VrdW5kJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VrdW5kJyxcbiAgICAgICAgICAgIG06ICdlaXQgbWludXR0JyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXR0JyxcbiAgICAgICAgICAgIGg6ICdlaW4gdGltZScsXG4gICAgICAgICAgICBoaDogJyVkIHRpbWFyJyxcbiAgICAgICAgICAgIGQ6ICdlaW4gZGFnJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGFnYXInLFxuICAgICAgIC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5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgb2NMbmMgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdvYy1sbmMnLCB7XG4gICAgICAgIG1vbnRoczoge1xuICAgICAgICAgICAgc3RhbmRhbG9uZTpcbiAgICAgICAgICAgICAgICAnZ2VuacOocl9mZWJyacOocl9tYXLDp19hYnJpbF9tYWlfanVuaF9qdWxoZXRfYWdvc3Rfc2V0ZW1icmVfb2N0w7JicmVfbm92ZW1icmVfZGVjZW1icmUnLnNwbGl0KFxuICAgICAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgZm9ybWF0OiBcImRlIGdlbmnDqHJfZGUgZmVicmnDqHJfZGUgbWFyw6dfZCdhYnJpbF9kZSBtYWlfZGUganVuaF9kZSBqdWxoZXRfZCdhZ29zdF9kZSBzZXRlbWJyZV9kJ29jdMOyYnJlX2RlIG5vdmVtYnJlX2RlIGRlY2VtYnJlXCIuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICAgICAgaXNGb3JtYXQ6IC9EW29EXT8oXFxzKStNTU1NLyxcbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAnZ2VuLl9mZWJyLl9tYXLDp19hYnIuX21haV9qdW5oX2p1bGguX2Fnby5fc2V0Ll9vY3QuX25vdi5fZGVjLicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICB3ZWVrZGF5czogJ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F0IGFdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiBcImQnYXF1w60gJXNcIixcbiAgICAgICAgICAgIHBhc3Q6ICdmYSAlcycsXG4gICAgICAgICAgICBzOiAndW5hcyBzZWdvbmRhcycsXG4gICAgICAgICAgICBzczogJyVkIHNlZ29uZGFzJyxcbiAgICAgICAgICAgIG06ICd1bmEgbWludXRhJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRhcycsXG4gICAgICAgICAgICBoOiAndW5hIG9yYScsXG4gICAgICAgICAgICBoaDogJyVkIG9yYXMnLFxuICAgICAgICAgICAgZDogJ3VuIGpvcm4nLFxuICAgICAgICAgICAgZGQ6ICclZCBqb3JucycsXG4gICAgICAgICAgICBNOiAndW4gbWVzJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbWVzZXMnLFxuICAgICAgICAgICAgeTogJ3VuIGFuJyxcbiAgICAgICAgICAgIHl5OiAnJWQgYW5zJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHJ8bnx0fMOofGEpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICB2YXIgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICBudW1iZXIgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgPyAncidcbiAgICAgICAgICAgICAgICAgICAgOiBudW1iZXIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICA/ICduJ1xuICAgICAgICAgICAgICAgICAgICAgIDogbnVtYmVyID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICdyJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBudW1iZXIgPT09IDRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyAndCdc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xlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBzeW1ib2xNYXAgPSB7XG4gICAgICAgICAgICAxOiAn4KmnJyxcbiAgICAgICAgICAgIDI6ICfgqagnLFxuICAgICAgICAgICAgMzogJ+CpqScsXG4gICAgICAgICAgICA0OiAn4KmqJyxcbiAgICAgICAgICAgIDU6ICfgqasnLFxuICAgICAgICAgICAgNjogJ+CprCcsXG4gICAgICAgICAgICA3OiAn4KmtJyxcbiAgICAgICAgICAgIDg6ICfgqa4nLFxuICAgICAgICAgICAgOTogJ+CprycsXG4gICAgICAgICAgICAwOiAn4KmmJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ+Cppyc6ICcxJyxcbiAgICAgICAgICAgICfgqagnOiAnMicsXG4gICAgICAgICAgICAn4KmpJzogJzMnLFxuICAgICAgICAgICAgJ+Cpqic6ICc0JyxcbiAgICAgICAgICAgICfgqasnOiAnNScsXG4gICAgICAgICAgICAn4KmsJzogJzYnLFxuICAgICAgICAgICAgJ+CprSc6ICc3JyxcbiAgICAgICAgICAgICfgqa4nOiAnOCcsXG4gICAgICAgICAgICAn4KmvJzogJzknLFxuICAgICAgICAgICAgJ+Cppic6ICcwJyxcbiAgICAgICAgfTtcblxuICAgIHZhciBwYUluID0gbW9tZW50LmRlZmluZUxvY2FsZSgncGEtaW4nLCB7XG4gICAgICAgIC8vIFRoZXJlIGFyZSBtb250aHMgbmFtZSBhcyBwZXIgTmFuYWtzaGFoaSBDYWxlbmRhciBidXQgdGhleSBhcmUgbm90IHVzZWQgYXMgcmlnaWRseSBpbiBtb2Rlcm4gUHVuamFiaS5cbiAgICAgICAgbW9udGhzOiAn4Kic4Kio4Ki14Kiw4KmAX+Coq+CovOCosOCoteCosOCpgF/gqK7gqL7gqLDgqJpf4KiF4Kiq4KmN4Kiw4KmI4KiyX+CoruCoiF/gqJzgqYLgqKhf4Kic4KmB4Kiy4Ki+4KiIX+CoheCol+CouOCop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aWdpZGx5IGluIG1vZGVybiBQdW5qYWJpLlxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv4Kiw4Ki+4KikfOCouOCoteCph+CosHzgqKbgqYHgqKrgqLngqL/gqLB84Ki44Ki84Ki+4KiuLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn4Kiw4Ki+4KikJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyIDwgNCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4Ki44Ki14KmH4KiwJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CopuCpgeCoquCoueCov+CosCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4Ki44Ki84Ki+4KiuJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CosOCovuCopCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Ki44Ki14KmH4KiwJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG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aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgbW9udGhzTm9taW5hdGl2ZSA9XG4gICAgICAgICAgICAnc3R5Y3plxYRfbHV0eV9tYXJ6ZWNfa3dpZWNpZcWEX21hal9jemVyd2llY19saXBpZWNfc2llcnBpZcWEX3dyemVzaWXFhF9wYcW6ZHppZXJuaWtfbGlzdG9wYWRfZ3J1ZHppZcWEJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIG1vbnRoc1N1YmplY3RpdmUgPVxuICAgICAgICAgICAgJ3N0eWN6bmlhX2x1dGVnb19tYXJjYV9rd2lldG5pYV9tYWphX2N6ZXJ3Y2FfbGlwY2Ffc2llcnBuaWFfd3J6ZcWbbmlhX3Bhxbpkemllcm5pa2FfbGlzdG9wYWRhX2dydWRuaWEnLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgbW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXnN0eS9pLFxuICAgICAgICAgICAgL15sdXQvaSxcbiAgICAgICAgICAgIC9ebWFyL2ksXG4gICAgICAgICAgICAvXmt3aS9pLFxuICAgICAgICAgICAgL15tYWovaSxcbiAgICAgICAgICAgIC9eY3plL2ksXG4gICAgICAgICAgICAvXmxpcC9pLFxuICAgICAgICAgICAgL15zaWUvaSxcbiAgICAgICAgICAgIC9ed3J6L2ksXG4gICAgICAgICAgICAvXnBhxbovaSxcbiAgICAgICAgICAgIC9ebGlzL2ksXG4gICAgICAgICAgICAvXmdydS9pLFxuICAgICAgICBdO1xuICAgIGZ1bmN0aW9uIHBsdXJhbChuKSB7XG4gICAgICAgIHJldHVybiBuICUgMTAgPCA1ICYmIG4gJSAxMCA+IDEgJiYgfn4obiAvIDEwKSAlIDEwICE9PSAxO1xuICAgIH1cbiAgICBmdW5jdGlvbiB0cmFuc2xhdGUobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXkpIHtcbiAgICAgICAgdmFyIHJlc3VsdCA9IG51bWJlciArICcgJztcbiAgICAgICAgc3dpdGNoIChrZXkpIHtcbiAgICAgICAgICAgIGNhc2UgJ3NzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ3Nla3VuZHknIDogJ3Nla3VuZCcpO1xuICAgICAgICAgICAgY2FzZSAnbSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyAnbWludXRhJyA6ICdtaW51dMSZJztcbiAgICAgICAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ21pbnV0eScgOiAnbWludXQnKTtcbiAgICAgICAgICAgIGNhc2UgJ2gnOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4ID8gJ2dvZHppbmEnIDogJ2dvZHppbsSZJztcbiAgICAgICAgICAgIGNhc2UgJ2hoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ2dvZHppbnknIDogJ2dvZHppbicpO1xuICAgICAgICAgICAgY2FzZSAnd3cnOlxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAndHlnb2RuaWUnIDogJ3R5Z29kbmknKTtcbiAgICAgICAgICAgIGNhc2UgJ01NJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ21pZXNpxIVjZScgOiAnbWllc2nEmWN5Jyk7XG4gICAgICAgICAgICBjYXNlICd5eSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVt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05kX1BuX1d0X8Wacl9Del9QdF9Tbycuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tEemnFmyBvXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW0p1dHJvIG9dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW1cgbmllZHppZWzEmSBvXSBMVCc7XG5cbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbV2Ugd3RvcmVrIG9dIExUJztcblxuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tXIMWbcm9kxJkgb10gTFQnO1xuXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW1cgc29ib3TEmSBvXSBMVCc7XG5cbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW1ddIGRkZGQgW29dIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogJ1tXY3pvcmFqIG9dIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW1cgemVzesWCxIUgbmllZHppZWzEmSBvXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW1cgemVzesWCxIUgxZtyb2TEmSBvXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW1cgemVzesWCxIUgc29ib3TEmSBvXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tXIHplc3rFgnldIGRkZGQgW29dIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICd6YSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgdGVtdScsXG4gICAgICAgICAgICBzOiAna2lsa2Egc2VrdW5kJyxcbiAgICAgICAgICAgIHNzOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBtOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBtbTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgaDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgaGg6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGQ6ICcxIGR6aWXFhCcsXG4gICAgICAgICAgICBkZDogJyVkIGRuaScsXG4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AgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIFtkZV0gTU1NTSBbZGVdIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBbZGVdIE1NTU0gW2RlXSBZWVlZIFvDoHNdIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIFtkZV0gTU1NTSBbZGVdIFlZWVkgW8Ogc10gSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tIb2plIMOgc10gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tBbWFuaMOjIMOgc10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvDoHNdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbT250ZW0gw6BzXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmRheSgpID09PSAwIHx8IHRoaXMuZGF5KCkgPT09IDZcbiAgICAgICAgICAgICAgICAgICAgPyAnW8OabHRpbW9dIGRkZGQgW8Ogc10gTFQnIC8vIFNhdHVyZGF5ICsgU3VuZGF5XG4gICAgICAgICAgICAgICAgICAgIDogJ1vDmmx0aW1hXSBkZGRkIFvDoHNdIExUJzsgLy8gTW9uZGF5IC0gRnJpZGF5XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdlbSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnaMOhICVzJyxcbiAgICAgICAgICAgIHM6ICdwb3Vjb3Mgc2VndW5kb3MnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWd1bmRvcycsXG4gICAgICAgICAgICBtOiAndW0gbWludXRvJyxcbiAgICAg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dIE1NTU0gW2RlXSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIFtkZV0gTU1NTSBbZGVdIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tIb2plIMOgc10gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tBbWFuaMOjIMOgc10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvDoHNdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbT250ZW0gw6BzXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmRheSgpID09PSAwIHx8IHRoaXMuZGF5KCkgPT09IDZcbiAgICAgICAgICAgICAgICAgICAgPyAnW8OabHRpbW9dIGRkZGQgW8Ogc10gTFQnIC8vIFNhdHVyZGF5ICsgU3VuZGF5XG4gICAgICAgICAgICAgICAgICAgIDogJ1vDmmx0aW1hXSBkZGRkIFvDoHNdIExUJzsgLy8gTW9uZGF5IC0gRnJpZGF5XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdlbSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnaMOhICVzJyxcbiAgICAgICAgICAgIHM6ICdzZWd1bmRvcycsXG4gICAgICAgICAgICBzczogJyVkIHNlZ3VuZG9zJyxcbiAgICAgICAgICAgIG06ICd1bSBtaW51dG8nLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dG9zJyxcbiAgICAgICAgICAgIGg6ICd1bWEgaG9yYScsXG4gICAgICAgICAgICBoaDogJyVkIGhvcmFzJyxcbiAgICAgICAgICAgIGQ6ICd1bSBkaWEnLFxuICAgICA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YgdHlwZW9mIHJlcXVpcmUgPT09ICdmdW5jdGlvbicgPyBmYWN0b3J5KHJlcXVpcmUoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICBmdW5jdGlvbiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsKG51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5KSB7XG4gICAgICAgIHZhciBmb3JtYXQgPSB7XG4gICAgICAgICAgICAgICAgc3M6ICdzZWN1bmRlJyxcbiAgICAgICAgICAgICAgICBtbTogJ21pbnV0ZScsXG4gICAgICAgICAgICAgICAgaGg6ICdvcmUnLFxuICAgICAgICAgICAgICAgIGRkOiAnemlsZScsXG4gICAgICAgICAgICAgICAgd3c6ICdzxINwdMSDbcOibmknLFxuICAgICAgICAgICAgICAgIE1NOiAnbHVuaScsXG4gICAgICAgICAgICAgICAgeXk6ICdhbmknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNlcGFyYXRvciA9ICcgJztcbiAgICAgICAgaWYgKG51bWJlciAlIDEwMCA+PSAyMCB8fCAobnVtYmVyID49IDEwMCAmJiBudW1iZXIgJSAxMDAgPT09IDApKSB7XG4gICAgICAgICAgICBzZXBhcmF0b3IgPSAnIGRlICc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bWJlciArIHNlcGFyYXRvciArIGZvcm1hdFtrZXldO1xuICAgIH1cblxuICAgIHZhciBybyA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ3JvJywge1xuICAgICAgICBtb250aHM6ICdpYW51YXJpZV9mZWJydWFyaWVfbWFydGllX2FwcmlsaWVfbWFpX2l1bmllX2l1bGllX2F1Z3VzdF9zZXB0ZW1icmllX29jdG9tYnJpZV9ub2llbWJyaWVfZGVjZW1icmllJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICdpYW4uX2ZlYi5fbWFydC5fYXByLl9tYWlfaXVuLl9pdWwuX2F1Zy5fc2VwdC5fb2N0Ll9ub3YuX2RlYy4nLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgbW9udGhzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgd2Vla2RheXM6ICdkdW1pbmljxINfbHVuaV9tYXLIm2lfbWllcmN1cmlfam9pX3ZpbmVyaV9zw6JtYsSDdMSDJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnRHVtX0x1bl9NYXJfTWllX0pvaV9WaW5fU8OibScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdEdV9MdV9NYV9NaV9Kb19WaV9Tw6InLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1themkgbGFdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbbcOiaW5lIGxhXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2xhXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2llcmkgbGFdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW2Zvc3RhXSBkZGRkIFtsYV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdwZXN0ZSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgw65uIHVybcSDJyxcbiAgICAgICAgICAgIHM6ICdjw6J0ZXZhIHNlY3VuZGUnLFxuICAgICAgICAgICAgc3M6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBtOiAndW4gbWludXQnLFxuICAgICAgICAgICAgbW06IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBoOiAnbyBvcsSDJyxcbiAgICAgICAgICAgIGhoOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgZDogJ28gemknLFxuICAgICAgICAgICAgZGQ6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICB3OiAnbyBzxINwdMSDbcOibsSDJyxcbiAgICAgICAgICAgIHd3OiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgTTogJ28gbHVuxIMnLFxuICAgICAgICAgICAgTU06IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICB5OiAndW4gYW4nLFxuICAgICAgICAgICAgeXk6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICB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wufNC+0LrRglxcLnzQvdC+0Y/QsT9cXC580LTQtdC6XFwuKS9pLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWSDQsy4nLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkg0LMuLCBIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSDQsy4sIEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vQodC10LPQvtC00L3Rjywg0LJdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb0JfQsNCy0YLRgNCwLCDQsl0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vQktGH0LXRgNCwLCDQsl0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uIChub3cpIHtcbiAgICAgICAgICAgICAgICBpZiAobm93LndlZWsoKSAhPT0gdGhpcy53ZWVrKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JIg0YHQu9C10LTRg9GO0YnQtdC1XSBkZGRkLCBb0LJdIExUJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vQkiDRgdC70LXQtNGD0Y7RidC40LldIGRkZGQsIFvQsl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9CSINGB0LvQtdC00YPRjtGJ0YPRjl0gZGRkZCwgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5kYXkoKSA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JLQvl0gZGRkZCwgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vQkl0gZGRkZCwgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uIChub3cpIHtcbiAgICAgICAgICAgICAgICBpZiAobm93LndlZWsoKSAhPT0gdGhpcy53ZWVrKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JIg0L/RgNC+0YjQu9C+0LVdIGRkZGQsIFvQsl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9CSINC/0YDQvtGI0LvRi9C5XSBkZGRkLCBb0LJdIExUJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vQkiDQv9GA0L7RiNC70YPRjl0gZGRkZCwgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5kYXkoKSA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JLQvl0gZGRkZCwgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vQkl0gZGRkZCwgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfRh9C10YDQtdC3ICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDQvdCw0LfQsNC0JyxcbiAgICAgICAgICAgIHM6ICfQvdC10YHQutC+0LvRjNC60L4g0YHQtdC60YPQvdC0JyxcbiAgICAgICAgICAgIHNzOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgbTogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIG1tOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgaDogJ9GH0LDRgScsXG4gICAgICAgICAgICBoaDogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIGQ6ICfQtNC10L3RjCcsXG4gICAgICAgICAgICBkZDogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIHc6ICfQvdC10LTQtdC70Y8nLFxuICAgICAgICAgICAgd3c6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBNOiAn0LzQtdGB0Y/RhicsXG4gICAgICAgICAgICBNTTogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIHk6ICfQs9C+0LQnLFxuICAgICAgICAgICAgeXk6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/QvdC+0YfQuHzRg9GC0YDQsHzQtNC90Y980LLQtdGH0LXRgNCwL2ksXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuIC9eKNC00L3Rj3zQstC10YfQtdGA0LApJC8udGVzdChpbnB1dCk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9C90L7Rh9C4JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfRg9GC0YDQsCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNykge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0LTQvdGPJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfQstC10YfQtdGA0LAnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0tKNC5fNCz0L580Y8pLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RERCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdC5JztcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct0LPQvic7XG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdGPJztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gcnU7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogU2luZGhpIFtzZF1cbi8vISBhdXRob3IgOiBOYXJhaW4gU2FnYXIgOiBodHRwczovL2dpdGh1Yi5jb20vbmFyYWluc2FnYXJcblxuOyhmdW5jdGlvbiAoZ2xvYmFsLCBmYWN0b3J5KSB7XG4gICB0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZSAhPT0gJ3VuZGVmaW5lZCdcbiAgICAgICAmJiB0eXBlb2YgcmVxdWlyZSA9PT0gJ2Z1bmN0aW9uJyA/IGZhY3RvcnkocmVxdWlyZSgnLi4vbW9tZW50JykpIDpcbiAgIHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBtb250aHMgPSBbXG4gICAgICAgICAgICAn2KzZhtmI2LHZiicsXG4gICAgICAgICAgICAn2YHZitio2LHZiNix2YonLFxuICAgICAgICAgICAgJ9mF2KfYsdqGJyxcbiAgICAgICAgICAgICfYp9m+2LHZitmEJyxcbiAgICAgICAgICAgICfZhdim2YonLFxuICAgICAgICAgICAgJ9is2YjZhicsXG4gICAgICAgICAgICAn2KzZiNmE2KfYodmQJyxcbiAgICAgICAgICAgICfYotqv2LPZvScsXG4gICAgICAgICAgICAn2LPZitm+2b3Zhdio2LEnLFxuICAgICAgICAgICAgJ9ii2qrZvdmI2KjYsScsXG4gICAgICAgICAgICAn2YbZiNmF2KjYsScsXG4gICAgICAgICAgICAn2orYs9mF2KjYsScsXG4gICAgICAgIF0sXG4gICAgICAgIGRheXMgPSBbJ9ii2obYsScsICfYs9mI2YXYsScsICfYp9qx2KfYsdmIJywgJ9in2LHYqNi5JywgJ9iu2YXZitizJywgJ9is2YXYuScsICfah9mG2ofYsSddO1xuXG4gICAgdmFyIHNkID0gbW9tZW50LmRlZmluZUxvY2FsZSgnc2QnLCB7XG4gICAgICAgIG1vbnRoczogbW9udGhzLFxuICAgICAgICBtb250aHNTaG9ydDogbW9udGhzLFxuICAgICAgICB3ZWVrZGF5czogZGF5cyxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogZGF5cyxcbiAgICAgICAgd2Vla2RheXNNaW46IGRheXMsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGTYjCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/Ytdio2K182LTYp9mFLyxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gJ9i02KfZhScgPT09IGlucHV0O1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn2LXYqNitJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAn2LTYp9mFJztcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb2KfahF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYs9qA2Kfau9mKXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9in2rPZitmGINmH2YHYqtmKINiq2YpdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2qrYp9mE2YfZh10gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb2q/Ystix2YrZhCDZh9mB2KrZil0gZGRkZCBb2KrZil0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDZvtmI2KEnLFxuICAgICAgICAgICAgcGFzdDogJyVzINin2rMnLFxuICAgICAgICAgICAgczogJ9qG2YbYryDYs9mK2qrZhtqKJyxcbiAgICAgICAgICAgIHNzOiAnJWQg2LPZitqq2YbaiicsXG4gICAgICAgICAgICBtOiAn2YfaqiDZhdmG2b0nLFxuICAgICAgICAgICAgbW06ICclZCDZhdmG2b0nLFxuICAgICAgICAgICAgaDogJ9mH2qog2qrZhNin2qonLFxuICAgICAgICAgICAgaGg6ICclZCDaqtmE2KfaqicsXG4gICAgICAgICAgICBkOiAn2YfaqiDaj9mK2YbZh9mGJyxcbiAgICAgICAgICAgIGRkOiAnJWQg2o/ZitmG2YfZhicsXG4gICAgICAgICAgICBNOiAn2YfaqiDZhdmH2YrZhtmIJyxcbiAgICAgICAgICAgIE1NOiAnJWQg2YXZh9mK2YbYpycsXG4gICAgICAgICAgICB5OiAn2YfaqiDYs9in2YQnLFxuICAgICAgICAgICAgeXk6ICclZCDYs9in2YQnLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC/YjC9nLCAnLCcpO1xuICAgICAgICB9LFxuICAgICAgICBwb3N0Zm9ybWF0OiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoLywvZywgJ9iMJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQg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dkZGRkIFt0aV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tpa3RlIHRpXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tvdmRkaXRdIGRkZGQgW3RpXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVzIGdlYcW+ZXMnLFxuICAgICAgICAgICAgcGFzdDogJ21hxYtpdCAlcycsXG4gICAgICAgICAgICBzOiAnbW9hZGRlIHNla3VuZGRhdCcsXG4gICAgICAgICAgICBzczogJyVkIHNla3VuZGRhdCcsXG4gICAgICAgICAgICBtOiAnb2t0YSBtaW51aHRhJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludWh0YXQnLFxuICAgICAgICAgICAgaDogJ29rdGEgZGlpbW11JyxcbiAgICAgICAgICAgIGhoOiAnJWQgZGlpbW11dCcsXG4gICAgICAgICAgICBkOiAnb2t0YSBiZWFpdmknLFxuICAgICAgICAgICAgZGQ6ICclZCBiZWFpdnZpdCcsXG4gICAgICAgICAgICBNOiAnb2t0YSBtw6FubnUnLFxuICAgICAgICAgICAgTU06ICclZCBtw6FudXQnLFxuICAgICAgICAgICAgeTogJ29rdGEgamFoa2knLFxuICAgICAgICAgICAgeXk6ICclZCBqYWdpdCcsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfVxcLi8sXG4gICAgICAgIG9yZGluYWw6ICclZC4nLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllY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OiB7XG4gICAgICAgICAgICBMVDogJ2EgaDptbScsXG4gICAgICAgICAgICBMVFM6ICdhIGg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ1lZWVkvTU0vREQnLFxuICAgICAgICAgICAgTEw6ICdZWVlZIE1NTU0gRCcsXG4gICAgICAgICAgICBMTEw6ICdZWVlZIE1NTU0gRCwgYSBoOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdZWVlZIE1NTU0gRCBb4LeA4LeQ4Lax4LeSXSBkZGRkLCBhIGg6bW06c3MnLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vgtoXgtq9dIExUW+C2p10nLFxuICAgICAgICAgICAgbmV4dERheTogJ1vgt4Tgt5ngtqddIExUW+C2p10nLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIExUW+C2p10nLFxuICAgICAgICAgICAgbGFzdERheTogJ1vgtorgtrrgt5pdIExUW+C2p10nLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb4La04LeD4LeU4Lac4LeS4La6XSBkZGRkIExUW+C2p10nLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclc+C2muC3kuC2seC3iicsXG4gICAgICAgICAgICBwYXN0OiAnJXPgtprgtqcg4La04LeZ4La7JyxcbiAgICAgICAgICAgIHM6ICfgtq3gtq3gt4rgtrTgtrsg4Laa4LeS4LeE4LeS4La04La6JyxcbiAgICAgICAgICAgIHNzOiAn4Lat4Lat4LeK4La04La7ICVkJyxcbiAgICAgICAgICAgIG06ICfgtrjgt5LgtrHgt5Lgtq3gt4rgtq3gt5Tgt4AnLFxuICAgICAgICAgICAgbW06ICfgtrjgt5LgtrHgt5Lgtq3gt4rgtq3gt5QgJWQnLFxuICAgICAgICAgICAgaDogJ+C2tOC3kOC2uicsXG4gIC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dSc7XG4gICAgICAgICAgICBjYXNlICdtbSc6IC8vIDkgbWludXRlcyAvIGluIDkgbWludXRlcyAvIDkgbWludXRlcyBhZ29cbiAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ21pbsO6dHknIDogJ21pbsO6dCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnbWluw7p0YW1pJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlICdoJzogLy8gYW4gaG91ciAvIGluIGFuIGhvdXIgLyBhbiBob3VyIGFnb1xuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4ID8gJ2hvZGluYScgOiBpc0Z1dHVyZSA/ICdob2RpbnUnIDogJ2hvZGlub3UnO1xuICAgICAgICAgICAgY2FzZSAnaGgnOiAvLyA5IGhvdXJzIC8gaW4gOSBob3VycyAvIDkgaG91cnMgYWdvXG4gICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdob2RpbnknIDogJ2hvZMOtbicpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnaG9kaW5hbWknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgJ2QnOiAvLyBhIGRheSAvIGluIGEgZGF5IC8gYSBkYXkgYWdvXG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnZGXFiCcgOiAnZMWIb20nO1xuICAgICAgICAgICAgY2FzZSAnZGQnOiAvLyA5IGRheXMgLyBpbiA5IGRheXMgLyA5IGRheXMgYWdvXG4gICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdkbmknIDogJ2Ruw60nKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ2TFiGFtaSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSAnTSc6IC8vIGEgbW9udGggLyBpbiBhIG1vbnRoIC8gYSBtb250aCBhZ29cbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdtZXNpYWMnIDogJ21lc2lhY29tJztcbiAgICAgICAgICAgIGNhc2UgJ01NJzogLy8gOSBtb250aHMgLyBpbiA5IG1vbnRocyAvIDkgbW9udGhzIGFnb1xuICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAnbWVzaWFjZScgOiAnbWVzaWFjb3YnKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ21lc2lhY21pJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlICd5JzogLy8gYSB5ZWFyIC8gaW4gYSB5ZWFyIC8gYSB5ZWFyIGFnb1xuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ3JvaycgOiAncm9rb20nO1xuICAgICAgICAgICAgY2FzZSAneXknOiAvLyA5IHllYXJzIC8gaW4gOSB5ZWFycyAvIDkgeWVhcnMgYWdvXG4gICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdyb2t5JyA6ICdyb2tvdicpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAncm9rbWknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBzayA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ3NrJywge1xuICAgICAgICBtb250aHM6IG1vbnRocyxcbiAgICAgICAgbW9udGhzU2hvcnQ6IG1vbnRoc1Nob3J0LFxuICAgICAgICB3ZWVrZGF5czogJ25lZGXEvmFfcG9uZGVsb2tfdXRvcm9rX3N0cmVkYV/FoXR2cnRva19waWF0b2tfc29ib3RhJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnbmVfcG9fdXRfc3RfxaF0X3BpX3NvJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ25lX3BvX3V0X3N0X8WhdF9waV9zbycuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSDptbScsXG4gICAgICAgICAgICBMVFM6ICdIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRC4gTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QuIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQuIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbZG5lcyBvXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW3phanRyYSBvXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2IG5lZGXEvnUgb10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ZdIGRkZGQgW29dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdiBzdHJlZHUgb10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2byDFoXR2cnRvayBvXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3YgcGlhdG9rIG9dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdiBzb2JvdHUgb10gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiAnW3bEjWVyYSBvXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1ttaW51bMO6IG5lZGXEvnUgb10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW21pbnVsw71dIGRkZGQgW29dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbbWludWzDuiBzdHJlZHUgb10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW21pbnVsw71dIGRkZGQgW29dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbbWludWzDuiBzb2JvdHUgb10gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ3phICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdwcmVkICVzJyxcbiAgICAgICAgICAgIHM6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIHNzOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBtOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBtbTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgaDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgaGg6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGQ6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGRkOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBNOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBNTTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgeTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgeXk6IHRyYW5zbGF0ZSxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5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VyLCB3aXRob3V0U3VmZml4LCBrZXksIGlzRnV0dXJlKSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBudW1iZXIgKyAnICc7XG4gICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZVxuICAgICAgICAgICAgICAgICAgICA/ICduZWthaiBzZWt1bmQnXG4gICAgICAgICAgICAgICAgICAgIDogJ25la2FqIHNla3VuZGFtaSc7XG4gICAgICAgICAgICBjYXNlICdzcyc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCA/ICdzZWt1bmRvJyA6ICdzZWt1bmRpJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdzZWt1bmRpJyA6ICdzZWt1bmRhaCc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPCA1KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ3Nla3VuZGUnIDogJ3Nla3VuZGFoJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ3Nla3VuZCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdlbmEgbWludXRhJyA6ICdlbm8gbWludXRvJztcbiAgICAgICAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4ID8gJ21pbnV0YScgOiAnbWludXRvJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdtaW51dGknIDogJ21pbnV0YW1hJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA8IDUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbWludXRlJyA6ICdtaW51dGFtaSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbWludXQnIDogJ21pbnV0YW1pJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ2gnOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4ID8gJ2VuYSB1cmEnIDogJ2VubyB1cm8nO1xuICAgICAgICAgICAgY2FzZSAnaGgnOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggPyAndXJhJyA6ICd1cm8nO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ3VyaScgOiAndXJhbWEnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyIDwgNSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICd1cmUnIDogJ3VyYW1pJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICd1cicgOiAndXJhbWknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnZW4gZGFuJyA6ICdlbmltIGRuZW0nO1xuICAgICAgICAgICAgY2FzZSAnZGQnOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnZGFuJyA6ICdkbmVtJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdkbmknIDogJ2RuZXZvbWEnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ2RuaScgOiAnZG5ldmknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnZW4gbWVzZWMnIDogJ2VuaW0gbWVzZWNlbSc7XG4gICAgICAgICAgICBjYXNlICdNTSc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdtZXNlYycgOiAnbWVzZWNlbSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbWVzZWNhJyA6ICdtZXNlY2VtYSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPCA1KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ21lc2VjZScgOiAnbWVzZWNpJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdtZXNlY2V2JyA6ICdtZXNlY2knO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgY2FzZSAneSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnZW5vIGxldG8nIDogJ2VuaW0gbGV0b20nO1xuICAgICAgICAgICAgY2FzZSAneXknOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbGV0bycgOiAnbGV0b20nO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx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yksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnbmVfcG9fdG9fc3JfxI1lX3BlX3NvJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuIE1NLiBZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRC4gTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QuIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBELiBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2RhbmVzIG9iXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2p1dHJpIG9iXSBMVCcsXG5cbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ZdIFtuZWRlbGpvXSBbb2JdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdl0gW3NyZWRvXSBbb2JdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdl0gW3NvYm90b10gW29iXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ZdIGRkZGQgW29iXSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbdsSNZXJhaiBvYl0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbcHJlasWhbmpvXSBbbmVkZWxqb10gW29iXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ByZWrFoW5qb10gW3NyZWRvXSBbb2JdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbcHJlasWhbmpvXSBbc29ib3RvXSBbb2JdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbcHJlasWhbmppXSBkZGRkIFtvYl0gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ8SNZXogJXMnLFxuICAgICAgICAgICAgcGFzdDogJ3ByZWQgJXMnLFxuICAgICAgICAgICAgczogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAg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0UgU2h0dW7Dqycuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ0RpZV9Iw6tuX01hcl9Nw6tyX0Vual9QcmVfU2h0Jy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ0RfSF9NYV9Nw6tfRV9QX1NoJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC9QRHxNRC8sXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuIGlucHV0LmNoYXJBdCgwKSA9PT0gJ00nO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICByZXR1cm4gaG91cnMgPCAxMiA/ICdQRCcgOiAnTUQnO1xuICAgICAgICB9LFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW1NvdCBuw6tdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbTmVzw6tyIG7Dq10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtuw6tdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbRGplIG7Dq10gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFtlIGthbHVhciBuw6tdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnbsOrICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBtw6sgcGFyw6snLFxuICAgICAgICAgICAgczogJ2Rpc2Egc2Vrb25kYScsXG4gICAgICAgICAgICBzczogJyVkIHNla29uZGEnLFxuICAgICAgICAgICAgbTogJ25qw6sgbWludXTDqycsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0YScsXG4gICAgICAgICAgICBoOiAnbmrDqyBvcsOrJyxcbiAgICAgICAgICAgIGhoOiAnJWQgb3LDqycsXG4gICAgICAgICAgICBkOiAnbmrDqyBkaXTDqycsXG4gICAgICAgICAgICBkZDogJyVkIGRpdMOrJyxcbiAgICAgICAgICAgIE06ICduasOrIG11YWonLFxuICAgICAgICAgICAgTU06ICclZCBtdWFqJyxcbiAgICAgICAgICAgIHk6ICduasOrIHZpdCcsXG4gICAgICAgICAgICB5eTogJyVkIHZpdGUnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn1cXC4vLFxuICAgICAgICBvcmRpbmFsOiAnJWQuJyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIHNxO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyB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ZXR1cm4gbnVtYmVyICUgMTAgPT09IDEgPyB3b3JkS2V5WzBdIDogd29yZEtleVsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB3b3JkS2V5WzJdO1xuICAgICAgICB9LFxuICAgICAgICB0cmFuc2xhdGU6IGZ1bmN0aW9uIChudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSwgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgIHZhciB3b3JkS2V5ID0gdHJhbnNsYXRvci53b3Jkc1trZXldLFxuICAgICAgICAgICAgICAgIHdvcmQ7XG5cbiAgICAgICAgICAgIGlmIChrZXkubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICAgICAgLy8gTm9taW5hdGl2XG4gICAgICAgICAgICAgICAgaWYgKGtleSA9PT0gJ3knICYmIHdpdGhvdXRTdWZmaXgpIHJldHVybiAn0ZjQtdC00L3QsCDQs9C+0LTQuNC90LAnO1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gd29yZEtleVswXSA6IHdvcmRLZXlbMV07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHdvcmQgPSB0cmFuc2xhdG9yLmNvcnJlY3RHcmFtbWF0aWNhbENhc2UobnVtYmVyLCB3b3JkS2V5KTtcbiAgICAgICAgICAgIC8vIE5vbWluYXRpdlxuICAgICAgICAgICAgaWYgKGtleSA9PT0gJ3l5JyAmJiB3aXRob3V0U3VmZml4ICYmIHdvcmQgPT09ICfQs9C+0LTQuNC90YMnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcg0LPQvtC00LjQvdCwJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcgJyArIHdvcmQ7XG4gICAgICAgIH0sXG4gICAgfTtcblxuICAgIHZhciBzckN5cmwgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdzci1jeXJsJywge1xuIC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OiAnRC4gTS4gWVlZWS4nLFxuICAgICAgICAgICAgTEw6ICdELiBNTU1NIFlZWVkuJyxcbiAgICAgICAgICAgIExMTDogJ0QuIE1NTU0gWVlZWS4gSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRC4gTU1NTSBZWVlZLiBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb0LTQsNC90LDRgSDRg10gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vRgdGD0YLRgNCwINGDXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vRg10gW9C90LXQtNC10ZnRg10gW9GDXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9GDXSBb0YHRgNC10LTRg10gW9GDXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9GDXSBb0YHRg9Cx0L7RgtGDXSBb0YNdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0YNdIGRkZGQgW9GDXSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb0ZjRg9GH0LUg0YNdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGxhc3RXZWVrRGF5cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgJ1vQv9GA0L7RiNC70LVdIFvQvdC10LTQtdGZ0LVdIFvRg10gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW9C/0YDQvtGI0LvQvtCzXSBb0L/QvtC90LXQtNC10ZnQutCwXSBb0YNdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1vQv9GA0L7RiNC70L7Qs10gW9GD0YLQvtGA0LrQsF0gW9GDXSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdb0L/RgNC+0YjQu9C1XSBb0YHRgNC10LTQtV0gW9GDXSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdb0L/RgNC+0YjQu9C+0LNdIFvRh9C10YLQstGA0YLQutCwXSBb0YNdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1vQv9GA0L7RiNC70L7Qs10gW9C/0LXRgtC60LBdIFvRg10gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW9C/0YDQvtGI0LvQtV0gW9GB0YPQsdC+0YLQtV0gW9GDXSBMVCcsXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbGFzdFdlZWtEYXlzW3RoaXMuZGF5KCldO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn0LfQsCAlcycsXG4gICAgICAgICAgICBwYXN0OiAn0L/RgNC1ICVzJyxcbiAgICAgICAgICAgIHM6ICfQvdC10LrQvtC70LjQutC+INGB0LXQutGD0L3QtNC4JyxcbiAgICAgICAgICAgIHNzOiB0cmFuc2xhdG9yLnRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG06IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICA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plZGFuIG1lc2VjJywgJ2plZG5vZyBtZXNlY2EnXSxcbiAgICAgICAgICAgIE1NOiBbJ21lc2VjJywgJ21lc2VjYScsICdtZXNlY2knXSxcbiAgICAgICAgICAgIHk6IFsnamVkbnUgZ29kaW51JywgJ2plZG5lIGdvZGluZSddLFxuICAgICAgICAgICAgeXk6IFsnZ29kaW51JywgJ2dvZGluZScsICdnb2RpbmEnXSxcbiAgICAgICAgfSxcbiAgICAgICAgY29ycmVjdEdyYW1tYXRpY2FsQ2FzZTogZnVuY3Rpb24gKG51bWJlciwgd29yZEtleSkge1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIG51bWJlciAlIDEwID49IDEgJiZcbiAgICAgICAgICAgICAgICBudW1iZXIgJSAxMCA8PSA0ICYmXG4gICAgICAgICAgICAgICAgKG51bWJlciAlIDEwMCA8IDEwIHx8IG51bWJlciAlIDEwMCA+PSAyMClcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgJSAxMCA9PT0gMSA/IHdvcmRLZXlbMF0gOiB3b3JkS2V5WzFdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHdvcmRLZXlbMl07XG4gICAgICAgIH0sXG4gICAgICAgIHRyYW5zbGF0ZTogZnVuY3Rpb24gKG51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5LCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgdmFyIHdvcmRLZXkgPSB0cmFuc2xhdG9yLndvcmRzW2tleV0sXG4gICAgICAgICAgICAgICAgd29yZDtcblxuICAgICAgICAgICAgaWYgKGtleS5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgICAgICAvLyBOb21pbmF0aXZcbiAgICAgICAgICAgICAgICBpZiAoa2V5ID09PSAneScgJiYgd2l0aG91dFN1ZmZpeCkgcmV0dXJuICdqZWRuYSBnb2RpbmEnO1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0Z1dHVyZSB8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i4nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnbmVfcG9fdXRfc3JfxI1lX3BlX3N1Jy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnRC4gTS4gWVlZWS4nLFxuICAgICAgICAgICAgTEw6ICdELiBNTU1NIFlZWVkuJyxcbiAgICAgICAgICAgIExMTDogJ0QuIE1NTU0gWVlZWS4gSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRC4gTU1NTSBZWVlZLiBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbZGFuYXMgdV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tzdXRyYSB1XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBbbmVkZWxqdV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdV0gW3NyZWR1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBbc3Vib3R1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBkZGRkIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbanXEjWUgdV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgbGFzdFdlZWtEYXlzID0gW1xuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbGVdIFtuZWRlbGplXSBbdV0gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbG9nXSBbcG9uZWRlbGprYV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxvZ10gW3V0b3JrYV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxlXSBbc3JlZGVdIFt1XSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdbcHJvxaFsb2ddIFvEjWV0dnJ0a2FdIFt1XSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdbcHJvxaFsb2ddIFtwZXRrYV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxlXSBbc3Vib3RlXSBbdV0gTFQnLFxuICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgcmV0dXJuIGxhc3RXZWVrRGF5c1t0aGlzLmRheSgpXTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ3phICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdwcmUgJXMnLFxuICAgICAgICAgICAgczogJ25la29saWtvIHNla3VuZGknLFxuICAgICAgICAgICAgc3M6IHRyYW5zbGF0b3IudHJhbnNsYXRl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RheXNTaG9ydDogJ0xpc19VbWJfTHNiX0xlc19Mc2lfTHNoX1VtZycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdMaV9Vc19MYl9MdF9Mc19MaF9VZycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdoOm1tIEEnLFxuICAgICAgICAgICAgTFRTOiAnaDptbTpzcyBBJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgaDptbSBBJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBoOm1tIEEnLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tOYW11aGxhIG5nYV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tLdXNhc2EgbmdhXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW25nYV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tJdG9sbyBuZ2FdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbbGVsaXBoZWxpbGVdIFtuZ2FdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnbmdhICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICd3ZW50ZWthIG5nYSAlcycsXG4gICAgICAgICAgICBzOiAnZW1penV6d2FuYSBsb21jYW5lJyxcbiAgICAgICAgICAgIHNzOiAnJWQgbXp1endhbmEnLFxuICAgICAgICAgICAgbTogJ3VtenV6dScsXG4gICAgICAgICAgICBtbTogJyVkIGVtaXp1enUnLFxuICAgICAgICAgICAgaDogJ2xpaG9yYScsXG4gICAgICAgICAgICBoaDogJyVkIGVtYWhvcmEnLFxuICAgICAgICAgICAgZDogJ2xpbGFuZ2EnLFxuICAgICAgICAgICAgZGQ6ICclZCBlbWFsYW5nYScsXG4gICAgICAgICAgICBNOiAnaW55YW5nYScsXG4gICAgICAgICAgICBNTTogJyVkIHRpbnlhbmdhJyxcbiAgICAgICAgICAgIHk6ICd1bW55YWthJyxcbiAgICAgICAgICAgIHl5OiAnJWQgaW1pbnlha2EnLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvZWt1c2VuaXxlbWluaXxlbnRzYW1iYW1hfGVidXN1a3UvLFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91cnMgPCAxMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZWt1c2VuaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXJzIDwgMTUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2VtaW5pJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91cnMgPCAxOSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZW50c2FtYmFtYSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZWJ1c3VrdSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ2VrdXNlbmknKSB7XG4gICAgICA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AgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnWVlZWS1NTS1ERCcsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIFtrbC5dIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBZWVlZIFtrbC5dIEhIOm1tJyxcbiAgICAgICAgICAgIGxsbDogJ0QgTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgbGxsbDogJ2RkZCBEIE1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSWRhZ10gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tJbW9yZ29uXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0lnw6VyXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1tQw6VdIGRkZGQgTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbSV0gZGRkZFtzXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ29tICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdmw7ZyICVzIHNlZGFuJyxcbiAgICAgICAgICAgIHM6ICduw6VncmEgc2VrdW5kZXInLFxuICAgICAgICAgICAgc3M6ICclZCBzZWt1bmRlcicsXG4gICAgICAgICAgICBtOiAnZW4gbWludXQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGVyJyxcbiAgICAgICAgICAgIGg6ICdlbiB0aW1tZScsXG4gICAgICAgICAgICBoaDogJyVkIHRpbW1hcicsXG4gICAgICAgICAgICBkOiAnZW4gZGFnJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGFnYXInLFxuICAgICAgICAgICAgTTogJ2VuIG3DpW5hZCcsXG4gICAgICAgICAgICBNTTogJyVkIG3DpW5hZGVyJyxcbiAgICAgICAgICAgIHk6ICdldHQgw6VyJyxcbiAgICAgICAgICAgIHl5OiAnJWQgw6VyJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KFxcOmV8XFw6YSkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYiA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgICAgIH5+KChudW1iZXIgJSAxMDApIC8gMTApID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICc6ZSdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/ICc6YSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnOmEnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICc6ZSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJzplJztcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBzdjtcblxufSkpKTt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tYXRhbm9fQWxoYW1pc2lfSWp1bWFhX0p1bWFtb3NpJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICdKcGxfSnRhdF9Kbm5lX0p0YW5fQWxoX0lqbV9KbW9zJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ0oyX0ozX0o0X0o1X0FsX0lqX0oxJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ2hoOm1tIEEnLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tsZW8gc2FhXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2tlc2hvIHNhYV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdbd2lraSBpamF5b10gZGRkZCBbc2FhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tqYW5hXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1t3aWtpIGlsaXlvcGl0YV0gZGRkZCBbc2FhdF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyBiYWFkYXllJyxcbiAgICAgICAgICAgIHBhc3Q6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lb2YgcmVxdWlyZSA9PT0gJ2Z1bmN0aW9uJyA/IGZhY3RvcnkocmVxdWlyZSgnLi4vbW9tZW50JykpIDpcbiAgIHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBzeW1ib2xNYXAgPSB7XG4gICAgICAgICAgICAxOiAn4K+nJyxcbiAgICAgICAgICAgIDI6ICfgr6gnLFxuICAgICAgICAgICAgMzogJ+CvqScsXG4gICAgICAgICAgICA0OiAn4K+qJyxcbiAgICAgICAgICAgIDU6ICfgr6snLFxuICAgICAgICAgICAgNjogJ+CvrCcsXG4gICAgICAgICAgICA3OiAn4K+tJyxcbiAgICAgICAgICAgIDg6ICfgr64nLFxuICAgICAgICAgICAgOTogJ+CvrycsXG4gICAgICAgICAgICAwOiAn4K+mJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ+Cvpyc6ICcxJyxcbiAgICAgICAgICAgICfgr6gnOiAnMicsXG4gICAgICAgICAgICAn4K+pJzogJzMnLFxuICAgICAgICAgICAgJ+Cvqic6ICc0JyxcbiAgICAgICAgICAgICfgr6snOiAnNScsXG4gICAgICAgICAgICAn4K+sJzogJzYnLFxuICAgICAgICAgICAgJ+CvrSc6ICc3JyxcbiAgICAgICAgICAgICfgr64nOiAnOCcsXG4gICAgICAgICAgICAn4K+vJzogJzknLFxuICAgICAgICAgICAgJ+Cvpic6ICcwJyxcbiAgICAgICAgfTtcblxuICAgIHZhciB0YSA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ3RhJywge1xuICAgICAgICBtb250aHM6ICfgrpzgrqngrrXgrrDgrr9f4K6q4K6/4K6q4K+N4K6w4K614K6w4K6/X+CuruCuvuCusOCvjeCumuCvjV/gro/grqrgr43grrDgrrLgr41f4K6u4K+HX+CunOCvguCuqeCvjV/grpzgr4LgrrLgr4hf4K6G4K6V4K644K+N4K6f4K+NX+CumuCvhuCuquCvjeCun+CvhuCuruCvjeCuquCusOCvjV/groXgrpXgr43grp/gr4fgrr7grqrgrrDgr41f4K6o4K614K6u4K+N4K6q4K6w4K+NX+Cun+Cuv+CumuCuruCvjeCuquCusOCvjScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAn4K6c4K6p4K614K6w4K6/X+CuquCuv+CuquCvjeCusOCuteCusOCuv1/grq7grr7grrDgr43grprgr41f4K6P4K6q4K+N4K6w4K6y4K+NX+CuruCvh1/grpzgr4Lgrqngr41f4K6c4K+C4K6y4K+IX+CuhuCuleCuuOCvjeCun+CvjV/grprgr4bgrqrgr43grp/gr4bgrq7gr43grqrgrrDgr41f4K6F4K6V4K+N4K6f4K+H4K6+4K6q4K6w4K+NX+CuqOCuteCuruCvjeCuquCusOCvjV/grp/grr/grprgrq7gr43grqrgrrDgr40nLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXM6XG4gICAgICAgICAgICAn4K6e4K6+4K6v4K6/4K6x4K+N4K6x4K+B4K6V4K+N4K6V4K6/4K604K6u4K+IX+CupOCuv+CumeCvjeCuleCun+CvjeCuleCuv+CutOCuruCviF/grprgr4bgrrXgr43grrXgrr7grq/gr43grpXgrr/grrTgrq7gr4hf4K6q4K+B4K6k4K6p4K+N4K6V4K6/4K604K6u4K+IX+CuteCuv+Cur+CuvuCutOCuleCvjeCuleCuv+CutOCuruCviF/grrXgr4bgrrPgr43grrPgrr/grpXgr43grpXgrr/grrTgrq7gr4hf4K6a4K6p4K6/4K6V4K+N4K6V4K6/4K604K6u4K+IJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfgrp7grr7grq/grr/grrHgr4Ff4K6k4K6/4K6Z4K+N4K6V4K6z4K+NX+CumuCvhuCuteCvjeCuteCuvuCur+CvjV/grqrgr4HgrqTgrqngr41f4K614K6/4K6v4K6+4K604K6p4K+NX+CuteCvhuCus+CvjeCus+Cuv1/grprgrqngrr8nLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn4K6e4K6+X+CupOCuv1/grprgr4Zf4K6q4K+BX+CuteCuv1/grrXgr4Zf4K6aJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZLCBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVksIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb4K6H4K6p4K+N4K6x4K+BXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+CuqOCuvuCus+CviF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkLCBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW+CuqOCvh+CuseCvjeCuseCvgV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb4K6V4K6f4K6o4K+N4K6kIOCuteCuvuCusOCuruCvjV0gZGRkZCwgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDgrofgrrLgr40nLFxuICAgICAgICAgICAgcGFzdDogJyVzIOCuruCvgeCuqeCvjScsXG4gICAgICAgICAgICBzOiAn4K6S4K6w4K+BIOCumuCuv+CusiDgrrXgrr/grqjgrr7grp/grr/grpXgrrPgr40nLFxuICAgICAgICAgICAgc3M6ICclZCDgrrXgrr/grqjgrr7grp/grr/grpXgrrPgr40nLFxuICAgICAgICAgICAgbTogJ+CukuCusOCvgSDgrqjgrr/grq7grr/grp/grq7gr40nLFxuICAgICAgICAgICAgbW06ICclZCDgrqjgrr/grq7grr/grp/grpngr43grpXgrrPgr40nLFxuICAgICAgICAgICAgaDogJ+CukuCusOCvgSDgrq7grqPgrr8g4K6o4K+H4K6w4K6u4K+NJyxcbiAgICAgICAgICAgIGhoOiAnJWQg4K6u4K6j4K6/IOCuqOCvh+CusOCuruCvjScsXG4gICAgICAgICAgICBkOiAn4K6S4K6w4K+BIOCuqOCuvuCus+CvjScsXG4gICAgICAgICAgICBkZDogJyVkIOCuqOCuvuCun+CvjeCuleCus+CvjScsXG4gICAgICAgICAgICBNOiAn4K6S4K6w4K+BIOCuruCuvuCupOCuruCvjScsXG4gICAgICAgICAgICBNTTogJyVkIOCuruCuvuCupOCumeCvjeCuleCus+CvjScsXG4gICAgICAgICAgICB5OiAn4K6S4K6w4K+BIOCuteCusOCvgeCun+CuruCvjScsXG4gICAgICAgICAgICB5eTogJyVkIOCuhuCuo+CvjeCun+CvgeCuleCus+CvjScsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfeCuteCupOCvgS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn4K614K6k4K+BJztcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvW+Cvp+CvqOCvqeCvquCvq+CvrOCvreCvruCvr+Cvpl0vZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC9cXGQvZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbE1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgLy8gcmVmZXIgaHR0cDovL3RhLndpa2lwZWRpYS5vcmcvcy8xZXIxXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/grq/grr7grq7grq7gr4184K614K+I4K6V4K6x4K+IfOCuleCuvuCusuCviHzgrqjgrqPgr43grqrgrpXgrrLgr4184K6O4K6x4K+N4K6q4K6+4K6f4K+BfOCuruCuvuCusuCviC8sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJyDgrq/grr7grq7grq7gr40nO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgNikge1xuICAgICAgICAgICAgICAgIHJldHVybiAnIOCuteCviOCuleCuseCviCc7IC8vIOCuteCviOCuleCuseCviFxuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJyDgrpXgrr7grrLgr4gnOyAvLyDgrpXgrr7grrLgr4hcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcg4K6o4K6j4K+N4K6q4K6V4K6y4K+NJzsgLy8g4K6o4K6j4K+N4K6q4K6V4K6y4K+NXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxOCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnIOCujuCuseCvjeCuquCuvuCun+CvgSc7IC8vIOCujuCuseCvjeCuquCuvuCun+CvgVxuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMjIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJyDgrq7grr7grrLgr4gnOyAvLyDgrq7grr7grrLgr4hcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcg4K6v4K6+4K6u4K6u4K+NJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn4K6v4K6+4K6u4K6u4K+NJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyIDwgMiA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4K614K+I4K6V4K6x4K+IJyB8fCBtZXJpZGllbSA9PT0gJ+CuleCuvuCusuCviCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgrqjgrqPgr43grqrgrpXgrrLgr40nKSB7XG4gICAgICAgICAgICAgIC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dDogJyVzIOCwleCxjeCwsOCwv+CwpOCwgicsXG4gICAgICAgICAgICBzOiAn4LCV4LGK4LCo4LGN4LCo4LC/IOCwleCxjeCwt+Cwo+CwvuCwsuCxgScsXG4gICAgICAgICAgICBzczogJyVkIOCwuOCxhuCwleCwqOCxjeCwsuCxgScsXG4gICAgICAgICAgICBtOiAn4LCS4LCVIOCwqOCwv+CwruCwv+Cwt+CwgicsXG4gICAgICAgICAgICBtbTogJyVkIOCwqOCwv+CwruCwv+Cwt+CwvuCwsuCxgScsXG4gICAgICAgICAgICBoOiAn4LCS4LCVIOCwl+CwguCwnycsXG4gICAgICAgICAgICBoaDogJyVkIOCwl+CwguCwn+CwsuCxgScsXG4gICAgICAgICAgICBkOiAn4LCS4LCVIOCwsOCxi+CwnOCxgScsXG4gICAgICAgICAgICBkZDogJyVkIOCwsOCxi+CwnOCxgeCwsuCxgScsXG4gICAgICAgICAgICBNOiAn4LCS4LCVIOCwqOCxhuCwsicsXG4gICAgICAgICAgICBNTTogJyVkIOCwqOCxhuCwsuCwsuCxgScsXG4gICAgICAgICAgICB5OiAn4LCS4LCVIOCwuOCwguCwteCwpOCxjeCwuOCwsOCwgicsXG4gICAgICAgICAgICB5eTogJyVkIOCwuOCwguCwteCwpOCxjeCwuOCwsOCwvuCwsuCxgScsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfeCwtS8sXG4gICAgICAgIG9yZGluYWw6ICclZOCwtScsXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gsLDgsL7gsKTgsY3gsLDgsL984LCJ4LCm4LCv4LCCfOCwruCwp+CxjeCwr+CwvuCwueCxjeCwqOCwgnzgsLjgsL7gsK/gsILgsKTgsY3gsLDgsIIvLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWVyaWRpZW0gPT09ICfgsLDgsL7gsKTgsY3gsLDgsL8nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPCA0ID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgsIngsKbgsK/gsIInKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4LCu4LCn4LGN4LCv4LC+4LC54LGN4LCo4LCCJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDEwID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgsLjgsL7gsK/gsILgsKTgsY3gsLDgsIInKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgNCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4LCw4LC+4LCk4LGN4LCw4LC/JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgsIngsKbgsK/gsIInO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CwruCwp+CxjeCwr+CwvuCwueCxjeCwqOCwgic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAyMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4LC44LC+4LCv4LCC4LCk4LGN4LCw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ISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW09oaW4gaWhhXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW0FiYW4gaWhhXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2loYV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tIb3Jpc2VpayBpaGFdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbc2VtYW5hIGtvdHVrXSBbaWhhXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2loYSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgbGl1YmEnLFxuICAgICAgICAgICAgczogJ3NlZ3VuZHUgYmFsdW4nLFxuICAgICAgICAgICAgc3M6ICdzZWd1bmR1ICVkJyxcbiAgICAgICAgICAgIG06ICdtaW51dHUgaWRhJyxcbiAgICAgICAgICAgIG1tOiAnbWludXR1ICVkJyxcbiAgICAgICAgICAgIGg6ICdvcmFzIGlkYScsXG4gICAgICAgICAgICBoaDogJ29yYXMgJWQnLFxuICAgICAgICAgICAgZDogJ2xvcm9uIGlkYScsXG4gICAgICAgICAgICBkZDogJ2xvcm9uICVkJyxcbiAgICAgICAgICAgIE06ICdmdWxhbiBpZGEnLFxuICAgICAgICAgICAgTU06ICdmdWxhbiAlZCcsXG4gICAgICAgICAgICB5OiAndGluYW4gaWRhJyxcbiAgICAgICAgICAgIHl5OiAndGluYW4gJWQnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oc3R8bmR8cmR8dGgpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIGIgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBvdXRwdXQgPVxuICAgICAgICAgICAgICAgICAgICB+figobnVtYmVyICUgMTAwKSAvIDEwKSA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgPyAndGgnXG4gICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnc3QnXG4gICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ25kJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gM1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAncmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICd0aCc7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgb3V0cHV0O1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gdGV0O1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IFRhamlrIFt0Z11cbi8vISBhdXRob3IgOiBPcmlmIE4uIEpyLiA6IGh0dHBzOi8vZ2l0aHViLmNvbS9vcmlmLWpyXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnXG4gICAg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vdC40Y8nLFxuICAgICAgICAgICAgbTogJ9GP0Log0LTQsNKb0LjSm9CwJyxcbiAgICAgICAgICAgIG1tOiAnJWQg0LTQsNKb0LjSm9CwJyxcbiAgICAgICAgICAgIGg6ICfRj9C6INGB0L7QsNGCJyxcbiAgICAgICAgICAgIGhoOiAnJWQg0YHQvtCw0YInLFxuICAgICAgICAgICAgZDogJ9GP0Log0YDTr9C3JyxcbiAgICAgICAgICAgIGRkOiAnJWQg0YDTr9C3JyxcbiAgICAgICAgICAgIE06ICfRj9C6INC80L7SsycsXG4gICAgICAgICAgICBNTTogJyVkINC80L7SsycsXG4gICAgICAgICAgICB5OiAn0Y/QuiDRgdC+0LsnLFxuICAgICAgICAgICAgeXk6ICclZCDRgdC+0LsnLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv0YjQsNCxfNGB0YPQsdKzfNGA06/Qt3zQsdC10LPQvtKzLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn0YjQsNCxJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyIDwgNCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn0YHRg9Cx0rMnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn0YDTr9C3Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDExID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfQsdC10LPQvtKzJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9GI0LDQsSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0YHRg9Cx0rMnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTYpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9GA06/Qtyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxOSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0LHQtdCz0L7Ssyc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0YjQsNCxJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9LSjRg9C8fNGO0LwpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIGEgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBiID0gbnVtYmVyID49IDEwMCA/IDEwMCA6IG51bGw7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgKHN1ZmZpeGVzW251bWJlcl0gfHwgc3VmZml4ZXNbYV0gfHwgc3VmZml4ZXNbYl0pO1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA3LCAvLyBUaGUgd2VlayB0aGF0IGNvb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1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSDguYDguKfguKXguLIgSDptbScsXG4gICAgICAgICAgICBMTExMOiAn4Lin4Lix4LiZZGRkZOC4l+C4teC5iCBEIE1NTU0gWVlZWSDguYDguKfguKXguLIgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/guIHguYjguK3guJnguYDguJfguLXguYjguKLguId84Lir4Lil4Lix4LiH4LmA4LiX4Li14LmI4Lii4LiHLyxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gaW5wdXQgPT09ICfguKvguKXguLHguIfguYDguJfguLXguYjguKLguIcnO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4LiB4LmI4Lit4LiZ4LmA4LiX4Li14LmI4Lii4LiHJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfguKvguKXguLHguIfguYDguJfguLXguYjguKLguIcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vguKfguLHguJnguJnguLXguYkg4LmA4Lin4Lil4LiyXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+C4nuC4o+C4uOC5iOC4h+C4meC4teC5iSDguYDguKfguKXguLJdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZFvguKvguJnguYnguLIg4LmA4Lin4Lil4LiyXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW+C5gOC4oeC4t+C5iOC4reC4p+C4suC4meC4meC4teC5iSDguYDguKfguKXguLJdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+C4p+C4seC4mV1kZGRkW+C4l+C4teC5iOC5geC4peC5ieC4pyDguYDguKfguKXguLJdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn4Lit4Li14LiBICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclc+C4l+C4teC5iOC5geC4peC5ieC4pycsXG4gICAgICAgICAgICBzOiAn4LmE4Lih4LmI4LiB4Li14LmI4Lin4Li04LiZ4Liy4LiX4Li1JyxcbiAgICAgICAgICAgIHNzOiAnJWQg4Lin4Li04LiZ4Liy4LiX4Li1JyxcbiAgICAgICAgICAgIG06ICcxIOC4meC4suC4l+C4tScsXG4gICAgICAgICAgICBtbTogJyVkIOC4meC4suC4l+C4tScsXG4gICAgICAgICAgICBoOiAnMSDguIrguLHguYjguKfguYLguKHguIcnLFxuICAgICAgICAgICAgaGg6ICclZCDguIrguLHguYjguKfguYLguKHguIcnLFxuICAgICAgICAgICAgZDogJzEg4Lin4Lix4LiZJyxcbiAgICAgICAgICAgIGRkOiAnJWQg4Lin4Lix4LiZJyxcbiAgICAgICAgICAgIHc6ICcxIOC4quC4seC4m+C4lOC4suC4q+C5jCcsXG4gICAgICAgICAgICB3dzogJyVkIOC4quC4seC4m+C4lOC4suC4q+C5jCcsXG4gICAgICAgICAgICBNOiAnMSDguYDguJTguLfguK3guJknLFxuICAgICAgICAgICAgTU06ICclZCDguYDguJTguLfguK3guJknLFxuICAgICAgICAgICAgeTogJzEg4Lib4Li1JyxcbiAgICAgICAgICAgIHl5OiAnJWQg4Lib4Li1Jyxcb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ICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbYnVnw7xuIHNhZ2F0XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2VydGlyIHNhZ2F0XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1tpbmRpa2ldIGRkZGQgW3NhZ2F0XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2TDvMO9bl0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbZ2XDp2VuXSBkZGRkIFtzYWdhdF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyBzb8WIJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDDtsWIJyxcbiAgICAgICAgICAgIHM6ICdiaXJuw6TDp2Ugc2VrdW50JyxcbiAgICAgICAgICAgIG06ICdiaXIgbWludXQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dCcsXG4gICAgICAgICAgICBoOiAnYmlyIHNhZ2F0JyxcbiAgICAgICAgICAgIGhoOiAnJWQgc2FnYXQnLFxuICAgICAgICAgICAgZDogJ2JpciBnw7xuJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZ8O8bicsXG4gICAgICAgICAgICBNOiAnYmlyIGHDvScsXG4gICAgICAgICAgICBNTTogJyVkIGHDvScsXG4gICAgICAgICAgICB5OiAnYmlyIMO9eWwnLFxuICAgICAgICAgICAgeXk6ICclZCDDvXlsJyxcbiAgICAgICAgfSxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RvJzpcbiAgICAgICAgICAgICAgICBjYXNlICdERCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3BlY2lhbCBjYXNlIGZvciB6ZXJvXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgXCIndW5qeVwiO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHZhciBhID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgICAgICAgICBiID0gKG51bWJlciAlIDEwMCkgLSBhLFxuICAgICAgICAgICAgICAgICAgICAgICAgYyA9IG51bWJlciA+PSAxMDAgPyAxMDAgOiBudWxsO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgKHN1ZmZpeGVzW2FdIHx8IHN1ZmZpeGVzW2JdIHx8IHN1ZmZpeGVzW2NdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN3RoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIHRrO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlv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lc19TYWJhZG8nLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICdMaW5fTHVuX01hcl9NaXlfSHV3X0JpeV9TYWInLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnTGlfTHVfTWFfTWlfSHVfQmlfU2FiJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnTU0vRC9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnTU1NTSBELCBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ01NTU0gRCwgWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgTU1NTSBERCwgWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnTFQgW25nYXlvbmcgYXJhd10nLFxuICAgICAgICAgICAgbmV4dERheTogJ1tCdWthcyBuZ10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdMVCBbc2Egc3VzdW5vZCBuYV0gZGRkZCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnTFQgW2thaGFwb25dJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnTFQgW25vb25nIG5ha2FyYWFuZ10gZGRkZCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ3NhIGxvb2IgbmcgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGFuZyBuYWthbGlwYXMnLFxuICAgICAgICAgICAgczogJ2lsYW5nIHNlZ3VuZG8nLFxuICAgICAgICAgICAgc3M6ICclZCBzZ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0aW9uIHRyYW5zbGF0ZVBhc3Qob3V0cHV0KSB7XG4gICAgICAgIHZhciB0aW1lID0gb3V0cHV0O1xuICAgICAgICB0aW1lID1cbiAgICAgICAgICAgIG91dHB1dC5pbmRleE9mKCdqYWonKSAhPT0gLTFcbiAgICAgICAgICAgICAgICA/IHRpbWUuc2xpY2UoMCwgLTMpICsgJ0h14oCZJ1xuICAgICAgICAgICAgICAgIDogb3V0cHV0LmluZGV4T2YoJ2phcicpICE9PSAtMVxuICAgICAgICAgICAgICAgICAgPyB0aW1lLnNsaWNlKDAsIC0zKSArICd3ZW4nXG4gICAgICAgICAgICAgICAgICA6IG91dHB1dC5pbmRleE9mKCdESVMnKSAhPT0gLTFcbiAgICAgICAgICAgICAgICAgICAgPyB0aW1lLnNsaWNlKDAsIC0zKSArICdiZW4nXG4gICAgICAgICAgICAgICAgICAgIDogdGltZSArICcgcmV0JztcbiAgICAgICAgcmV0dXJuIHRpbWU7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdHJhbnNsYXRlKG51bWJlciwgd2l0aG91dFN1ZmZpeCwgc3RyaW5nLCBpc0Z1dHVyZSkge1xuICAgICAgICB2YXIgbnVtYmVyTm91biA9IG51bWJlckFzTm91bihudW1iZXIpO1xuICAgICAgICBzd2l0Y2ggKHN0cmluZykge1xuICAgICAgICAgICAgY2FzZSAnc3MnOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJOb3VuICsgJyBsdXAnO1xuICAgICAgICAgICAgY2FzZSAnbW0nOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJOb3VuICsgJyB0dXAnO1xuICAgICAgICAgICAgY2FzZSAnaGgnOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJOb3VuICsgJyByZXAnO1xuICAgICAgICAgICAgY2FzZSAnZGQnOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJOb3VuICsgJyBqYWonO1xuICAgICAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJOb3VuICsgJyBqYXInO1xuICAgICAgICAgICAgY2FzZSAneXknOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJOb3VuICsgJyBESVMnO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbnVtYmVyQXNOb3VuKG51bWJlcikge1xuICAgICAgICB2YXIgaHVuZHJlZCA9IE1hdGguZmxvb3IoKG51bWJlciAlIDEwMDApIC8gMTAwKSxcbiAgICAgICAgICAgIHRlbiA9IE1hdGguZmxvb3IoKG51bWJlciAlIDEwMCkgLyAxMCksXG4gICAgICAgICAgICBvbmUgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgIHdvcmQgPSAnJztcbiAgICAgICAgaWYgKGh1bmRyZWQgPiAwKSB7XG4gICAgICAgICAgICB3b3JkICs9IG51bWJlcnNOb3Vuc1todW5kcmVkXSArICd2YXRsaCc7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRlbiA+IDApIHtcbiAgICAgICAgICAgIHdvcmQgKz0gKHdvcmQgIT09ICcnID8gJyAnIDogJycpICsgbnVtYmVyc05vdW5zW3Rlbl0gKyAnbWFIJztcbiAgICAgICAgfVxuICAgICAgICBpZiAob25lID4gMCkge1xuICAgICAgICAgICAgd29yZCArPSAod29yZCAhPT0gJycgPyAnICcgOiAnJykgKyBudW1iZXJzTm91bnNbb25lXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gd29yZCA9PT0gJycgPyAncGFnaCcgOiB3b3JkO1xuICAgIH1cblxuICAgIHZhciB0bGggPSBtb21lbnQuZGVmaW5lTG9jYWxlKCd0bGgnLCB7XG4gICAgICAgIG1vbnRoczogJ3RlcmHigJkgamFyIHdh4oCZX3RlcmHigJkgamFyIGNoYeKAmV90ZXJh4oCZIGphciB3ZWpfdGVyYeKAmSBqYXIgbG9TX3RlcmHigJkgamFyIHZhZ2hfdGVyYeKAmSBqYXIgamF2X3RlcmHigJkgamFyIFNvY2hfdGVyYeKAmSBqYXIgY2hvcmdoX3RlcmHigJkgamFyIEh1dF90ZXJh4oCZIGphciB3YeKAmW1hSF90ZXJh4oCZIGphciB3YeKAmW1hSCB3YeKAmV90ZXJh4oCZIGphciB3YeKAmW1hSCBjaGHigJknLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ2phciB3YeKAmV9qYXIgY2hh4oCZX2phciB3ZWpfamFyIGxvU19qYXIgdmFnaF9qYXIgamF2X2phciBTb2NoX2phciBjaG9yZ2hfamFyIEh1dF9qYXIgd2HigJltYUhfamFyIHdh4oCZbWFIIHdh4oCZX2phciB3YeKAmW1hSCBjaGHigJknLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgbW9udGhzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgd2Vla2RheXM6ICdsb2ptSXRqYWpfRGFTamFqX3Bvdmphal9naEl0bGhqYWpfbG9naGphal9idXFqYWpfZ2hJbmphaicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDpcbiAgICAgICAgICAgICdsb2ptSXRqYWpfRGFTamFqX3Bvdmphal9naEl0bGhqYWpfbG9naGphal9idXFqYWpfZ2hJbmphaicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46XG4gICAgICAgICAgICAnbG9qbUl0amFqX0RhU2phal9wb3ZqYWpfZ2hJdGxoamFqX2xvZ2hqYWpfYnVxamFqX2doSW5qYWonLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbRGFIamFqXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW3dh4oCZbGVTXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ0xMTCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW3dh4oCZSHXigJldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnTExMJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiB0cmFuc2xhdGVGdXR1cmUsXG4gICAgICAgICAgICBwYXN0OiB0cmFuc2xhdGVQYXN0LFxuICAgICAgICAgICAgczogJ3B1UyBsdXAnLFxuICAgICAgICAgICAgc3M6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG06ICd3YeKAmSB0dXAnLFxuICAgICAgICAgICAgbW06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGg6ICd3YeKAmSByZXAnLFxuICAgICAgICAgICAgaGg6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGQ6ICd3YeKAmSBqYWonLFxuICAgICAgICAgICAgZGQ6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIE06ICd3YeKAmSBqYXInLFxuICAgICAgICAgICAgTU06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIHk6ICd3YeKAmSBESVMnLFxuICAgICAgICAgICAgeXk6IHRyYW5zbGF0ZSxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9XFwuL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vcnQ6ICdQYXpfUHp0X1NhbF/Dh2FyX1Blcl9DdW1fQ210Jy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ1B6X1B0X1NhX8OHYV9QZV9DdV9DdCcuc3BsaXQoJ18nKSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VycywgbWludXRlcywgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXJzIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/ICfDtsO2JyA6ICfDlsOWJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzTG93ZXIgPyAnw7ZzJyA6ICfDllMnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvw7bDtnzDlsOWfMO2c3zDllMvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiBpbnB1dCA9PT0gJ8O2cycgfHwgaW5wdXQgPT09ICfDllMnO1xuICAgICAgICB9LFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2J1Z8O8biBzYWF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW3lhcsSxbiBzYWF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1tnZWxlY2VrXSBkZGRkIFtzYWF0XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2TDvG5dIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW2dlw6dlbl0gZGRkZCBbc2FhdF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyBzb25yYScsXG4gICAgICAgICAgICBwYXN0OiAnJXMgw7ZuY2UnLFxuICAgICAgICAgICAgczogJ2Jpcmthw6cgc2FuaXllJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2FuaXllJyxcbiAgICAgICAgICAgIG06ICdiaXIgZGFraWthJyxcbiAgICAgICAgICAgIG1tOiAnJWQgZGFraWthJyxcbiAgICAgICAgICAgIGg6ICdiaXIgc2FhdCcsXG4gICAgICAgICAgICBoaDogJyVkIHNhYXQnLFxuICAgICAgICAgICAgZDogJ2JpciBnw7xuJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZ8O8bicsXG4gICAgICAgICAgICB3OiAnYmlyIGhhZnRhJyxcbiAgICAgICAgICAgIHd3OiAnJWQgaGFmdGEnLFxuICAgICAgICAgICAgTTogJ2JpciBheScsXG4gICAgICAgICAgICBNTTogJyVkIGF5JyxcbiAgICAgICAgICAgIHk6ICdiaXIgecSxbCcsXG4gICAgICAgICAgICB5eTogJyVkIHnEsWwnLFxuICAgICAgICB9LFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRG8nOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0REJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzcGVjaWFsIGNhc2UgZm9yIHplcm9cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBcIifEsW5jxLFcIjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IChudW1iZXIgJSAxMDApIC0gYSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGMgPSBudW1iZXIgPj0gMTAwID8gMTAwIDogbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIChzdWZmaXhlc1thXSB8fCBzdWZmaXhlc1tiXSB8fCBzdWZmaXhlc1tjXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDcsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDd0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiB0cjtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBUYWxvc3NhbiBbdHpsXVxuLy8hIGF1dGhvciA6IFJvYmluIHZhbiBkZXIgVmxpZXQgOiBodHRwczovL2dpdGh1Yi5jb20vcm9iaW4wdmFuMGRlcjB2XG4vLyEgYXV0aG9yIDogSXVzdMOsIENhbnVuXG5cbjsoZnVuY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7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW294aGkgw6BdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbZGVtw6Agw6BdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbw6BdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbaWVpcmkgw6BdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW3PDvHIgZWxdIGRkZGQgW2xhc3RldSDDoF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdvc3ByZWkgJXMnLFxuICAgICAgICAgICAgcGFzdDogJ2phJXMnLFxuICAgICAgICAgICAgczogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIHNzOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgbTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIG1tOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgaDogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIGhoOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgZDogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIGRkOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgTTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIE1NOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgeTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIHl5OiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn1cXC4vLFxuICAgICAgICBvcmRpbmFsOiAnJWQuJyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgZnVuY3Rpb24gcHJvY2Vzc1JlbGF0aXZlVGltZShudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSwgaXNGdXR1cmUpIHtcbiAgICAgICAgdmFyIGZvcm1hdCA9IHtcbiAgICAgICAgICAgIHM6IFsndmllbnNhcyBzZWN1bmRzJywgXCInaWVuc2FzIHNlY3VuZHNcIl0sXG4gICAgICAgICAgICBzczogW251bWJlciArICcgc2VjdW5kcycsICcnICsgbnVtYmVyICsgJyBzZWN1bmRzJ10sXG4gICAgICAgICAgICBtOiBbXCInbiBtw611dFwiLCBcIidpZW5zIG3DrXV0XCJdLFxuICAgICAgICAgICAgbW06IFtudW1iZXIgKyAnIG3DrXV0cycsICcnICsgbnVtYmVyICsgJyBtw611dHMnXSxcbiAgICAgICAgICAgIGg6IFtcIiduIMO+b3JhXCIsIFwiJ2llbnNhIMO+b3JhXCJdLFxuICAgICAgICAgICAgaGg6IFtudW1iZXIgKyAnIMO+b3JhcycsICcnICsgbnVtYmVyICsgJyDDvm9yYXMnXSxcbiAgICAgICAgICAgIGQ6IFtcIiduIHppdWFcIiwgXCInaWVuc2Egeml1YVwiXSxcbiAgICAgICAgICAgIGRkOiBbbnVtYmVyICsgJyB6aXVhcycsICcnICsgbnVtYmVyICsgJyB6aXVhcyddLFxuICAgICAgICAgICAgTTogW1wiJ24gbWVzXCI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geyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgdHptTGF0biA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ3R6bS1sYXRuJywge1xuICAgICAgICBtb250aHM6ICdpbm5heXJfYnLLpGF5csukX21hcsukc8ukX2licmlyX21heXl3X3l3bnl3X3l3bHl3el/Jo3fFoXRfxaF3dGFuYmlyX2t0y6R3YnLLpF9ud3dhbmJpcl9kd2puYmlyJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICdpbm5heXJfYnLLpGF5csukX21hcsukc8ukX2licmlyX21heXl3X3l3bnl3X3l3bHl3el/Jo3fFoXRfxaF3dGFuYmlyX2t0y6R3YnLLpF9ud3dhbmJpcl9kd2puYmlyJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzOiAnYXNhbWFzX2F5bmFzX2FzaW5hc19ha3Jhc19ha3dhc19hc2ltd2FzX2FzaeG4jXlhcycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ2FzYW1hc19heW5hc19hc2luYXNfYWtyYXNfYWt3YXNfYXNpbXdhc19hc2nhuI15YXMnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnYXNhbWFzX2F5bmFzX2FzaW5hc19ha3Jhc19ha3dhc19hc2ltd2FzX2FzaeG4jXlhcycuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2FzZGtoIGddIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbYXNrYSBnXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2ddIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbYXNzYW50IGddIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbZ10gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdkYWRraCBzIHlhbiAlcycsXG4gICAgICAgICAgICBwYXN0OiAneWFuICVzJyxcbiAgICAgICAgICAgIHM6ICdpbWlrJyxcbiAgICAgICAgICAgIHNzOiAnJWQgaW1paycsXG4gICAgICAgICAgICBtOiAnbWludeG4jScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnXhuI0nLFxuICAgICAgICAgICAgaDogJ3NhyZthJyxcbiAgICAgICAgICAgIGhoOiAnJWQgdGFzc2HJm2luJyxcbiAgICAgICAgICAgIGQ6ICdhc3MnLFxuICAgICAgICAgICAgZGQ6ICclZCBvc3NhbicsXG4gICAgICAgICAgICBNOiAnYXlvd3InLFxuICAgICAgICAgICAgTU06ICclZCBpeXlpcm4nLFxuICAgICAgICAgICAgeTogJ2FzZ2FzJyxcbiAgICAgICAgICAgIHl5OiAnJWQgaXNnYXNuJyxcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiA2LCAvLyBTYXR1cmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICA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1/itZbitZPitZvitZxf4rWb4rWT4rWc4rSw4rWP4rSx4rWJ4rWUX+K0veK1n+K1k+K0seK1lV/itY/itZPitaHitLDitY/itLHitYnitZRf4rS34rWT4rWK4rWP4rSx4rWJ4rWUJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICfitYnitY/itY/itLDitaLitZRf4rSx4rWV4rSw4rWi4rWVX+K1juK0sOK1leK1ml/itYnitLHitZTitYnitZRf4rWO4rSw4rWi4rWi4rWTX+K1ouK1k+K1j+K1ouK1k1/itaLitZPitY3itaLitZPitaNf4rWW4rWT4rWb4rWcX+K1m+K1k+K1nOK0sOK1j+K0seK1ieK1lF/itL3itZ/itZPitLHitZVf4rWP4rWT4rWh4rSw4rWP4rSx4rWJ4rWUX+K0t+K1k+K1iuK1j+K0seK1ieK1lCcuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5czogJ+K0sOK1meK0sOK1juK0sOK1mV/itLDitaLitY/itLDitZlf4rSw4rWZ4rWJ4rWP4rSw4rWZX+K0sOK0veK1lOK0sOK1mV/itLDitL3itaHitLDitZlf4rSw4rWZ4rWJ4rWO4rWh4rSw4rWZX+K0sOK1meK1ieK0ueK1ouK0sOK1mScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ+K0sOK1meK0sOK1juK0sOK1mV/itLDitaLitY/itLDitZlf4rSw4rWZ4rWJ4rWP4rSw4rWZX+K0sOK0veK1lOK0sOK1mV/itLDitL3itaHitLDitZlf4rSw4rWZ4rWJ4rWO4rWh4rSw4rWZX+K0sOK1meK1ieK0ueK1ouK0sOK1mScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfitLDitZnitLDitY7itLDitZlf4rSw4rWi4rWP4rSw4rWZX+K0sOK1meK1ieK1j+K0sOK1mV/itLDitL3itZTitLDitZlf4rSw4rS94rWh4rSw4rWZX+K0sOK1meK1ieK1juK1oeK0sOK1mV/itLDitZnitYnitLnitaLitLDitZknLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vitLDitZnitLfitYUg4rS0XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+K0sOK1meK0veK0sCDitLRdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb4rS0XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW+K0sOK1muK0sOK1j+K1nCDitLRdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb4rS0XSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ+K0t+K0sOK0t+K1hSDitZkg4rWi4rSw4rWPICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICfitaLitLDitY8gJXMnLFxuICAgICAgICAgICAgczogJ+K1ieK1juK1ieK0vScsXG4gICAgICAgICAgICBzczogJyVkIOK1ieK1juK1ieK0vScsXG4gICAgICAgICAgICBtOiAn4rWO4rWJ4rWP4rWT4rS6JyxcbiAgICAgICAgICAgIG1tOiAnJWQg4rWO4rWJ4rWP4rWT4rS6JyxcbiAgICAgICAgICAgIGg6ICfitZnitLDitYTitLAnLFxuICAgICAgICAgICAgaGg6ICclZCDitZzitLDitZnitZnitLDitYTitYnitY8nLFxuICAgICAgICAgICAgZDogJ+K0sOK1meK1mScsXG4gICAgICAgICAgICBkZDogJyVkIG/itZnitZnitLDitY8nLFxuICAgICAgICAgICAgTTogJ+K0sOK1om/itZPitZQnLFxuICAgICAgICAgICAgTU06ICclZCDitYnitaLitaLitYnitZTitY8nLFxuICAgICAgICAgICAgeTogJ+K0sOK1meK0s+K0sOK1mScsXG4gICAgICAgICAgICB5eTogJyVkIOK1ieK1meK0s+K0sOK1meK1jycsXG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogNiwgLy8gU2F0dXJkYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogMTIsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDEydGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gdHptO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IFV5Z2h1ciAoQ2hpbmEpIFt1Zy1jbl1cbi8vISBhdXRob3I6IGJveWFxIDogaHR0cHM6Ly9naXRodWIuY29tL2JveWFxXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnXG4gICAgICAgJiYgdHlwZW9mIHJlcXVpcmUgPT09ICdmdW5jdGlvbicgPyBmYWN0b3J5KHJlcXVpcmUoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAn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tkYXlzU2hvcnQ6ICfZituVX9iv24hf2LPblV/ahtinX9m+25Vf2KzbiF/YtNuVJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ9mK25Vf2K/biF/Ys9uVX9qG2Kdf2b7blV/YrNuIX9i025UnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdZWVlZLU1NLUREJyxcbiAgICAgICAgICAgIExMOiAnWVlZWS3ZitmJ2YTZiU0t2KbYp9mK2YbZidqtRC3Zg9uI2YbZiScsXG4gICAgICAgICAgICBMTEw6ICdZWVlZLdmK2YnZhNmJTS3Yptin2YrZhtmJ2q1ELdmD24jZhtmJ2IwgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGTYjCBZWVlZLdmK2YnZhNmJTS3Yptin2YrZhtmJ2q1ELdmD24jZhtmJ2IwgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv2YrbkNix2YnZhSDZg9uQ2obblXzYs9uV2r7bldixfNqG24jYtNiq2YnZhiDYqNuH2LHbh9mGfNqG24jYtHzahtuI2LTYqtmJ2YYg2YPbkNmK2YnZhnzZg9uV2oYvLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgbWVyaWRpZW0gPT09ICfZituQ2LHZidmFINmD25DahtuVJyB8fFxuICAgICAgICAgICAgICAgIG1lcmlkaWVtID09PSAn2LPbldq+25XYsScgfHxcbiAgICAgICAgICAgICAgICBtZXJpZGllbSA9PT0gJ9qG24jYtNiq2YnZhiDYqNuH2LHbh9mGJ1xuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn2obbiNi02KrZidmGINmD25DZitmJ2YYnIHx8IG1lcmlkaWVtID09PSAn2YPbldqGJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDExID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIHZhciBobSA9IGhvdXIgKiAxMDAgKyBtaW51dGU7XG4gICAgICAgICAgICBpZiAoaG0gPCA2MDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9mK25DYsdmJ2YUg2YPbkNqG25UnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDkwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn2LPbldq+25XYsSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTEzMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn2obbiNi02KrZidmGINio24fYsduH2YYnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDEyMzApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9qG24jYtCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTgwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn2obbiNi02KrZidmGINmD25DZitmJ2YYnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9mD25Xahic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9io24jar9uI2YYg2LPYp9im25XYql0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYptuV2KrblSDYs9in2KbbldiqXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1vZg9uQ2YTbldix2YPZiV0gZGRkZCBb2LPYp9im25XYql0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vYqtuG2YbbiNqv24jZhl0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb2KbYp9mE2K/ZidmG2YLZiV0gZGRkZCBb2LPYp9im25XYql0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDZg9uQ2YrZidmGJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDYqNuH2LHbh9mGJyxcbiAgICAgICAgICAgIHM6ICfZhtuV2obahtuVINiz25DZg9mI2YbYqicsXG4gICAgICAgICAgICBzczogJyVkINiz25DZg9mI2YbYqicsXG4gICAgICAgICAgICBtOiAn2KjZidixINmF2YnZhtuH2KonLFxuICAgICAgICAgICAgbW06ICclZCDZhdmJ2Ybbh9iqJyxcbiAgICAgICAgICAgIGg6ICfYqNmJ2LEg2LPYp9im25XYqicsXG4gICAgICAgICAgICBoaDogJyVkINiz2KfYptuV2KonLFxuICAgICAgICAgICAgZDogJ9io2YnYsSDZg9uI2YYnLFxuICAgICAgICAgICAgZGQ6ICclZCDZg9uI2YYnLFxuICAgICAgICAgICAgTTogJ9io2YnYsSDYptin2YonLFxuICAgICAgICAgICAgTU06ICclZCDYptin2YonLFxuICAgICAgICAgICAgeTogJ9io2YnYsSDZitmJ2YQnLFxuICAgICAgICAgICAgeXk6ICclZCDZitmJ2YQnLFxuICAgICAgICB9LFxuXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSgt2YPbiNmG2Yl8Ldim2KfZinwt2r7bldm+2KrblSkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct2YPbiNmG2YknO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3cnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ1cnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3avtuV2b7YqtuVJztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC/YjC9nLCAnLCcpO1xuICAgICAgICB9LFxuICAgICAgICBwb3N0Zm9ybWF0OiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoLywvZywgJ9iMJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIC8vIEdCL1QgNzQwOC0xOTk044CK5pWw5o2u5YWD5ZKM5Lqk5o2i5qC85byPwrfkv6Hmga/kuqTmjaLCt+aXpeacn+WSjOaXtumXtOihqOekuuazleOAi+S4jklTTyA4NjAxOjE5ODjnrYnmlYhcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdl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2l0aG91dFN1ZmZpeCA/ICfRhdCy0LjQu9C40L3QsCcgOiAn0YXQstC40LvQuNC90YMnO1xuICAgICAgICB9IGVsc2UgaWYgKGtleSA9PT0gJ2gnKSB7XG4gICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICfQs9C+0LTQuNC90LAnIDogJ9Cz0L7QtNC40L3Rgyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJyAnICsgcGx1cmFsKGZvcm1hdFtrZXldLCArbnVtYmVyKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiB3ZWVrZGF5c0Nhc2VSZXBsYWNlKG0sIGZvcm1hdCkge1xuICAgICAgICB2YXIgd2Vla2RheXMgPSB7XG4gICAgICAgICAgICAgICAgbm9taW5hdGl2ZTpcbiAgICAgICAgICAgICAgICAgICAgJ9C90LXQtNGW0LvRj1/Qv9C+0L3QtdC00ZbQu9C+0Lpf0LLRltCy0YLQvtGA0L7Qul/RgdC10YDQtdC00LBf0YfQtdGC0LLQtdGAX9C/4oCZ0Y/RgtC90LjRhtGPX9GB0YPQsdC+0YLQsCcuc3BsaXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICBhY2N1c2F0aXZlOlxuICAgICAgICAgICAgICAgICAgICAn0L3QtdC00ZbQu9GOX9C/0L7QvdC10LTRltC70L7Qul/QstGW0LLRgtC+0YDQvtC6X9GB0LXRgNC10LTRg1/Rh9C10YLQstC10YBf0L/igJnRj9GC0L3QuNGG0Y5f0YHRg9Cx0L7RgtGDJy5zcGxpdChcbiAgICAgICAgICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgIGdlbml0aXZlOlxuICAgICAgICAgICAgICAgICAgICAn0L3QtdC00ZbQu9GWX9C/0L7QvdC10LTRltC70LrQsF/QstGW0LLRgtC+0YDQutCwX9GB0LXRgNC10LTQuF/Rh9C10YLQstC10YDQs9CwX9C/4oCZ0Y/RgtC90LjRhtGWX9GB0YPQsdC+0YLQuCcuc3BsaXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBub3VuQ2FzZTtcblxuICAgICAgICBpZiAobSA9PT0gdHJ1ZSkge1xuICAgICAgICAgICAgcmV0dXJuIHdlZWtkYXlzWydub21pbmF0aXZlJ11cbiAgICAgICAgICAgICAgICAuc2xpY2UoMSwgNylcbiAgICAgICAgICAgICAgICAuY29uY2F0KHdlZWtkYXlzWydub21pbmF0aXZlJ10uc2xpY2UoMCwgMSkpO1xuICAgICAgICB9XG4gICAgICAgIGlmICghbSkge1xuICAgICAgICAgICAgcmV0dXJuIHdlZWtkYXlzWydub21pbmF0aXZlJ107XG4gICAgICAgIH1cblxuICAgICAgICBub3VuQ2FzZSA9IC8oXFxbW9CS0LLQo9GDXVxcXSkgP2RkZGQvLnRlc3QoZm9ybWF0KVxuICAgICAgICAgICAgPyAnYWNjdXNhdGl2ZSdcbiAgICAgICAgICAgIDogL1xcWz8oPzrQvNC40L3Rg9C70L7Rl3zQvdCw0YHRgtGD0L/QvdC+0ZcpPyA/XFxdID9kZGRkLy50ZXN0KGZvcm1hdClcbiAgICAgICAgICAgICAgPyAnZ2VuaXRpdmUnXG4gICAgICAgICAgICAgIDogJ25vbWluYXRpdmUnO1xuICAgICAgICByZXR1cm4gd2Vla2RheXNbbm91bkNhc2VdW20uZGF5KCldO1xuICAgIH1cbiAgICBmdW5jdGlvbiBwcm9jZXNzSG91cnNGdW5jdGlvbihzdHIpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHIgKyAn0L4nICsgKHRoaXMuaG91cnMoKSA9PT0gMTEgPyAn0LEnIDogJycpICsgJ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ICAgICAgICAgcmV0dXJuIHByb2Nlc3NIb3Vyc0Z1bmN0aW9uKCdb0JzQuNC90YPQu9C+0ZddIGRkZGQgWycpLmNhbGwodGhpcyk7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJvY2Vzc0hvdXJzRnVuY3Rpb24oJ1vQnNC40L3Rg9C70L7Qs9C+XSBkZGRkIFsnKS5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ9C30LAgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzINGC0L7QvNGDJyxcbiAgICAgICAgICAgIHM6ICfQtNC10LrRltC70YzQutCwINGB0LXQutGD0L3QtCcsXG4gICAgICAgICAgICBzczogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIG06IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBtbTogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIGg6ICfQs9C+0LTQuNC90YMnLFxuICAgICAgICAgICAgaGg6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBkOiAn0LTQtdC90YwnLFxuICAgICAgICAgICAgZGQ6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBNOiAn0LzRltGB0Y/RhtGMJyxcbiAgICAgICAgICAgIE1NOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgeTogJ9GA0ZbQuicsXG4gICAgICAgICAgICB5eTogcmV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G4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct0LknO1xuICAgICAgICAgICAgICAgIGNhc2UgJ0QnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3Qs9C+JztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA3LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA3dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gdWs7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogVXJkdSBbdXJdXG4vLyEgYXV0aG9yIDogU2F3b29kIEFsYW0gOiBodHRwczovL2dpdGh1Yi5jb20vaWJuZXNheWVlZFxuLy8hIGF1dGhvciA6IFphY2sgOiBodHRwczovL2dpdGh1Yi5jb20vWmFja1Zpc2lvblxuXG47KGZ1bmN0aW9uIChnbG9iYWwsIGZhY3RvcnkpIHtcbiAgIHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJ1xuICAgICAgICYmIHR5cGVvZiByZXF1aXJlID09PSAnZnVuY3Rpb24nID8gZmFjdG9yeShyZXF1aXJlKCcuLi9tb21lbnQnKSkgOlxuICAgdHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIG1vbnRocyA9IFtcbiAgICAgICAgICAgICfYrNmG2YjYsduMJyxcbiAgICAgICAgICAgICfZgdix2YjYsduMJyxcbiAgICAgICAgICAgICfZhdin2LHahicsXG4gICAgICAgICAgICAn2KfZvtix24zZhCcsXG4gICAgICAgICAgICAn2YXYptuMJyxcbiAgICAgICAgICAgICfYrNmI2YYnLFxuICAgICAgICAgICAgJ9is2YjZhNin2KbbjCcsXG4gICAgICAgICAgICAn2Kfar9iz2KonLFxuICAgICAgICAgICAgJ9iz2KrZhdio2LEnLFxuICAgICAgICAgICAgJ9in2qnYqtmI2KjYsScsXG4gICAgICAgICAgICAn2YbZiNmF2KjYsScsXG4gICAgICAgICAgICAn2K/Ys9mF2KjYsScsXG4gICAgICAgIF0sXG4gICAgICAgIGRheXMgPSBbJ9in2KrZiNin2LEnLCAn2b7bjNixJywgJ9mF2Ybar9mEJywgJ9io2K/avicsICfYrNmF2LnYsdin2KonLCAn2KzZhdi524EnLCAn24HZgdiq24EnXTtcblxuICAgIHZhciB1ciA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ3VyJywge1xuICAgICAgICBtb250aHM6IG1vbnRocyxcbiAgICAgICAgbW9udGhzU2hvcnQ6IG1vbnRocyxcbiAgICAgICAgd2Vla2RheXM6IGRheXMsXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6IGRheXMsXG4gICAgICAgIHdlZWtkYXlzTWluOiBkYXlzLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRk2IwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv2LXYqNitfNi02KfZhS8sXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuICfYtNin2YUnID09PSBpbnB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9i12KjYrSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gJ9i02KfZhSc7XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9ii2Kwg2KjZiNmC2KpdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb2qnZhCDYqNmI2YLYql0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvYqNmI2YLYql0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1var9iw2LTYqtuBINix2YjYsiDYqNmI2YLYql0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb2q/YsNi02KrbgV0gZGRkZCBb2KjZiNmC2KpdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg2KjYudivJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDZgtio2YQnLFxuICAgICAgICAgICAgczogJ9qG2YbYryDYs9uM2qnZhtqIJyxcbiAgICAgICAgICAgIHNzOiAnJWQg2LPbjNqp2YbaiCcsXG4gICAgICAgICAgICBtOiAn2KfbjNqpINmF2YbZuScsXG4gICAgICAgICAgICBtbTogJyVkINmF2YbZuScsXG4gICAgICAgICAgICBoOiAn2KfbjNqpINqv2r7Zhtm524EnLFxuICAgICAgICAgICAgaGg6ICclZCDar9q+2YbZuduSJyxcbiAgICAgICAgICAgIGQ6ICfYp9uM2qkg2K/ZhicsXG4gICAgICAgICAgICBkZDogJyVkINiv2YYnLFxuICAgICAgICAgICAgTTogJ9in24zaqSDZhdin24EnLFxuICAgICAgICAgICAgTU06ICclZCDZhdin24EnLFxuICAgICAgICAgICAgeTogJ9in24zaqSDYs9in2YQnLFxuICAgICAgICAgICAgeXk6ICclZCDYs9in2YQnLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC/YjC9nLCAnLCcpO1xuICAgICAgICB9LFxuICAgICAgICBwb3N0Zm9ybWF0OiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoLywvZywgJ9iMJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtc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gICAgICAgICAgJ1lha3NoYW5iYV9EdXNoYW5iYV9TZXNoYW5iYV9DaG9yc2hhbmJhX1BheXNoYW5iYV9KdW1hX1NoYW5iYScuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnWWFrX0R1c2hfU2VzaF9DaG9yX1BheV9KdW1fU2hhbicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdZYV9EdV9TZV9DaG9fUGFfSnVfU2hhJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdEIE1NTU0gWVlZWSwgZGRkZCBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0J1Z3VuIHNvYXRdIExUIFtkYV0nLFxuICAgICAgICAgICAgbmV4dERheTogJ1tFcnRhZ2FdIExUIFtkYV0nLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtrdW5pIHNvYXRdIExUIFtkYV0nLFxuICAgICAgICAgICAgbGFzdERheTogJ1tLZWNoYSBzb2F0XSBMVCBbZGFdJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBcIltPJ3RnYW5dIGRkZGQgW2t1bmkgc29hdF0gTFQgW2RhXVwiLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdZYX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AgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnQ05fVDJfVDNfVDRfVDVfVDZfVDcnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnQ05fVDJfVDNfVDRfVDVfVDZfVDcnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL3NhfGNoL2ksXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuIC9eY2gkL2kudGVzdChpbnB1dCk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91cnMsIG1pbnV0ZXMsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VycyA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzTG93ZXIgPyAnc2EnIDogJ1NBJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzTG93ZXIgPyAnY2gnIDogJ0NIJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gW27Eg21dIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFtuxINtXSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gW27Eg21dIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgbDogJ0REL00vWVlZWScsXG4gICAgICAgICAgICBsbDogJ0QgTU1NIFlZWVknLFxuICAgICAgICAgICAgbGxsOiAnRCBNTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBsbGxsOiAnZGRkLCBEIE1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSMO0bSBuYXkgbMO6Y10gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tOZ8OgeSBtYWkgbMO6Y10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFt0deG6p24gdOG7m2kgbMO6Y10gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tIw7RtIHF1YSBsw7pjXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW3R14bqnbiB0csaw4bubYyBsw7pjXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVzIHThu5tpJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyB0csaw4bubYycsXG4gICAgICAgICAgICBzOiAndsOgaSBnacOieScsXG4gICAgICAgICAgICBzczogJyVkIGdpw6J5JyxcbiAgICAgICAgICAgIG06ICdt4buZdCBwaMO6dCcsXG4gICAgICAgICAgICBtbTogJyVkIHBow7p0JyxcbiAgICAgICAgICAgIGg6ICdt4buZdCBnaeG7nScsXG4gICAgICAgICAgICBoaDogJyVkIGdp4budJyxcbiAgICAgICAgICAgIGQ6ICdt4buZdCBuZ8OgeScsXG4gICAgICAgICAgICBkZDogJyVkIG5nw6B5JyxcbiAgICAgICAgICAgIHc6ICdt4buZdCB0deG6p24nLFxuICAgICAgICAgICAgd3c6ICclZCB0deG6p24nLFxuICAgICAgICAgICAgTTogJ23hu5l0IHRow6FuZycsXG4gICAgICAgICAgICBNTTogJyVkIHRow6FuZycsXG4gICAgICAgICAgICB5OiAnbeG7mXQgbsS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c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbVH7Ds2TDoX7DvSDDoXRdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbVH7Ds23Ds35ycsOzfncgw6F0XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW8OhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vDnX7DqXN0fsOpcmTDoX7DvSDDoXRdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW0x+w6FzdF0gZGRkZCBbw6F0XSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ8OtfsOxICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDDoX5nw7MnLFxuICAgICAgICAgICAgczogJ8OhIH5mw6l3IH5zw6ljw7N+w7FkcycsXG4gICAgICAgICAgICBzczogJyVkIHN+w6ljw7PDsX5kcycsXG4gICAgICAgICAgICBtOiAnw6Egfm3DrcOxfsO6dMOpJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbX7DrcOxw7p+dMOpcycsXG4gICAgICAgICAgICBoOiAnw6F+w7EgaMOzfsO6cicsXG4gICAgICAgICAgICBoaDogJyVkIGh+w7PDunJzJyxcbiAgICAgICAgICAgIGQ6ICfDoSB+ZMOhw70nLFxuICAgICAgICAgICAgZGQ6ICclZCBkfsOhw71zJyxcbiAgICAgICAgICAgIE06ICfDoSB+bcOzw7F+dGgnLFxuICAgICAgICAgICAgTU06ICclZCBtfsOzw7F0fmhzJyxcbiAgICAgICAgICAgIHk6ICfDoSB+w73DqcOhcicsXG4gICAgICAgICAgICB5eTogJyVkIMO9fsOpw6FycycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSh0aHxzdHxuZHxyZCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYiA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgICAgIH5+KChudW1iZXIgJSAxMDApIC8gMTApID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICd0aCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdzdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnbmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdyZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ3RoJztcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2V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ExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb4buMc+G6ucyAIHRvzIFs4buNzIFdIFtuaV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICduacyBICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBr4buNamHMgScsXG4gICAgICAgICAgICBzOiAnacyAc+G6uWp1zIEgYWF5YcyBIGRpZScsXG4gICAgICAgICAgICBzczogJ2FheWHMgSAlZCcsXG4gICAgICAgICAgICBtOiAnacyAc+G6uWp1zIEga2FuJyxcbiAgICAgICAgICAgIG1tOiAnacyAc+G6uWp1zIEgJWQnLFxuICAgICAgICAgICAgaDogJ3dhzIFrYXRpIGthbicsXG4gICAgICAgICAgICBoaDogJ3dhzIFrYXRpICVkJyxcbiAgICAgICAgICAgIGQ6ICfhu41q4buNzIEga2FuJyxcbiAgICAgICAgICAgIGRkOiAn4buNauG7jcyBICVkJyxcbiAgICAgICAgICAgIE06ICdvc3XMgCBrYW4nLFxuICAgICAgICAgICAgTU06ICdvc3XMgCAlZCcsXG4gICAgICAgICAgICB5OiAn4buNZHXMgW4ga2FuJyxcbiAgICAgICAgICAgIHl5OiAn4buNZHXMgW4gJWQnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAv4buNauG7jcyBXFxzXFxkezEsMn0vLFxuICAgICAgICBvcmRpbmFsOiAn4buNauG7jcyBICVkJyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyL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ydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6ICcx5pyIXzLmnIhfM+aciF805pyIXzXmnIhfNuaciF835pyIXzjmnIhfOeaciF8xMOaciF8xMeaciF8xMuaciCcuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXM6ICfmmJ/mnJ/ml6Vf5pif5pyf5LiAX+aYn+acn+S6jF/mmJ/mnJ/kuIlf5pif5pyf5ZubX+aYn+acn+S6lF/mmJ/mnJ/lha0nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICflkajml6Vf5ZGo5LiAX+WRqOS6jF/lkajkuIlf5ZGo5ZubX+WRqOS6lF/lkajlha0nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn5pelX+S4gF/kuoxf5LiJX+Wbm1/kupRf5YWtJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnWVlZWS9NTS9ERCcsXG4gICAgICAgICAgICBMTDogJ1lZWVnlubRN5pyIROaXpScsXG4gICAgICAgICAgICBMTEw6ICdZWVlZ5bm0TeaciETml6VBaOeCuW1t5YiGJyxcbiAgICAgICAgICAgIExMTEw6ICdZWVlZ5bm0TeaciETml6VkZGRkQWjngrltbeWIhicsXG4gICAgICAgICAgICBsOiAnWVlZWS9NL0QnLFxuICAgICAgICAgICAgbGw6ICdZWVlZ5bm0TeaciETml6UnLFxuICAgICAgICAgICAgbGxsOiAnWVlZWeW5tE3mnIhE5pelIEhIOm1tJyxcbiAgICAgICAgICAgIGxsbGw6ICdZWVlZ5bm0TeaciETml6VkZGRkIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+WHjOaZqHzml6nkuIp85LiK5Y2IfOS4reWNiHzkuIvljYh85pma5LiKLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn5YeM5pmoJyB8fCBtZXJpZGllbSA9PT0gJ+aXqeS4iicgfHwgbWVyaWRpZW0gPT09ICfkuIrljYgnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn5LiL5Y2IJyB8fCBtZXJpZGllbSA9PT0gJ+aZmuS4iicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyAn5Lit5Y2IJ1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDExID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIHZhciBobSA9IGhvdXIgKiAxMDAgKyBtaW51dGU7XG4gICAgICAgICAgICBpZiAoaG0gPCA2MDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+WHjOaZqCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgOTAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfml6nkuIonO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDExMzApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+S4iuWNiCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTIzMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5Lit5Y2IJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCAxODAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfkuIvljYgnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aZmuS4iic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+S7iuWkqV1MVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+aYjuWkqV1MVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKG5vdykge1xuICAgICAgICAgICAgICAgIGlmIChub3cud2VlaygpICE9PSB0aGlzLndlZWsoKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vkuItdZGRkTFQnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnW+acrF1kZGRMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb5pio5aSpXUxUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAobm93KSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMud2VlaygpICE9PSBub3cud2VlaygpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnW+S4il1kZGRMVCc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb5pysXWRkZExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KOaXpXzmnIh85ZGoKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+aXpSc7XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn5pyIJztcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICflkagnO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXPlkI4nLFxuICAgICAgICAgICAgcGFzdDogJyVz5YmNJyxcbiAgICAgICAgICAgIHM6ICflh6Dnp5InLFxuICAgICAgICAgICAgc3M6ICclZCDnp5InLFxuICAgICAgICAgICAgbTogJzEg5YiG6ZKfJyxcbiAgICAgICAgICAgIG1tOiAnJWQg5YiG6ZKfJyxcbiAgICAgICAgICAgIGg6ICcxIOWwj+aXticsXG4gICAgICAgICAgICBoaDogJyVkIOWwj+aXticsXG4gICAgICAgICAgICBkOiAnMSDlpKknLFxuICAgICAgICAgICAgZGQ6ICclZCDlpKknLFxuICAgICAgICAgICAgdzogJzEg5ZGoJyxcbiAgICAgICAgICAgIHd3OiAnJWQg5ZGoJyxcbiAgICAgICAgICAgIE06ICcxIOS4quaciCcsXG4gICAgICAgICAgICBNTTogJyVkIOS4quaciCcsXG4gICAgICAgICAgICB5OiAnMSDlubQnLFxuICA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ExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdZWVlZL01NL0REJyxcbiAgICAgICAgICAgIExMOiAnWVlZWeW5tE3mnIhE5pelJyxcbiAgICAgICAgICAgIExMTDogJ1lZWVnlubRN5pyIROaXpSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnWVlZWeW5tE3mnIhE5pelZGRkZCBISDptbScsXG4gICAgICAgICAgICBsOiAnWVlZWS9NL0QnLFxuICAgICAgICAgICAgbGw6ICdZWVlZ5bm0TeaciETml6UnLFxuICAgICAgICAgICAgbGxsOiAnWVlZWeW5tE3mnIhE5pelIEhIOm1tJyxcbiAgICAgICAgICAgIGxsbGw6ICdZWVlZ5bm0TeaciETml6VkZGRkIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+WHjOaZqHzml6nkuIp85LiK5Y2IfOS4reWNiHzkuIvljYh85pma5LiKLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn5YeM5pmoJyB8fCBtZXJpZGllbSA9PT0gJ+aXqeS4iicgfHwgbWVyaWRpZW0gPT09ICfkuIrljYgnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn5Lit5Y2IJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDExID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfkuIvljYgnIHx8IG1lcmlkaWVtID09PSAn5pma5LiKJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICB2YXIgaG0gPSBob3VyICogMTAwICsgbWludXRlO1xuICAgICAgICAgICAgaWYgKGhtIDwgNjAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICflh4zmmagnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDkwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5pep5LiKJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCAxMjAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfkuIrljYgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA9PT0gMTIwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5Lit5Y2IJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCAxODAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfkuIvljYgnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aZmuS4iic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+S7iuWkqV1MVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+aYjuWkqV1MVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1vkuItdZGRkZExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb5pio5aSpXUxUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+S4il1kZGRkTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KOaXpXzmnIh86YCxKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+aXpSc7XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn5pyIJztcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfpgLEnO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXPlvownLFxuICAgICAgICAgICAgcGFzdDogJyVz5YmNJyxcbiAgICAgICAgICAgIHM6ICflub7np5InLFxuICAgICAgICAgICAgc3M6ICclZCDnp5InLFxuICAgICAgICAgICAgbTogJzEg5YiG6ZCYJyxcbiAgICAgICAgICAgIG1tOiAnJWQg5YiG6ZCYJyxcbiAgICAgICAgICAgIGg6ICcxIOWwj+aZgicsXG4gICAgICAgICAgICBoaDogJyVkIOWwj+aZgicsXG4gICAgICAgICAgICBkOiAnMSDlpKknLFxuICAgICAgICAgICAgZGQ6ICclZCDlpKknLFxuICAgICAgICAgICAgTTogJzEg5YCL5pyIJyxcbiAgICAgICAgICAgIE1NOiAnJWQg5YCL5pyIJyxcbiAgICAgICAgICAgIHk6ICcxIOW5tCcsXG4gICAgICAgICAgICB5eTogJyVkIOW5tCcsXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICBy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AgICApLFxuICAgICAgICBtb250aHNTaG9ydDogJzHmnIhfMuaciF8z5pyIXzTmnIhfNeaciF825pyIXzfmnIhfOOaciF855pyIXzEw5pyIXzEx5pyIXzEy5pyIJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5czogJ+aYn+acn+aXpV/mmJ/mnJ/kuIBf5pif5pyf5LqMX+aYn+acn+S4iV/mmJ/mnJ/lm5tf5pif5pyf5LqUX+aYn+acn+WFrScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ+mAseaXpV/pgLHkuIBf6YCx5LqMX+mAseS4iV/pgLHlm5tf6YCx5LqUX+mAseWFrScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfml6Vf5LiAX+S6jF/kuIlf5ZubX+S6lF/lha0nLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnWVlZWeW5tE3mnIhE5pelJyxcbiAgICAgICAgICAgIExMTDogJ1lZWVnlubRN5pyIROaXpSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnWVlZWeW5tE3mnIhE5pelZGRkZCBISDptbScsXG4gICAgICAgICAgICBsOiAnRC9NL1lZWVknLFxuICAgICAgICAgICAgbGw6ICdZWVlZ5bm0TeaciETml6UnLFxuICAgICAgICAgICAgbGxsOiAnWVlZWeW5tE3mnIhE5pelIEhIOm1tJyxcbiAgICAgICAgICAgIGxsbGw6ICdZWVlZ5bm0TeaciETml6VkZGRkIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+WHjOaZqHzml6nkuIp85LiK5Y2IfOS4reWNiHzkuIvljYh85pma5LiKLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn5YeM5pmoJyB8fCBtZXJpZGllbSA9PT0gJ+aXqeS4iicgfHwgbWVyaWRpZW0gPT09ICfkuIrljYgnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn5Lit5Y2IJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDExID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfkuIvljYgnIHx8IG1lcmlkaWVtID09PSAn5pma5LiKJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICB2YXIgaG0gPSBob3VyICogMTAwICsgbWludXRlO1xuICAgICAgICAgICAgaWYgKGhtIDwgNjAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICflh4zmmagnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDkwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5pep5LiKJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCAxMTMwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfkuIrljYgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDEyMzApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+S4reWNiCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTgwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5LiL5Y2IJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfmmZrkuIonO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vku4rlpKldIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb5piO5aSpXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1vkuItdZGRkZCBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW+aYqOWkqV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb5LiKXWRkZGQgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KOaXpXzmnIh86YCxKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+aXpSc7XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn5pyIJztcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfpgLEnO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXPlhacnLFxuICAgICAgICAgICAgcGFzdDogJyVz5YmNJyxcbiAgICAgICAgICAgIHM6ICflub7np5InLFxuICAgICAgICAgICAgc3M6ICclZCDnp5InLFxuICAgICAgICAgICAgbTogJzEg5YiG6ZCYJyxcbiAgICAgICAgICAgIG1tOiAnJWQg5YiG6ZCYJyxcbiAgICAgICAgICAgIGg6ICcxIOWwj+aZgicsXG4gICAgICAgICAgICBoaDogJyVkIOWwj+aZgicsXG4gICAgICAgICAgICBkOiAnMSDlpKknLFxuICAgICAgICAgICAgZGQ6ICclZCDlpKknLFxuICAgICAgICAgICAgTTogJzEg5YCL5pyIJyxcbiAgICAgICAgICAgIE1NOiAnJWQg5YCL5pyIJyxcbiAgICAgICAgICAgIHk6ICcxIOW5tCcsXG4gICAgICAgICAgICB5eTogJyVkIOW5tCcsXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gemhNbztcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBDaGluZXNlIChUYWl3YW4pIFt6aC10d11cbi8vISBhdXRob3IgOiBCZW4gOiBodHRwczovL2dpdGh1Yi5jb20vYmVuLWxpblxuLy8hIGF1dGhvciA6IENocmlzIExhbSA6IGh0dHBzOi8vZ2l0aHViLmNvbS9oZWhhY2hyaXNcblxuOyhmdW5jdGlvbiAoZ2xvYmFsLCBmYWN0b3J5KSB7XG4gICB0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZSAhPT0gJ3VuZGVmaW5lZCdcbiAgICAgICAmJiB0eXBlb2YgcmVxdWlyZSA9PT0gJ2Z1bmN0aW9uJyA/IGZhY3RvcnkocmVxdWlyZSgnLi4vbW9tZW50JykpIDpcbiA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ogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdZWVlZL01NL0REJyxcbiAgICAgICAgICAgIExMOiAnWVlZWeW5tE3mnIhE5pelJyxcbiAgICAgICAgICAgIExMTDogJ1lZWVnlubRN5pyIROaXpSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnWVlZWeW5tE3mnIhE5pelZGRkZCBISDptbScsXG4gICAgICAgICAgICBsOiAnWVlZWS9NL0QnLFxuICAgICAgICAgICAgbGw6ICdZWVlZ5bm0TeaciETml6UnLFxuICAgICAgICAgICAgbGxsOiAnWVlZWeW5tE3mnIhE5pelIEhIOm1tJyxcbiAgICAgICAgICAgIGxsbGw6ICdZWVlZ5bm0TeaciETml6VkZGRkIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+WHjOaZqHzml6nkuIp85LiK5Y2IfOS4reWNiHzkuIvljYh85pma5LiKLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn5YeM5pmoJyB8fCBtZXJpZGllbSA9PT0gJ+aXqeS4iicgfHwgbWVyaWRpZW0gPT09ICfkuIrljYgnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn5Lit5Y2IJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDExID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfkuIvljYgnIHx8IG1lcmlkaWVtID09PSAn5pma5LiKJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICB2YXIgaG0gPSBob3VyICogMTAwICsgbWludXRlO1xuICAgICAgICAgICAgaWYgKGhtIDwgNjAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICflh4zmmagnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDkwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5pep5LiKJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCAxMTMwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfkuIrljYgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDEyMzApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+S4reWNiCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTgwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5LiL5Y2IJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfmmZrkuIonO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vku4rlpKldIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb5piO5aSpXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1vkuItdZGRkZCBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW+aYqOWkqV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb5LiKXWRkZGQgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KOaXpXzmnIh86YCxKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+aXpSc7XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn5pyIJztcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfpgLEnO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXPlvownLFxuICAgICAgICAgICAgcGFzdDogJyVz5YmNJyxcbiAgICAgICAgICAgIHM6ICflub7np5InLFxuICAgICAgICAgICAgc3M6ICclZCDnp5InLFxuICAgICAgICAgICAgbTogJzEg5YiG6ZCYJyxcbiAgICAgICAgICAgIG1tOiAnJWQg5YiG6ZCYJyxcbiAgICAgICAgICAgIGg6ICcxIOWwj+aZgicsXG4gICAgICAgICAgICBoaDogJyVkIOWwj+aZgicsXG4gICAgICAgICAgICBkOiAnMSDlpKknLFxuICAgICAgICAgICAgZGQ6ICclZCDlpKknLFxuICAgICAgICAgICAgTTogJzEg5YCL5pyIJyxcbiAgICAgICAgICAgIE1NOiAnJWQg5YCL5pyIJyxcbiAgICAgICAgICAgIHk6ICcxIOW5tCcsXG4gICAgICAgICAgICB5eTogJyVkIOW5tCcsXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4g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AgICAgICAvLyBJRTggd2lsbCB0cmVhdCB1bmRlZmluZWQgYW5kIG51bGwgYXMgb2JqZWN0IGlmIGl0IHdhc24ndCBmb3JcbiAgICAgICAgLy8gaW5wdXQgIT0gbnVsbFxuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgaW5wdXQgIT0gbnVsbCAmJlxuICAgICAgICAgICAgT2JqZWN0LnByb3RvdHlwZS50b1N0cmluZy5jYWxsKGlucHV0KSA9PT0gJ1tvYmplY3QgT2JqZWN0XSdcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBoYXNPd25Qcm9wKGEsIGIpIHtcbiAgICAgICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChhLCBiKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpc09iamVjdEVtcHR5KG9iaikge1xuICAgICAgICBpZiAoT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMpIHtcbiAgICAgICAgICAgIHJldHVybiBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhvYmopLmxlbmd0aCA9PT0gMDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBrO1xuICAgICAgICAgICAgZm9yIChrIGluIG9iaikge1xuICAgICAgICAgICAgICAgIGlmIChoYXNPd25Qcm9wKG9iaiwgaykpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNVbmRlZmluZWQoaW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIGlucHV0ID09PSB2b2lkIDA7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNOdW1iZXIoaW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIHR5cGVvZiBpbnB1dCA9PT0gJ251bWJlcicgfHxcbiAgICAgICAgICAgIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChpbnB1dCkgPT09ICdbb2JqZWN0IE51bWJlcl0nXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNEYXRlKGlucHV0KSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICBpbnB1dCBpbnN0YW5jZW9mIERhdGUgfHxcbiAgICAgICAgICAgIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChpbnB1dCkgPT09ICdbb2JqZWN0IERhdGVdJ1xuICAgICAgICApO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1hcChhcnIsIGZuKSB7XG4gICAgICAgIHZhciByZXMgPSBbXSxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBhcnJMZW4gPSBhcnIubGVuZ3RoO1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgYXJyTGVuOyArK2kpIHtcbiAgICAgICAgICAgIHJlcy5wdXNoKGZuKGFycltpXSwgaSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZXh0ZW5kKGEsIGIpIHtcbiAgICAgICAgZm9yICh2YXIgaSBpbiBiKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duUHJvcChiLCBpKSkge1xuICAgICAgICAgICAgICAgIGFbaV0gPSBiW2ldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGhhc093blByb3AoYiwgJ3RvU3RyaW5nJykpIHtcbiAgICAgICAgICAgIGEudG9TdHJpbmcgPSBiLnRvU3RyaW5nO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGhhc093blByb3AoYiwgJ3ZhbHVlT2YnKSkge1xuICAgICAgICAgICAgYS52YWx1ZU9mID0gYi52YWx1ZU9mO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGE7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY3JlYXRlVVRDKGlucHV0LCBmb3JtYXQsIGxvY2FsZSwgc3RyaWN0KSB7XG4gICAgICAgIHJldHVybiBjcmVhdGVMb2NhbE9yVVRDKGlucHV0LCBmb3JtYXQsIGxvY2FsZSwgc3RyaWN0LCB0cnVlKS51dGMoKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBkZWZhdWx0UGFyc2luZ0ZsYWdzKCkge1xuICAgICAgICAvLyBXZSBuZWVkIHRvIGRlZXAgY2xvbmUgdGhpcyBvYmplY3QuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBlbXB0eTogZmFsc2UsXG4gICAgICAgICAgICB1bnVzZWRUb2tlbnM6IFtdLFxuICAgICAgICAgICAgdW51c2VkSW5wdXQ6IFtdLFxuICAgICAgICAgICAgb3ZlcmZsb3c6IC0yLFxuICAgICAgICAgICAgY2hhcnNMZWZ0T3ZlcjogMCxcbiAgICAgICAgICAgIG51bGxJbnB1dDogZmFsc2UsXG4gICAgICAgICAgICBpbnZhbGlkRXJhOiBudWxsLFxuICAgICAgICAgICAgaW52YWxpZE1vbnRoOiBudWxsLFxuICAgICAgICAgICAgaW52YWxpZEZvcm1hdDogZmFsc2UsXG4gICAgICAgICAgICB1c2VySW52YWxpZGF0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgaXNvOiBmYWxzZSxcbiAgICAgICAgICAgIHBhcnNlZERhdGVQYXJ0czogW10sXG4gICAgICAgICAgICBlcmE6IG51bGwsXG4gICAgICAgICAgICBtZXJpZGllbTogbnVsbCxcbiAgICAgICAgICAgIHJmYzI4MjI6IGZhbHNlLFxuICAgICAgICAgICAgd2Vla2RheU1pc21hdGNoOiBmYWxzZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRQYXJzaW5nRmxhZ3MobSkge1xuICAgICAgICBpZiAobS5fcGYgPT0gbnVsbCkge1xuICAgICAgICAgICAgbS5fcGYgPSBkZWZhdWx0UGFyc2luZ0ZsYWdzKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG0uX3BmO1xuICAgIH1cblxuICAgIHZhciBzb21lO1xuICAgIGlmIChBcnJheS5wcm90b3R5cGUuc29tZSkge1xuICAgICAgICBzb21lID0gQXJyYXkucHJvdG90eXBlLnNvbWU7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgc29tZSA9IGZ1bmN0aW9uIChmdW4pIHtcbiAgICAgICAgICAgIHZhciB0ID0gT2JqZWN0KHRoaXMpLFxuICAgICAgICAgICAgICAgIGxlbiA9IHQubGVuZ3RoID4+PiAwLFxuICAgICAgICAgICAgICAgIGk7XG5cbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChpIGluIHQgJiYgZnVuLmNhbGwodGhpcywgdFtpXSwgaSwgdCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNWYWxpZChtKSB7XG4gICAgICAgIHZhciBmbGFncyA9IG51bGwsXG4gICAgICAgICAgICBwYXJzZWRQYXJ0cyA9IGZhbHNlLFxuICAgICAgICAgICAgaXNOb3dWYWxpZCA9IG0uX2QgJiYgIWlzTmFOKG0uX2QuZ2V0VGltZSgpKTtcbiAgICAgICAgaWYgKGlzTm93VmFsaWQpIHtcbiAgICAgICAgICAgIGZsYWdzID0gZ2V0UGFyc2luZ0ZsYWdzKG0pO1xuICAgICAgICAgICAgcGFyc2VkUGFydHMgPSBzb21lLmNhbGwoZmxhZ3MucGFyc2VkRGF0ZVBhcnRzLCBmdW5jdGlvbiAoaSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpICE9IG51bGw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlzTm93VmFsaWQgPVxuICAgICAgICAgICAgICAgIGZsYWdzLm92ZXJmbG93IDwgMCAmJlxuICAgICAgICAgICAgICAgICFmbGFncy5lbXB0eSAmJlxuICAgICAgICAgICAgICAgICFmbGFncy5pbnZhbGlkRXJhICYmXG4gICAgICAgICAgICAgICAgIWZsYWdzLmludmFsaWRNb250aCAmJlxuICAgICAgICAgICAgICAgICFmbGFncy5pbnZhbGlkV2Vla2RheSAmJlxuICAgICAgICAgICAgICAgICFmbGFncy53ZWVrZGF5TWlzbWF0Y2ggJiZcbiAgICAgICAgICAgICAgICAhZmxhZ3MubnVsbElucHV0ICYmXG4gICAgICAgICAgICAgICAgIWZsYWdzLmludmFsaWRGb3JtYXQgJiZcbiAgICAgICAgICAgICAgICAhZmxhZ3MudXNlckludmFsaWRhdGVkICYmXG4gICAgICAgICAgICAgICAgKCFmbGFncy5tZXJpZGllbSB8fCAoZmxhZ3MubWVyaWRpZW0gJiYgcGFyc2VkUGFydHMpKTtcbiAgICAgICAgICAgIGlmIChtLl9zdHJpY3QpIHtcbiAgICAgICAgICAgICAgICBpc05vd1ZhbGlkID1cbiAgICAgICAgICAgICAgICAgICAgaXNOb3dWYWxpZCAmJlxuICAgICAgICAgICAgICAgICAgICBmbGFncy5jaGFyc0xlZnRPdmVyID09PSAwICYmXG4gICAgICAgICAgICAgICAgICAgIGZsYWdzLnVudXNlZFRva2Vucy5sZW5ndGggPT09IDAgJiZcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MuYmlnSG91ciA9PT0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChPYmplY3QuaXNGcm96ZW4gPT0gbnVsbCB8fCAhT2JqZWN0LmlzRnJvemVuKG0pKSB7XG4gICAgICAgICAgICBtLl9pc1ZhbGlkID0gaXNOb3dWYWxpZDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgIC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ICghaXNVbmRlZmluZWQoZnJvbS5faSkpIHtcbiAgICAgICAgICAgIHRvLl9pID0gZnJvbS5faTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX2YpKSB7XG4gICAgICAgICAgICB0by5fZiA9IGZyb20uX2Y7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFpc1VuZGVmaW5lZChmcm9tLl9sKSkge1xuICAgICAgICAgICAgdG8uX2wgPSBmcm9tLl9sO1xuICAgICAgICB9XG4gICAgICAgIGlmICghaXNVbmRlZmluZWQoZnJvbS5fc3RyaWN0KSkge1xuICAgICAgICAgICAgdG8uX3N0cmljdCA9IGZyb20uX3N0cmljdDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX3R6bSkpIHtcbiAgICAgICAgICAgIHRvLl90em0gPSBmcm9tLl90em07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFpc1VuZGVmaW5lZChmcm9tLl9pc1VUQykpIHtcbiAgICAgICAgICAgIHRvLl9pc1VUQyA9IGZyb20uX2lzVVRDO1xuICAgICAgICB9XG4gICAgICAgIGlmICghaXNVbmRlZmluZWQoZnJvbS5fb2Zmc2V0KSkge1xuICAgICAgICAgICAgdG8uX29mZnNldCA9IGZyb20uX29mZnNldDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX3BmKSkge1xuICAgICAgICAgICAgdG8uX3BmID0gZ2V0UGFyc2luZ0ZsYWdzKGZyb20pO1xuICAgICAgICB9XG4gICAgICAgIGlmICghaXNVbmRlZmluZWQoZnJvbS5fbG9jYWxlKSkge1xuICAgICAgICAgICAgdG8uX2xvY2FsZSA9IGZyb20uX2xvY2FsZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChtb21lbnRQcm9wZXJ0aWVzTGVuID4gMCkge1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG1vbWVudFByb3BlcnRpZXNMZW47IGkrKykge1xuICAgICAgICAgICAgICAgIHByb3AgPSBtb21lbnRQcm9wZXJ0aWVzW2ldO1xuICAgICAgICAgICAgICAgIHZhbCA9IGZyb21bcHJvcF07XG4gICAgICAgICAgICAgICAgaWYgKCFpc1VuZGVmaW5lZCh2YWwpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvW3Byb3BdID0gdmFsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0bztcbiAgICB9XG5cbiAgICAvLyBNb21lbnQgcHJvdG90eXBlIG9iamVjdFxuICAgIGZ1bmN0aW9uIE1vbWVudChjb25maWcpIHtcbiAgICAgICAgY29weUNvbmZpZyh0aGlzLCBjb25maWcpO1xuICAgICAgICB0aGlzLl9kID0gbmV3IERhdGUoY29uZmlnLl9kICE9IG51bGwgPyBjb25maWcuX2QuZ2V0VGltZSgpIDogTmFOKTtcbiAgICAgICAgaWYgKCF0aGlzLmlzVmFsaWQoKSkge1xuICAgICAgICAgICAgdGhpcy5fZCA9IG5ldyBEYXRlKE5hTik7XG4gICAgICAgIH1cbiAgICAgICAgLy8gUHJldmVudCBpbmZpbml0ZSBsb29wIGluIGNhc2UgdXBkYXRlT2Zmc2V0IGNyZWF0ZXMgbmV3IG1vbWVudFxuICAgICAgICAvLyBvYmplY3RzLlxuICAgICAgICBpZiAodXBkYXRlSW5Qcm9ncmVzcyA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgIHVwZGF0ZUluUHJvZ3Jlc3MgPSB0cnVlO1xuICAgICAgICAgICAgaG9va3MudXBkYXRlT2Zmc2V0KHRoaXMpO1xuICAgICAgICAgICAgdXBkYXRlSW5Qcm9ncmVzcyA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNNb21lbnQob2JqKSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICBvYmogaW5zdGFuY2VvZiBNb21lbnQgfHwgKG9iaiAhPSBudWxsICYmIG9iai5faXNBTW9tZW50T2JqZWN0ICE9IG51bGwpXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gd2Fybihtc2cpIHtcbiAgICAgICAgaWYgKFxuICAgICAgICAgICAgaG9va3Muc3VwcHJlc3NEZXByZWNhdGlvbldhcm5pbmdzID09PSBmYWxzZSAmJlxuICAgICAgICAgICAgdHlwZW9mIGNvbnNvbGUgIT09ICd1bmRlZmluZWQnICYmXG4gICAgICAgICAgICBjb25zb2xlLndhcm5cbiAgICAgICAgKSB7XG4gICAgICAgICAgICBjb25zb2xlLndhcm4oJ0RlcHJlY2F0aW9uIHdhcm5pbmc6ICcgKyBtc2cpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZGVwcmVjYXRlKG1zZywgZm4pIHtcbiAgICAgICAgdmFyIGZpcnN0VGltZSA9IHRydWU7XG5cbiAgICAgICAgcmV0dXJuIGV4dGVuZChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoaG9va3MuZGVwcmVjYXRpb25IYW5kbGVyICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBob29rcy5kZXByZWNhdGlvbkhhbmRsZXIobnVsbCwgbXNnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChmaXJzdFRpbWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgYXJncyA9IFtdLFxuICAgICAgICAgICAgICAgICAgICBhcmcsXG4gICAgICAgICAgICAgICAgICAgIGksXG4gICAgICAgICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgICAgICAgYXJnTGVuID0gYXJndW1lbnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgYXJnTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgYXJnID0gJyc7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgYXJndW1lbnRzW2ldID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXJnICs9ICdcXG5bJyArIGkgKyAnXSAnO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChrZXkgaW4gYXJndW1lbnRzWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc093blByb3AoYXJndW1lbnRzWzBdLCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZyArPSBrZXkgKyAnOiAnICsgYXJndW1lbnRzWzBdW2tleV0gKyAnLCAnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZyA9IGFyZy5zbGljZSgwLCAtMik7IC8vIFJlbW92ZSB0cmFpbGluZyBjb21tYSBhbmQgc3BhY2VcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZyA9IGFyZ3VtZW50c1tpXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBhcmdzLnB1c2goYXJnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgd2FybihcbiAgICAgICAgICAgICAgICAgICAgbXNnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICdcXG5Bcmd1bWVudHM6ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJncykuam9pbignJykgK1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1xcbicgK1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEVycm9yKCkuc3RhY2tcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIGZpcnN0VGltZSA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGZuLmFwcGx5K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XNGdW5jdGlvbihwcm9wKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzW2ldID0gcHJvcDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzWydfJyArIGldID0gcHJvcDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fY29uZmlnID0gY29uZmlnO1xuICAgICAgICAvLyBMZW5pZW50IG9yZGluYWwgcGFyc2luZyBhY2NlcHRzIGp1c3QgYSBudW1iZXIgaW4gYWRkaXRpb24gdG9cbiAgICAgICAgLy8gbnVtYmVyICsgKHBvc3NpYmx5KSBzdHVmZiBjb21pbmcgZnJvbSBfZGF5T2ZNb250aE9yZGluYWxQYXJzZS5cbiAgICAgICAgLy8gVE9ETzogUmVtb3ZlIFwib3JkaW5hbFBhcnNlXCIgZmFsbGJhY2sgaW4gbmV4dCBtYWpvciByZWxlYXNlLlxuICAgICAgICB0aGlzLl9kYXlPZk1vbnRoT3JkaW5hbFBhcnNlTGVuaWVudCA9IG5ldyBSZWdFeHAoXG4gICAgICAgICAgICAodGhpcy5fZGF5T2ZNb250aE9yZGluYWxQYXJzZS5zb3VyY2UgfHwgdGhpcy5fb3JkaW5hbFBhcnNlLnNvdXJjZSkgK1xuICAgICAgICAgICAgICAgICd8JyArXG4gICAgICAgICAgICAgICAgL1xcZHsxLDJ9Ly5zb3VyY2VcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtZXJnZUNvbmZpZ3MocGFyZW50Q29uZmlnLCBjaGlsZENvbmZpZykge1xuICAgICAgICB2YXIgcmVzID0gZXh0ZW5kKHt9LCBwYXJlbnRDb25maWcpLFxuICAgICAgICAgICAgcHJvcDtcbiAgICAgICAgZm9yIChwcm9wIGluIGNoaWxkQ29uZmlnKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duUHJvcChjaGlsZENvbmZpZywgcHJvcCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNPYmplY3QocGFyZW50Q29uZmlnW3Byb3BdKSAmJiBpc09iamVjdChjaGlsZENvbmZpZ1twcm9wXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzW3Byb3BdID0ge307XG4gICAgICAgICAgICAgICAgICAgIGV4dGVuZChyZXNbcHJvcF0sIHBhcmVudENvbmZpZ1twcm9wXSk7XG4gICAgICAgICAgICAgICAgICAgIGV4dGVuZChyZXNbcHJvcF0sIGNoaWxkQ29uZmlnW3Byb3BdKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoaWxkQ29uZmlnW3Byb3BdICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzW3Byb3BdID0gY2hpbGRDb25maWdbcHJvcF07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJlc1twcm9wXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChwcm9wIGluIHBhcmVudENvbmZpZykge1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIGhhc093blByb3AocGFyZW50Q29uZmlnLCBwcm9wKSAmJlxuICAgICAgICAgICAgICAgICFoYXNPd25Qcm9wKGNoaWxkQ29uZmlnLCBwcm9wKSAmJlxuICAgICAgICAgICAgICAgIGlzT2JqZWN0KHBhcmVudENvbmZpZ1twcm9wXSlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSBjaGFuZ2VzIHRvIHByb3BlcnRpZXMgZG9uJ3QgbW9kaWZ5IHBhcmVudCBjb25maWdcbiAgICAgICAgICAgICAgICByZXNbcHJvcF0gPSBleHRlbmQoe30sIHJlc1twcm9wXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlcztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBMb2NhbGUoY29uZmlnKSB7XG4gICAgICAgIGlmIChjb25maWcgIT0gbnVsbCkge1xuICAgICAgICAgICAgdGhpcy5zZXQoY29uZmlnKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBrZXlzO1xuXG4gICAgaWYgKE9iamVjdC5rZXlzKSB7XG4gICAgICAgIGtleXMgPSBPYmplY3Qua2V5cztcbiAgICB9IGVsc2Uge1xuICAgICAgICBrZXlzID0gZnVuY3Rpb24gKG9iaikge1xuICAgICAgICAgICAgdmFyIGksXG4gICAgICAgICAgICAgICAgcmVzID0gW107XG4gICAgICAgICAgICBmb3IgKGkgaW4gb2JqKSB7XG4gICAgICAgICAgICAgICAgaWYgKGhhc093blByb3Aob2JqLCBpKSkge1xuICAgICAgICAgICAgICAgICAgICByZXMucHVzaChpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIHZhciBkZWZhdWx0Q2FsZW5kYXIgPSB7XG4gICAgICAgIHNhbWVEYXk6ICdbVG9kYXkgYXRdIExUJyxcbiAgICAgICAgbmV4dERheTogJ1tUb21vcnJvdyBhdF0gTFQnLFxuICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2F0XSBMVCcsXG4gICAgICAgIGxhc3REYXk6ICdbWWVzdGVyZGF5IGF0XSBMVCcsXG4gICAgICAgIGxhc3RXZWVrOiAnW0xhc3RdIGRkZGQgW2F0XSBMVCcsXG4gICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIGNhbGVuZGFyKGtleSwgbW9tLCBub3cpIHtcbiAgICAgICAgdmFyIG91dHB1dCA9IHRoaXMuX2NhbGVuZGFyW2tleV0gfHwgdGhpcy5fY2FsZW5kYXJbJ3NhbWVFbHNlJ107XG4gICAgICAgIHJldHVybiBpc0Z1bmN0aW9uKG91dHB1dCkgPyB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vIHRva2VuOiAgICAnTSdcbiAgICAvLyBwYWRkZWQ6ICAgWydNTScsIDJdXG4gICAgLy8gb3JkaW5hbDogICdNbydcbiAgICAvLyBjYWxsYmFjazogZnVuY3Rpb24gKCkgeyB0aGlzLm1vbnRoKCkgKyAxIH1cbiAgICBmdW5jdGlvbiBhZGRGb3JtYXRUb2tlbih0b2tlbiwgcGFkZGVkLCBvcmRpbmFsLCBjYWxsYmFjaykge1xuICAgICAgICB2YXIgZnVuYyA9IGNhbGxiYWNrO1xuICAgICAgICBpZiAodHlwZW9mIGNhbGxiYWNrID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgZnVuYyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpc1tjYWxsYmFja10oKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRva2VuKSB7XG4gICAgICAgICAgICBmb3JtYXRUb2tlbkZ1bmN0aW9uc1t0b2tlbl0gPSBmdW5jO1xuICAgICAgICB9XG4gICAgICAgIGlmIChwYWRkZWQpIHtcbiAgICAgICAgICAgIGZvcm1hdFRva2VuRnVuY3Rpb25zW3BhZGRlZFswXV0gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHplcm9GaWxsKGZ1bmMuYXBwbHkodGhpcywgYXJndW1lbnRzKSwgcGFkZGVkWzFdLCBwYWRkZWRbMl0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBpZiAob3JkaW5hbCkge1xuICAgICAgICAgICAgZm9ybWF0VG9rZW5GdW5jdGlvbnNbb3JkaW5hbF0gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubG9jYWxlRGF0YSgpLm9yZGluYWwoXG4gICAgICAgICAgICAgICAgICAgIGZ1bmMuYXBwbHkodGhpcywgYXJndW1lbnRzKSxcbiAgICAgICAgICAgICAgICAgICAgdG9rZW5cbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlbW92ZUZvcm1hdHRpbmdUb2tlbnMoaW5wdXQpIHtcbiAgICAgICAgaWYgKGlucHV0Lm1hdGNoKC9cXFtbXFxzXFxTXS8pKSB7XG4gICAgICAgICAgICByZXR1cm4gaW5wdXQucmVwbGFjZSgvXlxcW3xcXF0kL2csICcnKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaW5wdXQucmVwbGFjZSgvXFxcXC9nLCAnJyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbWFrZUZvcm1hdEZ1bmN0aW9uKGZvcm1hdCkge1xuICAgICAgICB2YXIgYXJyYXkgPSBmb3JtYXQubWF0Y2goZm9ybWF0dGluZ1Rva2VucyksXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgbGVuZ3RoO1xuXG4gICAgICAgIGZvciAoaSA9IDAsIGxlbmd0aCA9IGFycmF5Lmxlbmd0aDsgaSA8IGxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAoZm9ybWF0VG9rZW5GdW5jdGlvbnNbYXJyYXlbaV1dKSB7XG4gICAgICAgICAgICAgICAgYXJyYXlbaV0gPSBmb3JtYXRUb2tlbkZ1bmN0aW9uc1thcnJheVtpXV07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGFycmF5W2ldID0gcmVtb3ZlRm9ybWF0dGluZ1Rva2VucyhhcnJheVtpXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKG1vbSkge1xuICAgICAgICAgICAgdmFyIG91dHB1dCA9ICcnLFxuICAgICAgICAgICAgICAgIGk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBvdXRwdXQgKz0gaXNGdW5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MpXG4gICAgICAgICAgICAubWFwKGZ1bmN0aW9uICh0b2spIHtcbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgIHRvayA9PT0gJ01NTU0nIHx8XG4gICAgICAgICAgICAgICAgICAgIHRvayA9PT0gJ01NJyB8fFxuICAgICAgICAgICAgICAgICAgICB0b2sgPT09ICdERCcgfHxcbiAgICAgICAgICAgICAgICAgICAgdG9rID09PSAnZGRkZCdcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRvay5zbGljZSgxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvaztcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuam9pbignJyk7XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuX2xvbmdEYXRlRm9ybWF0W2tleV07XG4gICAgfVxuXG4gICAgdmFyIGRlZmF1bHRJbnZhbGlkRGF0ZSA9ICdJbnZhbGlkIGRhdGUnO1xuXG4gICAgZnVuY3Rpb24gaW52YWxpZERhdGUoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9pbnZhbGlkRGF0ZTtcbiAgICB9XG5cbiAgICB2YXIgZGVmYXVsdE9yZGluYWwgPSAnJWQnLFxuICAgICAgICBkZWZhdWx0RGF5T2ZNb250aE9yZGluYWxQYXJzZSA9IC9cXGR7MSwyfS87XG5cbiAgICBmdW5jdGlvbiBvcmRpbmFsKG51bWJlcikge1xuICAgICAgICByZXR1cm4gdGhpcy5fb3JkaW5hbC5yZXBsYWNlKCclZCcsIG51bWJlcik7XG4gICAgfVxuXG4gICAgdmFyIGRlZmF1bHRSZWxhdGl2ZVRpbWUgPSB7XG4gICAgICAgIGZ1dHVyZTogJ2luICVzJyxcbiAgICAgICAgcGFzdDogJyVzIGFnbycsXG4gICAgICAgIHM6ICdhIGZldyBzZWNvbmRzJyxcbiAgICAgICAgc3M6ICclZCBzZWNvbmRzJyxcbiAg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2RhdGUnLFxuICAgICAgICBkYXRlOiAnZGF0ZScsXG4gICAgICAgIGQ6ICdkYXknLFxuICAgICAgICBkYXlzOiAnZGF5JyxcbiAgICAgICAgZGF5OiAnZGF5JyxcbiAgICAgICAgZTogJ3dlZWtkYXknLFxuICAgICAgICB3ZWVrZGF5czogJ3dlZWtkYXknLFxuICAgICAgICB3ZWVrZGF5OiAnd2Vla2RheScsXG4gICAgICAgIEU6ICdpc29XZWVrZGF5JyxcbiAgICAgICAgaXNvd2Vla2RheXM6ICdpc29XZWVrZGF5JyxcbiAgICAgICAgaXNvd2Vla2RheTogJ2lzb1dlZWtkYXknLFxuICAgICAgICBEREQ6ICdkYXlPZlllYXInLFxuICAgICAgICBkYXlvZnllYXJzOiAnZGF5T2ZZZWFyJyxcbiAgICAgICAgZGF5b2Z5ZWFyOiAnZGF5T2ZZZWFyJyxcbiAgICAgICAgaDogJ2hvdXInLFxuICAgICAgICBob3VyczogJ2hvdXInLFxuICAgICAgICBob3VyOiAnaG91cicsXG4gICAgICAgIG1zOiAnbWlsbGlzZWNvbmQnLFxuICAgICAgICBtaWxsaXNlY29uZHM6ICdtaWxsaXNlY29uZCcsXG4gICAgICAgIG1pbGxpc2Vjb25kOiAnbWlsbGlzZWNvbmQnLFxuICAgICAgICBtOiAnbWludXRlJyxcbiAgICAgICAgbWludXRlczogJ21pbnV0ZScsXG4gICAgICAgIG1pbnV0ZTogJ21pbnV0ZScsXG4gICAgICAgIE06ICdtb250aCcsXG4gICAgICAgIG1vbnRoczogJ21vbnRoJyxcbiAgICAgICAgbW9udGg6ICdtb250aCcsXG4gICAgICAgIFE6ICdxdWFydGVyJyxcbiAgICAgICAgcXVhcnRlcnM6ICdxdWFydGVyJyxcbiAgICAgICAgcXVhcnRlcjogJ3F1YXJ0ZXInLFxuICAgICAgICBzOiAnc2Vjb25kJyxcbiAgICAgICAgc2Vjb25kczogJ3NlY29uZCcsXG4gICAgICAgIHNlY29uZDogJ3NlY29uZCcsXG4gICAgICAgIGdnOiAnd2Vla1llYXInLFxuICAgICAgICB3ZWVreWVhcnM6ICd3ZWVrWWVhcicsXG4gICAgICAgIHdlZWt5ZWFyOiAnd2Vla1llYXInLFxuICAgICAgICBHRzogJ2lzb1dlZWtZZWFyJyxcbiAgICAgICAgaXNvd2Vla3llYXJzOiAnaXNvV2Vla1llYXInLFxuICAgICAgICBpc293ZWVreWVhcjogJ2lzb1dlZWtZZWFyJyxcbiAgICAgICAgdzogJ3dlZWsnLFxuICAgICAgICB3ZWVrczogJ3dlZWsnLFxuICAgICAgICB3ZWVrOiAnd2VlaycsXG4gICAgICAgIFc6ICdpc29XZWVrJyxcbiAgICAgICAgaXNvd2Vla3M6ICdpc29XZWVrJyxcbiAgICAgICAgaXNvd2VlazogJ2lzb1dlZWsnLFxuICAgICAgICB5OiAneWVhcicsXG4gICAgICAgIHllYXJzOiAneWVhcicsXG4gICAgICAgIHllYXI6ICd5ZWFyJyxcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gbm9ybWFsaXplVW5pdHModW5pdHMpIHtcbiAgICAgICAgcmV0dXJuIHR5cGVvZiB1bml0cyA9PT0gJ3N0cmluZydcbiAgICAgICAgICAgID8gYWxpYXNlc1t1bml0c10gfHwgYWxpYXNlc1t1bml0cy50b0xvd2VyQ2FzZSgpXVxuICAgICAgICAgICAgOiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbm9ybWFsaXplT2JqZWN0VW5pdHMoaW5wdXRPYmplY3QpIHtcbiAgICAgICAgdmFyIG5vcm1hbGl6ZWRJbnB1dCA9IHt9LFxuICAgICAgICAgICAgbm9ybWFsaXplZFByb3AsXG4gICAgICAgICAgICBwcm9wO1xuXG4gICAgICAgIGZvciAocHJvcCBpbiBpbnB1dE9iamVjdCkge1xuICAgICAgICAgICAgaWYgKGhhc093blByb3AoaW5wdXRPYmplY3QsIHByb3ApKSB7XG4gICAgICAgICAgICAgICAgbm9ybWFsaXplZFByb3AgPSBub3JtYWxpemVVbml0cyhwcm9wKTtcbiAgICAgICAgICAgICAgICBpZiAobm9ybWFsaXplZFByb3ApIHtcbiAgICAgICAgICAgICAgICAgICAgbm9ybWFsaXplZElucHV0W25vcm1hbGl6ZWRQcm9wXSA9IGlucHV0T2JqZWN0W3Byb3BdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBub3JtYWxpemVkSW5wdXQ7XG4gICAgfVxuXG4gICAgdmFyIHByaW9yaXRpZXMgPSB7XG4gICAgICAgIGRhdGU6IDksXG4gICAgICAgIGRheTogMTEsXG4gICAgICAgIHdlZWtkYXk6IDExLFxuICAgICAgICBpc29XZWVrZGF5OiAxMSxcbiAgICAgICAgZGF5T2ZZZWFyOiA0LFxuICAgICAgICBob3VyOiAxMyxcbiAgICAgICAgbWlsbGlzZWNvbmQ6IDE2LFxuICAgICAgICBtaW51dGU6IDE0LFxuICAgICAgICBtb250aDogOCxcbiAgICAgICAgcXVhcnRlcjogNyxcbiAgICAgICAgc2Vjb25kOiAxNSxcbiAgICAgICAgd2Vla1llYXI6IDEsXG4gICAgICAgIGlzb1dlZWtZZWFyOiAxLFxuICAgICAgICB3ZWVrOiA1LFxuICAgICAgICBpc29XZWVrOiA1LFxuICAgICAgICB5ZWFyOiAxLFxuICAgIH07XG5cbiAgICBmdW5jdGlvbiBnZXRQcmlvcml0aXplZFVuaXRzKHVuaXRzT2JqKSB7XG4gICAgICAgIHZhciB1bml0cyA9IFtdLFxuICAgICAgICAgICAgdTtcbiAgICAgICAgZm9yICh1IGluIHVuaXRzT2JqKSB7XG4gICAgICAgICAgICBpZiAoaGFzT3duUHJvcCh1bml0c09iaiwgdSkpIHtcbiAgICAgICAgICAgICAgICB1bml0cy5wdXNoKHsgdW5pdDogdSwgcHJpb3JpdHk6IHByaW9yaXRpZXNbdV0gfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdW5pdHMuc29ydChm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5dID0gaXNGdW5jdGlvbihyZWdleClcbiAgICAgICAgICAgID8gcmVnZXhcbiAgICAgICAgICAgIDogZnVuY3Rpb24gKGlzU3RyaWN0LCBsb2NhbGVEYXRhKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gaXNTdHJpY3QgJiYgc3RyaWN0UmVnZXggPyBzdHJpY3RSZWdleCA6IHJlZ2V4O1xuICAgICAgICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldFBhcnNlUmVnZXhGb3JUb2tlbih0b2tlbiwgY29uZmlnKSB7XG4gICAgICAgIGlmICghaGFzT3duUHJvcChyZWdleGVzLCB0b2tlbikpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgUmVnRXhwKHVuZXNjYXBlRm9ybWF0KHRva2VuKSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVnZXhlc1t0b2tlbl0oY29uZmlnLl9zdHJpY3QsIGNvbmZpZy5fbG9jYWxlKTtcbiAgICB9XG5cbiAgICAvLyBDb2RlIGZyb20gaHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL3F1ZXN0aW9ucy8zNTYxNDkzL2lzLXRoZXJlLWEtcmVnZXhwLWVzY2FwZS1mdW5jdGlvbi1pbi1qYXZhc2NyaXB0XG4gICAgZnVuY3Rpb24gdW5lc2NhcGVGb3JtYXQocykge1xuICAgICAgICByZXR1cm4gcmVnZXhFc2NhcGUoXG4gICAgICAgICAgICBzXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoJ1xcXFwnLCAnJylcbiAgICAgICAgICAgICAgICAucmVwbGFjZShcbiAgICAgICAgICAgICAgICAgICAgL1xcXFwoXFxbKXxcXFxcKFxcXSl8XFxbKFteXFxdXFxbXSopXFxdfFxcXFwoLikvZyxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKG1hdGNoZWQsIHAxLCBwMiwgcDMsIHA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcDEgfHwgcDIgfHwgcDMgfHwgcDQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcmVnZXhFc2NhcGUocykge1xuICAgICAgICByZXR1cm4gcy5yZXBsYWNlKC9bLVxcL1xcXFxeJCorPy4oKXxbXFxde31dL2csICdcXFxcJCYnKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBhYnNGbG9vcihudW1iZXIpIHtcbiAgICAgICAgaWYgKG51bWJlciA8IDApIHtcbiAgICAgICAgICAgIC8vIC0wIC0+IDBcbiAgICAgICAgICAgIHJldHVybiBNYXRoLmNlaWwobnVtYmVyKSB8fCAwO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIE1hdGguZmxvb3IobnVtYmVyKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHRvSW50KGFyZ3VtZW50Rm9yQ29lcmNpb24pIHtcbiAgICAgICAgdmFyIGNvZXJjZWROdW1iZXIgPSArYXJndW1lbnRGb3JDb2VyY2lvbixcbiAgICAgICAgICAgIHZhbHVlID0gMDtcblxuICAgICAgICBpZiAoY29lcmNlZE51bWJlciAhPT0gMCAmJiBpc0Zpbml0ZShjb2VyY2VkTnVtYmVyKSkge1xuICAgICAgICAgICAgdmFsdWUgPSBhYnNGbG9vcihjb2VyY2VkTnVtYmVyKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICB2YXIgdG9rZW5zID0ge307XG5cbiAgICBmdW5jdGlvbiBhZGRQYXJzZVRva2VuKHRva2VuLCBjYWxsYmFjaykge1xuICAgICAgICB2YXIgaSxcbiAgICAgICAgICAgIGZ1bmMgPSBjYWxsYmFjayxcbiAgICAgICAgICAgIHRva2VuTGVuO1xuICAgICAgICBpZiAodHlwZW9mIHRva2VuID09PSAnc3RyaW5nJykge1xuICA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IGdldElzTGVhcFllYXIoKSB7XG4gICAgICAgIHJldHVybiBpc0xlYXBZZWFyKHRoaXMueWVhcigpKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtYWtlR2V0U2V0KHVuaXQsIGtlZXBUaW1lKSB7XG4gICAgICAgIHJldHVybiBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh2YWx1ZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgc2V0JDEodGhpcywgdW5pdCwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIGhvb2tzLnVwZGF0ZU9mZnNldCh0aGlzLCBrZWVwVGltZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBnZXQodGhpcywgdW5pdCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0KG1vbSwgdW5pdCkge1xuICAgICAgICBpZiAoIW1vbS5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIHJldHVybiBOYU47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgZCA9IG1vbS5fZCxcbiAgICAgICAgICAgIGlzVVRDID0gbW9tLl9pc1VUQztcblxuICAgICAgICBzd2l0Y2ggKHVuaXQpIHtcbiAgICAgICAgICAgIGNhc2UgJ01pbGxpc2Vjb25kcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVVRDID8gZC5nZXRVVENNaWxsaXNlY29uZHMoKSA6IGQuZ2V0TWlsbGlzZWNvbmRzKCk7XG4gICAgICAgICAgICBjYXNlICdTZWNvbmRzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNVVEMgPyBkLmdldFVUQ1NlY29uZHMoKSA6IGQuZ2V0U2Vjb25kcygpO1xuICAgICAgICAgICAgY2FzZSAnTWludXRlcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVVRDID8gZC5nZXRVVENNaW51dGVzKCkgOiBkLmdldE1pbnV0ZXMoKTtcbiAgICAgICAgICAgIGNhc2UgJ0hvdXJzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNVVEMgPyBkLmdldFVUQ0hvdXJzKCkgOiBkLmdldEhvdXJzKCk7XG4gICAgICAgICAgICBjYXNlICdEYXRlJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNVVEMgPyBkLmdldFVUQ0RhdGUoKSA6IGQuZ2V0RGF0ZSgpO1xuICAgICAgICAgICAgY2FzZSAnRGF5JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNVVEMgPyBkLmdldFVUQ0RheSgpIDogZC5nZXREYXkoKTtcbiAgICAgICAgICAgIGNhc2UgJ01vbnRoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNVVEMgPyBkLmdldFVUQ01vbnRoKCkgOiBkLmdldE1vbnRoKCk7XG4gICAgICAgICAgICBjYXNlICdGdWxsWWVhcic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVVRDID8gZC5nZXRVVENGdWxsWWVhcigpIDogZC5nZXRGdWxsWWVhcigpO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICByZXR1cm4gTmFOOyAvLyBKdXN0IGluIGNhc2VcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHNldCQxKG1vbSwgdW5pdCwgdmFsdWUpIHtcbiAgICAgICAgdmFyIGQsIGlzVVRDLCB5ZWFyLCBtb250aCwgZGF0ZTtcblxuICAgICAgICBpZiAoIW1vbS5pc1ZhbGlkKCkgfHwgaXNOYU4odmFsdWUpKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBkID0gbW9tLl9kO1xuICAgICAgICBpc1VUQyA9IG1vbS5faXNVVEM7XG5cbiAgICAgICAgc3dpdGNoICh1bml0KSB7XG4gICAgICAgICAgICBjYXNlICdNaWxsaXNlY29uZHMnOlxuICAgICAgICAgICAgICAgIHJldHVybiB2b2lkIChpc1VUQ1xuICAgICAgICAgICAgICAgICAgICA/IGQuc2V0VVRDTWlsbGlzZWNvbmRzKHZhbHVlKVxuICAgICAgICAgICAgICAgICAgICA6IGQuc2V0TWlsbGlzZWNvbmRzKHZhbHVlKSk7XG4gICAgICAgICAgICBjYXNlICdTZWNvbmRzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gdm9pZCAoaXNVVEMgPyBkLnNldFVUQ1NlY29uZHModmFsdWUpIDogZC5zZXRTZWNvbmRzKHZhbHVlKSk7XG4gICAgICAgICAgICBjYXNlICdNaW51dGVzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gdm9pZCAoaXNVVEMgPyBkLnNldFVUQ01pbnV0ZXModmFsdWUpIDogZC5zZXRNaW51dGVzKHZhbHVlKSk7XG4gICAgICAgICAgICBjYXNlICdIb3Vycyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZvaWQgKGlzVVRDID8gZC5zZXRVVENIb3Vycyh2YWx1ZSkgOiBkLnNldEhvdXJzKHZhbHVlKSk7XG4gICAgICAgICAgICBjYXNlICdEYXRlJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gdm9pZCAoaXNVVEMgPyBkLnNldFVUQ0RhdGUodmFsdWUpIDogZC5zZXREYXRlKHZhbHVlKSk7XG4gICAgICAgICAgICAvLyBjYXNlICdEYXknOiAvLyBOb3QgcmVhbFxuICAgICAgICAgICAgLy8gICAgcmV0dXJuIHZvaWQgKGlzVVRDID8gZC5zZXRVVENEYXkodmFsdWUpIDogZC5zZXREYXkodmFsdWUpKTtcbiAgICAgICAgICAgIC8vIGNhc2UgJ01vbnRoJzogLy8gTm90IHVzZWQgYmVjYXVzZSB3ZSBuZWVkIHRvIHBhc3MgdHdvIHZhcmlhYmxlc1xuICAgICAgICAgICAgLy8gICAgIHJldHVybiB2b2lkIChpc1VUQyA/IGQuc2V0VVRDTW9udGgodmFsdWUpIDogZC5zZXRNb250aCh2YWx1ZSkpO1xuICAgICAgICAgICAgY2FzZSAnRnVsbFllYXInOlxuICAgICAgICAgICAgICAgIGJyZWFrOyAvLyBTZWUgYmVsb3cgLi4uXG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHJldHVybjsgLy8gSnVzdCBpbiBjYXNlXG4gICAgICAgIH1cblxuICAgICAgICB5ZWFyID0gdmFsdWU7XG4gICAgICAgIG1vbnRoID0gbW9tLm1vbnRoKCk7XG4gICAgICAgIGRhdGUgPSBtb20uZGF0ZSgpO1xuICAgICAgICBkYXRlID0gZGF0ZSA9PT0gMjkgJiYgbW9udGggPT09IDEgJiYgIWlzTGVhcFllYXIoeWVhcikgPyAyOCA6IGRhdGU7XG4gICAgICAgIHZvaWQgKGlzVVRDXG4gICAgICAgICAgICA/IGQuc2V0VVRDRnVsbFllYXIoeWVhciwgbW9udGgsIGRhdGUpXG4gICAgICAgICAgICA6IGQuc2V0RnVsbFllYXIoeWVhciwgbW9udGgsIGRhdGUpKTtcbiAgICB9XG5cbiAgICAvLyBNT01FTlRTXG5cbiAgICBmdW5jdGlvbiBzdHJpbmdHZXQodW5pdHMpIHtcbiAgICAgICAgdW5pdHMgPSBub3JtYWxpemVVbml0cyh1bml0cyk7XG4gICAgICAgIGlmIChpc0Z1bmN0aW9uKHRoaXNbdW5pdHNdKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXNbdW5pdHNdKCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc3RyaW5nU2V0KHVuaXRzLCB2YWx1ZSkge1xuICAgICAgICBpZiAodHlwZW9mIHVuaXRzID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgdW5pdHMgPSBub3JtYWxpemVPYmplY3RVbml0cyh1bml0cyk7XG4gICAgICAgICAgICB2YXIgcHJpb3JpdGl6ZWQgPSBnZXRQcmlvcml0aXplZFVuaXRzKHVuaXRzKSxcbiAgICAgICAgICAgICAgICBpLFxuICAgICAgICAgICAgICAgIHByaW9yaXRpemVkTGVuID0gcHJpb3JpdGl6ZWQubGVuZ3RoO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHByaW9yaXRpemVkTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICB0aGlzW3ByaW9yaXRpemVkW2ldLnVuaXRdKHVuaXRzW3ByaW9yaXRpemVkW2ldLnVuaXRdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHVuaXRzID0gbm9ybWFsaXplVW5pdHModW5pdHMpO1xuICAgICAgICAgICAgaWYgKGlzRnVuY3Rpb24odGhpc1t1bml0c10pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXNbdW5pdHNdKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtb2QobiwgeCkge1xuICAgICAgICByZXR1cm4gKChuICUgeCkgKyB4KSAlIHg7XG4gICAgfVxuXG4gICAgdmFyIGluZGV4T2Y7XG5cbiAgICBpZiAoQXJyYXkucHJvdG90eXBlLmluZGV4T2YpIHtcbiAgICAgICAgaW5kZXhPZiA9IEFycmF5LnByb3RvdHlwZS5pbmRleE9mO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIGluZGV4T2YgPSBmdW5jdGlvbiAobykge1xuICAgICAgICAgICAgLy8gSSBrbm93XG4gICAgICAgICAgICB2YXIgaTtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0aGlzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXNbaV0gPT09IG8pIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIC0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icnVhcnlfTWFyY2hfQXByaWxfTWF5X0p1bmVfSnVseV9BdWd1c3RfU2VwdGVtYmVyX09jdG9iZXJfTm92ZW1iZXJfRGVjZW1iZXInLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgZGVmYXVsdExvY2FsZU1vbnRoc1Nob3J0ID1cbiAgICAgICAgICAgICdKYW5fRmViX01hcl9BcHJfTWF5X0p1bl9KdWxfQXVnX1NlcF9PY3RfTm92X0RlYycuc3BsaXQoJ18nKSxcbiAgICAgICAgTU9OVEhTX0lOX0ZPUk1BVCA9IC9EW29EXT8oXFxbW15cXFtcXF1dKlxcXXxcXHMpK01NTU0/LyxcbiAgICAgICAgZGVmYXVsdE1vbnRoc1Nob3J0UmVnZXggPSBtYXRjaFdvcmQsXG4gICAgICAgIGRlZmF1bHRNb250aHNSZWdleCA9IG1hdGNoV29yZDtcblxuICAgIGZ1bmN0aW9uIGxvY2FsZU1vbnRocyhtLCBmb3JtYXQpIHtcbiAgICAgICAgaWYgKCFtKSB7XG4gICAgICAgICAgICByZXR1cm4gaXNBcnJheSh0aGlzLl9tb250aHMpXG4gICAgICAgICAgICAgICAgPyB0aGlzLl9tb250aHNcbiAgICAgICAgICAgICAgICA6IHRoaXMuX21vbnRoc1snc3RhbmRhbG9uZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBpc0FycmF5KHRoaXMuX21vbnRocylcbiAgICAgICAgICAgID8gdGhpcy5fbW9udGhzW20ubW9udGgoKV1cbiAgICAgICAgICAgIDogdGhpcy5fbW9udGhzW1xuICAgICAgICAgICAgICAgICAgKHRoaXMuX21vbnRocy5pc0Zvcm1hdCB8fCBNT05USFNfSU5fRk9STUFUKS50ZXN0KGZvcm1hdClcbiAgICAgICAgICAgICAgICAgICAgICA/ICdmb3JtYXQnXG4gICAgICAgICAgICAgICAgICAgICAgOiAnc3RhbmRhbG9uZSdcbiAgICAgICAgICAgICAgXVttLm1vbnRoKCldO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGxvY2FsZU1vbnRoc1Nob3J0KG0sIGZvcm1hdCkge1xuICAgICAgICBpZiAoIW0pIHtcbiAgICAgICAgICAgIHJldHVybiBpc0FycmF5KHRoaXMuX21vbnRoc1Nob3J0KVxuICAgICAgICAgICAgICAgID8gdGhpcy5fbW9udGhzU2hvcnRcbiAgICAgICAgICAgICAgICA6IHRoaXMuX21vbnRoc1Nob3J0WydzdGFuZGFsb25lJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGlzQXJyYXkodGhpcy5fbW9udGhzU2hvcnQpXG4gICAgICAgICAgICA/IHRoaXMuX21vbnRoc1Nob3J0W20ubW9udGgoKV1cbiAgICAgICAgICAgIDogdGhpcy5fbW9udGhzU2hvcnRbXG4gICAgICAgICAgICAgICAgICBNT05USFNfSU5fRk9STUFULnRlc3QoZm9ybWF0KSA/ICdmb3JtYXQnIDogJ3N0YW5kYWxvbmUnXG4gICAgICAgICAgICAgIF1bbS5tb250aCgpXTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBoYW5kbGVTdHJpY3RQYXJzZShtb250aE5hbWUsIGZvcm1hdCwgc3RyaWN0KSB7XG4gICAgICAgIHZhciBpLFxuICAgICAgICAgICAgaWksXG4gICAgICAgICAgICBtb20sXG4gICAgICAgICAgICBsbGMgPSBtb250aE5hbWUudG9Mb2NhbGVMb3dlckNhc2UoKTtcbiAgICAgICAgaWYgKCF0aGlzLl9tb250aHNQYXJzZSkge1xuICAgICAgICAgICAgLy8gdGhpcyBpcyBub3QgdXNlZFxuICAgICAgICAgICAgdGhpcy5fbW9udGhzUGFyc2UgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuX2xvbmdNb250aHNQYXJzZSA9IFtdO1xuICAgICAgICAgICAgdGhpcy5fc2hvcnRNb250aHNQYXJzZSA9IFtdO1xuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDEyOyArK2kpIHtcbiAgICAgICAgICAgICAgICBtb20gPSBjcmVhdGVVVEMoWzIwMDAsIGldKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9zaG9ydE1vbnRoc1BhcnNlW2ldID0gdGhpcy5tb250aHNTaG9ydChcbiAgICAgICAgICAgICAgICAgICAgbW9tLFxuICAgICAgICAgICAgICAgICAgICAnJ1xuICAgICAgICAgICAgICAgICkudG9Mb2NhbGVMb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9sb25nTW9udGhzUGFyc2VbaV0gPSB0aGlzLm1vbnRocyhtb20sICcnKS50b0xvY2FsZUxvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHN0cmljdCkge1xuICAgICAgICAgICAgaWYgKGZvcm1hdCA9PT0gJ01NTScpIHtcbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9zaG9ydE1vbnRoc1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBpaSAhPT0gLTEgPyBpaSA6IG51bGw7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX2xvbmdNb250aHNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGZvcm1hdCA9PT0gJ01NTScpIHtcbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9zaG9ydE1vbnRoc1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIGlmIChpaSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9sb25nTW9udGhzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlpICE9PSAtMSA/IGlpIDogbnVsbDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fbG9uZ01vbnRoc1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIGlmIChpaSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9zaG9ydE1vbnRoc1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBpaSAhPT0gLTEgPyBpaSA6IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBsb2NhbGVNb250aHNQYXJzZShtb250aE5hbWUsIGZvcm1hdCwgc3RyaWN0KSB7XG4gICAgICAgIHZhciBpLCBtb20sIHJlZ2V4O1xuXG4gICAgICAgIGlmICh0aGlzLl9tb250aHNQYXJzZUV4YWN0KSB7XG4gICAgICAgICAgICByZXR1cm4gaGFuZGxlU3RyaWN0UGFyc2UuY2FsbCh0aGlzLCBtb250aE5hbWUsIGZvcm1hdCwgc3RyaWN0KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghdGhpcy5fbW9udGhzUGFyc2UpIHtcbiAgICAgICAgICAgIHRoaXMuX21vbnRoc1BhcnNlID0gW107XG4gICAgICAgICAgICB0aGlzLl9sb25nTW9udGhzUGFyc2UgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuX3Nob3J0TW9udGhzUGFyc2UgPSBbXTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFRPRE86IGFkZCBzb3J0aW5nXG4gICAgICAgIC8vIFNvcnRpbmcgbWFrZXMgc3VyZSBpZiBvbmUgbW9udGggKG9yIGFiYnIpIGlzIGEgcHJlZml4IG9mIGFub3RoZXJcbiAgICAgICAgLy8gc2VlIHNvcnRpbmcgaW4gY29tcHV0ZU1vbnRoc1BhcnNlXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCAxMjsgaSsrKSB7XG4gICAgICAgICAgICAvLyBtYWtlIHRoZSByZWdleCBpZiB3ZSBkb24ndCBoYXZlIGl0IGFscmVhZHlcbiAgICAgICAgICAgIG1vbSA9IGNyZWF0ZVVUQyhbMjAwMCwgaV0pO1xuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiAhdGhpcy5fbG9uZ01vbnRoc1BhcnNlW2ldKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fbG9uZ01vbnRoc1BhcnNlW2ldID0gbmV3IFJlZ0V4cChcbiAgICAgICAgICAgICAgICAgICAgJ14nICsgdGhpcy5tb250aHMobW9tLCAnJykucmVwbGFjZSgnLicsICcnKSArICckJyxcbiAgICAgICAgICAgICAgICAgICAgJ2knXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9zaG9ydE1vbnRoc1BhcnNlW2ldID0gbmV3IFJlZ0V4cChcbiAgICAgICAgICAgICAgICAgICAgJ14nICsgdGhpcy5tb250aHNTaG9ydChtb20sICcnKS5yZXBsYWNlKCcuJywgJycpICsgJyQnLFxuICAgICAgICAgICAgICAgICAgICAnaSdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFzdHJpY3QgJiYgIXRoaXMuX21vbnRoc1BhcnNlW2ldKSB7XG4gICAgICAgICAgICAgICAgcmVnZXggPVxuICAgICAgICAgICAgICAgICAgICAnXicgKyB0aGlzLm1vbnRocyhtb20sICcnKSArICd8XicgKyB0aGlzLm1vbnRoc1Nob3J0KG1vbSwgJycpO1xuICAgICAgICAgICAgICAgIHRoaXMuX21vbnRoc1BhcnNlW2ldID0gbmV3IFJlZ0V4cChyZWdleC5yZXBsYWNlKCcuJywgJycpLCAnaScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gdGVzdCB0aGUgcmVnZXhcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICBzdHJpY3QgJiZcbiAgICAgICAgICAgICAgICBmb3JtYXQgPT09ICdNTU1NJyAmJlxuICAgICAgICAgICAgICAgIHRoaXMuX2xvbmdNb250aHNQYXJzZVtpXS50ZXN0KG1vbnRoTmFtZSlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChcbiAgICAgICAgICAgICAgICBzdHJpY3QgJiZcbiAgICAgICAgICAgICAgICBmb3JtYXQgPT09ICdNTU0nICYmXG4gICAgICAgICAgICAgICAgdGhpcy5fc2hvcnRNb250aHNQYXJzZVtpXS50ZXN0KG1vbnRoTmFtZSlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyaWN0ICYmIHRoaXMuX21vbnRoc1BhcnNlW2ldLnRlc3QobW9udGhOYW1lKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gTU9NRU5UU1xuXG4gICAgZnVuY3Rpb24gc2V0TW9udGgobW9tLCB2YWx1ZSkge1xuICAgICAgICBpZiAoIW1vbS5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIC8vIE5vIG9wXG4gICAgICAgICAgICByZXR1cm4gbW9tO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGlmICgvXlxcZCskLy50ZXN0KHZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gdG9JbnQodmFsdWUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IG1vbS5sb2NhbGVEYXRhKCkubW9udGhzUGFyc2UodmFsdWUpO1xuICAgICAgICAgICAgICAgIC8vIFRPRE86IEFub3RoZXIgc2lsZW50IGZhaWx1cmU/XG4gICAgICAgICAgICAgICAgaWYgKCFpc051bWJlcih2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1vbTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbW9udGggPSB2YWx1ZSxcbiAgICAgICAgICAgIGRhdGUgPSBtb20uZGF0ZSgpO1xuXG4gICAgICAgIGRhdGUgPSBkYXRlIDwgMjkgPyBkYXRlIDogTWF0aC5taW4oZGF0ZSwgZGF5c0luTW9udGgobW9tLnllYXIoKSwgbW9udGgpKTtcbiAgICAgICAgdm9pZCAobW9tLl9pc1VUQ1xuICAgICAgICAgICAgPyBtb20uX2Quc2V0VVRDTW9udGgobW9udGgsIGRhdGUpXG4gICAgICAgICAgICA6IG1vbS5fZC5zZXRNb250aChtb250aCwgZGF0ZSkpO1xuICAgICAgICByZXR1cm4gbW9tO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldFNldE1vbnRoKHZhbHVlKSB7XG4gICAgICAgIGlmICh2YWx1ZSAhPSBudWxsKSB7XG4gICAgICAgICAgICBzZXRNb250aCh0aGlzLCB2YWx1ZSk7XG4gICAgICAgICAgICBob29rcy51cGRhdGVPZmZzZXQodGhpcywgdHJ1ZSk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBnZXQodGhpcywgJ01vbnRoJyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXREYXlzSW5Nb250aCgpIHtcbiAgICAgICAgcmV0dXJuIGRheXNJbk1vbnRoKHRoaXMueWVhcigpLCB0aGlzLm1vbnRoKCkpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1vbnRoc1Nob3J0UmVnZXgoaXNTdHJpY3QpIHtcbiAgICAgICAgaWYgKHRoaXMuX21vbnRoc1BhcnNlRXhhY3QpIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX21vbnRoc1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlTW9udGhzUGFyc2UuY2FsbCh0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1N0cmljdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9tb250aHNTaG9ydFN0cmljdFJlZ2V4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fbW9udGhzU2hvcnRSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX21vbnRoc1Nob3J0UmVnZXgnKSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX21vbnRoc1Nob3J0UmVnZXggPSBkZWZhdWx0TW9udGhzU2hvcnRSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9tb250aHNTaG9ydFN0cmljdFJlZ2V4ICYmIGlzU3RyaWN0XG4gICAgICAgICAgICAgICAgPyB0aGlzLl9tb250aHNTaG9ydFN0cmljdFJlZ2V4XG4gICAgICAgICAgICAgICAgOiB0aGlzLl9tb250aHNTaG9ydFJlZ2V4O1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbW9udGhzUmVnZXgoaXNTdHJpY3QpIHtcbiAgICAgICAgaWYgKHRoaXMuX21vbnRoc1BhcnNlRXhhY3QpIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX21vbnRoc1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlTW9udGhzUGFyc2UuY2FsbCh0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1N0cmljdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9tb250aHNTdHJpY3RSZWdleDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX21vbnRoc1JlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfbW9udGhzUmVnZXgnKSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX21vbnRoc1JlZ2V4ID0gZGVmYXVsdE1vbnRoc1JlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX21vbnRoc1N0cmljdFJlZ2V4ICYmIGlzU3RyaWN0XG4gICAgICAgICAgICAgICAgPyB0aGlzLl9tb250aHNTdHJpY3RSZWdleFxuICAgICAgICAgICAgICAgIDogdGhpcy5fbW9udGhzUmVnZXg7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjb21wdXRlTW9udGhzUGFyc2UoKSB7XG4gICAgICAgIGZ1bmN0aW9uIGNtcExlblJldihhLCBiKSB7XG4gICAgICAgICAgICByZXR1cm4gYi5sZW5ndGggLSBhLmxlbmd0aDtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBzaG9ydFBpZWNlcyA9IFtdLFxuICAgICAgICAgICAgbG9uZ1BpZWNlcyA9IFtdLFxuICAgICAgICAgICAgbWl4ZWRQaWVjZXMgPSBbXSxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBtb20sXG4gICAgICAgICAgICBzaG9ydFAsXG4gICAgICAgICAgICBsb25nUDtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IDEyOyBpKyspIHtcbiAgICAgICAgICAgIC8vIG1ha2UgdGhlIHJlZ2V4IGlmIHdlIGRvbid0IGhhdmUgaXQgYWxyZWFkeVxuICAgICAgICAgICAgbW9tID0gY3JlYXRlVVRDKFsyMDAwLCBpXSk7XG4gICAgICAgICAgICBzaG9ydFAgPSByZWdleEVzY2FwZSh0aGlzLm1vbnRoc1Nob3J0KG1vbSwgJycpKTtcbiAgICAgICAgICAgIGxvbmdQID0gcmVnZXhFc2NhcGUodGhpcy5tb250aHMobW9tLCAnJykpO1xuICAgICAgICAgICAgc2hvcnRQaWVjZXMucHVzaChzaG9ydFApO1xuICAgICAgICAgICAgbG9uZ1BpZWNlcy5wdXNoKGxvbmdQKTtcbiAgICAgICAgICAgIG1peGVkUGllY2VzLnB1c2gobG9uZ1ApO1xuICAgICAgICAgICAgbWl4ZWRQaWVjZXMucHVzaChzaG9ydFApO1xuICAgICAgICB9XG4gICAgICAgIC8vIFNvcnRpbmcgbWFrZXMgc3VyZSBpZiBvbmUgbW9udGggKG9yIGFiYnIpIGlzIGEgcHJlZml4IG9mIGFub3RoZXIgaXRcbiAgICAgICAgLy8gd2lsbCBtYXRjaCB0aGUgbG9uZ2VyIHBpZWNlLlxuICAgICAgICBzaG9ydFBpZWNlcy5zb3J0KGNtcExlblJldik7XG4gICAgICAgIGxvbmdQaWVjZXMuc29ydChjbXBMZW5SZXYpO1xuICAgICAgICBtaXhlZFBpZWNlcy5zb3J0KGNtcExlblJldik7XG5cbiAgICAgICAgdGhpcy5fbW9udGhzUmVnZXggPSBuZXcgUmVnRXhwKCdeKCcgKyBtaXhlZFBpZWNlcy5qb2luKCd8JykgKyAnKScsICdpJyk7XG4gICAgICAgIHRoaXMuX21vbnRoc1Nob3J0UmVnZXggPSB0aGlzLl9tb250aHNSZWdleDtcbiAgICAgICAgdGhpcy5fbW9udGhzU3RyaWN0UmVnZXggPSBuZXcgUmVnRXhwKFxuICAgICAgICAgICAgJ14oJyArIGxvbmdQaWVjZXMuam9pbignfCcpICsgJyknLFxuICAgICAgICAgICAgJ2knXG4gICAgICAgICk7XG4g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AgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc1llYXIgPSB5ZWFyO1xuICAgICAgICAgICAgcmVzRGF5T2ZZZWFyID0gZGF5T2ZZZWFyO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHllYXI6IHJlc1llYXIsXG4gICAgICAgICAgICBkYXlPZlllYXI6IHJlc0RheU9mWWVhcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiB3ZWVrT2ZZZWFyKG1vbSwgZG93LCBkb3kpIHtcbiAgICAgICAgdmFyIHdlZWtPZmZzZXQgPSBmaXJzdFdlZWtPZmZzZXQobW9tLnllYXIoKSwgZG93LCBkb3kpLFxuICAgICAgICAgICAgd2VlayA9IE1hdGguZmxvb3IoKG1vbS5kYXlPZlllYXIoKSAtIHdlZWtPZmZzZXQgLSAxKSAvIDcpICsgMSxcbiAgICAgICAgICAgIHJlc1dlZWssXG4gICAgICAgICAgICByZXNZZWFyO1xuXG4gICAgICAgIGlmICh3ZWVrIDwgMSkge1xuICAgICAgICAgICAgcmVzWWVhciA9IG1vbS55ZWFyKCkgLSAxO1xuICAgICAgICAgICAgcmVzV2VlayA9IHdlZWsgKyB3ZWVrc0luWWVhcihyZXNZZWFyLCBkb3csIGRveSk7XG4gICAgICAgIH0gZWxzZSBpZiAod2VlayA+IHdlZWtzSW5ZZWFyKG1vbS55ZWFyKCksIGRvdywgZG95KSkge1xuICAgICAgICAgICAgcmVzV2VlayA9IHdlZWsgLSB3ZWVrc0luWWVhcihtb20ueWVhcigpLCBkb3csIGRveSk7XG4gICAgICAgICAgICByZXNZZWFyID0gbW9tLnllYXIoKSArIDE7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXNZZWFyID0gbW9tLnllYXIoKTtcbiAgICAgICAgICAgIHJlc1dlZWsgPSB3ZWVrO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAg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ICAgICAgICAgICAgICAgICAgICBtb20sXG4gICAgICAgICAgICAgICAgICAgICcnXG4gICAgICAgICAgICAgICAgKS50b0xvY2FsZUxvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgICAgIHRoaXMuX3Nob3J0V2Vla2RheXNQYXJzZVtpXSA9IHRoaXMud2Vla2RheXNTaG9ydChcbiAgICAgICAgICAgICAgICAgICAgbW9tLFxuICAgICAgICAgICAgICAgICAgICAnJ1xuICAgICAgICAgICAgICAgICkudG9Mb2NhbGVMb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICB0aGlzLl93ZWVrZGF5c1BhcnNlW2ldID0gdGhpcy53ZWVrZGF5cyhtb20sICcnKS50b0xvY2FsZUxvd2VyQ2FzZSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHN0cmljdCkge1xuICAgICAgICAgICAgaWYgKGZvcm1hdCA9PT0gJ2RkZGQnKSB7XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fd2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChmb3JtYXQgPT09ICdkZGQnKSB7XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fc2hvcnRXZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBpaSAhPT0gLTEgPyBpaSA6IG51bGw7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX21pbldlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlpICE9PSAtMSA/IGlpIDogbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChmb3JtYXQgPT09ICdkZGRkJykge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3dlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgaWYgKGlpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaWk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3Nob3J0V2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICBpZiAoaWkgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fbWluV2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChmb3JtYXQgPT09ICdkZGQnKSB7XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fc2hvcnRXZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIGlmIChpaSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl93ZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIGlmIChpaSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9taW5XZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBpaSAhPT0gLTEgPyBpaSA6IG51bGw7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX21pbldlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgaWYgKGlpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaWk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3dlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgaWYgKGlpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaWk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3Nob3J0V2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbG9jYWxlV2Vla2RheXNQYXJzZSh3ZWVrZGF5TmFtZSwgZm9ybWF0LCBzdHJpY3QpIHtcbiAgICAgICAgdmFyIGksIG1vbSwgcmVnZXg7XG5cbiAgICAgICAgaWYgKHRoaXMuX3dlZWtkYXlzUGFyc2VFeGFjdCkge1xuICAgICAgICAgICAgcmV0dXJuIGhhbmRsZVN0cmljdFBhcnNlJDEuY2FsbCh0aGlzLCB3ZWVrZGF5TmFtZSwgZm9ybWF0LCBzdHJpY3QpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCF0aGlzLl93ZWVrZGF5c1BhcnNlKSB7XG4gICAgICAgICAgICB0aGlzLl93ZWVrZGF5c1BhcnNlID0gW107XG4gICAgICAgICAgICB0aGlzLl9taW5XZWVrZGF5c1BhcnNlID0gW107XG4gICAgICAgICAgICB0aGlzLl9zaG9ydFdlZWtkYXlzUGFyc2UgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuX2Z1bGxXZWVrZGF5c1BhcnNlID0gW107XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNzsgaSsrKSB7XG4gICAgICAgICAgICAvLyBtYWtlIHRoZSByZWdleCBpZiB3ZSBkb24ndCBoYXZlIGl0IGFscmVhZHlcblxuICAgICAgICAgICAgbW9tID0gY3JlYXRlVVRDKFsyMDAwLCAxXSkuZGF5KGkpO1xuICAgICAgICAgICAgaWYgKHN0cmljdCAmJiAhdGhpcy5fZnVsbFdlZWtkYXlzUGFyc2VbaV0pIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9mdWxsV2Vla2RheXNQYXJzZVtpXSA9IG5ldyBSZWdFeHAoXG4gICAgICAgICAgICAgICAgICAgICdeJyArIHRoaXMud2Vla2RheXMobW9tLCAnJykucmVwbGFjZSgnLicsICdcXFxcLj8nKSArICckJyxcbiAgICAgICAgICAgICAgICAgICAgJ2knXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9zaG9ydFdlZWtkYXlzUGFyc2VbaV0gPSBuZXcgUmVnRXhwKFxuICAgICAgICAgICAgICAgICAgICAnXicgKyB0aGlzLndlZWtkYXlzU2hvcnQobW9tLCAnJykucmVwbGFjZSgnLicsICdcXFxcLj8nKSArICckJyxcbiAgICAgICAgICAgICAgICAgICAgJ2knXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9taW5XZWVrZGF5c1BhcnNlW2ldID0gbmV3IFJlZ0V4cChcbiAgICAgICAgICAgICAgICAgICAgJ14nICsgdGhpcy53ZWVrZGF5c01pbihtb20sICcnKS5yZXBsYWNlKCcuJywgJ1xcXFwuPycpICsgJyQnLFxuICAgICAgICAgICAgICAgICAgICAnaSdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCF0aGlzLl93ZWVrZGF5c1BhcnNlW2ldKSB7XG4gICAgICAgICAgICAgICAgcmVnZXggPVxuICAgICAgICAgICAgICAgICAgICAnXicgK1xuICAgICAgICAgICAgICAgICAgICB0aGlzLndlZWtkYXlzKG1vbSwgJycpICtcbiAgICAgICAgICAgICAgICAgICAgJ3xeJyArXG4gICAgICAgICAgICAgICAgICAgIHRoaXMud2Vla2RheXNTaG9ydChtb20sICcnKSArXG4gICAgICAgICAgICAgICAgICAgICd8XicgK1xuICAgICAgICAgICAgICAgICAgICB0aGlzLndlZWtkYXlzTWluKG1vbSwgJycpO1xuICAgICAgICAgICAgICAgIHRoaXMuX3dlZWtkYXlzUGFyc2VbaV0gPSBuZXcgUmVnRXhwKHJlZ2V4LnJlcGxhY2UoJy4nLCAnJyksICdpJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyB0ZXN0IHRoZSByZWdleFxuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIHN0cmljdCAmJlxuICAgICAgICAgICAgICAgIGZvcm1hdCA9PT0gJ2RkZGQnICYmXG4gICAgICAgICAgICAgICAgdGhpcy5fZnVsbFdlZWtkYXlzUGFyc2VbaV0udGVzdCh3ZWVrZGF5TmFtZSlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChcbiAgICAgICAgICAgICAgICBzdHJpY3QgJiZcbiAgICAgICAgICAgICAgICBmb3JtYXQgPT09ICdkZGQnICYmXG4gICAgICAgICAgICAgICAgdGhpcy5fc2hvcnRXZWVrZGF5c1BhcnNlW2ldLnRlc3Qod2Vla2RheU5hbWUpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoXG4gICAgICAgICAgICAgICAgc3RyaWN0ICYmXG4gICAgICAgICAgICAgICAgZm9ybWF0ID09PSAnZGQnICYmXG4gICAgICAgICA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0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1N0cmljdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl93ZWVrZGF5c1N0cmljdFJlZ2V4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fd2Vla2RheXNSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX3dlZWtkYXlzUmVnZXgnKSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX3dlZWtkYXlzUmVnZXggPSBkZWZhdWx0V2Vla2RheXNSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLl93ZWVrZGF5c1N0cmljdFJlZ2V4ICYmIGlzU3RyaWN0XG4gICAgICAgICAgICAgICAgPyB0aGlzLl93ZWVrZGF5c1N0cmljdFJlZ2V4XG4gICAgICAgICAgICAgICAgOiB0aGlzLl93ZWVrZGF5c1JlZ2V4O1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gd2Vla2RheXNTaG9ydFJlZ2V4KGlzU3RyaWN0KSB7XG4gICAgICAgIGlmICh0aGlzLl93ZWVrZGF5c1BhcnNlRXhhY3QpIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX3dlZWtkYXlzUmVnZXgnKSkge1xuICAgICAgICAgICAgICAgIGNvbXB1dGVXZWVrZGF5c1BhcnNlLmNhbGwodGhpcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNTdHJpY3QpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fd2Vla2RheXNTaG9ydFN0cmljdFJlZ2V4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fd2Vla2RheXNTaG9ydFJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfd2Vla2RheXNTaG9ydFJlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl93ZWVrZGF5c1Nob3J0UmVnZXggPSBkZWZhdWx0V2Vla2RheXNTaG9ydFJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzU2hvcnRTdHJpY3RSZWdleCAmJiBpc1N0cmljdFxuICAgICAgICAgICAgICAgID8gdGhpcy5fd2Vla2RheXNTaG9ydFN0cmljdFJlZ2V4XG4gICAgICAgICAgICAgICAgOiB0aGlzLl93ZWVrZGF5c1Nob3J0UmVnZXg7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiB3ZWVrZGF5c01pblJlZ2V4KGlzU3RyaWN0KSB7XG4gICAgICAgIGlmICh0aGlzLl93ZWVrZGF5c1BhcnNlRXhhY3QpIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX3dlZWtkYXlzUmVnZXgnKSkge1xuICAgICAgICAgICAgICAgIGNvbXB1dGVXZWVrZGF5c1BhcnNlLmNhbGwodGhpcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNTdHJpY3QpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fd2Vla2RheXNNaW5TdHJpY3RSZWdleDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzTWluUmVnZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ193ZWVrZGF5c01pblJlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl93ZWVrZGF5c01pblJlZ2V4ID0gZGVmYXVsdFdlZWtkYXlzTWluUmVnZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fd2Vla2RheXNNaW5TdHJpY3RSZWdleCAmJiBpc1N0cmljdFxuICAgICAgICAgICAgICAgID8gdGhpcy5fd2Vla2RheXNNaW5TdHJpY3RSZWdleFxuICAgICAgICAgICAgICAgIDogdGhpcy5fd2Vla2RheXNNaW5SZWdleDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbXB1dGVXZWVrZGF5c1BhcnNlKCkge1xuICAgICAgICBmdW5jdGlvbiBjbXBMZW5SZXYoYSwgYikge1xuICAgICAgICAgICAgcmV0dXJuIGIubGVuZ3RoIC0gYS5sZW5ndGg7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbWluUGllY2VzID0gW10sXG4gICAgICAgICAgICBzaG9ydFBpZWNlcyA9IFtdLFxuICAgICAgICAgICAgbG9uZ1BpZWNlcyA9IFtdLFxuICAgICAgICAgICAgbWl4ZWRQaWVjZXMgPSBbXSxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBtb20sXG4gICAgICAgICAgICBtaW5wLFxuICAgICAgICAgICAgc2hvcnRwLFxuICAgICAgICAgICAgbG9uZ3A7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCA3OyBpKyspIHtcbiAgICAgICAgICAgIC8vIG1ha2UgdGhlIHJlZ2V4IGlmIHdlIGRvbid0IGhhdmUgaXQgYWxyZWFkeVxuICAgICAgICAgICAgbW9tID0gY3JlYXRlVVRDKFsyMDAwLCAxXSkuZGF5KGkpO1xuICAgICAgICAgICAgbWlucCA9IHJlZ2V4RXNjYXBlKHRoaXMud2Vla2RheXNNaW4obW9tLCAnJykpO1xuICAgICAgICAgICAgc2hvcnRwID0gcmVnZXhFc2NhcGUodGhpcy53ZWVrZGF5c1Nob3J0KG1vbSwgJycpKTtcbiAgICAgICAgICAgIGxvbmdwID0gcm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knLFxuICAgICAgICAgICAgJ2knXG4gICAgICAgICk7XG4gICAgICAgIHRoaXMuX3dlZWtkYXlzU2hvcnRTdHJpY3RSZWdleCA9IG5ldyBSZWdFeHAoXG4gICAgICAgICAgICAnXignICsgc2hvcnRQaWVjZXMuam9pbignfCcpICsgJyknLFxuICAgICAgICAgICAgJ2knXG4gICAgICAgICk7XG4gICAgICAgIHRoaXMuX3dlZWtkYXlzTWluU3RyaWN0UmVnZXggPSBuZXcgUmVnRXhwKFxuICAgICAgICAgICAgJ14oJyArIG1pblBpZWNlcy5qb2luKCd8JykgKyAnKScsXG4gICAgICAgICAgICAnaSdcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICAvLyBGT1JNQVRUSU5HXG5cbiAgICBmdW5jdGlvbiBoRm9ybWF0KCkge1xuICAgICAgICByZXR1cm4gdGhpcy5ob3VycygpICUgMTIgfHwgMTI7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24ga0Zvcm1hdCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuaG91cnMoKSB8fCAyNDtcbiAgICB9XG5cbiAgICBhZGRGb3JtYXRUb2tlbignSCcsIFsnSEgnLCAyXSwgMCwgJ2hvdXInKTtcbiAgICBhZGRGb3JtYXRUb2tlbignaCcsIFsnaGgnLCAyXSwgMCwgaEZvcm1hdCk7XG4gICAgYWRkRm9ybWF0VG9rZW4oJ2snLCBbJ2trJywgMl0sIDAsIGtGb3JtYXQpO1xuXG4gICAgYWRkRm9ybWF0VG9rZW4oJ2htbScsIDAsIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuICcnICsgaEZvcm1hdC5hcHBseSh0aGlzKSArIHplcm9GaWxsKHRoaXMubWludXRlcygpLCAyKTtcbiAgICB9KTtcblxuICAgIGFkZEZvcm1hdFRva2VuKCdobW1zcycsIDAsIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICcnICtcbiAgICAgICAgICAgIGhGb3JtYXQuYXBwbHkodGhpcykgK1xuICAgICAgICAgICAgemVyb0ZpbGwodGhpcy5taW51dGVzKCksIDIpICtcbiAgICAgICAgICAgIHplcm9GaWxsKHRoaXMuc2Vjb25kcygpLCAyKVxuICAgICAgICApO1xuICAgIH0pO1xuXG4gICAgYWRkRm9ybWF0VG9rZW4oJ0htbScsIDAsIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuICcnICsgdGhpcy5ob3VycygpICsgemVyb0ZpbGwodGhpcy5taW51dGVzKCksIDIpO1xuICAgIH0pO1xuXG4gICAgYWRkRm9ybWF0VG9rZW4oJ0htbXNzJywgMCwgMCwgZnVuY3Rpb24gKCkge1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgJycgK1xuICAgICAgICAgICAgdGhpcy5ob3VycygpICtcbiAgICAgICAgICAgIHplcm9GaWxsKHRoaXMubWludXRlcygpLCAyKSArXG4gICAgICAgICAgICB6ZXJvRmlsbCh0aGlzLnNlY29uZHMoKSwgMilcbiAgICAgICAgKTtcbiAgICB9KTtcblxuICAgIGZ1bmN0aW9uIG1lcmlkaWVtKHRva2VuLCBsb3dlcmNhc2UpIHtcbiAgICAgICAgYWRkRm9ybWF0VG9rZW4odG9rZW4sIDAsIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmxvY2FsZURhdGEoKS5tZXJpZGllbShcbiAgICAgICAgICAgICAgICB0aGlzLmhvdXJzKCksXG4gICAgICAgICAgICAgICAgdGhpcy5taW51dGVzKCksXG4gICAgICAgICAgICAgICAgbG93ZXJjYXNlXG4gICAgICAgICAgICApO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBtZXJpZGllbSgnYScsIHRydWUpO1xuICAgIG1lcmlkaWVtKCdBJywgZmFsc2UpO1xuXG4gICAgLy8gUEFSU0lOR1xuXG4gICAgZnVuY3Rpb24gbWF0Y2hNZXJpZGllbShpc1N0cmljdCwgbG9jYWx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KTtcbiAgICAgICAgICAgICAgICBpZiAobG9jYWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBsb2NhbGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgbmV4dCAmJlxuICAgICAgICAgICAgICAgICAgICBuZXh0Lmxlbmd0aCA+PSBqICYmXG4gICAgICAgICAgICAgICAgICAgIGNvbW1vblByZWZpeChzcGxpdCwgbmV4dCkgPj0gaiAtIDFcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgLy90aGUgbmV4dCBhcnJheSBpdGVtIGlzIGJldHRlciB0aGFuIGEgc2hhbGxvd2VyIHN1YnN0cmluZyBvZiB0aGlzIG9uZVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgai0tO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaSsrO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBnbG9iYWxMb2NhbGU7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNMb2NhbGVOYW1lU2FuZShuYW1lKSB7XG4gICAgICAgIC8vIFByZXZlbnQgbmFtZXMgdGhhdCBsb29rIGxpa2UgZmlsZXN5c3RlbSBwYXRocywgaS5lIGNvbnRhaW4gJy8nIG9yICdcXCdcbiAgICAgICAgLy8gRW5zdXJlIG5hbWUgaXMgYXZhaWxhYmxlIGFuZCBmdW5jdGlvbiByZXR1cm5zIGJvb2xlYW5cbiAgICAgICAgcmV0dXJuICEhKG5hbWUgJiYgbmFtZS5tYXRjaCgnXlteL1xcXFxcXFxcXSokJykpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGxvYWRMb2NhbGUobmFtZSkge1xuICAgICAgICB2YXIgb2xkTG9jYWxlID0gbnVsbCxcbiAgICAgICAgICAgIGFsaWFzZWRSZXF1aXJlO1xuICAgICAgICAvLyBUT0RPOiBGaW5kIGEgYmV0dGVyIHdheSB0byByZWdpc3RlciBhbmQgbG9hZCBhbGwgdGhlIGxvY2FsZXMgaW4gTm9kZVxuICAgICAgICBpZiAoXG4gICAgICAgICAgICBsb2NhbGVzW25hbWVdID09PSB1bmRlZmluZWQgJiZcbiAgICAgICAgICAgIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnICYmXG4gICAgICAgICAgICBtb2R1bGUgJiZcbiAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzICYmXG4gICAgICAgICAgICBpc0xvY2FsZU5hbWVTYW5lKG5hbWUpXG4gICAgICAgICkge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBvbGRMb2NhbGUgPSBnbG9iYWxMb2NhbGUuX2FiYnI7XG4gICAgICAgICAgICAgICAgYWxpYXNlZFJlcXVpcmUgPSByZXF1aXJlO1xuICAgICAgICAgICAgICAgIGFsaWFzZWRSZXF1aXJlKCcuL2xvY2FsZS8nICsgbmFtZSk7XG4gICAgICAgICAgICAgICAgZ2V0U2V0R2xvYmFsTG9jYWxlKG9sZExvY2FsZSk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgLy8gbWFyayBhcyBub3QgZm91bmQgdG8gYXZvaWQgcmVwZWF0aW5nIGV4cGVuc2l2ZSBmaWxlIHJlcXVpcmUgY2FsbCBjYXVzaW5nIGhpZ2ggQ1BVXG4gICAgICAgICAgICAgICAgLy8gd2hlbiB0cnlpbmcgdG8gZmluZCBlbi1VUywgZW5fVVMsIGVuLXVzIGZvciBldmVyeSBmb3JtYXQgY2FsbFxuICAgICAgICAgICAgICAgIGxvY2FsZXNbbmFtZV0gPSBudWxsOyAvLyBudWxsIG1lYW5zIG5vdCBmb3VuZFxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBsb2NhbGVzW25hbWVdO1xuICAgIH1cblxuICAgIC8vIFRoaXMgZnVuY3Rpb24gd2lsbCBsb2FkIGxvY2FsZSBhbmQgdGhlbiBzZXQgdGhlIGdsb2JhbCBsb2NhbGUuICBJZlxuICAgIC8vIG5vIGFyZ3VtZW50cyBhcmUgcGFzc2VkIGluLCBpdCB3aWxsIHNpbXBseSByZXR1cm4gdGhlIGN1cnJlbnQgZ2xvYmFsXG4gICAgLy8gbG9jYWxlIGtleS5cbiAgICBmdW5jdGlvbiBnZXRTZXRHbG9iYWxMb2NhbGUoa2V5LCB2YWx1ZXMpIHtcbiAgICAgICAgdmFyIGRhdGE7XG4gICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgIGlmIChpc1VuZGVmaW5lZCh2YWx1ZXMpKSB7XG4gICAgICAgICAgICAgICAgZGF0YSA9IGdldExvY2FsZShrZXkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBkYXRhID0gZGVmaW5lTG9jYWxlKGtleSwgdmFsdWVzKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGRhdGEpIHtcbiAgICAgICAgICAgICAgICAvLyBtb21lbnQuZHVyYXRpb24uX2xvY2FsZSA9IG1vbWVudC5fbG9jYWxlID0gZGF0YTtcbiAgICAgICAgICAgICAgICBnbG9iYWxMb2NhbGUgPSBkYXRhO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvbnNvbGUgIT09ICd1bmRlZmluZWQnICYmIGNvbnNvbGUud2Fybikge1xuICAgICAgICAgICAgICAgICAgICAvL3dhcm4gdXNlciBpZiBhcmd1bWVudHMgYXJlIHBhc3NlZCBidXQgdGhlIGxvY2FsZSBjb3VsZCBub3QgYmUgc2V0XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcbiAgICAgICAgICAgICAgICAgICAgICAgICdMb2NhbGUgJyArIGtleSArICcgbm90IGZvdW5kLiBEaWQgeW91IGZvcmdldCB0byBsb2FkIGl0PydcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZ2xvYmFsTG9jYWxlLl9hYmJyO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlZmluZUxvY2FsZShuYW1lLCBjb25maWcpIHtcbiAgICAgICAgaWYgKGNvbmZpZyAhPT0gbnVsbCkge1xuICAgICAgICAgICAgdmFyIGxvY2FsZSxcbiAgICAgICAgICAgICAgICBwYXJlbnRDb25maWcgPSBiYXNlQ29uZmlnO1xuICAgICAgICAgICAgY29uZmlnLmFiYnIgPSBuYW1lO1xuICAgICAgICAgICAgaWYgKGxvY2FsZXNbbmFtZV0gIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGRlcHJlY2F0ZVNpbXBsZShcbiAgICAgICAgICAgICAgICAgICAgJ2RlZmluZUxvY2FsZU92ZXJyaWRlJyxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZSBtb21lbnQudXBkYXRlTG9jYWxlKGxvY2FsZU5hbWUsIGNvbmZpZykgdG8gY2hhbmdlICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FuIGV4aXN0aW5nIGxvY2FsZS4gbW9tZW50LmRlZmluZUxvY2FsZShsb2NhbGVOYW1lLCAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb25maWcpIHNob3VsZCBvbmx5IGJlIHVzZWQgZm9yIGNyZWF0aW5nIGEgbmV3IGxvY2FsZSAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWUgaHR0cDovL21vbWVudGpzLmNvbS9ndWlkZXMvIy93YXJuaW5ncy9kZWZpbmUtbG9jYWxlLyBmb3IgbW9yZSBpbmZvLidcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHBhcmVudENvbmZpZyA9IGxvY2FsZXNbbmFtZV0uX2NvbmZpZztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29uZmlnLnBhcmVudExvY2FsZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgaWYgKGxvY2FsZXNbY29uZmlnLnBhcmVudExvY2FsZV0gIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBwYXJlbnRDb25maWcgPSBsb2NhbGVzW2NvbmZpZy5wYXJlbnRMb2NhbGVdLl9jb25maWc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbG9jYWxlID0gbG9hZExvY2FsZShjb25maWcucGFyZW50TG9jYWxlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxvY2FsZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRDb25maWcgPSBsb2NhbGUuX2NvbmZpZztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbG9jYWxlRmFtaWxpZXNbY29uZmlnLnBhcmVudExvY2FsZV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbGVGYW1pbGllc1tjb25maWcucGFyZW50TG9jYWxlXSA9IFtdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxlRmFtaWxpZXNbY29uZmlnLnBhcmVudExvY2FsZV0ucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWc6IGNvbmZpZyxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsb2NhbGVzW25hbWVdID0gbmV3IExvY2FsZShtZXJnZUNvbmZpZ3MocGFyZW50Q29uZmlnLCBjb25maWcpKTtcblxuICAgICAgICAgICAgaWYgKGxvY2FsZUZhbWlsaWVzW25hbWVdKSB7XG4gICAgICAgICAgICAgICAgbG9jYWxlRmFtaWxpZXNbbmFtZV0uZm9yRWFjaChmdW5jdGlvbiAoeCkge1xuICAgICAgICAgICAgICAgICAgICBkZWZpbmVMb2NhbGUoeC5uYW1lLCB4LmNvbmZpZyk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIGJhY2t3YXJkcyBjb21wYXQgZm9yIG5vdzogYWxzbyBzZXQgdGhlIGxvY2FsZVxuICAgICAgICAgICAgLy8gbWFrZSBzdXJlIHdlIHNldCB0aGUgbG9jYWxlIEFGVEVSIGFsbCBjaGlsZCBsb2NhbGVzIGhhdmUgYmVlblxuICAgICAgICAgICAgLy8gY3JlYXRlZCwgc28gd2Ugd29uJ3QgZW5kIHVwIHdpdGggdGhlIGNoaWxkIGxvY2FsZSBzZXQuXG4gICAgICAgICAgICBnZXRTZXRHbG9iYWxMb2NhbGUobmFtZSk7XG5cbiAgICAgICAgICAgIHJldHVybiBsb2NhbGVzW25hbWVdO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gdXNlZnVsIGZvciB0ZXN0aW5nXG4gICAgICAgICAgICBkZWxldGUgbG9jYWxlc1tuYW1lXTtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdXBkYXRlTG9jYWxlKG5hbWUsIGNvbmZpZykge1xuICAgICAgICBpZiAoY29uZmlnICE9IG51bGwpIHtcbiAgICAgICAgICAgIHZhciBsb2NhbGUsXG4gICAgICAgICAgICAgICAgdG1wTG9jYWxlLFxuICAgICAgICAgICAgICAgIHBhcmVudENvbmZpZyA9IGJhc2VDb25maWc7XG5cbiAgICAgICAgICAgIGlmIChsb2NhbGVzW25hbWVdICE9IG51bGwgJiYgbG9jYWxlc1tuYW1lXS5wYXJlbnRMb2NhbGUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSBleGlzdGluZyBjaGlsZCBsb2NhbGUgaW4tcGxhY2UgdG8gYXZvaWQgbWVtb3J5LWxlYWtzXG4gICAgICAgICAgICAgICAgbG9jYWxlc1tuYW1lXS5zZXQobWVyZ2VDb25maWdzKGxvY2FsZXNbbmFtZV0uX2NvbmZpZywgY29uZmlnKSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIE1FUkdFXG4gICAgICAgICAgICAgICAgdG1wTG9jYWxlID0gbG9hZExvY2FsZShuYW1lKTtcbiAgICAgICAgICAgICAgICBpZiAodG1wTG9jYWxlICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50Q29uZmlnID0gdG1wTG9jYWxlLl9jb25maWc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGNvbmZpZyA9IG1lcmdlQ29uZmlncyhwYXJlbnRDb25maWcsIGNvbmZpZyk7XG4gICAgICAgICAgICAgICAgaWYgKHRtcExvY2FsZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHVwZGF0ZUxvY2FsZSBpcyBjYWxsZWQgZm9yIGNyZWF0aW5nIGEgbmV3IGxvY2FsZVxuICAgICAgICAgICAgICAgICAgICAvLyBTZXQgYWJiciBzbyBpdCB3aWxsIGhhdmUgYSBuYW1lIChnZXR0ZXJzIHJldHVyblxuICAgICAgICAgICAgICAgICAgICAvLyB1bmRlZmluZWQgb3RoZXJ3aXNlKS5cbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLmFiYnIgPSBuYW1lO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsb2NhbGUgPSBuZXcgTG9jYWxlKGNvbmZpZyk7XG4gICAgICAgICAgICAgICAgbG9jYWxlLnBhcmVudExvY2FsZSA9IGxvY2FsZXNbbmFtZV07XG4gICAgICAgICAgICAgICAgbG9jYWxlc1tuYW1lXSA9IGxvY2FsZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gYmFja3dhcmRzIGNvbXBhdCBmb3Igbm93OiBhbHNvIHNldCB0aGUgbG9jYWxlXG4gICAgICAgICAgICBnZXRTZXRHbG9iYWxMb2NhbGUobmFtZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBwYXNzIG51bGwgZm9yIGNvbmZpZyB0byB1bnVwZGF0ZSwgdXNlZnVsIGZvciB0ZXN0c1xuICAgICAgICAgICAgaWYgKGxvY2FsZXNbbmFtZV0gIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGlmIChsb2NhbGVzW25hbWVdLnBhcmVudExvY2FsZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGxvY2FsZXNbbmFtZV0gPSBsb2NhbGVzW25hbWVdLnBhcmVudExvY2FsZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5hbWUgPT09IGdldFNldEdsb2JhbExvY2FsZSgpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRTZXRHbG9iYWxMb2NhbGUobmFtZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxvY2FsZXNbbmFtZV0gIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBkZWxldGUgbG9jYWxlc1tuYW1lXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGxvY2FsZXNbbmFtZV07XG4gICAgfVxuXG4gICAgLy8gcmV0dXJucyBsb2NhbGUgZGF0YVxuICAgIGZ1bmN0aW9uIGdldExvY2FsZShrZXkpIHtcbiAgICAgICAgdmFyIGxvY2FsZTtcblxuICAgICAgICBpZiAoa2V5ICYmIGtleS5fbG9jYWxlICYmIGtleS5fbG9jYWxlLl9hYmJyKSB7XG4gICAgICAgICAgICBrZXkgPSBrZXkuX2xvY2FsZS5fYWJicjtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICgha2V5KSB7XG4gICAgICAgICAgICByZXR1cm4gZ2xvYmFsTG9jYWxlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFpc0FycmF5KGtleSkpIHtcbiAgICAgICAgICAgIC8vc2hvcnQtY2lyY3VpdCBldmVyeXRoaW5nIGVsc2VcbiAgICAgICAgICAgIGxvY2FsZSA9IGxvYWRMb2NhbGUoa2V5KTtcbiAgICAgICAgICAgIGlmIChsb2NhbGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbG9jYWxlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAga2V5ID0gW2tleV07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gY2hvb3NlTG9jYWxlKGtleSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbGlzdExvY2FsZXMoKSB7XG4gICAgICAgIHJldHVybiBrZXlzKGxvY2FsZXMpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNoZWNrT3ZlcmZsb3cobSkge1xuICAgICAgICB2YXIgb3ZlcmZsb3csXG4gICAgICAgICAgICBhID0gbS5fYTtcblxuICAgICAgICBpZiAoYSAmJiBnZXRQYXJzaW5nRmxhZ3MobSkub3ZlcmZsb3cgPT09IC0yKSB7XG4gICAgICAgICAgICBvdmVyZmxvdyA9XG4gICAgICAgICAgICAgICAgYVtNT05USF0gPCAwIHx8IGFbTU9OVEhdID4gMTFcbiAgICAgICAgICAgICAgICAgICAgPyBNT05USFxuICAgICAgICAgICAgICAgICAgICA6IGFbREFURV0gPCAxIHx8IGFbREFURV0gPiBkYXlzSW5Nb250aChhW1lFQVJdLCBhW01PTlRIXSlcbiAgICAgICAgICAgICAgICAgICAgICA/IERBVEVcbiAgICAgICAgICAgICAgICAgICAgICA6IGFbSE9VUl0gPCAwIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGFbSE9VUl0gPiAyNCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtIT1VSXSA9PT0gMjQgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhW01JTlVURV0gIT09IDAgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW1NFQ09ORF0gIT09IDAgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhW01JTExJU0VDT05EXSAhPT0gMCkpXG4gICAgICAgICAgICAgICAgICAgICAgICA/IEhPVVJcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYVtNSU5VVEVdIDwgMCB8fCBhW01JTlVURV0gPiA1OVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1JTlVURVxuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGFbU0VDT05EXSA8IDAgfHwgYVtTRUNPTkRdID4gNTlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IFNFQ09ORFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYVtNSUxMSVNFQ09ORF0gPCAwIHx8IGFbTUlMTElTRUNPTkRdID4gOTk5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IE1JTExJU0VDT05EXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IC0xO1xuXG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKG0pLl9vdmVyZmxvd0RheU9mWWVhciAmJlxuICAgICAgICAgICAgICAgIChvdmVyZmxvdyA8IFlFQVIgfHwgb3ZlcmZsb3cgPiBEQVRFKVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgb3ZlcmZsb3cgPSBEQVRFO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGdldFBhcnNpbmdGbGFncyhtKS5fb3ZlcmZsb3dXZWVrcyAmJiBvdmVyZmxvdyA9PT0gLTEpIHtcbiAgICAgICAgICAgICAgICBvdmVyZmxvdyA9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DYwLFxuICAgICAgICAgICAgRVNUOiAtNSAqIDYwLFxuICAgICAgICAgICAgQ0RUOiAtNSAqIDYwLFxuICAgICAgICAgICAgQ1NUOiAtNiAqIDYwLFxuICAgICAgICAgICAgTURUOiAtNiAqIDYwLFxuICAgICAgICAgICAgTVNUOiAtNyAqIDYwLFxuICAgICAgICAgICAgUERUOiAtNyAqIDYwLFxuICAgICAgICAgICAgUFNUOiAtOCAqIDYwLFxuICAgICAgICB9O1xuXG4gICAgLy8gZGF0ZSBmcm9tIGlzbyBmb3JtYXRcbiAgICBmdW5jdGlvbiBjb25maWdGcm9tSVNPKGNvbmZpZykge1xuICAgICAgICB2YXIgaSxcbiAgICAgICAgICAgIGwsXG4gICAgICAgICAgICBzdHJpbmcgPSBjb25maWcuX2ksXG4gICAgICAgICAgICBtYXRjaCA9IGV4dGVuZGVkSXNvUmVnZXguZXhlYyhzdHJpbmcpIHx8IGJhc2ljSXNvUmVnZXguZXhlYyhzdHJpbmcpLFxuICAgICAgICAgICAgYWxsb3dUaW1lLFxuICAgICAgICAgICAgZGF0ZUZvcm1hdCxcbiAgICAgICAgICAgIHRpbWVGb3JtYXQsXG4gICAgICAgICAgICB0ekZvcm1hdCxcbiAgICAgICAgICAgIGlzb0RhdGVzTGVuID0gaXNvRGF0ZXMubGVuZ3RoLFxuICAgICAgICAgICAgaXNvVGltZXNMZW4gPSBpc29UaW1lcy5sZW5ndGg7XG5cbiAgICAgICAgaWYgKG1hdGNoKSB7XG4gICAgICAgICAgICBnZXRQYXJzaW5nRmxhZ3MoY29uZmlnKS5pc28gPSB0cnVlO1xuICAgICAgICAgICAgZm9yIChpID0gMCwgbCA9IGlzb0RhdGVzTGVuOyBpIDwgbDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzb0RhdGVzW2ldWzFdLmV4ZWMobWF0Y2hbMV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIGRhdGVGb3JtYXQgPSBpc29EYXRlc1tpXVswXTtcbiAgICAgICAgICAgICAgICAgICAgYWxsb3dUaW1lID0gaXNvRGF0ZXNbaV1bMl0gIT09IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZGF0ZUZvcm1hdCA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLl9pc1ZhbGlkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1hdGNoWzNdKSB7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMCwgbCA9IGlzb1RpbWVzTGVuOyBpIDwgbDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc29UaW1lc1tpXVsxXS5leGVjKG1hdGNoWzNdKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWF0Y2hbMl0gc2hvdWxkIGJlICdUJyBvciBzcGFjZVxuICAgICAgICAgICAgICAgICAgICAgICAgdGltZUZvcm1hdCA9IChtYXRjaFsyXSB8fCAnICcpICsgaXNvVGltZXNbaV1bMF07XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodGltZUZvcm1hdCA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5faXNWYWxpZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFhbGxvd1RpbWUgJiYgdGltZUZvcm1hdCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnLl9pc1ZhbGlkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1hdGNoWzRdKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR6UmVnZXguZXhlYyhtYXRjaFs0XSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdHpGb3JtYXQgPSAnWic7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLl9pc1ZhbGlkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb25maWcuX2YgPSBkYXRlRm9ybWF0ICsgKHRpbWVGb3JtYXQgfHwgJycpICsgKHR6Rm9ybWF0IHx8ICcnKTtcbiAgICAgICAgICAgIGNvbmZpZ0Zyb21TdHJpbmdBbmRGb3JtYXQoY29uZmlnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbmZpZy5faXNWYWxpZCA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZXh0cmFjdEZyb21SRkMyODIyU3RyaW5ncyhcbiAgICAgICAgeWVhclN0cixcbiAgICAgICAgbW9udGhTdHIsXG4gICAgICAgIGRheVN0cixcbiAgICAgICAgaG91clN0cixcbiAgICAgICAgbWludXRlU3RyLFxuICAgICAgICBzZWNvbmRTdHJcbiAgICApIHtcbiAgICAgICAgdmFyIHJlc3VsdCA9IFtcbiAgICAgICAgICAgIHVudHJ1bmNhdGVZZWFyKHllYXJTdHIpLFxuICAgICAgICAgICAgZGVmYXVsdExvY2FsZU1vbnRoc1Nob3J0LmluZGV4T2YobW9udGhTdHIpLFxuICAgICAgICAgICAgcGFyc2VJbnQoZGF5U3RyLCAxMCksXG4gICAgICAgICAgICBwYXJzZUludChob3VyU3RyLCAxMCksXG4gICAgICAgICAgICBwYXJzZUludChtaW51dGVTdHIsIDEwKSxcbiAgICAgICAgXTtcblxuICAgICAgICBpZiAoc2Vjb25kU3RyKSB7XG4gICA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ZGVudCBkYXktb2Ytd2VlayBjaGVjay5cbiAgICAgICAgICAgIHZhciB3ZWVrZGF5UHJvdmlkZWQgPSBkZWZhdWx0TG9jYWxlV2Vla2RheXNTaG9ydC5pbmRleE9mKHdlZWtkYXlTdHIpLFxuICAgICAgICAgICAgICAgIHdlZWtkYXlBY3R1YWwgPSBuZXcgRGF0ZShcbiAgICAgICAgICAgICAgICAgICAgcGFyc2VkSW5wdXRbMF0sXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlZElucHV0WzFdLFxuICAgICAgICAgICAgICAgICAgICBwYXJzZWRJbnB1dFsyXVxuICAgICAgICAgICAgICAgICkuZ2V0RGF5KCk7XG4gICAgICAgICAgICBpZiAod2Vla2RheVByb3ZpZGVkICE9PSB3ZWVrZGF5QWN0dWFsKSB7XG4gICAgICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykud2Vla2RheU1pc21hdGNoID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBjb25maWcuX2lzVmFsaWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY2FsY3VsYXRlT2Zmc2V0KG9ic09mZnNldCwgbWlsaXRhcnlPZmZzZXQsIG51bU9mZnNldCkge1xuICAgICAgICBpZiAob2JzT2Zmc2V0KSB7XG4gICAgICAgICAgICByZXR1cm4gb2JzT2Zmc2V0c1tvYnNPZmZzZXRdO1xuICAgICAgICB9IGVsc2UgaWYgKG1pbGl0YXJ5T2Zmc2V0KSB7XG4gICAgICAgICAgICAvLyB0aGUgb25seSBhbGxvd2VkIG1pbGl0YXJ5IHR6IGlzIFpcbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIGhtID0gcGFyc2VJbnQobnVtT2Zmc2V0LCAxMCksXG4gICAgICAgICAgICAgICAgbSA9IGhtICUgMTAwLFxuICAgICAgICAgICAgICAgIGggPSAoaG0gLSBtKSAvIDEwMDtcbiAgICAgICAgICAgIHJldHVybiBoICogNjAgKyBtO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gZGF0ZSBhbmQgdGltZSBmcm9tIHJlZiAyODIyIGZvcm1hdFxuICAgIGZ1bmN0aW9uIGNvbmZpZ0Zyb21SRkMyODIyKGNvbmZpZykge1xuICAgICAgICB2YXIgbWF0Y2ggPSByZmMyODIyLmV4ZWMocHJlcHJvY2Vzc1JGQzI4MjIoY29uZmlnLl9pKSksXG4gICAgICAgICAgICBwYXJzZWRBcnJheTtcbiAgICAgICAgaWYgKG1hdGNoKSB7XG4gICAgICAgICAgICBwYXJzZWRBcnJheSA9IGV4dHJhY3RGcm9tUkZDMjgyMlN0cmluZ3MoXG4gICAgICAgICAgICAgICAgbWF0Y2hbNF0sXG4gICAgICAgICAgICAgICAgbWF0Y2hbM10sXG4gICAgICAgICAgICAgICAgbWF0Y2hbMl0sXG4gICAgICAgICAgICAgICAgbWF0Y2hbNV0sXG4gICAgICAgICAgICAgICAgbWF0Y2hbNl0sXG4gICAgICAgICAgICAgICAgbWF0Y2hbN11cbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBpZiAoIWNoZWNrV2Vla2RheShtYXRjaFsxXSwgcGFyc2VkQXJyYXksIGNvbmZpZykpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGNvbmZpZy5fYSA9IHBhcnNlZEFycmF5O1xuICAgICAgICAgICAgY29uZmlnLl90em0gPSBjYWxjdWxhdGVPZmZzZXQobWF0Y2hbOF0sIG1hdGNoWzldLCBtYXRjaFsxMF0pO1xuXG4gICAgICAgICAgICBjb25maWcuX2QgPSBjcmVhdGVVVENEYXRlLmFwcGx5KG51bGwsIGNvbmZpZy5fYSk7XG4gICAgICAgICAgICBjb25maWcuX2Quc2V0VVRDTWludXRlcyhjb25maWcuX2QuZ2V0VVRDTWludXRlcygpIC0gY29uZmlnLl90em0pO1xuXG4gICAgICAgICAgICBnZXRQYXJzaW5nRmxhZ3MoY29uZmlnKS5yZmMyODIyID0gdHJ1ZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbmZpZy5faXNWYWxpZCA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gZGF0ZSBmcm9tIDEpIEFTUC5ORVQsIDIpIElTTywgMykgUkZDIDI4MjIgZm9ybWF0cywgb3IgNCkgb3B0aW9uYWwgZmFsbGJhY2sgaWYgcGFyc2luZyBpc24ndCBzdHJpY3RcbiAgICBmdW5jdGlvbiBjb25maWdGcm9tU3RyaW5nKGNvbmZpZykge1xuICAgICAgICB2YXIgbWF0Y2hlZCA9IGFzcE5ldEpzb25SZWdleC5leGVjKGNvbmZpZy5faSk7XG4gICAgICAgIGlmIChtYXRjaGVkICE9PSBudWxsKSB7XG4gICAgICAgICAgICBjb25maWcuX2QgPSBuZXcgRGF0ZSgrbWF0Y2hlZFsxXSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBjb25maWdGcm9tSVNPKGNvbmZpZyk7XG4gICAgICAgIGlmIChjb25maWcuX2lzVmFsaWQgPT09IGZhbHNlKSB7XG4gICAgICAgICAgICBkZWxldGUgY29uZmlnLl9pc1ZhbGlkO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uZmlnRnJvbVJGQzI4MjIoY29uZmlnKTtcbiAgICAgICAgaWYgKGNvbmZpZy5faXNWYWxpZCA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuX2lzVmFsaWQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAg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pZ0Zyb21BcnJheShjb25maWcpIHtcbiAgICAgICAgdmFyIGksXG4gICAgICAgICAgICBkYXRlLFxuICAgICAgICAgICAgaW5wdXQgPSBbXSxcbiAgICAgICAgICAgIGN1cnJlbnREYXRlLFxuICAgICAgICAgICAgZXhwZWN0ZWRXZWVrZGF5LFxuICAgICAgICAgICAgeWVhclRvVXNlO1xuXG4gICAgICAgIGlmIChjb25maWcuX2QpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGN1cnJlbnREYXRlID0gY3VycmVudERhdGVBcnJheShjb25maWcpO1xuXG4gICAgICAgIC8vY29tcHV0ZSBkYXkgb2YgdGhlIHllYXIgZnJvbSB3ZWVrcyBhbmQgd2Vla2RheXNcbiAgICAgICAgaWYgKGNvbmZpZy5fdyAmJiBjb25maWcuX2FbREFURV0gPT0gbnVsbCAmJiBjb25maWcuX2FbTU9OVEhdID09IG51bGwpIHtcbiAgICAgICAgICAgIGRheU9mWWVhckZyb21XZWVrSW5mbyhjb25maWcpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy9pZiB0aGUgZGF5IG9mIHRoZSB5ZWFyIGlzIHNldCwgZmlndXJlIG91dCB3aGF0IGl0IGlzXG4gICAgICAgIGlmIChjb25maWcuX2RheU9mWWVhciAhPSBudWxsKSB7XG4gICAgICAgICAgICB5ZWFyVG9Vc2UgPSBkZWZhdWx0cyhjb25maWcuX2FbWUVBUl0sIGN1cnJlbnREYXRlW1lFQVJdKTtcblxuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIGNvbmZpZy5fZGF5T2ZZZWFyID4gZGF5c0luWWVhcih5ZWFyVG9Vc2UpIHx8XG4gICAgICAgICAgICAgICAgY29uZmlnLl9kYXlPZlllYXIgPT09IDBcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIGdldFBhcnNpbmdGbGFncyhjb25maWcpLl9vdmVyZmxvd0RheU9mWWVhciA9IHRydWU7XG4gICAgICA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m9yIDI0OjAwOjAwLjAwMFxuICAgICAgICBpZiAoXG4gICAgICAgICAgICBjb25maWcuX2FbSE9VUl0gPT09IDI0ICYmXG4gICAgICAgICAgICBjb25maWcuX2FbTUlOVVRFXSA9PT0gMCAmJlxuICAgICAgICAgICAgY29uZmlnLl9hW1NFQ09ORF0gPT09IDAgJiZcbiAgICAgICAgICAgIGNvbmZpZy5fYVtNSUxMSVNFQ09ORF0gPT09IDBcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBjb25maWcuX25leHREYXkgPSB0cnVlO1xuICAgICAgICAgICAgY29uZmlnLl9hW0hPVVJdID0gMDtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbmZpZy5fZCA9IChjb25maWcuX3VzZVVUQyA/IGNyZWF0ZVVUQ0RhdGUgOiBjcmVhdGVEYXRlKS5hcHBseShcbiAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICBpbnB1dFxuICAgICAgICApO1xuICAgICAgICBleHBlY3RlZFdlZWtkYXkgPSBjb25maWcuX3VzZVVUQ1xuICAgICAgICAgICAgPyBjb25maWcuX2QuZ2V0VVRDRGF5KClcbiAgICAgICAgICAgIDogY29uZmlnLl9kLmdldERheSgpO1xuXG4gICAgICAgIC8vIEFwcGx5IHRpbWV6b25lIG9mZnNldCBmcm9tIGlucHV0LiBUaGUgYWN0dWFsIHV0Y09mZnNldCBjYW4gYmUgY2hhbmdlZFxuICAgICAgICAvLyB3aXRoIHBhcnNlWm9uZS5cbiAgICAgICAgaWYgKGNvbmZpZy5fdHptICE9IG51bGwpIHtcbiAgICAgICAgICAgIGNvbmZpZy5fZC5zZXRVVENNaW51dGVzKGNvbmZpZy5fZC5nZXRVVENNaW51dGVzKCkgLSBjb25maWcuX3R6bSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY29uZmlnLl9uZXh0RGF5KSB7XG4gICAgICAgICAgICBjb25maWcuX2FbSE9VUl0gPSAyNDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIG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AgICAgICAgICB3LkdHLFxuICAgICAgICAgICAgICAgIGNvbmZpZy5fYVtZRUFSXSxcbiAgICAgICAgICAgICAgICB3ZWVrT2ZZZWFyKGNyZWF0ZUxvY2FsKCksIDEsIDQpLnllYXJcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICB3ZWVrID0gZGVmYXVsdHMody5XLCAxKTtcbiAgICAgICAgICAgIHdlZWtkYXkgPSBkZWZhdWx0cyh3LkUsIDEpO1xuICAgICAgICAgICAgaWYgKHdlZWtkYXkgPCAxIHx8IHdlZWtkYXkgPiA3KSB7XG4gICAgICAgICAgICAgICAgd2Vla2RheU92ZXJmbG93ID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGRvdyA9IGNvbmZpZy5fbG9jYWxlLl93ZWVrLmRvdztcbiAgICAgICAgICAgIGRveSA9IGNvbmZpZy5fbG9jYWxlLl93ZWVrLmRveTtcblxuICAgICAgICAgICAgY3VyV2VlayA9IHdlZWtPZlllYXIoY3JlYXRlTG9jYWwoKSwgZG93LCBkb3kpO1xuXG4gICAgICAgICAgICB3ZWVrWWVhciA9IGRlZmF1bHRzKHcuZ2csIGNvbmZpZy5fYVtZRUFSXSwgY3VyV2Vlay55ZWFyKTtcblxuICAgICAgICAgICAgLy8gRGVmYXVsdCB0byBjdXJyZW50IHdlZWsuXG4gICAgICAgICAgICB3ZWVrID0gZGVmYXVsdHMody53LCBjdXJXZWVrLndlZWspO1xuXG4gICAgICAgICAgICBpZiAody5kICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAvLyB3ZWVrZGF5IC0tIGxvdyBkYXkgbnVtYmVycyBhcmUgY29uc2lkZXJlZCBuZXh0IHdlZWtcbiAgICAgICAgICAgICAgICB3ZWVrZGF5ID0gdy5kO1xuICAgICAgICAgICAgICAgIGlmICh3ZWVrZGF5IDwgMCB8fCB3ZWVrZGF5ID4gNikge1xuICAgICAgICAgICAgICAgICAgICB3ZWVrZGF5T3ZlcmZsb3cgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAody5lICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAvLyBsb2NhbCB3ZWVrZGF5IC0tIGNvdW50aW5nIHN0YXJ0cyBmcm9tIGJlZ2lubmluZyBvZiB3ZWVrXG4gICAgICAgICAgICAgICAgd2Vla2RheSA9IHcuZSArIGRvdztcbiAgICAgICAgICAgICAgICBpZiAody5lIDwgMCB8fCB3LmUgPiA2KSB7XG4gICAgICAgICAgICAgICAgICAgIHdlZWtkYXlPdmVyZmxvdyA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBkZWZhdWx0IHRvIGJlZ2lubmluZyBvZiB3ZWVrXG4gICAgICAgICAgICAgICAgd2Vla2RheSA9IGRvdztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAod2VlayA8IDEgfHwgd2VlayA+IHdlZWtzSW5ZZWFyKHdlZWtZZWFyLCBkb3csIGRveSkpIHtcbiAgICAgICAgICAgIGdldFBhcnNpbmdGbGFncyhjb25maWcpLl9vdmVyZmxvd1dlZWtzID0gdHJ1ZTtcbiAgICAgICAgfSBlbHNlIGlmICh3ZWVrZGF5T3ZlcmZsb3cgIT0gbnVsbCkge1xuICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykuX292ZXJmbG93V2Vla2RheSA9IHRydWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0ZW1wID0gZGF5T2ZZZWFyRnJvbVdlZWtzKHdlZWtZZWFyLCB3ZWVrLCB3ZWVrZGF5LCBkb3csIGRveSk7XG4gICAgICAgICAgICBjb25maWcuX2FbWUVBUl0gPSB0ZW1wLnllYXI7XG4gICAgICAgICAgICBjb25maWcuX2RheU9mWWVhciA9IHRlbXAuZGF5T2Z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YXJzZWRJbnB1dCxcbiAgICAgICAgICAgIHRva2VucyxcbiAgICAgICAgICAgIHRva2VuLFxuICAgICAgICAgICAgc2tpcHBlZCxcbiAgICAgICAgICAgIHN0cmluZ0xlbmd0aCA9IHN0cmluZy5sZW5ndGgsXG4gICAgICAgICAgICB0b3RhbFBhcnNlZElucHV0TGVuZ3RoID0gMCxcbiAgICAgICAgICAgIGVyYSxcbiAgICAgICAgICAgIHRva2VuTGVuO1xuXG4gICAgICAgIHRva2VucyA9XG4gICAgICAgICAgICBleHBhbmRGb3JtYXQoY29uZmlnLl9mLCBjb25maWcuX2xvY2FsZSkubWF0Y2goZm9ybWF0dGluZ1Rva2VucykgfHwgW107XG4gICAgICAgIHRva2VuTGVuID0gdG9rZW5zLmxlbmd0aDtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IHRva2VuTGVuOyBpKyspIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgcGFyc2VkSW5wdXQgPSAoc3RyaW5nLm1hdGNoKGdldFBhcnNlUmVnZXhGb3JUb2tlbih0b2tlbiwgY29uZmlnKSkgfHxcbiAgICAgICAgICAgICAgICBbXSlbMF07XG4gICAgICAgICAgICBpZiAocGFyc2VkSW5wdXQpIHtcbiAgICAgICAgICAgICAgICBza2lwcGVkID0gc3RyaW5nLnN1YnN0cigwLCBzdHJpbmcuaW5kZXhPZihwYXJzZWRJbnB1dCkpO1xuICAgICAgICAgICAgICAgIGlmIChza2lwcGVkLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykudW51c2VkSW5wdXQucHVzaChza2lwcGVkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc3RyaW5nID0gc3RyaW5nLnNsaWNlKFxuICAgICAgICAgICAgICAgICAgICBzdHJpbmcuaW5kZXhPZihwYXJzZWRJbnB1dCkgKyBwYXJzZWRJbnB1dC5sZW5ndGhcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHRvdGFsUGFyc2VkSW5wdXRMZW5ndGggKz0gcGFyc2VkSW5wdXQubGVuZ3RoO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gZG9uJ3QgcGFyc2UgaWYgaXQncyBub3QgYSBrbm93biB0b2tlblxuICAgICAgICAgICAgaWYgKGZvcm1hdFRva2VuRnVuY3Rpb25zW3Rva2VuXSkge1xuICAgICAgICAgICAgICAgIGlmIChwYXJzZWRJbnB1dCkge1xuICAgICAgICAgICAgICAgICAgICBnZXRQYXJzaW5nRmxhZ3MoY29uZmlnKS5lbXB0eSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGdldFBhcnNpbmdGbGFncyhjb25maWcpLnVudXNlZFRva2Vucy5wdXNoKHRva2VuKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYWRkVGltZVRvQXJyYXlGcm9tVG9rZW4odG9rZW4sIHBhcnNlZElucHV0LCBjb25maWcpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjb25maWcuX3N0cmljdCAmJiAhcGFyc2VkSW5wdXQpIHtcbiAgICAgICAgICAgICAgICBnZXRQYXJzaW5nRmxhZ3MoY29uZmlnKS51bnVzZWRUb2tlbnMucHVzaCh0b2tlbik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBhZGQgcmVtYWluaW5nIHVucGFyc2VkIGlucHV0IGxlbmd0aCB0byB0aGUgc3RyaW5nXG4gICAgICAgIGdldFBhcnNpbmdGbGFncyhjb25maWcpLmNoYXJzTGVmdE92ZXIgPVxuICAgICAgICAgICAgc3RyaW5nTGVuZ3RoIC0gdG90YWxQYXJzZWRJbnB1dExlbmd0aDtcbiAgICAgICAgaWYgKHN0cmluZy5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBnZXRQYXJzaW5nR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0Zyb21BcnJheShjb25maWcpO1xuICAgICAgICBjaGVja092ZXJmbG93KGNvbmZpZyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbWVyaWRpZW1GaXhXcmFwKGxvY2FsZSwgaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgdmFyIGlzUG07XG5cbiAgICAgICAgaWYgKG1lcmlkaWVtID09IG51bGwpIHtcbiAgICAgICAgICAgIC8vIG5vdGhpbmcgdG8gZG9cbiAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICB9XG4gICAgICAgIGlmIChsb2NhbGUubWVyaWRpZW1Ib3VyICE9IG51bGwpIHtcbiAgICAgICAgICAgIHJldHVybiBsb2NhbGUubWVyaWRpZW1Ib3VyKGhvdXIsIG1lcmlkaWVtKTtcbiAgICAgICAgfSBlbHNlIGlmIChsb2NhbGUuaXNQTSAhPSBudWxsKSB7XG4gICAgICAgICAgICAvLyBGYWxsYmFja1xuICAgICAgICAgICAgaXNQbSA9IGxvY2FsZS5pc1BNKG1lcmlkaWVtKTtcbiAgICAgICAgICAgIGlmIChpc1BtICYmIGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgKz0gMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIWlzUG0gJiYgaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gdGhpcyBpcyBub3Qgc3VwcG9zZWQgdG8gaGFwcGVuXG4gICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIGRhdGUgZnJvbSBzdHJpbmcgYW5kIGFycmF5IG9mIGZvcm1hdCBzdHJpbmdzXG4gICAgZnVuY3Rpb24gY29uZmlnRnJvbVN0cmluZ0FuZEFycmF5KGNvbmZpZykge1xuICAgICAgICB2YXIgdGVtcENvbmZpZyxcbiAgICAgICAgICAgIGJlc3RNb21lbnQsXG4gICAgICAgICAgICBzY29yZVRvQmVhdCxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBjdXJyZW50U2NvcmUsXG4gICAgICAgICAgICB2YWxpZEZvcm1hdEZvdW5kLFxuICAgICAgICAgICAgYmVzdEZvcm1hdElzVmFsaWQgPSBmYWxzZSxcbiAgICAgICAgICAgIGNvbmZpZ2ZMZW4gPSBjb25maWcuX2YubGVuZ3RoO1xuXG4gICAgICAgIGlmIChjb25maWdmTGVuID09PSAwKSB7XG4gICAgICAgICAgICBnZXRQYXJzaW5nRmxhZ3MoY29uZmlnKS5pbnZhbGlkRm9ybWF0ID0gdHJ1ZTtcbiAgICAgICAgICAgIGNvbmZpZy5fZCA9IG5ldyBEYXRlKE5hTik7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29uZmlnZkxlbjsgaSsrKSB7XG4gICAgICAgICAgICBjdXJyZW50U2NvcmUgPSAwO1xuICAgICAgICAgICAgdmFsaWRGb3JtYXRGb3VuZCA9IGZhbHNlO1xuICAgICAgICAgICAgdGVtcENvbmZpZyA9IGNvcHlDb25maWcoe30sIGNvbmZpZyk7XG4gICAgICAgICAgICBpZiAoY29uZmlnLl91c2VVVEMgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHRlbXBDb25maWcuX3VzZVVUQyA9IGNvbmZpZy5fdXNlVVRDO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGVtcENvbmZpZy5fZiA9IGNvbmZpZy5fZltpXTtcbiAgICAgICAgICAgIGNvbmZpZ0Zyb21TdHJpbmdBbmRGb3JtYXQodGVtcENvbmZpZyk7XG5cbiAgICAgICAgICAgIGlmIChpc1ZhbGlkKHRlbXBDb25maWcpKSB7XG4gICAgICAgICAgICAgICAgdmFsaWRGb3JtYXRGb3VuZCA9IHRydWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIGlmIHRoZXJlIGlzIGFueSBpbnB1dCB0aGF0IHdhcyBub3QgcGFyc2VkIGFkZCBhIHBlbmFsdHkgZm9yIHRoYXQgZm9ybWF0XG4gICAgICAgICAgICBjdXJyZW50U2NvcmUgKz0gZ2V0UGFyc2luZ0ZsYWdzKHRlbXBDb25maWcpLmNoYXJzTGVmdE92ZXI7XG5cbiAgICAgICAgICAgIC8vb3IgdG9rZW5zXG4gICAgICAgICAgICBjdXJyZW50U2NvcmUgKz0gZ2V0UGFyc2luZ0ZsYWdzKHRlbXBDb25maWcpLnVudXNlZFRva2Vucy5sZW5ndGggKiAxMDtcblxuICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKHRlbXBDb25maWcpLnNjb3JlID0gY3VycmVudFNjb3JlO1xuXG4gICAgICAgICAgICBpZiAoIWJlc3RGb3JtYXRJc1ZhbGlkKSB7XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICBzY29yZVRvQmVhdCA9PSBudWxsIHx8XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRTY29yZSA8IHNjb3JlVG9CZWF0IHx8XG4gICAgICAgICAgICAgICAgICAgIHZhbGlkRm9ybWF0Rm91bmRcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgc2NvcmVUb0JlYXQgPSBjdXJyZW50U2NvcmU7XG4gICAgICAgICAgICAgICAgICAgIGJlc3RNb21lbnQgPSB0ZW1wQ29uZmlnO1xuICAgICAgICAgICAgICAgICAgICBpZiAodmFsaWRGb3JtYXRGb3VuZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYmVzdEZvcm1hdElzVmFsaWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVudFNjb3JlIDwgc2NvcmVUb0JlYXQpIHtcbiAgICAgICAgICAgICAgICAgICAgc2NvcmVUb0JlYXQgPSBjdXJyZW50U2NvcmU7XG4gICAgICAgICAgICAgICAgICAgIGJlc3RNb21lbnQgPSB0ZW1wQ29uZmlnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGV4dGVuZChjb25maWcsIGJlc3RNb21lbnQgfHwgdGVtcENvbmZpZyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY29uZmlnRnJvbU9iamVjdChjb25maWcpIHtcbiAgICAgICAgaWYgKGNvbmZpZy5fZCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGkgPSBub3JtYWxpemVPYmplY3RVbml0cyhjb25maWcuX2kpLFxuICAgICAgICAgICAgZGF5T3JEYXRlID0gaS5kYXkgPT09IHVuZGVmaW5lZCA/IGkuZGF0ZSA6IGkuZGF5O1xuICAgICAgICBjb25maWcuX2EgPSBtYXAoXG4gICAgICAgICAgICBbaS55ZWFyLCBpLm1vbnRoLCBkYXlPckRhdGUsIGkuaG91ciwgaS5taW51dGUsIGkuc2Vjb25kLCBpLm1pbGxpc2Vjb25kXSxcbiAgICAgICAgICAgIGZ1bmN0aW9uIChvYmopIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gb2JqICYmIHBhcnNlSW50KG9iaiwgMTApO1xuICAgICAgICAgICAgfVxuICAgICAgICApO1xuXG4gICAgICAgIGNvbmZpZ0Zyb21BcnJheShjb25maWcpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNyZWF0ZUZyb21Db25maWcoY29uZmlnKSB7XG4gICAgICAgIHZhciByZXMgPSBuZXcgTW9tZW50KGNoZWNrT3ZlcmZsb3cocHJlcGFyZUNvbmZpZyhjb25maWcpKSk7XG4gICAgICAgIGlmIChyZXMuX25leHREYXkpIHtcbiAgICAgICAgICAgIC8vIEFkZGluZyBpcy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XG4gICAgICAgICAgICBjb25maWdGcm9tU3RyaW5nQW5kRm9ybWF0KGNvbmZpZyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25maWdGcm9tSW5wdXQoY29uZmlnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghaXNWYWxpZChjb25maWcpKSB7XG4gICAgICAgICAgICBjb25maWcuX2QgPSBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNvbmZpZztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjb25maWdGcm9tSW5wdXQoY29uZmlnKSB7XG4gICAgICAgIHZhciBpbnB1dCA9IGNvbmZpZy5faTtcbiAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGlucHV0KSkge1xuICAgICAgICAgICAgY29uZmlnLl9kID0gbmV3IERhdGUoaG9va3Mubm93KCkpO1xuICAgICAgICB9IGVsc2UgaWYgKGlzRGF0ZShpbnB1dCkpIHtcbiAgICAgICAgICAgIGNvbmZpZy5fZCA9IG5ldyBEYXRlKGlucHV0LnZhbHVlT2YoKSk7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGlucHV0ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgY29uZmlnRnJvbVN0cmluZyhjb25maWcpO1xuICAgICAgICB9IGVsc2UgaWYgKGlzQXJyYXkoaW5wdXQpKSB7XG4gICAgICAgICAgICBjb25maWcuX2EgPSBtYXAoaW5wdXQuc2xpY2UoMCksIGZ1bmN0aW9uIChvYmopIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VJbnQob2JqLCAxMCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGNvbmZpZ0Zyb21BcnJheShjb25maWcpO1xuICAgICAgICB9IGVsc2UgaWYgKGlzT2JqZWN0KGlucHV0KSkge1xuICAgICAgICAgICAgY29uZmlnRnJvbU9iamVjdChjb25maWcpO1xuICAgICAgICB9IGVsc2UgaWYgKGlzTnVtYm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KG1vbWVudHNbMF0pKSB7XG4gICAgICAgICAgICBtb21lbnRzID0gbW9tZW50c1swXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIW1vbWVudHMubGVuZ3RoKSB7XG4gICAgICAgICAgICByZXR1cm4gY3JlYXRlTG9jYWwoKTtcbiAgICAgICAgfVxuICAgICAgICByZXMgPSBtb21lbnRzWzBdO1xuICAgICAgICBmb3IgKGkgPSAxOyBpIDwgbW9tZW50cy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgaWYgKCFtb21lbnRzW2ldLmlzVmFsaWQoKSB8fCBtb21lbnRzW2ldW2ZuXShyZXMpKSB7XG4gICAgICAgICAgICAgICAgcmVzID0gbW9tZW50c1tpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH1cblxuICAgIC8vIFRPRE86IFVzZSBbXS5zb3J0IGluc3RlYWQ/XG4gICAgZnVuY3Rpb24gbWluKCkge1xuICAgICAgICB2YXIgYXJncyA9IFtdLnNsaWNlLmNhbGwoYXJndW1lbnRzLCAwKTtcblxuICAgICAgICByZXR1cm4gcGlja0J5KCdpc0JlZm9yZScsIGFyZ3MpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1heCgpIHtcbiAgICAgICAgdmFyIGFyZ3MgPSBbXS5zbGljZS5jYWxsKGFyZ3VtZW50cywgMCk7XG5cbiAgICAgICAgcmV0dXJuIHBpY2tCeSgnaXNBZnRlcicsIGFyZ3MpO1xuICAgIH1cblxuICAgIHZhciBub3cgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiBEYXRlLm5vdyA/IERhdGUubm93KCkgOiArbmV3IERhdGUoKTtcbiAgICB9O1xuXG4gICAgdmFyIG9yZGVyaW5nID0gW1xuICAgICAgICAneWVhcicsXG4gICAgICAgICdxdWFydGVyJyxcbiAgICAgICAgJ21vbnRoJyxcbiAgICAgICAgJ3dlZWsnLFxuICAgICAgICAnZGF5JyxcbiAgICAgICAgJ2hvdXInLFxuICAgICAgICAnbWludXRlJyxcbiAgICAgICAgJ3NlY29uZCcsXG4gICAgICAgICdtaWxsaXNlY29uZCcsXG4gICAgXTtcblxuICAgIGZ1bmN0aW9uIGlzRHVyYXRpb25WYWxpZChtKSB7XG4gICAgICAgIHZhciBrZXksXG4gICAgICAgICAgICB1bml0SGFzRGVjaW1hbCA9IGZhbHNlLFxuICAgICAgICAgICAgaSxcbiAgICAgICAgICAgIG9yZGVyTGVuID0gb3JkZXJpbmcubGVuZ3RoO1xuICAgICAgICBmb3IgKGtleSBpbiBtKSB7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgaGFzT3duUHJvcChtLCBrZXkpICYmXG4gICAgICAgICAgICAgICAgIShcbiAgICAgICAgICAgICAgICAgICAgaW5kZXhPZi5jYWxsKG9yZGVyaW5nLCBrZXkpICE9PSAtMSAmJlxuICAgICAgICAgICAgICAgICAgICAobVtrZXldID09IG51bGwgfHwgIWlzTmFOKG1ba2V5XSkpXG4gICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IG9yZGVyTGVuOyArK2kpIHtcbiAgICAgICAgICAgIGlmIChtW29yZGVyaW5nW2ldXSkge1xuICAgICAgICAgICAgICAgIGlmICh1bml0SGFzRGVjaW1hbCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7IC8vIG9ubHkgYWxsb3cgbm9uLWludGVnZXJzIGZvciBzbWFsbGVzdCB1bml0XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChwYXJzZUZsb2F0KG1bb3JkZXJpbmdbaV1dKSAhPT0gdG9JbnQobVtvcmRlcmluZ1tpXV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHVuaXRIYXNEZWNpbW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XRhID0ge307XG5cbiAgICAgICAgdGhpcy5fbG9jYWxlID0gZ2V0TG9jYWxlKCk7XG5cbiAgICAgICAgdGhpcy5fYnViYmxlKCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNEdXJhdGlvbihvYmopIHtcbiAgICAgICAgcmV0dXJuIG9iaiBpbnN0YW5jZW9mIER1cmF0aW9uO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFic1JvdW5kKG51bWJlcikge1xuICAgICAgICBpZiAobnVtYmVyIDwgMCkge1xuICAgICAgICAgICAgcmV0dXJuIE1hdGgucm91bmQoLTEgKiBudW1iZXIpICogLTE7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gTWF0aC5yb3VuZChudW1iZXIpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gY29tcGFyZSB0d28gYXJyYXlzLCByZXR1cm4gdGhlIG51bWJlciBvZiBkaWZmZXJlbmNlc1xuICAgIGZ1bmN0aW9uIGNvbXBhcmVBcnJheXMoYXJyYXkxLCBhcnJheTIsIGRvbnRDb252ZXJ0KSB7XG4gICAgICAgIHZhciBsZW4gPSBNYXRoLm1pbihhcnJheTEubGVuZ3RoLCBhcnJheTIubGVuZ3RoKSxcbiAgICAgICAgICAgIGxlbmd0aERpZmYgPSBNYXRoLmFicyhhcnJheTEubGVuZ3RoIC0gYXJyYXkyLmxlbmd0aCksXG4gICAgICAgICAgICBkaWZmcyA9IDAsXG4gICAgICAgICAgICBpO1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAoZG9udENvbnZlcnQgJiYgYXJyYXkxW2ldICE9PSBhcnJheTJbaV0pIHx8XG4gICAgICAgICAgICAgICAgKCFkb250Q29udmVydCAmJiB0b0ludChhcnJheTFbaV0pICE9PSB0b0ludChhcnJheTJbaV0pKVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgZGlmZnMrKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZGlmZnMgKyBsZW5ndGhEaWZmO1xuICAgIH1cblxuICAgIC8vIEZPUk1BVFRJTkdcblxuICAgIGZ1bmN0aW9uIG9mZnNldCh0b2tlbiwgc2VwYXJhdG9yKSB7XG4gICAgICAgIGFkZEZvcm1hdFRva2VuKHRva2VuLCAwLCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgb2Zmc2V0ID0gdGhpcy51dGNPZmZzZXQoKSxcbiAgICAgICAgICAgICAgICBzaWduID0gJysnO1xuICAgICAgICAgICAgaWYgKG9mZnNldCA8IDApIHtcbiAgICAgICAgICAgICAgICBvZmZzZXQgPSAtb2Zmc2V0O1xuICAgICAgICAgICAgICAgIHNpZ24gPSAnLSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIHNpZ24gK1xuICAgICAgICAgICAgICAgIHplcm9GaWxsKH5+KG9mZnNldCAvIDYwKSwgMikgK1xuICAgICAgICAgICAgICAgIHNlcGFyYXRvciArXG4gICAgICAgICAgICAgICAgemVyb0ZpbGwofn5vZmZzZXQgJSA2MCwgMilcbiAgICAgICAgICAgICk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIG9mZnNldCgnWicsICc6Jyk7XG4gICAgb2Zmc2V0KCdaWicsICcnKTtcblxuICAgIC8vIFBBUlNJTkdcblxuICAgIGFkZFJlZ2V4VG9rZW4oJ1onLCBtYXRjaFNob3J0T2Zmc2V0KTtcbiAgICBhZGRSZWdleFRva2VuKCdaWicsIG1hdGNoU2hvcnRPZmZzZXQpO1xuICAgIGFkZFBhcnNlVG9rZW4oWydaJywgJ1paJ10sIGZ1bmN0aW9uIChpbnB1dCwgYXJyYXksIGNvbmZpZykge1xuICAgICAgICBjb25maWcuX3VzZVVUQyA9IHRydWU7XG4gICAgICAgIGNvbmZpZy5f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SB7XG4gICAgICAgIHZhciByZXMsIGRpZmY7XG4gICAgICAgIGlmIChtb2RlbC5faXNVVEMpIHtcbiAgICAgICAgICAgIHJlcyA9IG1vZGVsLmNsb25lKCk7XG4gICAgICAgICAgICBkaWZmID1cbiAgICAgICAgICAgICAgICAoaXNNb21lbnQoaW5wdXQpIHx8IGlzRGF0ZShpbnB1dClcbiAgICAgICAgICAgICAgICAgICAgPyBpbnB1dC52YWx1ZU9mKClcbiAgICAgICAgICAgICAgICAgICAgOiBjcmVhdGVMb2NhbChpbnB1dCkudmFsdWVPZigpKSAtIHJlcy52YWx1ZU9mKCk7XG4gICAgICAgICAgICAvLyBVc2UgbG93LWxldmVsIGFwaSwgYmVjYXVzZSB0aGlzIGZuIGlzIGxvdy1sZXZlbCBhcGkuXG4gICAgICAgICAgICByZXMuX2Quc2V0VGltZShyZXMuX2QudmFsdWVPZigpICsgZGlmZik7XG4gICAgICAgICAgICBob29rcy51cGRhdGVPZmZzZXQocmVzLCBmYWxzZSk7XG4gICAgICAgICAgICByZXR1cm4gcmVzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGNyZWF0ZUxvY2FsKGlucHV0KS5sb2NhbCgpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RGF0ZU9mZnNldChtKSB7XG4gICAgICAgIC8vIE9uIEZpcmVmb3guMjQgRGF0ZSNnZXRUaW1lem9uZU9mZnNldCByZXR1cm5zIGEgZmxvYXRpbmcgcG9pbnQuXG4gICAgICAgIC8vIGh0dHBzOi8vZ2l0aHViLmNvbS9tb21lbnQvbW9tZW50L3B1bGwvMTg3MVxuICAgICAgICByZXR1cm4gLU1hdGgucm91bmQobS5fZC5nZXRUaW1lem9uZU9mZnNldCgpKTtcbiAgICB9XG5cbiAgICAvLyBIT09LU1xuXG4gICAgLy8gVGhpcyBmdW5jdGlvbiB3aWxsIGJlIGNhbGxlZCB3aGVuZXZlciBhIG1vbWVudCB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VwTG9jYWxUaW1lLCBrZWVwTWludXRlcykge1xuICAgICAgICB2YXIgb2Zmc2V0ID0gdGhpcy5fb2Zmc2V0IHx8IDAsXG4gICAgICAgICAgICBsb2NhbEFkanVzdDtcbiAgICAgICAgaWYgKCF0aGlzLmlzVmFsaWQoKSkge1xuICAgICAgICAgICAgcmV0dXJuIGlucHV0ICE9IG51bGwgPyB0aGlzIDogTmFOO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpbnB1dCAhPSBudWxsKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGlucHV0ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlucHV0ID0gb2Zmc2V0RnJvbVN0cmluZyhtYXRjaFNob3J0T2Zmc2V0LCBpbnB1dCk7XG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoTWF0aC5hYnMoaW5wdXQpIDwgMTYgJiYgIWtlZXBNaW51dGVzKSB7XG4gICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dCAqIDYwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCF0aGlzLl9pc1VUQyAmJiBrZWVwTG9jYWxUaW1lKSB7XG4gICAgICAgICAgICAgICAgbG9jYWxBZGp1c3QgPSBnZXREYXRlT2Zmc2V0KHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy5fb2Zmc2V0ID0gaW5wdXQ7XG4gICAgICAgICAgICB0aGlzLl9pc1VUQyA9IHRydWU7XG4gICAgICAgICAgICBpZiAobG9jYWxBZGp1c3QgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHRoaXMuYWRkKGxvY2FsQWRqdXN0LCAnbScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG9mZnNldCAhPT0gaW5wdXQpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWtlZXBMb2NhbFRpbWUgfHwgdGhpcy5fY2hhbmdlSW5Qcm9ncmVzcykge1xuICAgICAgICAgICAgICAgICAgICBhZGRTdWJ0cmFjdChcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMsXG4gICAgICAgICAgICAgICAgICAgICAgICBjcmVhdGVEdXJhdGlvbihpbnB1dCAtIG9mZnNldCwgJ20nKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIDEsXG4gICAgICAgICAgICAgICAgICAgICAgICBmYWxzZVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIXRoaXMuX2NoYW5nZUluUHJvZ3Jlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fY2hhbmdlSW5Qcm9ncmVzcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGhvb2tzLnVwZGF0ZU9mZnNldCh0aGlzLCB0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fY2hhbmdlSW5Qcm9ncmVzcyA9IG51bGw7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5faXNVVEMgPyBvZmZzZXQgOiBnZXREYXRlT2Zmc2V0KHRoaXMpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0U2V0Wm9uZShpbnB1dCwga2VlcExvY2FsVGltZSkge1xuICAgICAgICBpZiAoaW5wdXQgIT0gbnVsbCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBpbnB1dCAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICBpbnB1dCA9IC1pbnB1dDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy51dGNPZmZzZXQoaW5wdXQsIG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V9kYXRlLmpzLnNvdXJjZS5odG1sXG4gICAgICAgIC8vIHNvbWV3aGF0IG1vcmUgaW4gbGluZSB3aXRoIDQuNC4zLjIgMjAwNCBzcGVjLCBidXQgYWxsb3dzIGRlY2ltYWwgYW55d2hlcmVcbiAgICAgICAgLy8gYW5kIGZ1cnRoZXIgbW9kaWZpZWQgdG8gYWxsb3cgZm9yIHN0cmluZ3MgY29udGFpbmluZyBib3RoIHdlZWsgYW5kIGRheVxuICAgICAgICBpc29SZWdleCA9XG4gICAgICAgICAgICAvXigtfFxcKyk/UCg/OihbLStdP1swLTksLl0qKVkpPyg/OihbLStdP1swLTksLl0qKU0pPyg/OihbLStdP1swLTksLl0qKVcpPyg/OihbLStdP1swLTksLl0qKUQpPyg/OlQoPzooWy0rXT9bMC05LC5dKilIKT8oPzooWy0rXT9bMC05LC5dKilNKT8oPzooWy0rXT9bMC05LC5dKilTKT8pPyQvO1xuXG4gICAgZnVuY3Rpb24gY3JlYXRlRHVyYXRpb24oaW5wdXQsIGtleSkge1xuICAgICAgICB2YXIgZHVyYXRpb24gPSBpbnB1dCxcbiAgICAgICAgICAgIC8vIG1hdGNoaW5nIGFnYWluc3QgcmVnZXhwIGlzIGV4cGVuc2l2ZSwgZG8gaXQgb24gZGVtYW5kXG4gICAgICAgICAgICBtYXRjaCA9IG51bGwsXG4gICAgICAgICAgICBzaWduLFxuICAgICAgICAgICAgcmV0LFxuICAgICAgICAgICAgZGlmZlJlcztcblxuICAgICAgICBpZiAoaXNEdXJhdGlvbihpbnB1dCkpIHtcbiAgICAgICAgICAgIGR1cmF0aW9uID0ge1xuICAgICAgICAgICAgICAgIG1zOiBpbnB1dC5fbWlsbGlzZWNvbmRzLFxuICAgICAgICAgICAgICAgIGQ6IGlucHV0Ll9kYXlzLFxuICAgICAgICAgICAgICAgIE06IGlucHV0Ll9tb250aHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKGlzTnVtYmVyKGlucHV0KSB8fCAhaXNOYU4oK2lucHV0KSkge1xuICAgICAgICAgICAgZHVyYXRpb24gPSB7fTtcbiAgICAgICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgICAgICBkdXJhdGlvbltrZXldID0gK2lucHV0O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBkdXJhdGlvbi5taWxsaXNlY29uZHMgPSAraW5wdXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoKG1hdGNoID0gYXNwTmV0UmVnZXguZXhlYyhpbnB1dCkpKSB7XG4gICAgICAgICAgICBzaWduID0gbWF0Y2hbMV0gPT09ICctJyA/IC0xIDogMTtcbiAgICAgICAgICAgIGR1cmF0aW9uID0ge1xuICAgICAgICAgICAgICAgIHk6IDAsXG4gICAgICAgICAgICAgICAgZDogdG9JbnQobWF0Y2hbREFURV0pICogc2lnbixcbiAgICAgICAgICAgICAgICBoOiB0b0ludChtYXRjaFtIT1VSXSkgKiBzaWduLFxuICAgICAgICAgICAgICAgIG06IHRvSW50KG1hdGNoW01JTlVURV0pICogc2lnbixcbiAgICAgICAgICAgICAgICBzOiB0b0ludChtYXRjaFtTRUNPTkRdKSAqIHNpZ24sXG4gICAgICAgICAgICAgICAgbXM6IHRvSW50KGFic1JvdW5kKG1hdGNoW01JTExJU0VDT05EXSAqIDEwMDApKSAqIHNpZ24sIC8vIHRoZSBtaWxsaXNlY29uZCBkZWNpbWFsIHBvaW50IGlzIGluY2x1ZGVkIGluIHRoZSBtYXRjaFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmICgobWF0Y2ggPSBpc29SZWdleC5leGVjKGlucHV0KSkpIHtcbiAgICAgICAgICAgIHNpZ24gPSBtYXRjaFsxXSA9PT0gJy0nID8gLTEgOiAxO1xuICAgICAgICAgICAgZHVyYXRpb24gPSB7XG4gICAgICAgICAgICAgICAgeTogcGFyc2VJc28obWF0Y2hbMl0sIHNpZ24pLFxuICAgICAgICAgICAgICAgIE06IHBhcnNlSXNvKG1hdGNoWzNdLCBzaWduKSxcbiAgICAgICAgICAgICAgICB3OiBwYXJzZUlzbyhtYXRjaFs0XSwgc2lnbiksXG4gICAgICAgICAgICAgICAgZDogcGFyc2VJc28obWF0Y2hbNV0sIHNpZ24pLFxuICAgICAgICAgICAgICAgIGg6IHBhcnNlSXNvKG1hdGNoWzZdLCBzaWduKSxcbiAgICAgICAgICAgICAgICBtOiBwYXJzZUlzbyhtYXRjaFs3XSwgc2lnbiksXG4gICAgICAgICAgICAgICAgczogcGFyc2VJc28obWF0Y2hbOF0sIHNpZ24pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmIChkdXJhdGlvbiA9PSBudWxsKSB7XG4gICAgICAgICAgICAvLyBjaGVja3MgZm9yIG51bGwgb3IgdW5kZWZpbmVkXG4gICAgICAgICAgICBkdXJhdGlvbiA9IHt9O1xuICAgICAgICB9IGVsc2UgaWYgKFxuICAgICAgICAgICAgdHlwZW9mIGR1cmF0aW9uID09PSAnb2JqZWN0JyAmJlxuICAgICAgICAgICAgKCdmcm9tJyBpbiBkdXJhdGlvbiB8fCAndG8nIGluIGR1cmF0aW9uKVxuICAgICAgICApIHtcbiAgICAgICAgICAgIGRpZmZSZXMgPSBtb21lbnRzRGlmZmVyZW5jZShcbiAgICAgICAgICAgICAgICBjcmVhdGVMb2NhbChkdXJhdGlvbi5mcm9tKSxcbiAgICAgICAgICAgICAgICBjcmVhdGVMb2NhbChkdXJhdGlvbi50bylcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIGR1cmF0aW9uID0ge307XG4gICAgICAgICAgICBkdXJhdGlvbi5tcyA9IGRpZmZSZXMubWlsbGlzZWNvbmRzO1xuICAgICAgICAgICAgZHVyYXRpb24uTSA9IGRpZmZSZXMubW9udGhzO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0ID0gbmV3IER1cmF0aW9uKGR1cmF0aW9uKTtcblxuICAgICAgICBpZiAoaXNE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gICBvdGhlci5tb250aCgpIC0gYmFzZS5tb250aCgpICsgKG90aGVyLnllYXIoKSAtIGJhc2UueWVhcigpKSAqIDEyO1xuICAgICAgICBpZiAoYmFzZS5jbG9uZSgpLmFkZChyZXMubW9udGhzLCAnTScpLmlzQWZ0ZXIob3RoZXIpKSB7XG4gICAgICAgICAgICAtLXJlcy5tb250aHM7XG4gICAgICAgIH1cblxuICAgICAgICByZXMubWlsbGlzZWNvbmRzID0gK290aGVyIC0gK2Jhc2UuY2xvbmUoKS5hZGQocmVzLm1vbnRocywgJ00nKTtcblxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1vbWVudHNEaWZmZXJlbmNlKGJhc2UsIG90aGVyKSB7XG4gICAgICAgIHZhciByZXM7XG4gICAgICAgIGlmICghKGJhc2UuaXNWYWxpZCgpICYmIG90aGVyLmlzVmFsaWQoKSkpIHtcbiAgICAgICAgICAgIHJldHVybiB7IG1pbGxpc2Vjb25kczogMCwgbW9udGhzOiAwIH07XG4gICAgICAgIH1cblxuICAgICAgICBvdGhlciA9IGNsb25lV2l0aE9mZnNldChvdGhlciwgYmFzZSk7XG4gICAgICAgIGlmIChiYXNlLmlzQmVmb3JlKG90aGVyKSkge1xuICAgICAgICAgICAgcmVzID0gcG9zaXRpdmVNb21lbnRzRGlmZmVyZW5jZShiYXNlLCBvdGhlcik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXMgPSBwb3NpdGl2ZU1vbWVudHNEaWZmZXJlbmNlKG90aGVyLCBiYXNlKTtcbiAgICAgICAgICAgIHJlcy5taWxsaXNlY29uZHMgPSAtcmVzLm1pbGxpc2Vjb25kcztcbiAgICAgICAgICAgIHJlcy5tb250aHMgPSAtcmVzLm1vbnRocztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfVxuXG4gICAgLy8gVE9ETzogcmVtb3ZlICduYW1lJyBhcmcgYWZ0ZXIgZGVwcmVjYXRpb24gaXMgcmVtb3ZlZFxuICAgIGZ1bmN0aW9uIGNyZWF0ZUFkZGVyKGRpcmVjdGlvbiwgbmFtZSkge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKHZhbCwgcGVyaW9kKSB7XG4gICAgICAgICAgICB2YXIgZHVyLCB0bXA7XG4gICAgICAgICAgICAvL2ludmVydCB0aGUgYXJndW1lbnRzLCBidXQgY29tcGxhaW4gYWJvdXQgaXRcbiAgICAgICAgICAgIGlmIChwZXJpb2QgIT09IG51bGwgJiYgIWlzTmFOKCtwZXJpb2QpKSB7XG4gICAgICAgICAgICAgICAgZGVwcmVjYXRlU2ltcGxlKFxuICAgICAgICAgICAgICAgICAgICBuYW1lLFxuICAgICAgICAgICAgICAgICAgICAnbW9tZW50KCkuJyArXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lICtcbiAgICAgICAgICAgICAgICAgICAgICAgICcocGVyaW9kLCBudW1iZXIpIGlzIGRlcHJlY2F0ZWQuIFBsZWFzZSB1c2UgbW9tZW50KCkuJyArXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lICtcbiAgICAgICAgICAgICAgICAgICAgICAgICcobnVtYmVyLCBwZXJpb2QpLiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWUgaHR0cDovL21vbWVudGpzLmNvbS9ndWlkZXMvIy93YXJuaW5ncy9hZGQtaW52ZXJ0ZWQtcGFyYW0vIGZvciBtb3JlIGluZm8uJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgdG1wID0gdmFsO1xuICAgICAgICAgICAgICAgIHZhbCA9IHBlcmlvZDtcbiAgICAgICAgICAgICAgICBwZXJpb2QgPSB0bXA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGR1ciA9IGNyZWF0ZUR1cmF0aW9uKHZhbCwgcGVyaW9kKTtcbiAgICAgICAgICAgIGFkZFN1YnRyYWN0KHRoaXMsIGR1ciwgZGlyZWN0aW9uKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFkZFN1YnRyYWN0KG1vbSwgZHVyYXRpb24sIGlzQWRkaW5nLCB1cGRhdGVPZmZzZXQpIHtcbiAgICAgICAgdmFyIG1pbGxpc2Vjb25kcyA9IGR1cmF0aW9uLl9taWxsaXNlY29uZHMsXG4gICAgICAgICAgICBkYXlzID0gYWJzUm91bmQoZHVyYXRpb24uX2RheXMpLFxuICAgICAgICAgICAgbW9udGhzID0gYWJzUm91bmQoZHVyYXRpb24uX21vbnRocyk7XG5cbiAgICAgICAgaWYgKCFtb20uaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICAvLyBObyBvcFxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdXBkYXRlT2Zmc2V0ID0gdXBkYXRlT2Zmc2V0ID09IG51bGwgPyB0cnVlIDogdXBkYXRlT2Zmc2V0O1xuXG4gICAgICAgIGlmIChtb250aHMpIHtcbiAgICAgICAgICAgIHNldE1vbnRoKG1vbSwgZ2V0KG1vbSwgJ01vbnRoJykgKyBtb250aHMgKiBpc0FkZGluZyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGRheXMpIHtcbiAgICAgICAgICAgIHNldCQxKG1vbSwgJ0RhdGUnLCBnZXQobW9tLCAnRGF0ZScpICsgZGF5cyAqIGlzQWRkaW5nKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWlsbGlzZWNvbmRzKSB7XG4gICAgICAgICAgICBtb20uX2Quc2V0VGltZShtb20uX2QudmFsdWVPZigpICsgbWlsbGlzZWNvbmRzICogaXNBZGRpbmcpO1xuICAgICAgICB9XG4gICAgICAgIGlmICh1cGRhdGVPZmZzZXQpIHtcbiAgICAgICAgICAgIGhvb2tzLnVwZGF0ZU9mZnNldChtb20sIGRheXMgfHwgbW9udGhzKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBh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lcnRpZXMgPSBbXG4gICAgICAgICAgICAgICAgJ3llYXJzJyxcbiAgICAgICAgICAgICAgICAneWVhcicsXG4gICAgICAgICAgICAgICAgJ3knLFxuICAgICAgICAgICAgICAgICdtb250aHMnLFxuICAgICAgICAgICAgICAgICdtb250aCcsXG4gICAgICAgICAgICAgICAgJ00nLFxuICAgICAgICAgICAgICAgICdkYXlzJyxcbiAgICAgICAgICAgICAgICAnZGF5JyxcbiAgICAgICAgICAgICAgICAnZCcsXG4gICAgICAgICAgICAgICAgJ2RhdGVzJyxcbiAgICAgICAgICAgICAgICAnZGF0ZScsXG4gICAgICAgICAgICAgICAgJ0QnLFxuICAgICAgICAgICAgICAgICdob3VycycsXG4gICAgICAgICAgICAgICAgJ2hvdXInLFxuICAgICAgICAgICAgICAgICdoJyxcbiAgICAgICAgICAgICAgICAnbWludXRlcycsXG4gICAgICAgICAgICAgICAgJ21pbnV0ZScsXG4gICAgICAgICAgICAgICAgJ20nLFxuICAgICAgICAgICAgICAgICdzZWNvbmRzJyxcbiAgICAgICAgICAgICAgICAnc2Vjb25kJyxcbiAgICAgICAgICAgICAgICAncycsXG4gICAgICAgICAgICAgICAgJ21pbGxpc2Vjb25kcycsXG4gICAgICAgICAgICAgICAgJ21pbGxpc2Vjb25kJyxcbiAgICAgICAgICAgICAgICAnbXMnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBwcm9wZXJ0eSxcbiAgICAgICAgICAgIHByb3BlcnR5TGVuID0gcHJvcGVydGllcy5sZW5ndGg7XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IHByb3BlcnR5TGVuOyBpICs9IDEpIHtcbiAgICAgICAgICAgIHByb3BlcnR5ID0gcHJvcGVydGllc1tpXTtcbiAgICAgICAgICAgIHByb3BlcnR5VGVzdCA9IHByb3BlcnR5VGVzdCB8fCBoYXNPd25Qcm9wKGlucHV0LCBwcm9wZXJ0eSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gb2JqZWN0VGVzdCAmJiBwcm9wZXJ0eVRlc3Q7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNOdW1iZXJPclN0cmluZ0FycmF5KGlucHV0KSB7XG4gICAgICAgIHZhciBhcnJheVRlc3QgPSBpc0FycmF5KGlucHV0KSxcbiAgICAgICAgICAgIGRhdGFUeXBlVGVzdCA9IGZhbHNlO1xuICAgICAgICBpZiAoYXJyYXlUZXN0KSB7XG4gICAgICAgICAgICBkYXRhVHlwZVRlc3QgPVxuICAgICAgICAgICAgICAgIGlucHV0LmZpbHRlcihmdW5jdGlvbiAoaXRlbSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gIWlzTnVtYmVyKGl0ZW0pICYmIGlzU3RyaW5nKGlucHV0KTtcbiAgICAgICAgICAgICAgICB9KS5sZW5ndGggPT09IDA7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGFycmF5VGVzdCAmJiBkYXRhVHlwZVRlc3Q7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNDYWxlbmRhclNwZWMoaW5wdXQpIHtcbiAgICAgICAgdmFyIG9iamVjdFRlc3QgPSBpc09iamVjdChpbnB1dCkgJiYgIWlzT2JqZWN0RW1wdHkoaW5wdXQpLFxuICAgICAgICAgICAgcHJvcGVydHlUZXN0ID0gZmFsc2UsXG4gICAgICAgICAgICBwcm9wZXJ0aWVzID0gW1xuICAgICAgICAgICAgICAgICdzYW1lRGF5JyxcbiAgICAgICAgICAgICAgICAnbmV4dERheScsXG4gICAgICAgICAgICAgICAgJ2xhc3REYXknLFxuICAgICAgICAgICAgICAgICduZXh0V2VlaycsXG4gICAgICAgICAgICAgICAgJ2xhc3RXZWVrJyxcbiAgICAgICAgICAgICAgICAnc2FtZUVsc2UnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBwcm9wZXJ0eTtcblxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcHJvcGVydGllcy5sZW5ndGg7IGkgKz0gMSkge1xuICAgICAgICAgICAgcHJvcGVydHkgPSBwcm9wZXJ0aWVzW2ldO1xuICAgICAgICAgICAgcHJvcGVydHlUZXN0ID0gcHJvcGVydHlUZXN0IHx8IGhhc093blByb3AoaW5wdXQsIHByb3BlcnR5KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBvYmplY3RUZXN0ICYmIHByb3BlcnR5VGVzdDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRDYWxlbmRhckZvcm1hdChteU1vbWVudCwgbm93KSB7XG4gICAgICAgIHZhciBkaWZmID0gbXlNb21lbnQuZGlmZihub3csICdkYXlzJywgdHJ1ZSk7XG4gICAgICAgIHJldHVybiBkaWZmIDwgLTZcbiAgICAgICAgICAgID8gJ3NhbWVFbHNlJ1xuICAgICAgICAgICAgOiBkaWZmIDwgLTFcbiAgICAgICAgICAgICAgPyAnbGFzdFdlZWsnXG4gICAgICAgICAgICAgIDogZGlmZiA8IDBcbiAgICAgICAgICAgICAgICA/ICdsYXN0RGF5J1xuICAgICAgICAgICAgICAgIDogZGlmZiA8IDFcbiAgICAgICAgICAgICAgICAgID8gJ3NhbWVEYXknXG4gICAgICAgICAgICAgICAgICA6IGRpZmYgPCAyXG4gICAgICAgICAgICAgICAgICAgID8gJ25leHREYXknXG4gICAgICAgICAgICAgICAgICAgIDogZGlmZiA8IDdcbiAgICAgICAgICAgICAgICAgICAgICA/ICduZXh0V2VlaydcbiAgICAgICAgICAgICAgICAgICAgICA6ICdzYW1lRWxzZSc7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY2FsZW5kYXIkMSh0aW1lLCBmb3JtYXRzKSB7XG4gICAgICAgIC8vIFN1cHBvcnQgZm9yIHNpbmdsZSBwYXJhbWV0ZXIsIGZvcm1hdHMgb25seSBvdmVybG9hZCB0byB0aGUgY2FsZW5kYXIgZnVuY3Rpb25cbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgIGlmICghYXJndW1lbnRzWzBdKSB7XG4gICAgICAgICAgICAgICAgdGltZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBmb3JtYXRzID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChpc01vbWVudElucHV0KGFyZ3VtZW50c1swXSkpIHtcbiAgICAgICAgICAgICAgICB0aW1lID0gYXJndW1lbnRzWzBdO1xuICAgICAgICAgICAgICAgIGZvcm1hdHMgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzQ2FsZW5kYXJTcGVjKGFyZ3VtZW50c1swXSkpIHtcbiAgICAgICAgICAgICAgICBmb3JtYXRzID0gYXJndW1lbnRzWzBdO1xuICAgICAgICAgICAgICAgIHRpbWUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gV2Ugd2FudCB0byBjb21wYXJlIHRoZSBzdGFydCBvZiB0b2RheSwgdnMgdGhpcy5cbiAgICAgICAgLy8gR2V0dGluZyBzdGFydC1vZi10b2RheSBkZXBlbmRzIG9uIHdoZXRoZXIgd2UncmUgbG9jYWwvdXRjL29mZnNldCBvciBub3QuXG4gICAgICAgIHZhciBub3cgPSB0aW1lIHx8IGNyZWF0ZUxvY2FsKCksXG4gICAgICAgICAgICBzb2QgPSBjbG9uZVdpdGhPZmZzZXQobm93LCB0aGlzKS5zdGFydE9mKCdkYXknKSxcbiAgICAgICAgICAgIGZvcm1hdCA9IGhvb2tzLmNhbGVuZGFyRm9ybWF0KHRoaXMsIHNvZCkgfHwgJ3NhbWVFbHNlJyxcbiAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgZm9ybWF0cyAmJlxuICAgICAgICAgICAgICAgIChpc0Z1bmN0aW9uKGZvcm1hdHNbZm9ybWF0XSlcbiAgICAgICAgICAgICAgICAgICAgPyBmb3JtYXRzW2Zvcm1h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gICAgIDogIXRoaXMuaXNCZWZvcmUobG9jYWxGcm9tLCB1bml0cykpICYmXG4gICAgICAgICAgICAoaW5jbHVzaXZpdHlbMV0gPT09ICcpJ1xuICAgICAgICAgICAgICAgID8gdGhpcy5pc0JlZm9yZShsb2NhbFRvLCB1bml0cylcbiAgICAgICAgICAgICAgICA6ICF0aGlzLmlzQWZ0ZXIobG9jYWxUbywgdW5pdHMpKVxuICAgICAgICApO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzU2FtZShpbnB1dCwgdW5pdHMpIHtcbiAgICAgICAgdmFyIGxvY2FsSW5wdXQgPSBpc01vbWVudChpbnB1dCkgPyBpbnB1dCA6IGNyZWF0ZUxvY2FsKGlucHV0KSxcbiAgICAgICAgICAgIGlucHV0TXM7XG4gICAgICAgIGlmICghKHRoaXMuaXNWYWxpZCgpICYmIGxvY2FsSW5wdXQuaXNWYWxpZCgpKSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHVuaXRzID0gbm9ybWFsaXplVW5pdHModW5pdHMpIHx8ICdtaWxsaXNlY29uZCc7XG4gICAgICAgIGlmICh1bml0cyA9PT0gJ21pbGxpc2Vjb25kJykge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudmFsdWVPZigpID09PSBsb2NhbElucHV0LnZhbHVlT2YoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlucHV0TXMgPSBsb2NhbElucHV0LnZhbHVlT2YoKTtcbiAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgdGhpcy5jbG9uZSgpLnN0YXJ0T2YodW5pdHMpLnZhbHVlT2YoKSA8PSBpbnB1dE1zICYmXG4gICAgICAgICAgICAgICAgaW5wdXRNcyA8PSB0aGlzLmNsb25lKCkuZW5kT2YodW5pdHMpLnZhbHVlT2YoKVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0a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gICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdxdWFydGVyJzpcbiAgICAgICAgICAgICAgICBvdXRwdXQgPSBtb250aERpZmYodGhpcywgdGhhdCkgLyAzO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnc2Vjb25kJzpcbiAgICAgICAgICAgICAgICBvdXRwdXQgPSAodGhpcyAtIHRoYXQpIC8gMWUzO1xuICAgICAgICAgICAgICAgIGJyZWFrOyAvLyAxMDAwXG4gICAgICAgICAgICBjYXNlICdtaW51dGUnOlxuICAgICAgICAgICAgICAgIG91dHB1dCA9ICh0aGlzIC0gdGhhdCkgLyA2ZTQ7XG4gICAgICAgICAgICAgICAgYnJlYWs7IC8vIDEwMDAgKiA2MFxuICAgICAgICAgICAgY2FzZSAnaG91cic6XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gKHRoaXMgLSB0aGF0KSAvIDM2ZTU7XG4gICAgICAgICAgICAgICAgYnJlYWs7IC8vIDEwMDAgKiA2MCAqIDYwXG4gICAgICAgICAgICBjYXNlICdkYXknOlxuICAgICAgICAgICAgICAgIG91dHB1dCA9ICh0aGlzIC0gdGhhdCAtIHpvbmVEZWx0YSkgLyA4NjRlNTtcbiAgICAgICAgICAgICAgICBicmVhazsgLy8gMTAwMCAqIDYwICogNjAgKiAyNCwgbmVnYXRlIGRzdFxuICAgICAgICAgICAgY2FzZSAnd2Vlayc6XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gKHRoaXMgLSB0aGF0IC0gem9uZURlbHRhKSAvIDYwNDhlNTtcbiAgICAgICAgICAgICAgICBicmVhazsgLy8gMTAwMCAqIDYwICogNjAgKiAyNCAqIDcsIG5lZ2F0ZSBkc3RcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gdGhpcyAtIHRoYXQ7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gYXNGbG9hdCA/IG91dHB1dCA6IGFic0Zsb29yKG91dHB1dCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbW9udGhEaWZmKGEsIGIpIHtcbiAgICAgICAgaWYgKGEuZGF0ZSgpIDwgYi5kYXRlKCkpIHtcbiAgICAgICAgICAgIC8vIGVuZC1vZi1tb250aCBjYWxjdWxhdGlvbnMgd29yayBjb3JyZWN0IHdoZW4gdGhlIHN0YXJ0IG1vbnRoIGhhcyBtb3JlXG4gICAgICAgICAgICAvLyBkYXlzIHRoYW4gdGhlIGVuZCBtb250aC5cbiAgICAgICAgICAgIHJldHVybiAtbW9udGhEaWZmKGIsIGEpO1xuICAgICAgICB9XG4gICAgICAgIC8vIGRpZmZlcmVuY2UgaW4gbW9udGhzXG4gICAgICAgIHZhciB3aG9sZU1vbnRoRGlmZiA9IChiLnllYXIoKSAtIGEueWVhcigpKSAqIDEyICsgKGIubW9udGgoKSAtIGEubW9udGgoKSksXG4gICAgICAgICAgICAvLyBiIGlzIGluIChhbmNob3IgLSAxIG1vbnRoLCBhbmNob3IgKyAxIG1vbnRoKVxuICAgICAgICAgICAgYW5jaG9yID0gYS5jbG9uZSgpLmFkZCh3aG9sZU1vbnRoRGlmZiwgJ21vbnRocycpLFxuICAgICAgICAgICAgYW5jaG9yMixcbiAgICAgICAgICAgIGFkanVzdDtcblxuICAgICAgICBpZiAoYiAtIGFuY2hvciA8IDApIHtcbiAgICAgICAgICAgIGFuY2hvcjIgPSBhLmNsb25lKCkuYWRkKHdob2xlTW9udGhEaWZmIC0gMSwgJ21vbnRocycpO1xuICAgICAgICAgICAgLy8gbGluZWFyIGFjcm9zcyB0aGUgbW9udGhcbiAgICAgICAgICAgIGFkanVzdCA9IChiIC0gYW5jaG9yKSAvIChhbmNob3IgLSBhbmNob3IyKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGFuY2hvcjIgPSBhLmNsb25lKCkuYWRkKHdob2xlTW9udGhEaWZmICsgMSwgJ21vbnRocycpO1xuICAgICAgICAgIC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AgICAgICAgICAgIDogJ1lZWVlZWS1NTS1ERFtUXUhIOm1tOnNzLlNTU1onXG4gICAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc0Z1bmN0aW9uKERhdGUucHJvdG90eXBlLnRvSVNPU3RyaW5nKSkge1xuICAgICAgICAgICAgLy8gbmF0aXZlIGltcGxlbWVudGF0aW9uIGlzIH41MHggZmFzdGVyLCB1c2UgaXQgd2hlbiB3ZSBjYW5cbiAgICAgICAgICAgIGlmICh1dGMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy50b0RhdGUoKS50b0lTT1N0cmluZygpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IERhdGUodGhpcy52YWx1ZU9mKCkgKyB0aGlzLnV0Y09mZnNldCgpICogNjAgKiAxMDAwKVxuICAgICAgICAgICAgICAgICAgICAudG9JU09TdHJpbmcoKVxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgnWicsIGZvcm1hdE1vbWVudChtLCAnWicpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZm9ybWF0TW9tZW50KFxuICAgICAgICAgICAgbSxcbiAgICAgICAgICAgIHV0YyA/ICdZWVlZLU1NLUREW1RdSEg6bW06c3MuU1NTW1pdJyA6ICdZWVlZLU1NLUREW1RdSEg6bW06c3MuU1NTWidcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXR1cm4gYSBodW1hbiByZWFkYWJsZSByZXByZXNlbnRhdGlvbiBvZiBhIG1vbWVudCB0aGF0IGNhblxuICAgICAqIGFsc28gYmUgZXZhbHVhdGVkIHRvIGdldCBhIG5ldyBtb21lbnQgd2hpY2ggaXMgdGhlIHNhbWVcbiAgICAgKlxuICAgICAqIEBsaW5rIGh0dHBzOi8vbm9kZWpzLm9yZy9kaXN0L2xhdGVzdC9kb2NzL2FwaS91dGlsLmh0bWwjdXRpbF9jdXN0b21faW5zcGVjdF9mdW5jdGlvbl9vbl9vYmplY3RzXG4gICAgICovXG4gICAgZnVuY3Rpb24gaW5zcGVjdCgpIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzVmFsaWQoKSkge1xuICAgICAgICAgICAgcmV0dXJuICdtb21lbnQuaW52YWxpZCgvKiAnICsgdGhpcy5faSArICcgKi8pJztcbiAgICAgICAgfVxuICAgICAgICB2YXIgZnVuYyA9ICdtb21lbnQnLFxuICAgICAgICAgICAgem9uZSA9ICcnLFxuICAgICAgICAgICAgcHJlZml4LFxuICAgICAgICAgICAgeWVhcixcbiAgICAgICAgICAgIGRhdGV0aW1lLFxuICAgICAgICAgICAgc3VmZml4O1xuICAgICAgICBpZiAoIXRoaXMuaXNMb2NhbCgpKSB7XG4gICAgICAgICAgICBmdW5jID0gdGhpcy51dGNPZmZzZXQoKSA9PT0gMCA/ICdtb21lbnQudXRjJyA6ICdtb21lbnQucGFyc2Vab25lJztcbiAgICAgICAgICAgIHpvbmUgPSAnWic7XG4gICAgICAgIH1cbiAgICAgICAgcHJlZml4ID0gJ1snICsgZnVuYyArICcoXCJdJztcbiAgICAgICAgeWVhciA9IDAgPD0gdGhpcy55ZWFyKCkgJiYgdGhpcy55ZWFyKCkgPD0gOTk5OSA/ICdZWVlZJyA6ICdZWVlZWVknO1xuICAgICAgICBkYXRldGltZSA9ICctTU0tRERbVF1ISDptbTpzcy5TU1MnO1xuICAgICAgICBzdWZmaXggPSB6b25lICsgJ1tcIildJztcblxuICAgICAgICByZXR1cm4gdGhpcy5mb3JtYXQocHJlZml4ICsgeWVhciArIGRhdGV0aW1lICsgc3VmZml4KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBmb3JtYXQoaW5wdXRTdHJpbmcpIHtcbiAgICAgICAgaWYgKCFpbnB1dFN0cmluZykge1xuICAgICAgICAgICAgaW5wdXRTdHJpbmcgPSB0aGlzLmlzVXRjKClcbiAgICAgICAgICAgICAgICA/IGh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4gICAgICAgIHZhciB0aW1lLCBzdGFydE9mRGF0ZTtcbiAgICAgICAgdW5pdHMgPSBub3JtYWxpemVVbml0cyh1bml0cyk7XG4gICAgICAgIGlmICh1bml0cyA9PT0gdW5kZWZpbmVkIHx8IHVuaXRzID09PSAnbWlsbGlzZWNvbmQnIHx8ICF0aGlzLmlzVmFsaWQoKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cblxuICAgICAgICBzdGFydE9mRGF0ZSA9IHRoaXMuX2lzVVRDID8gdXRjU3RhcnRPZkRhdGUgOiBsb2NhbFN0YXJ0T2ZEYXRlO1xuXG4gICAgICAgIHN3aXRjaCAodW5pdHMpIHtcbiAgICAgICAgICAgIGNhc2UgJ3llYXInOlxuICAgICAgICAgICAgICAgIHRpbWUgPSBzdGFydE9mRGF0ZSh0aGlzLnllYXIoKSwgMCwgMSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdxdWFydGVyJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gc3RhcnRPZkRhdGUoXG4gICAgICAgICAgICAgICAgICAgIHRoaXMueWVhcigpLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLm1vbnRoKCkgLSAodGhpcy5tb250aCgpICUgMyksXG4gICAgICAgICAgICAgICAgICAgIDFcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnbW9udGgnOlxuICAgICAgICAgICAgICAgIHRpbWUgPSBzdGFydE9mRGF0ZSh0aGlzLnllYXIoKSwgdGhpcy5tb250aCgpLCAxKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ3dlZWsnOlxuICAgICAgICAgICAgICAgIHRpbWUgPSBzdGFydE9mRGF0ZShcbiAgICAgICAgICAgICAgICAgICAgdGhpcy55ZWFyKCksXG4gICAgICAgICAgICAgICAgICAgIHRoaXMubW9udGgoKSxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kYXRlKCkgLSB0aGlzLndlZWtkYXkoKVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdpc29XZWVrJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gc3RhcnRPZkRhdGUoXG4gICAgICAgICAgICAgICAgICAgIHRoaXMueWVhcigpLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLm1vbnRoKCksXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGF0ZSgpIC0gKHRoaXMuaXNvV2Vla2RheSgpIC0gMSlcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnZGF5JzpcbiAgICAgICAgICAgIGNhc2UgJ2RhdGUnOlxuICAgICAgICAgICAgICAgIHRpbWUgPSBzdGFydE9mRGF0ZSh0aGlzLnllYXIoKSwgdGhpcy5tb250aCgpLCB0aGlzLmRhdGUoKSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdob3VyJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gdGhpcy5fZC52YWx1ZU9mKCk7XG4gICAgICAgICAgICAgICAgdGltZSAtPSBtb2QkMShcbiAgICAgICAgICAgICAgICAgICAgdGltZSArICh0aGlzLl9pc1VUQyA/IDAgOiB0aGlzLnV0Y09mZnNldCgpICogTVNfUEVSX01JTlVURSksXG4gICAgICAgICAgICAgICAgICAgIE1TX1BFUl9IT1VSXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ21pbnV0ZSc6XG4gICAgICAgICAgICAgICAgdGltZSA9IHRoaXMuX2QudmFsdWVPZigpO1xuICAgICAgICAgICAgICAgIHRpbWUgLT0gbW9kJDEodGltZSwgTVNfUEVSX01JTlVURSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdzZWNvbmQnOlxuICAgICAgICAgICAgICAgIHRpbWUgPSB0aGlzLl9kLnZhbHVlT2YoKTtcbiAgICAgICAgICAgICAgICB0aW1lIC09IG1vZCQxKHRpbWUsIE1TX1BFUl9TRUNPTkQpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5fZC5zZXRUaW1lKHRpbWUpO1xuICAgICAgICBob29rcy51cGRhdGVPZmZzZXQodGhpcywgdHJ1ZSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGVuZE9mKHVuaXRzKSB7XG4gICAgICAgIHZhciB0aW1lLCBzdGFydE9mRGF0ZTtcbiAgICAgICAgdW5pdHMgPSBub3JtYWxpemVVbml0cyh1bml0cyk7XG4gICAgICAgIGlmICh1bml0cyA9PT0gdW5kZWZpbmVkIHx8IHVuaXRzID09PSAnbWlsbGlzZWNvbmQnIHx8ICF0aGlzLmlzVmFsaWQoKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cblxuICAgICAgICBzdGFydE9mRGF0ZSA9IHRoaXMuX2lzVVRDID8gdXRjU3RhcnRPZkRhdGUgOiBsb2NhbFN0YXJ0T2ZEYXRlO1xuXG4gICAgICAgIHN3aXRjaCAodW5pdHMpIHtcbiAgICAgICAgICAgIGNhc2UgJ3llYXInOlxuICAgICAgICAgICAgICAgIHRpbWUgPSBzdGFydE9mRGF0ZSh0aGlzLnllYXIoKSArIDEsIDAsIDEpIC0gMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ3F1YXJ0ZXInOlxuICAgICAgICAgICAgICAgIHRpbWUgPVxuICAgICAgICAgICAgICAgICAgICBzdGFydE9mRGF0ZShcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMueWVhcigpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5tb250aCgpIC0gKHRoaXMubW9udGgoKSAlIDMpICsgMyxcbiAgICAgICAgICAgICAgICAgICAgICAgIDFcbiAgICAgICAgICAgICAgICAgICAgKSAtIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdtb250aCc6XG4gICAgICAgICAgICAgICAgdGltZSA9IHN0YXJ0T2ZEYXRlKHRoaXMueWVhcigpLCB0aGlzLm1vbnRoKCkgKyAxLCAxKSAtIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICd3ZWVrJzpcbiAgICAgICAgICAgICAgICB0aW1lID1cbiAgICAgICAgICAgICAgICAgICAgc3RhcnRPZkRhdGUoXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnllYXIoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubW9udGgoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGF0ZSgpIC0gdGhpcy53ZWVrZGF5KCkgKyA3XG4gICAgICAgICAgICAgICAgICAgICkgLSAxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnaXNvV2Vlayc6XG4gICAgICAgICAgICAgICAgdGltZSA9XG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0T2ZEYXRlKFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy55ZWFyKCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm1vbnRoKCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRhdGUoKSAtICh0aGlzLmlzb1dlZWtkYXkoKSAtIDEpICsgN1xuICAgICAgICAgICAgICAgICAgICApIC0gMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2RheSc6XG4gICAgICAgICAgICBjYXNlICdkYXRlJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gc3RhcnRPZkRhdGUodGhpcy55ZWFyKCksIHRoaXMubW9udGgoKSwgdGhpcy5kYXRlKCkgKyAxKSAtIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdob3VyJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gdGhpcy5fZC52YWx1ZU9mKCk7XG4gICAgICAgICAgICAgICAgdGltZSArPVxuICAgICAgICAgICAgICAgICAgICBNU19QRVJfSE9VUiAtXG4gICAgICAgICAgICAgICAgICAgIG1vZCQxKFxuICAgICAgICAgICAgICAgICAgICAgICAgdGltZSArICh0aGlzLl9pc1VUQyA/IDAgOiB0aGlzLnV0Y09mZnNldCgpICogTVNfUEVSX01JTlVURSksXG4gICAgICAgICAgICAgICAgICAgICAgICBNU19QRVJfSE9VUlxuICAgICAgICAgICAgICAgICAgICApIC1cbiAgICAgICAgICAgICAgICAgICAgMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ21pbnV0ZSc6XG4gICAgICAgICAgICAgICAgdGltZSA9IHRoaXMuX2QudmFsdWVPZigpO1xuICAgICAgICAgICAgICAgIHRpbWUgKz0gTVNfUEVSX01JTlVURSAtIG1vZCQxKHRpbWUsIE1TX1BFUl9NSU5VVEUpIC0gMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ3NlY29uZCc6XG4gICAgICAgICAgICAgICAgdGltZSA9IHRoaXMuX2QudmFsdWVPZigpO1xuICAgICAgICAgICAgICAgIHRpbWUgKz0gTVNfUEVSX1NFQ09ORCAtIG1vZCQxKHRpbWUsIE1TX1BFUl9TRUNPTkQpIC0gMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX2Quc2V0VGltZSh0aW1lKTtcbiAgICAgICAgaG9va3MudXBkYXRlT2Zmc2V0KHRoaXMsIHRydWUpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiB2YWx1ZU9mKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fZC52YWx1ZU9mKCkgLSAodGhpcy5fb2Zmc2V0IHx8IDApICogNjAwMDA7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdW5peCgpIHtcbiAgICAgICAgcmV0dXJuIE1hdGguZmxvb3IodGhpcy52YWx1ZU9mKCkgLyAxMDAwKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiB0b0RhdGUoKSB7XG4gICAgICAgIHJldHVybiBuZXcgRGF0ZSh0aGlzLnZhbHVlT2YoKSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdG9BcnJheSgpIHtcbiAgICAgICAgdmFyIG0gPSB0aGlzO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgbS55ZWFyKCksXG4gICAgICAgICAgICBtLm1vbnRoKCksXG4gICAgICAgICAgICBtLmRhdGUoKSxcbiAgICAgICAgICAgIG0uaG91cigpLFxuICAgICAgICAgICAgbS5taW51dGUoKSxcbiAgICAgICAgICAgIG0uc2Vjb25kKCksXG4gICAgICAgICAgICBtLm1pbGxpc2Vjb25kKCksXG4gICAgICAgIF07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdG9PYmplY3QoKSB7XG4gICAgICAgIHZhciBtID0gdGhpcztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHllYXJzOiBtLnllYXIoKSxcbiAgICAgICAgICAgIG1vbnRoczogbS5tb250aCgpLFxuICAgICAgICAgICAgZGF0ZTogbS5kYXRlKCksXG4gICAgICAgICAgICBob3VyczogbS5ob3VycygpLFxuICAgICAgICAgICAgbWludXRlczogbS5taW51dGVzKCksXG4gICAgICAgICAgICBzZWNvbmRzOiBtLnNlY29uZHMoKSxcbiAgICAgICAgICAgIG1pbGxpc2Vjb25kczogbS5taWxsaXNlY29uZHMoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiB0b0pTT04oKSB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ICAgZm9yIChpID0gMCwgbCA9IGVyYXMubGVuZ3RoOyBpIDwgbDsgKytpKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHR5cGVvZiBlcmFzW2ldLnNpbmNlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnc3RyaW5nJzpcbiAgICAgICAgICAgICAgICAgICAgLy8gdHJ1bmNhdGUgdGltZVxuICAgICAgICAgICAgICAgICAgICBkYXRlID0gaG9va3MoZXJhc1tpXS5zaW5jZSkuc3RhcnRPZignZGF5Jyk7XG4gICAgICAgICAgICAgICAgICAgIGVyYXNbaV0uc2luY2UgPSBkYXRlLnZhbHVlT2YoKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHN3aXRjaCAodHlwZW9mIGVyYXNbaV0udW50aWwpIHtcbiAgICAgICAgICAgICAgICBjYXNlICd1bmRlZmluZWQnOlxuICAgICAgICAgICAgICAgICAgICBlcmFzW2ldLnVudGlsID0gK0luZmluaXR5O1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdzdHJpbmcnOlxuICAgICAgICAgICAgICAgICAgICAvLyB0cnVuY2F0ZSB0aW1lXG4gICAgICAgICAgICAgICAgICAgIGRhdGUgPSBob29rcyhlcmFzW2ldLnVudGlsKS5zdGFydE9mKCdkYXknKS52YWx1ZU9mKCk7XG4gICAgICAgICAgICAgICAgICAgIGVyYXNbaV0udW50aWwgPSBkYXRlLnZhbHVlT2YoKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGVyYXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbG9jYWxlRXJhc1BhcnNlKGVyYU5hbWUsIGZvcm1hdCwgc3RyaWN0KSB7XG4gICAgICAgIHZhciBpLFxuICAgICAgICAgICAgbCxcbiAgICAgICAgICAgIGVyYXMgPSB0aGlzLmVyYXMoKSxcbiAgICAgICAgICAgIG5hbWUsXG4gICAgICAgICAgICBhYmJyLFxuICAgICAgICAgICAgbmFycm93O1xuICAgICAgICBlcmFOYW1lID0gZXJhTmFtZS50b1VwcGVyQ2FzZSgpO1xuXG4gICAgICAgIGZvciAoaSA9IDAsIGwgPSBlcmFzLmxlbmd0aDsgaSA8IGw7ICsraSkge1xuICAgICAgICAgICAgbmFtZSA9IGVyYXNbaV0ubmFtZS50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgYWJiciA9IGVyYXNbaV0uYWJici50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgbmFycm93ID0gZXJhc1tpXS5uYXJyb3cudG9VcHBlckNhc2UoKTtcblxuICAgICAgICAgICAgaWYgKHN0cmljdCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAoZm9ybWF0KSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ04nOlxuICAgICAgICAgICAgICAgICAgICBjYXNlICdOTic6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ05OTic6XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWJiciA9PT0gZXJhTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlcmFzW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnTk5OTic6XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmFtZSA9PT0gZXJhTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlcmFzW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnTk5OTk4nOlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5hcnJvdyA9PT0gZXJhTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlcmFzW2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChbbmFtZSwgYWJiciwgbmFycm93XS5pbmRleE9mKGVyYU5hbWUpID49IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZXJhc1tpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGxvY2FsZUVyYXNDb252ZXJ0WWVhcihlcmEsIHllYXIpIHtcbiAgICAgICAgdmFyIGRpciA9IGVyYS5zaW5jZSA8PSBlcmEudW50aWwgPyArMSA6IC0xO1xuICAgICAgICBpZiAoeWVhciA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXR1cm4gaG9va3MoZXJhLnNpbmNlKS55ZWFyKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gaG9va3MoZXJhLnNpbmNlKS55ZWFyKCkgKyAoeWVhciAtIGVyYS5vZmZzZXQpICogZGlyO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RXJhTmFtZSgpIHtcbiAgICAgICAgdmFyIGksXG4gICAgICAgICAgICBsLFxuICAgICAgICAgICAgdmFsLFxuICAgICAgICAgICAgZXJhcyA9IHRoaXMubG9jYWxlRGF0YSgpLmVyYXMoKTtcbiAgICAgICAgZm9yIChpID0gMCwgbCA9IGVyYXMubGVuZ3RoOyBpIDwgbDsgKytpKSB7XG4gICAgICAgICAgICAvLyB0cnVuY2F0ZSB0aW1lXG4gICAgICAgICAgICB2YWwgPSB0aGlzLmNsb25lKCkuc3RhcnRPZignZGF5JykudmFsdWVPZigpO1xuXG4gICAgICAgICAgICBpZiAoZXJhc1tpXS5zaW5jZSA8PSB2YWwgJiYgdmFsIDw9IGVyYXNbaV0udW50aWwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZXJhc1tpXS5uYW1lO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGVyYXNbaV0udW50aWwgPD0gdmFsICYmIHZhbCA8PSBlcmFzW2ldLnNpbmNlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVyYXNbaV0ubmFtZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAnJztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRFcmFOYXJyb3coKSB7XG4gICAgICAgIHZhciBpLFxuICAgICAgICAgICAgbCxcbiAgICAgICAgICAgIHZhbCxcbiAgICAgICAgICAgIGVyYXMgPSB0aGlzLmxvY2FsZURhdGEoKS5lcmFzKCk7XG4gICAgICAgIGZvciAoaSA9IDAsIGwgPSBlcmFzLmxlbmd0aDsgaSA8IGw7ICsraSkge1xuICAgICAgICAgICAgLy8gdHJ1bmNhdGUgdGltZVxuICAgICAgICAgICAgdmFsID0gdGhpcy5jbG9uZSgpLnN0YXJ0T2YoJ2RheScpLnZhbHVlT2YoKTtcblxuICAgICAgICAgICAgaWYgKGVyYXNbaV0uc2luY2UgPD0gdmFsICYmIHZhbCA8PSBlcmFzW2ldLnVudGlsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVyYXNbaV0ubmFycm93O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGVyYXNbaV0udW50aWwgPD0gdmFsICYmIHZhbCA8PSBlcmFzW2ldLnNpbmNlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVyYXNbaV0ubmFycm93O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuICcnO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldEVyYUFiYnIoKSB7XG4gICAgICAgIHZhciBpLFxuICAgICAgICAgICAgbCxcbiAgICAgICAgICAgIHZhbCxcbiAgICAgICAgICAgIGVyYXMgPSB0aGlzLmxvY2FsZURhdGEoKS5lcmFzKCk7XG4gICAgICAgIGZvciAoaSA9IDAsIGwgPSBlcmFzLmxlbmd0aDsgaSA8IGw7ICsraSkge1xuICAgICAgICAgICAgLy8gdHJ1bmNhdGUgdGltZVxuICAgICAgICAgICAgdmFsID0gdGhpcy5jbG9uZSgpLnN0YXJ0T2YoJ2RheScpLnZhbHVlT2YoKTtcblxuICAgICAgICAgICAgaWYgKGVyYXNbaV0uc2luY2UgPD0gdmFsICYmIHZhbCA8PSBlcmFzW2ldLnVudGlsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVyYXNbaV0uYWJicjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChlcmFzW2ldLnVudGlsIDw9IHZhbCAmJiB2YWwgPD0gZXJhc1tpXS5zaW5jZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBlcmFzW2ldLmFiYnI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gJyc7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RXJhWWVhcigpIHtcbiAgICAgICAgdmFyIGksXG4gICAgICAgICAgICBsLFxuICAgICAgICAgICAgZGlyLFxuICAgICAgICAgICAgdmFsLFxuICAgICAgICAgICAgZXJhcyA9IHRoaXMubG9jYWxlRGF0YSgpLmVyYXMoKTtcbiAgICAgICAgZm9yIChpID0gMCwgbCA9IGVyYXMubGVuZ3RoOyBpIDwgbDsgKytpKSB7XG4gICAgICAgICAgICBkaXIgPSBlcmFzW2ldLnNpbmNlIDw9IGVyYXNbaV0udW50aWwgPyArMSA6IC0xO1xuXG4gICAgICAgICAgICAvLyB0cnVuY2F0ZSB0aW1lXG4gICAgICAgICAgICB2YWwgPSB0aGlzLmNsb25lKCkuc3RhcnRPZignZGF5JykudmFsdWVPZigpO1xuXG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgKGVyYXNbaV0uc2luY2UgPD0gdmFsICYmIHZhbCA8PSBlcmFzW2ldLnVudGlsKSB8fFxuICAgICAgICAgICAgICAgIChlcmFzW2ldLnVudGlsIDw9IHZhbCAmJiB2YWwgPD0gZXJhc1tpXS5zaW5jZSlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICh0aGlzLnllYXIoKSAtIGhvb2tzKGVyYXNbaV0uc2luY2UpLnllYXIoKSkgKiBkaXIgK1xuICAgICAgICAgICAgICAgICAgICBlcmFzW2ldLm9mZnNldFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy55ZWFyKCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZXJhc05hbWVSZWdleChpc1N0cmljdCkge1xuICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ19lcmFzTmFtZVJlZ2V4JykpIHtcbiAgICAgICAgICAgIGNvbXB1dGVFcmFzUGFyc2UuY2FsbCh0aGlzKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaXNTdHJpY3QgPyB0aGlzLl9lcmFzTmFtZVJlZ2V4IDogdGhpcy5fZXJhc1JlZ2V4O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGVyYXNBYmJyUmVnZXgoaXNTdHJpY3QpIHtcbiAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfZXJhc0FiYnJSZWdleCcpKSB7XG4gICAgICAgICAgICBjb21wdXRlRXJhc1BhcnNlLmNhbGwodGhpcyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGlzU3RyaWN0ID8gdGhpcy5fZXJhc0FiYnJSZWdleCA6IHRoaXMuX2VyYXNSZWdleDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBlcmFzTmFycm93UmVnZXgoaXNTdHJpY3QpI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gICAgICAgIGZvcm1hdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvcm1hdCA9IGZvcm1hdCB8fCAnJztcblxuICAgICAgICBpZiAoaW5kZXggIT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuIGdldCQxKGZvcm1hdCwgaW5kZXgsIGZpZWxkLCAnbW9udGgnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBpLFxuICAgICAgICAgICAgb3V0ID0gW107XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCAxMjsgaSsrKSB7XG4gICAgICAgICAgICBvdXRbaV0gPSBnZXQkMShmb3JtYXQsIGksIGZpZWxkLCAnbW9udGgnKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb3V0O1xuICAgIH1cblxuICAgIC8vICgpXG4gICAgLy8gKDUpXG4gICAgLy8gKGZtdCwgNSlcbiAgICAvLyAoZm10KVxuICAgIC8vICh0cnVlKVxuICAgIC8vICh0cnVlLCA1KVxuICAgIC8vICh0cnVlLCBmbXQsIDUpXG4gICAgLy8gKHRydWUsIGZtdClcbiAgICBmdW5jdGlvbiBsaXN0V2Vla2RheXNJbXBsKGxvY2FsZVNvcnRlZCwgZm9ybWF0LCBpbmRleCwgZmllbGQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBsb2NhbGVTb3J0ZWQgPT09ICdib29sZWFuJykge1xuICAgICAgICAgICAgaWYgKGlzTnVtYmVyKGZvcm1hdCkpIHtcbiAgICAgICAgICAgICAgICBpbmRleCA9IGZvcm1hdDtcbiAgICAgICAgICAgICAgICBmb3JtYXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvcm1hdCA9IGZvcm1hdCB8fCAnJztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZvcm1hdCA9IGxvY2FsZVNvcnRlZDtcbiAgICAgICAgICAgIGluZGV4ID0gZm9ybWF0O1xuICAgICAgICA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kYXlzKGxvY2FsZVNvcnRlZCwgZm9ybWF0LCBpbmRleCkge1xuICAgICAgICByZXR1cm4gbGlzdFdlZWtkYXlzSW1wbChsb2NhbGVTb3J0ZWQsIGZvcm1hdCwgaW5kZXgsICd3ZWVrZGF5cycpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGxpc3RXZWVrZGF5c1Nob3J0KGxvY2FsZVNvcnRlZCwgZm9ybWF0LCBpbmRleCkge1xuICAgICAgICByZXR1cm4gbGlzdFdlZWtkYXlzSW1wbChsb2NhbGVTb3J0ZWQsIGZvcm1hdCwgaW5kZXgsICd3ZWVrZGF5c1Nob3J0Jyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbGlzdFdlZWtkYXlzTWluKGxvY2FsZVNvcnRlZCwgZm9ybWF0LCBpbmRleCkge1xuICAgICAgICByZXR1cm4gbGlzdFdlZWtkYXlzSW1wbChsb2NhbGVTb3J0ZWQsIGZvcm1hdCwgaW5kZXgsICd3ZWVrZGF5c01pbicpO1xuICAgIH1cblxuICAgIGdldFNldEdsb2JhbExvY2FsZSgnZW4nLCB7XG4gICAgICAgIGVyYXM6IFtcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaW5jZTogJzAwMDEtMDEtMDEnLFxuICAgICAgICAgICAgICAgIHVudGlsOiArSW5maW5pdHksXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAxLFxuICAgICAgICAgICAgICAgIG5hbWU6ICdBbm5vIERvbWluaScsXG4gICAgICAgICAgICAgICAgbmFycm93OiAnQUQnLFxuICAgICAgICAgICAgICAgIGFiYnI6ICdBRCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHNpbmNlOiAnMDAwMC0xMi0zMScsXG4gICAgICAgICAgICAgICAgdW50aWw6IC1JbmZpbml0eSxcbiAgICAgICAgICAgICAgICBvZmZzZXQ6IDEsXG4gICAgICAgICAgICAgICAgbmFtZTogJ0JlZm9yZSBDaHJpc3QnLFxuICAgICAgICAgICAgICAgIG5hcnJvdzogJ0JDJyxcbiAgICAgICAgICAgICAgICBhYmJyOiAnQkMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgXSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHRofHN0fG5kfHJkKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICAgICAgdG9JbnQoKG51bWJlciAlIDEwMCkgLyAxMCkgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ3RoJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3N0J1xuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICduZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAndGgnO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIC8vIFNpZGUgZWZmZWN0IGltcG9ydHNcblxuICAgIGhvb2tzLmxhbmcgPSBkZXByZWNhdGUoXG4gICAgICAgICdtb21lbnQubGFuZyBpcyBkZXByZWNhdGVkLiBVc2UgbW9tZW50LmxvY2FsZSBpbnN0ZWFkLicsXG4gICAgICAgIGdldFNldEdsb2JhbExvY2FsZVxuICAgICk7XG4gICAgaG9va3MubGFuZ0RhdGEgPSBkZXByZWNhdGUoXG4gICAgICAgICdtb21lbnQubGFuZ0RhdGEgaXMgZGVwcmVjY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HMgLyA2MCk7XG4gICAgICAgIGRhdGEubWludXRlcyA9IG1pbnV0ZXMgJSA2MDtcblxuICAgICAgICBob3VycyA9IGFic0Zsb29yKG1pbnV0ZXMgLyA2MCk7XG4gICAgICAgIGRhdGEuaG91cnMgPSBob3VycyAlIDI0O1xuXG4gICAgICAgIGRheXMgKz0gYWJzRmxvb3IoaG91cnMgLyAyNCk7XG5cbiAgICAgICAgLy8gY29udmVydCBkYXlzIHRvIG1vbnRoc1xuICAgICAgICBtb250aHNGcm9tRGF5cyA9IGFic0Zsb29yKGRheXNUb01vbnRocyhkYXlzKSk7XG4gICAgICAgIG1vbnRocyArPSBtb250aHNGcm9tRGF5cztcbiAgICAgICAgZGF5cyAtPSBhYnNDZWlsKG1vbnRoc1RvRGF5cyhtb250aHNGcm9tRGF5cykpO1xuXG4gICAgICAgIC8vIDEyIG1vbnRocyAtPiAxIHllYXJcbiAgICAgICAgeWVhcnMgPSBhYnNGbG9vcihtb250aHMgLyAxMik7XG4gICAgICAgIG1vbnRocyAlPSAxMjtcblxuICAgICAgICBkYXRhLmRheXMgPSBkYXlzO1xuICAgICAgICBkYXRhLm1vbnRocyA9IG1vbnRocztcbiAgICAgICAgZGF0YS55ZWFycyA9IHllYXJzO1xuXG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRheXNUb01vbnRocyhkYXlzKSB7XG4gICAgICAgIC8vIDQwMCB5ZWFycyBoYXZlIDE0NjA5NyBkYXlzICh0YWtpbmcgaW50byBhY2NvdW50IGxlYXAgeWVhciBydWxlcylcbiAgICAgICAgLy8gNDAwIHllYXJzIGhhdmUgMTIgbW9udGhzID09PSA0ODAwXG4gICAgICAgIHJldHVybiAoZGF5cyAqIDQ4MDApIC8gMTQ2MDk3O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1vbnRoc1RvRGF5cyhtb250aHMpIHtcbiAgICAgICAgLy8gdGhlIHJldmVyc2Ugb2YgZGF5c1RvTW9udGhzXG4gICAgICAgIHJldHVybiAobW9udGhzICogMTQ2MDk3KSAvIDQ4MDA7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gYXModW5pdHMpIHtcbiAgICAgICAgaWYgKCF0aGlzLmlzVmFsaWQoKSkge1xuICAgICAgICAgICAgcmV0dXJuIE5hTjtcbiAgICAgICAgfVxuICAgICAgICB2YXIgZGF5cyxcbiAgICAgICAgICAgIG1vbnRocyxcbiAgICAgICAgICAgIG1pbGxpc2Vjb25kcyA9IHRoaXMuX21pbGxpc2Vjb25kcztcblxuICAgICAgICB1bml0cyA9IG5vcm1hbGl6ZVVuaXRzKHVuaXRzKTtcblxuICAgICAgICBpZiAodW5pdHMgPT09ICdtb250aCcgfHwgdW5pdHMgPT09ICdxdWFydGVyJyB8fCB1bml0cyA9PT0gJ3llYXInKSB7XG4gICAgICAgICAgICBkYXlzID0gdGhpcy5fZGF5cyArIG1pbGxpc2Vjb25kcyAvIDg2NGU1O1xuICAgICAgICAgICAgbW9udGhzID0gdGhpcy5fbW9udGhzICsgZGF5c1RvTW9udGhzKGRheXMpO1xuICAgICAgICAgICAgc3dpdGNoICh1bml0cykge1xuICAgICAgICAgICAgICAgIGNhc2UgJ21vbnRoJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRocztcbiAgICAgICAgICAgICAgICBjYXNlICdxdWFydGVyJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRocyAvIDM7XG4gICAgICAgICAgICAgICAgY2FzZSAneWVhcic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtb250aHMgLyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIGhhbmRsZSBtaWxsaXNlY29uZHMgc2VwYXJhdGVseSBiZWNhdXNlIG9mIGZsb2F0aW5nIHBvaW50IG1hdGggZXJyb3JzIChpc3N1ZSAjMTg2NylcbiAgICAgICAgICAgIGRheXMgPSB0aGlzLl9kYXlzICsgTWF0aC5yb3VuZChtb250aHNUb0RheXModGhpcy5fbW9udGhzKSk7XG4gICAgICAgICAgICBzd2l0Y2ggKHVuaXRzKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnd2Vlayc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkYXlzIC8gNyArIG1pbGxpc2Vjb25kcyAvIDYwNDhlNTtcbiAgICAgICAgICAgICAgICBjYXNlICdkYXknOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF5cyArIG1pbGxpc2Vjb25kcyAvIDg2NGU1O1xuICAgICAgICAgICAgICAgIGNhc2UgJ2hvdXInOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF5cyAqIDI0ICsgbWlsbGlzZWNvbmRzIC8gMzZlNTtcbiAgICAgICAgICAgICAgICBjYXNlICdtaW51dGUnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF5cyAqIDE0NDAgKyBtaWxsaXNlY29uZHMgLyA2ZTQ7XG4gICAgICAgICAgICAgICAgY2FzZSAnc2Vjb25kJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRheXMgKiA4NjQwMCArIG1pbGxpc2Vjb25kcyAvIDEwMDA7XG4gICAgICAgICAgICAgICAgLy8gTWF0aC5mbG9vciBwcmV2ZW50cyBmbG9hdGluZyBwb2ludCBtYXRoIGVycm9ycyBoZXJlXG4gICAgICAgICAgICAgICAgY2FzZSAnbWlsbGlzZWNvbmQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gTWF0aC5mbG9vcihkYXlzICogODY0ZTUpICsgbWlsbGlzZWNvbmRzO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5rbm93biB1bml0ICcgKyB1bml0cyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtYWtlQXMoYWxpYXMpI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biAgICAgICAgc2Vjb25kcyA9IG1ha2VHZXR0ZXIoJ3NlY29uZHMnKSxcbiAgICAgICAgbWludXRlcyA9IG1ha2VHZXR0ZXIoJ21pbnV0ZXMnKSxcbiAgICAgICAgaG91cnMgPSBtYWtlR2V0dGVyKCdob3VycycpLFxuICAgICAgICBkYXlzID0gbWFrZUdldHRlcignZGF5cycpLFxuICAgICAgICBtb250aHMgPSBtYWtlR2V0dGVyKCdtb250aHMnKSxcbiAgICAgICAgeWVhcnMgPSBtYWtlR2V0dGVyKCd5ZWFycycpO1xuXG4gICAgZnVuY3Rpb24gd2Vla3MoKSB7XG4gICAgICAgIHJldHVybiBhYnNGbG9vcih0aGlzLmRheXMoKSAvIDcpO1xuICAgIH1cblxuICAgIHZhciByb3VuZCA9IE1hdGgucm91bmQsXG4gICAgICAgIHRocmVzaG9sZHMgPSB7XG4gICAgICAgICAgICBzczogNDQsIC8vIGEgZmV3IHNlY29uZHMgdG8gc2Vjb25kc1xuICAgICAgICAgICAgczogNDUsIC8vIHNlY29uZHMgdG8gbWludXRlXG4gICAgICAgICAgICBtOiA0NSwgLy8gbWludXRlcyB0byBob3VyXG4gICAgICAgICAgICBoOiAyMiwgLy8gaG91cnMgdG8gZGF5XG4gICAgICAgICAgICBkOiAyNiwgLy8gZGF5cyB0byBtb250aC93ZWVrXG4gICAgICAgICAgICB3OiBudWxsLCAvLyB3ZWVrcyB0byBtb250aFxuICAgICAgICAgICAgTTogMTEsIC8vIG1vbnRocyB0byB5ZWFyXG4gICAgICAgIH07XG5cbiAgICAvLyBoZWxwZXIgZnVuY3Rpb24gZm9yIG1vbWVudC5mbi5mcm9tLCBtb21lbnQuZm4uZnJvbU5vdywgYW5kIG1vbWVudC5kdXJhdGlvbi5mbi5odW1hbml6ZVxuICAgIGZ1bmN0aW9uIHN1YnN0aXR1dGVUaW1lQWdvKHN0cmluZywgbnVtYmVyLCB3aXRob3V0U3VmZml4LCBpc0Z1dHVyZSwgbG9jYWxlKSB7XG4gICAgICAgIHJldHVybiBsb2NhbGUucmVsYXRpdmVUaW1lKG51bWJlciB8fCAxLCAhIXdpdGhvdXRTdWZmaXgsIHN0cmluZywgaXNGdXR1cmUpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlbGF0aXZlVGltZSQxKHBvc05lZ0R1cmF0aW9uLCB3aXRob3V0U3VmZml4LCB0aHJlc2hvbGRzLCBsb2NhbGUpIHtcbiAgICAgICAgdmFyIGR1cmF0aW9uID0gY3JlYXRlRHVyYXRpb24ocG9zTmVnRHVyYXRpb24pLmFicygpLFxuICAgICAgICAgICAgc2Vjb25kcyA9IHJvdW5kKGR1cmF0aW9uLmFzKCdzJykpLFxuICAgICAgICAgICAgbWludXRlcyA9IHJvdW5kKGR1cmF0aW9uLmFzKCdtJykpLFxuICAgICAgICAgICAgaG91cnMgPSByb3VuZChkdXJhdGlvbi5hcygnaCcpKSxcbiAgICAgICAgICAgIGRheXMgPSByb3VuZChkdXJhdGlvbi5hcygnZCcpKSxcbiAgICAgICAgICAgIG1vbnRocyA9IHJvdW5kKGR1cmF0aW9uLmFzKCdNJykpLFxuICAgICAgICAgICAgd2Vla3MgPSByb3VuZChkdXJhdGlvbi5hcygndycpKSxcbiAgICAgICAgICAgIHllYXJzID0gcm91bmQoZHVyYXRpb24uYXMoJ3knKSksXG4gICAgICAgICAgICBhID1cbiAgICAgICAgICAgICAgICAoc2Vjb25kcyA8PSB0aHJlc2hvbGRzLnNzICYmIFsncycsIHNlY29uZHNdKSB8fFxuICAgICAgICAgICAgICAgIChzZWNvbmRzIDwgdGhyZXNob2xkcy5zICYmIFsnc3MnLCBzZWNvbmRzXSkgfHxcbiAgICAgICAgICAgICAgICAobWludXRlcyA8PSAxICYmIFsnbSddKSB8fFxuICAgICAgICAgICAgICAgIChtaW51dGVzIDwgdGhyZXNob2xkcy5tICYmIFsnbW0nLCBtaW51dGVzXSkgfHxcbiAgICAgICAgICAgICAgICAoaG91cnMgPD0gMSAmJiBbJ2gnXSkgfHxcbiAgICAgICAgICAgICAgICAoaG91cnMgPCB0aHJlc2hvbGRzLmggJiYgWydoaCcsIGhvdXJzXSkgfHxcbiAgICAgICAgICAgICAgICAoZGF5cyA8PSAxICYmIFsnZCddKSB8fFxuICAgICAgICAgICAgICAgIChkYXlzIDwgdGhyZXNob2xkcy5kICYmIFsnZGQnLCBkYXlzXSk7XG5cbiAgICAgICAgaWYgKHRocmVzaG9sZHMudyAhPSBudWxsKSB7XG4gICAgICAgICAgICBhID1cbiAgICAgICAgICAgICAgICBhIHx8XG4gICAgICAgICAgICAgICAgKHdlZWtzIDw9IDEgJiYgWyd3J10pIHx8XG4gICAgICAgICAgICAgICAgKHdlZWtzIDwgdGhyZXNob2xkcy53ICYmIFsnd3cnLCB3ZWVrc10pO1xuICAgICAgICB9XG4gICAgICAgIGEgPSBhIHx8XG4gICAgICAgICAgICAobW9udGhzIDw9IDEgJiYgWydNJ10pIHx8XG4gICAgICAgICAgICAobW9udGhzIDwgdGhyZXNob2xkcy5NICYmIFsnTU0nLCBtb250aHNdKSB8fFxuICAgICAgICAgICAgKHllYXJzIDw9IDEgJiYgWyd5J10pIHx8IFsneXknLCB5ZWFyc107XG5cbiAgICAgICAgYVsyXSA9IHdpdGhvdXRTdWZmaXg7XG4gICAgICAgIGFbM10gPSArcG9zTmVnRHVyYXRpb24gPiAwO1xuICAgICAgICBhWzRdID0gbG9jYWxlO1xuICAgICAgICByZXR1cm4gc3Vic3RpdHV0ZVRpbWVBZ28uYXBwbHkobnVsbCwgYSk7XG4gICAgfVxuXG4gICAgLy8gVGhpcyBmdW5jdGlvbiBhbGxvd3MgeW91IHRvIHNldCB0aGUgcm91bmRpbmcgZnVuY3Rpb24gZm9yIHJlbGF0aXZlIHRpbWUgc3RyaW5nc1xuICAgIGZ1bmN0aW9uIGdldFNldFJlbGF0aXZlVGltZVJvdW5kaW5nKHJvdW5kaW5nRnVuY3Rpb24pIHtcbiAgICAgICAgaWYgKHJvdW5kaW5nRnVuY3Rpb24gP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gfVxuXG4gICAgICAgIHZhciB3aXRoU3VmZml4ID0gZmFsc2UsXG4gICAgICAgICAgICB0aCA9IHRocmVzaG9sZHMsXG4gICAgICAgICAgICBsb2NhbGUsXG4gICAgICAgICAgICBvdXRwdXQ7XG5cbiAgICAgICAgaWYgKHR5cGVvZiBhcmdXaXRoU3VmZml4ID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgYXJnVGhyZXNob2xkcyA9IGFyZ1dpdGhTdWZmaXg7XG4gICAgICAgICAgICBhcmdXaXRoU3VmZml4ID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBhcmdXaXRoU3VmZml4ID09PSAnYm9vbGVhbicpIHtcbiAgICAgICAgICAgIHdpdGhTdWZmaXggPSBhcmdXaXRoU3VmZml4O1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgYXJnVGhyZXNob2xkcyA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgIHRoID0gT2JqZWN0LmFzc2lnbih7fSwgdGhyZXNob2xkcywgYXJnVGhyZXNob2xkcyk7XG4gICAgICAgICAgICBpZiAoYXJnVGhyZXNob2xkcy5zICE9IG51bGwgJiYgYXJnVGhyZXNob2xkcy5zcyA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgdGguc3MgPSBhcmdUaHJlc2hvbGRzLnMgLSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbG9jYWxlID0gdGhpcy5sb2NhbGVEYXRhKCk7XG4gICAgICAgIG91dHB1dCA9IHJlbGF0aXZlVGltZSQxKHRoaXMsICF3aXRoU3VmZml4LCB0aCwgbG9jYWxlKTtcblxuICAgICAgICBpZiAod2l0aFN1ZmZpeCkge1xuICAgICAgICAgICAgb3V0cHV0ID0gbG9jYWxlLnBhc3RGdXR1cmUoK3RoaXMsIG91dHB1dCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbG9jYWxlLnBvc3Rmb3Jt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3RhbFNpZ24gPSB0b3RhbCA8IDAgPyAnLScgOiAnJztcbiAgICAgICAgeW1TaWduID0gc2lnbih0aGlzLl9tb250aHMpICE9PSBzaWduKHRvdGFsKSA/ICctJyA6ICcnO1xuICAgICAgICBkYXlzU2lnbiA9IHNpZ24odGhpcy5fZGF5cykgIT09IHNpZ24odG90YWwpID8gJy0nIDogJyc7XG4gICAgICAgIGhtc1NpZ24gPSBzaWduKHRoaXMuX21pbGxpc2Vjb25kcykgIT09IHNpZ24odG90YWwpID8gJy0nIDogJyc7XG5cbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIHRvdGFsU2lnbiArXG4gICAgICAgICAgICAnUCcgK1xuICAgICAgICAgICAgKHllYXJzID8geW1TaWduICsgeWVhcnMgKyAnWScgOiAnJykgK1xuICAgICAgICAgICAgKG1vbnRocyA/IHltU2lnbiArIG1vbnRocyArICdNJyA6ICcnKSArXG4gICAgICAgICAgICAoZGF5cyA/IGRheXNTaWduICsgZGF5cyArICdEJyA6ICcnKSArXG4gICAgICAgICAgICAoaG91cnMgfHwgbWludXRlcyB8fCBzZWNvbmRzID8gJ1QnIDogJycpICtcbiAgICAgICAgICAgIChob3VycyA/IGhtc1NpZ24gKyBob3VycyArICdIJyA6ICcnKSArXG4gICAgICAgICAgICAobWludXRlcyA/IGhtc1NpZ24gKyBtaW51dGVzICsgJ00nIDogJycpICtcbiAgICAgICAgICAgIChzZWNvbmRzID8gaG1zU2lnbiArIHMgKyAnUycgOiAnJylcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICB2YXIgcHJvdG8kMiA9IER1cmF0aW9uLnByb3RvdHlwZTtcblxuICAgIHByb3RvJDIuaXNWYWxpZCA9IGlzVmFsaWQkMTtcbiAgICBwcm90byQyLmFicyA9IGFicztcbiAgICBwcm90byQyLmFkZCA9IGFkZCQxO1xuICAgIHByb3RvJDIuc3VidHJhY3QgPSBzdWJ0cmFjdCQxO1xuICAgIHByb3RvJDIuYXMgPSBhcztcbiAg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gMSk7XG4gICAgICB9XG4gICAgICBpZiAoc3RyLmluZGV4T2YoJ1xcbicpID4gLTEpIHtcbiAgICAgICAgaWYgKGFycmF5KSB7XG4gICAgICAgICAgc3RyID0gc3RyLnNwbGl0KCdcXG4nKS5tYXAoZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgcmV0dXJuICcgICcgKyBsaW5lO1xuICAgICAgICAgIH0pLmpvaW4oJ1xcbicpLnNsaWNlKDIpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHN0ciA9ICdcXG4nICsgc3RyLnNwbGl0KCdcXG4nKS5tYXAoZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgcmV0dXJuICcgICAnICsgbGluZTtcbiAgICAgICAgICB9KS5qb2luKCdcXG4nKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBzdHIgPSBjdHguc3R5bGl6ZSgnW0NpcmN1bGFyXScsICdzcGVjaWFsJyk7XG4gICAgfVxuICB9XG4gIGlmIChpc1VuZGVmaW5lZChuYW1lKSkge1xuICAgIGlmIChhcnJheSAmJiBrZXkubWF0Y2goL15cXGQrJC8pKSB7XG4gICAgICByZXR1cm4gc3RyO1xuICAgIH1cbiAgICBuYW1lID0gSlNPTi5zdHJpbmdpZnkoJycgKyBrZXkpO1xuICAgIGlmIChuYW1lLm1hdGNoKC9eXCIoW2EtekEtWl9dW2EtekEtWl8wLTldKilcIiQvKSkge1xuICAgICAgbmFtZSA9IG5hbWUuc2xpY2UoMSwgLTEpO1xuICAgICAgbmFtZSA9IGN0eC5zdHlsaXplKG5hbWUsICduYW1lJyk7XG4gICAgfSBlbHNlIHtcbiAgICAgIG5hbWUgPSBuYW1lLnJlcGxhY2UoLycvZywgXCJcXFxcJ1wiKVxuICAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxcXFwiL2csICdcIicpXG4gICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oXlwifFwiJCkvZywgXCInXCI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VNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL2x2LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL21lLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL21pLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL21rLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL21sLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL21uLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL21yLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL21zLW15LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL21zLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL210LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL215LmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL25iLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL25lLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL25sLWJlLmpzIiwid2VicGFjazovL0pzV2lkZVNreS8uL25vZGVfbW9kdWxlcy9tb21lbnQvbG9jYWxlL25sLmpzIiwid2VicGFjazovL0pzV2l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X19XRUJQQUNLX0VYVEVSTkFMX01PRFVMRV9tdl9fLCBfX1dFQlBBQ0tfRVhURVJOQUxfTU9EVUxFX3NvdXJjZV9tYXBfc3VwcG9ydF9fKSA9PiB7XG5yZXR1cm4gIiwibW9kdWxlLmV4cG9ydHMgPSBhZnRlclxuXG5mdW5jdGlvbiBhZnRlcihjb3VudCwgY2FsbGJhY2ssIGVycl9jYikge1xuICAgIHZhciBiYWlsID0gZmFsc2VcbiAgICBlcnJfY2IgPSBlcnJfY2IgfHwgbm9vcFxuICAgIHByb3h5LmNvdW50ID0gY291bnRcblxuICAgIHJldHVybiAoY291bnQgPT09IDApID8gY2FsbGJhY2soKSA6IHByb3h5XG5cbiAgICBmdW5jdGlvbiBwcm94eShlcnIsIHJlc3VsdCkge1xuICAgICAgICBpZiAocHJveHkuY291bnQgPD0gMCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdhZnRlciBjYWxsZWQgdG9vIG1hbnkgdGltZXMnKVxuICAgICAgICB9XG4gICAgICAgIC0tcHJveHkuY291bnRcblxuICAgICAgICAvLyBhZnRlciBmaXJzdCBlcnJvciwgcmVzdCBhcmUgcGFzc2VkIHRvIGVycl9jYlxuICAgICAgICBpZiAoZXJyKSB7XG4gICAgICAgICAgICBiYWlsID0gdHJ1ZVxuICAgICAgICAgICAgY2FsbGJhY2soZXJyKVxuICAgICAgICAgICAgLy8gZnV0dXJlIGVycm9yIGNhbGxiYWNrcyB3aWxsIGdvIHRvIGVycm9yIGhhbmRsZXJcbiAgICAgICAgICAgIGNhbGxiYWNrID0gZXJyX2NiXG4gICAgICAgIH0gZWxzZSBpZiAocHJveHkuY291bnQgPT09IDAgJiYgIWJhaWwpIHtcbiAgICAgICAgICAgIGNhbGxiYWNrKG51bGwsIHJlc3VsdClcbiAgICAgICAgfVxuICAgIH1cbn1cblxuZnVuY3Rpb24gbm9vcCgpIHt9XG4iLCIndXNlIHN0cmljdCc7XG5cbm1vZHVsZS5leHBvcnRzID0g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G4gICAgLCBicmlnaHRDeWFuICAgIDogIDk2XG4gICAgLCBicmlnaHRXaGl0ZSAgIDogIDk3XG4gICAgfVxuICAsIGJhY2tncm91bmRDb2xvck51bXMgPSB7XG4gICAgICBiZ0JsYWNrICAgICAgICAgOiAgNDBcbiAgICAsIGJnUmVkICAgICAgICAgICA6ICA0MVxuICAgICwgYmdHcmVlbiAgICAgICAgIDogIDQyXG4gICAgLCBiZ1llbGxvdyAgICAgICAgOiAgNDNcbiAgICAsIGJnQmx1ZSAgICAgICAgICA6ICA0NFxuICAgICwgYmdNYWdlbnRhICAgICAgIDogIDQ1XG4gICAgLCBiZ0N5YW4gICAgICAgICAgOiAgNDZcbiAgICAsIGJnV2hpdGUgICAgICAgICA6ICA0N1xuICAgICwgYmdCcmlnaHRCbGFjayAgIDogIDEwMFxuICAgICwgYmdCcmlnaHRSZWQgICAgIDogIDEwMVxuICAgICwgYmdCcmlnaHRHcmVlbiAgIDogIDEwMlxuICAgICwgYmdCcmlnaHRZZWxsb3cgIDogIDEwM1xuICAgICwgYmdCcmlnaHRCbHVlICAgIDogIDEwNFxuICAgICwgYmdCcmlnaHRNYWdlbnRhIDogIDEwNVxuICAgICwgYmdCcmlnaHRDeWFuICAgIDogIDEwNlxuICAgICwgYmdCcmlnaHRXaGl0ZSAgIDogIDEwN1xuICAgIH0gXG4gICwgY29sb3JzID0ge307XG5cblxuT2JqZWN0LmtleXMoY29sb3JOdW1zKS5mb3JFYWNoKGZ1bmN0aW9uIChrKSB7XG4gIGNvbG9yc1trXSA9IGZ1bmN0aW9uIChzKSB7IFxuICAgIHJldHVybiAnXFx1MDAxYlsnICsgY29sb3JOdW1zW2tdICsgJ20nICsgcyArICdcXHUwMDFiWzM5bSc7XG4gIH07XG59KTtcblxuT2JqZWN0LmtleXMoYmFja2dyb3VuZENvbG9yTnVtcykuZm9yRWFjaChmdW5jdGlvbiAoaykge1xuICBjb2xvcnNba10gPSBmdW5jdGlvbiAocykgeyBcbiAgICByZXR1cm4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XRoOlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgIC0gbmFtZTogTmFtZSBvZiBsb2dnaW5nIGluc3RhbmNlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgLSBsZXZlbDogQnVueWFuIGxvZ2dpbmcgbGV2ZWwgdG8gc2hvdyBsb2dzIGhpZ2hlci5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAtIHJhdzogSWYgdHJ1ZSwgb3V0cHV0IGluIEpTT04gZm9ybWF0LiBJZiBmYWxzZSwgb3V0cHV0IGluIHByZXR0aWZpZWRcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgIEJ1bnlhbiBsb2dnaW5nIGZvcm1hdC5cbiAgICAgKiAgICAgICAgICAgICAgICAgIC0gQnVueWFuIGxvZ2dpbmcgaW5zdGFuY2UuXG4gICAgICogQHBhcmFtIGFjY2Vzc1Rva2VuIEEgdmFsaWQgV2lkZVNreSBhY2Nlc3MgdG9rZW4uXG4gICAgICogQHBhcmFtIG9wdGlvbnMgQW4gT2JqZWN0IGNvbnRhaW5pbmcgYXR0cmlidXRlcyBcImF4aW9zXCIsIFwiaHR0cHNcIiBhbmQgXCJjbGllbnRcIiBmb3IgY29uZmlndXJpbmdcbiAgICAgKiAgICAgICAgICAgICAgICB0aGUgYXhpb3MsIGh0dHBzQWdlbnQgYW5kIFdpZGVTa3kgY2xpZW50IHJlc3BlY3RpdmVseS5cbiAgICAgKlxuICAgICAqICAgICAgICAgICAgICAgIEF4aW9zIGNvbmZpZ3VyYXRpb25zIGFyZVxuICAgICAqICAgICAgICAgICAgICAgIGRlc2NyaWJlZCBhdCBodHRwczovL2F4aW9zLWh0dHAuY29tL2RvY3MvY29uZmlnX2RlZmF1bHRzLlxuICAgICAqXG4gICAgICogICAgICAgICAgICAgICAgSHR0cHNBZ2VudCBjb25maWd1cmF0aW9ucyBhcmUgZGVzY3JpYmVkIGF0XG4gICAgICogICAgICAgICAgICAgICAgaHR0cHM6Ly9ub2RlanMub3JnL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gIC0gbGV2ZWw6IEJ1bnlhbiBsb2dnaW5nIGxldmVsIHRvIHNob3cgbG9ncyBoaWdoZXIuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgLSByYXc6IElmIHRydWUsIG91dHB1dCBpbiBKU09OIGZvcm1hdC4gSWYgZmFsc2UsIG91dHB1dCBpbiBwcmV0dGlmaWVkIEJ1bnlhbiBsb2dnaW5nIGZvcm1hdC5cbiAgICAgKiAgICAgICAgICAgICAgICAgIC0gQnVueWFuIGxvZ2dpbmcgaW5zdGFuY2UuXG4gICAgICogQHJldHVybnMge1dpZGVTa3lDbGllbnR9IEEgV2lkZVNreSBjbGllbnQgaW5zdGFuY2UuXG4gICAgICovXG4gICAgc3RhdGljIG1ha2VGcm9tQ29uZmlnKGNvbmZpZz17fSkge1xuICAgICAgICBjb25zdCByZXF1aXJlZFByb3BzID0gW1xuICAgICAgICAgICAgXCJzZXJ2ZXJVUkxcIixcbiAgICAgICAgICAgIFwidXNlcm5hbWVcIixcbiAgICAgICAgICAgIFwicGFzc3dvcmRcIixcbiAgICAgICAgICAgIFwiY2xpZW50SWRcIixcbiAgICAgICAgICAgIFwiY2xpZW50U2VjcmV0XCJcbiAgICAgICAgXTtcbiAgICAgICAgZm9yIChjb25zdCBwcm9wIG9mIHJlcXVpcmVkUHJvcHMpIHtcbiAgICAgICAgICAgIGlmIChjb25maWdbcHJvcF0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgQ29uZmlndXJhdGlvbiBwYXJhbWV0ZXIgcmVxdWlyZXMgcHJvcGVydGllcyAke3JlcXVpcmVkUHJvcHMuam9pbihcIiwgXCIpfWApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG5ldyBXaWRlU2t5Q2xpZW50KFxuICAgICAgICAgICAgY29uZmlnLnNlcnZlclVSTCxcbiAgICAgICAgICAgIGNvbmZpZy51c2VybmFtZSxcbiAgICAgICA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HRvIHRydWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMub3B0aW9ucy5odHRwID0ge1xuICAgICAgICAgICAgICAgIGtlZXBBbGl2ZTogdHJ1ZSAvLyBkZWZhdWx0IHRvIHRydWVcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmh0dHBBZ2VudCA9IG5ldyBodHRwLkFnZW50KHRoaXMub3B0aW9ucy5odHRwKTtcbiAgICAgICAgdGhpcy5odHRwc0FnZW50ID0gbmV3IGh0dHBzLkFnZW50KHRoaXMub3B0aW9ucy5odHRwKTtcblxuICAgICAgICB0aGlzLmF4aW9zID0gYXhpb3MuY3JlYXRlKE9iamVjdC5hc3NpZ24oe1xuICAgICAgICAgICAgYmFzZVVSTDogdGhpcy5iYXNlVXJpLFxuICAgICAgICAgICAgaHR0cEFnZW50OiB0aGlzLmh0dHBBZ2VudCxcbiAgICAgICAgICAgIGh0dHBzQWdlbnQ6IHRoaXMuaHR0cHNBZ2VudFxuICAgICAgICB9LCB0aGlzLm9wdGlvbnMuYXhpb3MgfHwge30pKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBJbml0aWFsaXNlIHRoZSBXaWRlU2t5Q2xpZW50IHdpdGggdGhlIHVzZXIgY29uZmlndXJhdGlvbnMuXG4gICAgICogQHJldHVybnMge1Byb21pc2U8dm9pZD59XG4gICAgICovXG4gICAgYXN5bmMgaW5pdENsaWVudE9wdGlvbnMoKSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBhd2FpdCBDTElFTlRfU0NIRU1BLnZhbGlkYXRlKHRoaXMub3B0aW9ucy5jbGllbnQpO1xuICAgICAgICAgICAgdGhpcy5jbGllbnRPcHRpb25zID0gQ0xJRU5UX1NDSEVNQS5jYXN0KHRoaXMub3B0aW9ucy5jbGllbnQpO1xuICAgICAgICAgICAgdGhpcy5zZXRBY2NlcHRHemlwKHRoaXMuY2xpZ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VG9rZW5gIHdoaWxzdFxuICAgICAqIHBlcmZvcm1pbmcgbm8gZnVydGhlciBvcGVyYXRpb25zLlxuICAgICAqL1xuICAgIGxvZ2luKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5nZXRUb2tlbigpO1xuICAgIH07XG5cbiAgICBpbXBlcnNvbmF0ZUFzKHVzZXJJZCkge1xuICAgICAgICBpZiAoIXRoaXMuaW5pdGlhbGlzZWQpIHtcbiAgICAgICAgICAgIGNvbnN0IG9sZFByb21pc2UgPSB0aGlzLmluaXRXYWl0Rm9yO1xuICAgICAgICAgICAgdGhpcy5pbml0V2FpdEZvciA9IG5ldyBQcm9taXNlKGFzeW5jIChyZXNvbHZlKSA9PiB7XG4gICAgICAgICAgICAgICAgYXdhaXQgb2xkUHJvbWlzZTtcbiAgICAgICAgICAgICAgICB0aGlzLl9pbXBlcnNvbmF0ZSA9IHVzZXJJZDtcbiAgICAgICAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuX2ltcGVyc29uYXRlID0gdXNlcklkO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIGlzSW1wZXJzb25hdGluZygpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2ltcGVyc29uYXRlICE9PSBudWxsO1xuICAgIH07XG5cbiAgICB1bnNldEltcGVyc29uYXRlKCkge1xuICAgICAgICB0aGlzLl9pbXBlcnNvbmF0ZSA9IG51bGw7XG4gICAgfTtcblxuICAgIHNldEFjY2VwdEd6aXAoYWNjZXB0R3ppcCkge1xuICAgICAgICB0aGlzLl9hY2NlcHRHemlwRW5jb2RpbmcgPSBCb29sZWFuKGFjY2VwdEd6aXApO1xuICAgIH1cblxuICAgIGlzQWNjZXB0aW5nR3ppcCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2FjY2VwdEd6aXBFbmNvZGluZztcbiAgICB9XG5cbiAgICBnZXQgaXNQcm9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gYXdhaXQgdGhpcy5heGlvcy5wYXRjaCh1cmksIGJvZHksIGNvbmZpZyk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdQVVQnOlxuICAgICAgICAgICAgICAgIHJlcyA9IGF3YWl0IHRoaXMuYXhpb3MucHV0KHVyaSwgYm9keSwgY29uZmlnKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBOb3QgY29uZmlndXJlZCBmb3IgbWV0aG9kICR7bWV0aG9kfS5gKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXMuZGF0YTtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogQXR0YWNoIG5lY2Vzc2FyeSBoZWFkZXJzIHRvIHJlcXVlc3QgY29uZmlnLlxuICAgICAqIEBwYXJhbSBjb25maWcgRXhpc3RpbmcgY29uZmlnIHRvIGFkZCB0by5cbiAgICAgKiBAcmV0dXJucyBNb2RpZmllZCBjb25maWcuXG4gICAgICovXG4gICAgYXN5bmMgX2F0dGFjaFJlcUNvbmZpZyhjb25maWcpIHtcbiAgICAgICAgY29uc3QgdG9rZW4gPSBhd2FpdCB0aGlzLmdldFRva2VuKCk7XG5cbiAgICAgICAgY29uZmlnID0gT2JqZWN0LmFzc2lnbih7fSwgY29uZmlnKTsgICAgICAgLy8gbWFrZSBhIGNvcHlcbiAgICAgICAgaWYgKGNvbmZpZy5oZWFkZXJzID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGNvbmZpZy5oZWFkZXJzID0ge307XG4gICAgICAgIH1cblxuICAgICAgICBjb25maWcuaGVhZGVyc1snQXV0aG9yaXphdGlvbiddID0gJ0JlYXJlciAnICsgdG9rZW4uYWNjZXNzX3Rva2VuO1xuICAgICAgICBjb25maWcuaGVhZGVyc1snQWNjZXB0J10gPSAnYXBwbGljYXRpb24vanNvbic7XG5cbiAgICAgICAgaWYgKHRoaXMuaXNBY2NlcHRpbmdHemlwKCkpIHtcbiAgICAgICAgICAgIGNvbmZpZy5kZWNvbXByZXNzID0gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmlzSW1wZXJzb25hdGluZygpKSB7XG4gICAgICAgICAgICBjb25maWcuaGVhZGVyc1snWC1JTVBFUlNPTkFURSddID0gdGhpcy5faW1wZXJzb25hdGU7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgIH1cblxuICAgIGFzeW5jIHN1Ym1pdFJlcXVlc3QobWV0aG9kLCB1cmksIGJvZHk9e30sIGNvbmZpZz17fSkge1xuICAgICAgICBjb25maWcgPSBhd2FpdCB0aGlzLl9hdHRhY2hSZXFDb25maWcoY29uZmlnKTtcblxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGhpcy5sb2dnZXIuaW5mbyhcIlN1Ym1pdHRpbmcgcmVxdWVzdCBbJXNdICVzXCIsIG1ldGhvZC50b1VwcGVyQ2FzZSgpLCB1cmkpO1xuICAgICAgICAgICAgdGhpcy5sb2dnZXIuZGVidWcoXCJXaXRoIGJvZHkgJWogYW5kIGNvbmZpZyAlalwiLCBib2R5LCBjb25maWcpO1xuICAgICAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMuX3dzUmF3U3VibWl0KG1ldGhvZCwgdXJpLCBib2R5LCBjb25maWcpO1xuICAgICAgICB9XG4gICAgICAgIGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgIGxldCBwYXJzZWRFcnIgPSBlcnI7XG4gICAgICAgICAgICBpZiAoaXNBeGlvc0Vycm9yKGVycikpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXJyLnJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHJlc3BvbnNlIGhhcyBiZWVuIHJlY2VpdmVkIGZyb20gQVBJIHNlcnZlclxuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyLnJlc3BvbnNlLnN0YXR1cyA9PT0gNDAxICYmIHRoaXMuX3dzX3Rva2VuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBlcnJvciBpcyA0MDEsIHRoZW4gZ2V0IG5ldyB0b2tlblxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fd3NfdG9rZW4gPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gYXdhaXQgdGhpcy5fYXR0YWNoUmVxQ29uZmlnKGNvbmZpZyk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fd3NSYXdTdWJtaXQobWV0aG9kLCB1cmksIGJvZHksIGNvbmZpZyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZWRFcnIgPSBSZXF1ZXN0RXJyb3IubWFrZShlcnIsIHRoaXMubG9nZ2VyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMubG9nZ2VyLmVycm9yKHBhcnNlZEVycik7XG4gICAgICAgICAgICBpZiAocGFyc2VkRXJyIGluc3RhbmNlb2YgR3JhcGhRTEVycm9yICYmIHBhcnNlZEVyci5lcnJvcnMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgIHBhcnNlZEVyci5lcnJvcnMuZm9yRWFjaCgobXNnLCBpKSA9PiB0aGlzLmxvZ2dlci5lcnJvcihcIkdyYXBoUUwgZXJyb3IgIyVkOiAlc1wiLCBpICsgMSwgbXNnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBwYXJzZWRFcnI7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBQcml2YXRlIG1ldGhvZDogcGVyZm9ybSBhIG5ldyBsb2ctaW4uICBSZXR1cm5zIEpTT04gcmVzcG9uc2UgZnJvbVxuICAgICAqIHNlcnZlciBvciByYWlzZXMgYW4gZXJyb3IuXG4gICAgICovXG4gICAgX2RvTG9naW4oKSB7XG4gICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgIGlmICh0aGlzLmxvZ2dlcikge1xuICAgICAgICAgICAgdGhpcy5sb2dnZXIudHJhY2UoJ1BlcmZvcm1pbmcgbG9naW4gYXR0ZW1wdCcpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuX3dzUmF3U3VibWl0KFxuICAgICAgICAgICAgJ1BPU1QnLFxuICAgICAgICAgICAgJy9vYXV0aDIvdG9rZW4nLFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHVzZXJuYW1lOiB0aGlzLiN1c2VybmFtZSxcbiAgICAgICAgICAgICAgICBwYXNzd29yZDogdGhpcy4jcGFzc3dvcmQsXG4gICAgICAgICAgICAgICAgZ3JhbnRfdHlwZTogJ3Bhc3N3b3JkJ1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBhdXRoOiB7XG4gICAgICAgICAgICAgICAgICAgIHVzZXJuYW1lOiB0aGlzLiNjbGllbnRJZCxcbiAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmQ6IHRoaXMuI2NsaWVudFNlY3JldFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogUHJpdmF0ZSBtZXRob2Q6IHJlZnJlc2ggYSB0b2tlbi4gUmV0dXJucyBKU09OIHJlc3BvbnNlIGZyb20gc2VydmVyIG9yXG4gICAgICogcmFpc2VzIGFuIGVycm9yLiBSZXF1aXJlcyB0aGF0IF93c190b2tlbiBpcyBub3QgbnVsbC5cbiAgICAgKi9cbiAgICBfZG9SZWZyZXNoKCkge1xuICAgICAgICAvKiBpc3RhbmJ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VsbCkge1xuICAgICAgICAgICAgLyogSm9pbiB0aGUgcXVldWUgKi9cbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgICAgICBpZiAodGhpcy5sb2dnZXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxvZ2dlci50cmFjZSgnV2FpdGluZyBmb3IgdG9rZW4gYWNxdWlzaXRpb24nKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKCAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5fd3NfdG9rZW5fd2FpdC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZTogcmVzb2x2ZSxcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0OiByZWplY3RcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuX3dzX3Rva2VuID09PSBudWxsKSB7XG4gICAgICAgICAgICAvKiBObyB0b2tlbiwgc28gYWNxdWlyZSBvbmUgKi9cbiAgICAgICAgICAgIHRoaXMuX3dzX3Rva2VuX3dhaXQgPSBbXTtcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgICAgICBpZiAodGhpcy5sb2dnZXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxvZ2dlci50cmFjZSgnQmVnaW4gdG9rZW4gYWNxdWlzaXRpb24nKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZmlyc3RTdGVwID0gdGhpcy5fZG9Mb2dpbigpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHRoaXMuX3dzX3Rva2VuLmV4cGlyZXNfaW4gPCBEYXRlLm5vdygpKSB7XG4gICAgICAgICAgICAvKiBUb2tlbiBpcyBleHBpcmVkLCBzbyBkbyBhIHJlZnJlc2ggKi9cbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgICAgICBpZiAodGhpcy5sb2dnZXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxvZ2dlci50cmFjZSgnQmVnaW4gdG9rZW4gcmVmcmVzaCcpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLl93c190b2tlbl93YWl0ID0gW107XG4gICAgICAgICAgICBmaXJzdFN0ZXAgPSB0aGlzLl9kb1JlZnJlc2goKTtcbiAgICAgICAgICAgIHJlZnJlc2ggPSB0cnVlO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dzX3Rva2VuO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKCBhc3luYyAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gZmlyc3RTdGVwXG4gICAgICAgICAgICAgICAgLnRoZW4oKHRva2VuKSA9PiB0aGlzLl9nZXRUb2tlblN1Y2Nlc3ModG9rZW4sIHJlc29sdmUpKVxuICAgICAgICAgICAgICAgIC5jYXRjaCgoZXJyKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIC8qIElmIHdlJ3JlIHJlZnJlc2hpbmcsIHRyeSBhIGZ1bGwgbG9nLWluICovXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZWZyZXNoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMubG9nZ2VyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5sb2dnZXIuaW5mbyhcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnUmVmcmVzaCBmYWlscywgdHJ5aW5nIGxvZy1pbiBpbnN0ZWFkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fZG9Mb2dpbigpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oKHRva2VuKSA9PiB0aGlzLl9nZXRUb2tlblN1Y2Nlc3ModG9rZW4sIHJlc29sdmUpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jYXRjaCgoZXJyKSA9PiB0aGlzLl9nZXRUb2tlbkZhaWwoZXJyLCByZWplY3QpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9nZXRUb2tlbkZhaWwoZXJyLCByZWplY3QpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgIH07XG5cbiAgICAvKipcbiAgICAgKiBQZXJmb3JtIGFuIG9wZXJhdGlvbiBnaXZlbiBieSB0aGUgdXJpIHdpdGggYXJndW1lbnQgaWRzLiBJZHMgY2FuIGVpdGhlciBiZSBhIFN0cmluZyBvciBhbiBhcnJheSBvZiBTdHJpbmcncy5cbiAgICAgKiBAcGFyYW0gaWRzIEVudGl0eSBpZC9zIGZvciB0aGUgb3BlcmF0aW9uIHRvIGJlIHBlcmZvcm1lZCBvbi5cbiAgICAgKiBAcGFyYW0gdXJpIEFQSSBlbmRwb2ludCB0byBwZXJmb3JtIHRoZSBvcGVyYXRpb24uXG4gICAgICogQHJldHVybnMge1Byb21pc2U8Kj59XG4gICAgICovXG4gICAgX29wQnlJZHMoaWRzLCB1cmkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBpZHMgPT09ICdzdHJpbmcnIHx8IChBcnJheS5pc0FycmF5KGlkcykgJiYgaWRzLmxlbmd0aCA9PT0gMSkpIHtcbiAgICAgICAgICAgIGNvbnN0IGlkID0gQXJyYXkuaXNBcnJheShpZHMpID8gaWRzWzBdIDogaWRzO1xuXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5zdWJtaXRSZXF1ZXN0KFxuICAgICAgICAgICAgICAgICdHRVQnLFxuICAgICAgICAgICAgICAgIHVyaSxcbiAgICAgICAgICAgICAgICB7fSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIHBhcmFtczoge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IChuZXcgZGF0YS5SZWYoaWQpKS50b0hTWklOQygpXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoaWRzKSkge1xuICAgICAgICAgICAgaWYgKGlkcy5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAgICAgLy8gdmVyaWZ5IGlucHV0IGlzIGFsbCBzdHJpbmdzXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBpZCBvZiBpZHMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodHlwZW9mIGlkID09PSAnc3RyaW5nJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpZCBpbnN0YW5jZW9mIE9iamVjdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIGl0cyBjb21wYXRpYmxlIHdpdGggY2xhc3MgUmVmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IGRhdGEuUmVmKGlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBQYXJhbWV0ZXIgJ2lkcycgY29udGFpbnMgYW4gZWxlbWVudCB0aGF0IGlzIG9mIHR5cGUgb2JqZWN0IGJ1dCBub3QgY29tcGF0aWJsZSBgICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGB3aXRoIGNsYXNzIFJlZiBkdWUgdG86ICR7ZXJyb3IubWVzc2FnZX1gXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBQYXJhbWV0ZXIgJ2lkcycgY29udGFpbnMgYW4gZWxlbWVudCB0aGF0IGlzIG5vdCBhIHN0cmluZy4gRm91bmQgJHt0eXBlb2YgaWR9LmBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3VibWl0UmVxdWVzdChcbiAgICAgICAgICAgICAgICAgICAgJ1BPU1QnLFxuICAgICAgICAgICAgICAgICAgICB1cmksXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXI6ICcyLjAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHM6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bmFtZTogJ2lkJ31cbiAgIC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XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIGZpbHRlciAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgSW52YWxpZCBmaWx0ZXIgdHlwZSAke3R5cGVvZiBmaWx0ZXJ9IGdpdmVuLiBFeHBlY3RlZCBzdHJpbmcuYCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5zdWJtaXRSZXF1ZXN0KFxuICAgICAgICAgICAgXCJQT1NUXCIsXG4gICAgICAgICAgICBgL2FwaS8ke29wfWAsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgbWV0YToge1xuICAgICAgICAgICAgICAgICAgICB2ZXI6IFwiMi4wXCJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGNvbHM6IFtcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJuYW1lXCI6IFwiZmlsdGVyXCJcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJuYW1lXCI6IFwibGltaXRcIlxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICByb3dzOiBbXG4gICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcjogYHM6JHtmaWx0ZXJ9YCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0OiBgbjoke2xpbWl0fWBcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBQZXJmb3JtIGEgYHJlYWRgIHJlcXVlc3Qgb2YgdGhlIFdpZGVTa3kgQVBJIHNlcnZlci4gIFRoaXMgZnVuY3Rpb24gdGFrZXNc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vcCAgICAgICAgICBPcGVyYXRpb24gdG8gcGVyZm9ybVxuICAgICAqIEBwYXJhbSAgIGVudGl0aWVzICAgIEFycmF5IG9mIGVudGl0eSBvYmplY3RzXG4gICAgICogQHJldHVybnMgUHJvbWlzZSB0aGF0IHJlc29sdmVzIHRvIHRoZSByYXcgZ3JpZC5cbiAgICAgKi9cbiAgICBfY3JlYXRlX29yX3VwZGF0ZShvcCwgZW50aXRpZXMpIHtcbiAgICAgICAgaWYgKCEoQXJyYXkuaXNBcnJheShlbnRpdGllcykpKSB7XG4gICAgICAgICAgICBlbnRpdGllcyA9IFtlbnRpdGllc107XG4gICAgICAgIH1cblxuICAgICAgICAvKiBHZW5lcmF0ZSB0aGUgY29sdW1ucywgbWFrZSBhIG5vdGUgb2YgdGhlIGhheXN0YWNrIHZlcnNpb24gbmVlZGVkICovXG4gICAgICAgIGxldCBjb2xzID0gW10sIHByZXNlbnQgPSB7fSwgdmVyID0gJzIuMCc7XG5cbiAgICAgICAgZW50aXRpZXMuZm9yRWFjaChmdW5jdGlvbiAoZW50aXR5KSB7XG4gICAgICAgICAgICBPYmplY3Qua2V5cyhlbnRpdHkpLmZvckVhY2goZnVuY3Rpb24gKGNvbCkge1xuICAgICAgICAgICAgICAgIGlmICghcHJlc2VudFtjb2xdKSB7XG4gICAgICAgICAgICAgICAgICAgIHByZXNlbnRbY29sXSA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLyogVXBncmFkZSB0byBIYXlzdGFjayAzLjAgKi9cbiAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShlbnRpdHlbY29sXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdmVyID0gJzMuMCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8qIEVuc3VyZSB1cGRhdGVSZWMgbGlzdHMgYGlkYCAqL1xuICAgICAgICBpZiAoKCFwcmVzZW50LmlkKSAmJiAob3AgPT09ICd1cGRhdGVSZWMnKSkge1xuICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi9cbiAgICAgICAgICAgIGlmICh0aGlzLmxvZ2dlcikge1xuICAgICAgICAgICAgICAgIHRoaXMubG9nZ2VyLnRyYWNlKGVudGl0aWVzLCAnRW50aXRpZXMgbGFja3MgaWQgY29sdW1uJyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignaWQgaXMgbWlzc2luZycpO1xuICAgICAgICB9XG5cbiAgICAgICAgLyogR2VuZXJhdGUgdGhlIGNvbHVtbnMgdG8gYmUgZW1pdHRlZCwgc3RhcnRpbmcgd2l0aCB0aGUgc3BlY2lhbCBvbmVzICovXG4gICAgICAgIFNQRUNJQUxfQ09MUy5mb3JFYWNoKChjKSA9PiB7XG4gICAgICAgICAgICBpZiAocHJlc2VudFtjXSkge1xuICAgICAgICAgICAgICAgIGNvbHMucHVzaChjKTtcbiAgICAgICAgICAgICAgICBkZWxldGUgcHJlc2VudFtjXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLyogQWRkIHRoZSBvdGhlcnMgaW4sIGluIGFscGhhYmV0aWNhbCBvcmRlciAqL1xuICAgICAgICBjb2xzID0gWy4uLmNvbHMsIC4uLihPYmplY3Qua2V5cyhwcmVzZW50KS5zb3J0KCkpXTtcblxuICAgICAgICByZXR1cm4gdGhpcy5zdWJtaXRSZXF1ZXN0KFxuICAgICAgICAgICAgJ1BPU1QnLFxuICAgICAgICAgICAgYC9hcGkvJHtvcH1gLFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIG1ldGE6IHt2ZXI6IHZlcn0sXG4gICAgICAgICAgICAgICAgY29sczogY29scy5tYXAoZnVuY3Rpb24gKGMpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtuYW1lOiBjfTtcbiAgICAgICAgICAgICAgICB9K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biAgICAgKlxuICAgICAqIEBwYXJhbSAgIHtzdHJpbmd9ICAgIGVtYWlsICAgICAgIEVtYWlsICh1c2VyIG5hbWUpIG9mIHRoZSBuZXcgdXNlclxuICAgICAqIEBwYXJhbSAgIHtzdHJpbmd9ICAgIG5hbWUgICAgICAgIE5hbWUgKGRlc2NyaXB0aW9uKSBvZiB0aGUgbmV3IHVzZXIgYWNjb3VudCxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWxsIGJlY29tZSB0aGUgYGRpc2AgZmllbGQgb2YgdGhlIHVzZXIgZW50aXR5LlxuICAgICAqIEBwYXJhbSAgIHtzdHJpbmd9ICAgIGRlc2NyaXB0aW9uIFB1cnBvc2Ugb2YgdGhlIHVzZXIgYWNjb3VudCwgZS5nLiBcIlVzZXJcIixcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIlN1cGVyVXNlclwiLCDigKYgZXRjLiAgRmlsbHMgaW4gdGhlIGBwcmltYXJ5RnVuY3Rpb25gIHRhZy5cbiAgICAgKiBAcGFyYW0gICB7c3RyaW5nW119ICByb2xlcyAgICAgICBUaGUgSURzIChVVUlEcyBvciBuYW1lcykgb2YgdGhlIGByb2xlYCBlbnRpdGllcyB0byBsaW5rIHRvXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBuZXcgdXNlci5cbiAgICAgKiBAcGFyYW0gICB7c3RyaW5nP30gICBwYXNzd29yZCAgICBUaGUgbmV3IHBhc3N3b3JkIGZvciB0aGUgdXNlci4gIElmIHNldCB0byBgbnVsbGAgb3IgdGhlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW1wdHkgc3RyaW5nLCB0aGUgdXNlciB3aWxsIGJlIHNlbnQgYW4gZW1haWwgdG8gXCJhY3RpdmF0ZVwiXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlaXIgdXNlciBhY2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RhdGluZyBwYXNzd29yZCcpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFuZXdQYXNzd29yZCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdOZXcgcGFzc3dvcmQgY2Fubm90IGJlIGVtcHR5LicpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuc3VibWl0UmVxdWVzdChcbiAgICAgICAgICAgICdQT1NUJyxcbiAgICAgICAgICAgICcvdXNlci91cGRhdGVQYXNzd29yZCcsXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgbmV3UGFzc3dvcmRcbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogRGVsZXRlIG9uZSBvciBtb3JlIGVudGl0aWVzIGdpdmVuIGFzIElEcy5cbiAgICAgKlxuICAgICAqIEBwYXJhbSAgIGlkcyAgICAgRW50aXR5IElEcywgZWl0aGVyIGEgc2luZ2xlIElEIG9yIGFuIGFycmF5LiAgKHN0cmluZyBvclxuICAgICAqICAgICAgICAgICAgICAgICAgYXJyYXkgb2Ygc3RyaW5ncylcbiAgICAgKiBAcmV0dXJucyBQcm9taXNlIHRoYXQgcmVzb2x2ZXMgdG8gdGhlIHJhdyBncmlkLlxuICAgICAqL1xuICAgIGRlbGV0ZUJ5SWQoaWRzKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9vcEJ5SWRzKGlkcywgJy9hcGkvZGVsZXRlUmVjJyk7XG4gICAgfTtcblxuXG4gICAgLyoqXG4gICAgICogRGVsZXRlIGVudGl0aWVzIHRoYXQgbWF0Y2ggYSBnaXZlbiBmaWx0ZXIgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHBhcmFtICAgZmlsdGVyICAgICAgRmlsdGVyIGV4cHJlc3Npb24gKHN0cmluZylcbiAgICAgKiBAcGFyYW0gICBsaW1pdCAgICAgICBPcHRpb25hbCBsaW1pdCBvbiB0aGUgbnVtYmVyIG9mIGVudGl0aWVzIHRvIGRlbGV0ZVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgIChpbnRlZ2VyKVxuICAgICAqIEByZXR1cm5zIFByb21pc2UgdGhhdCByZXNvbHZlcyB0byB0aGUgcmF3IGdyaWQuXG4gICAgICovXG4gICAgZGVsZXRlQnlGaWx0ZXIoZmlsdGVyLCBsaW1pdD0wKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9ieUZpbHRlcignZGVsZXRlUmVjJywgZmlsdGVyLCBsaW1pdCk7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIFBlcmZvcm0gYSBoaXN0b3J5IHJlYWQgcmVxdWVzdC5cbiAgICAgKlxuICAgICAqIEBwYXJhbSAgIGlkcyAgICAgICAgIChzdHJpbmcpICAgIEVudGl0eSB0byByZWFkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgKGFycmF5KSAgICAgRW50aXRpZXMgdG8gcmVhZCAobXVsdGktcG9pbnQpXG4gICAgICogQHBhcmFtICAgZnJvbSAgICAgICAgKHN0cmluZykgICAgVGV4dHVhbCByZWFkIHJhbmdlIChlLmcuIFwidG9kYXlcIilcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAoRGF0ZSkgICAgICBTdGFydGluZyB0aW1lc3RhbXAgb2YgcmVhZFxuICAgICAqIEBwYXJhbSAgIHRvICAgICAgICAgIChEYXRlKSAgICAgIEVuZGluZyB0aW1lc3RhbXAgb2YgcmVhZFxuICAgICAqXG4gICAgICogQHBhcmFtICAgYmF0Y2hTaXplICAgIChOdW1iZXIpICAgIE9wdGlvbmFsIGJhdGNoIHNpemUgd2hlbiByZWFkaW5nIG11bHRpcGxlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRzLiAgU29tZSBlbnZpcm9ubWVudHMgbWF5IGV4cGVyaWVuY2VcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc3N1ZXMgcmVhZGluZyBtb3JlIHRoYW4gYSBmZXcgZG96ZW4gcG9pbnRzXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXQgYSB0aW1lIGR1ZSB0byBIVFRQIHJlcXVlc3QgcGF5bG9hZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0aW9ucywgc28gYmlnZ2VyIHJlYWRzIHdpbGwgYmVcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicm9rZW4gdXAgaW50byA1MC1wb2ludCBncm91cHMuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHNpemUgY2FuIGJlIHR1bmVkIGhlcmUuXG4gICAgICpcbiAgICAgKiBAcmV0dXJucyBQcm9taXNlIHRoYXQgcmVzb2x2ZXMgdG8gdGhlIHJhdyBncmlkLlxuICAgICAqL1xuICAgIGhpc1JlYWQoaWRzLCBmcm9tLCB0bywgYmF0Y2hTaXplPTUwKSB7XG4gICAgICAgIGxldCByYW5nZTtcblxuICAgICAgICBpZiAodG8gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgLyogRnVsbCByYW5nZSBnaXZlbiwgYm90aCBmcm9tIGFuZCB0byAqbXVzdCogYmUgRGF0ZXMgKi9cbiAgICAgICAgICAgIGlmICghKGZyb20gaW5zdGFuY2VvZiBEYXRlKSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignYGZyb21gIGlzIG5vdCBhIERhdGUnKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCEodG8gaW5zdGFuY2VvZiBEYXRlKSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignYHRvYCBpcyBub3QgYSBEYXRlJyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJhbmdlID0gZnJvbS50b0hTWklOQygpICsgJywnICsgdG8udG9IU1pJTkMoKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJhbmdlID0gZnJvbTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghKEFycmF5LmlzQXJyYXkoaWRzKSkpIHtcbiAgICAgICAgICAgIGlkcyA9IFtpZHNdO1xuICAgICAgICB9XG5cbiAgICAgICAgLyogRm9ybWF0IHRoZSByYW5nZSAqL1xuICAgICAgICByYW5nZSA9IHJhbmdlLnRvSFNaSU5DKCk7XG5cbiAgICAgICAgLyogTm9ybWFsaXNlIHRoZSBJRHMgaW50byBzdGFuZGFyZCBmb3JtICovXG4gICAgICAgIGlkcyA9IGlkcy5tYXAoZnVuY3Rpb24gKGlkKSB7XG4gICAgICAgICAgICByZXR1cm4gKG5ldyBkYXRhLlJlZihpZCkpLnRvSFNKU09OKCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmIChpZHMubGVuZ3RoIDwgYmF0Y2hTaXplKSB7XG4gICAgICAgICAgICAvKiBTbWFsbCBoaXNSZWFkLCBoYW5kbGUgYXMgbm9ybWFsICovXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5faGlzUmVhZChpZHMsIHJhbmdlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8qIEdyb3VwIHRoZSBJRHMgaW50byBibG9ja3MgKi9cbiAgICAgICAgY29uc3QgcmVhZHMgPSBbXTtcbiAgICAgICAgbGV0IG9mZnNldCA9IDA7XG5cbiAgICAgICAgd2hpbGUgKG9mZnNldCA8IGlkcy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGNvbnN0IGJsb2NrID0gaWRzLnNsaWNlKG9mZnNldCwgb2Zmc2V0ICsgYmF0Y2hTaXplKTtcblxuICAgICAgICAgICAgcmVhZHMucHVzaChibG9jayk7XG4gICAgICAgICAgICBvZmZzZXQgKz0gYmxvY2subGVuZ3RoO1xuICAgICAgICB9XG5cbiAgICAgICAgLyogQXNzZW1ibGUgdGhlIG92ZXJhbGwgcmVzdWx0ICovXG4gICAgICAgIGNvbnN0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgIG1ldGE6IHtcbiAgICAgICAgICAgICAgICB2ZXI6ICcyLjAnLFxuICAgICAgICAgICAgICAgIGhpc1N0YXJ0OiBudWxsLFxuICAgICAgICAgICAgICAgIGhpc0VuZDogbnVsbFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNvbHM6IFtcbiAgICAgICAgICAgICAgICB7bmFtZTogJ3RzJ31cbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICByb3dzOiBbXVxuICAgICAgICB9O1xuXG4gICAgICAgIGNvbnN0IHN0YXR1cyA9IHtcbiAgICAgICAgICAgIGhpc1N0YXJ0OiBudWxsLFxuICAgICAgICAgICAgaGlzRW5kOiBudWxsLFxuICAgICAgICAgICAgcm93VHM6IHt9LFxuICAgICAgICAgICAgY29sSWQ6IHt9XG4gICAgICAgIH07XG5cbiAgICAgICAgLyogRW51bWVyYXRlIHRoZSBjb2x1bW5zICovXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBzdGF0dXMuY29sSWRbaWRzW2ldXSA9IGk7XG4gICAgICAgICAgICByZXN1bHQuY29scy5wdXNoKHtcbiAgICAgICAgICAgICAgICBuYW1lOiAndicgKyBpLFxuICAgICAgICAgICAgICAgIGlkOiBpZHNbaV1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLyogRXhlY3V0ZSB0aGUgcmVhZHMgKi9cbiAgICAgICAgcmV0dXJuIFByb21pc2UuYWxsKFxuICAgICAgICAgICAgcmVhZHMubWFwKChibG9ja19pZHMpID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5faGlzUmVhZChibG9ja19pZHMsIHJhbmdlKS50aGVuKChibG9ja19yZXMpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fbWVyZ2VIaXNSZWFkUmVzKHJlc3VsdCwgc3RhdHVzLCBibG9ja19pZHMsIGJsb2NrX3Jlcyk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICApLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgLyogQXNzZW1ibGUgYWxsIHRoZSByb3dzICovXG4gICAgICAgICAgICBsZXQgdGltZXMgPSBPYmplY3Qua2V5cyhzdGF0dXMucm93VHMpLm1hcCgodHMpID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VJbnQodHMpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0aW1lcy5zb3J0KCk7XG5cbiAgICAgICAgICAgIHJlc3VsdC5yb3dzID0gdGltZXMubWFwKGZ1bmN0aW9uICh0cykge1xuICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXMucm93VHNbdHNdO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIC8qIFJldHVybiB0aGUgbWVyZ2VkIHJlc3VsdCAqL1xuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIF9tZXJnZUhpc1JlYWRSZXMocmVzdWx0LCBzdGF0dXMsIGJsb2NrSWRzLCBibG9ja1Jlcykge1xuICAgICAgICAvKiBNZXJnZSB0aGUgaGVhZGVyICovXG5cbiAgICAgICAgbGV0IHRoaXNfc3RhcnQgPSBkYXRhLnBhcnNlKGJsb2NrUmVzLm1ldGEuaGlzU3RhcnQpO1xuICAgICAgICBsZXQgdGhpc19lbmQgPSBkYXRhLnBhcnNlKGJsb2NrUmVzLm1ldGEuaGlzRW5kKTtcblxuICAgICAgICAvKlxuICAgICAgICAgKiBEZWZlbnNpdmUgcHJvZ3JhbW1pbmc6IGRvY3Mgc2F5IGhpc1N0YXJ0L2hpc0VuZCBjYW4gYmUgJ206J1xuICAgICAgICAgKiBhbmQgd2UgcmVhbGx5IHNob3VsZG4ndCBcInRydXN0XCIgdGhlIGlucHV0cyBpbiBzb21ld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gICAgICAgfVxuXG4gICAgICAgIC8qIEFyZSB0aGVyZSBvdGhlciBmaWVsZHMgdG8gbWVyZ2U/ICAoZm9yIGZ1dHVyZSBleHBhbnNpb24pICovXG5cbiAgICAgICAgZm9yIChjb25zdCBmaWVsZCBpbiBibG9ja1Jlcy5tZXRhKSB7XG4gICAgICAgICAgICBpZiAoIXJlc3VsdC5tZXRhLmhhc093blByb3BlcnR5KGZpZWxkKSkge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5tZXRhW2ZpZWxkXSA9IGJsb2NrUmVzLm1ldGFbZmllbGRdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLyogTm93LCBtZXJnZSB0aGUgZGF0YSAqL1xuXG4gICAgICAgIGZvciAobGV0IHIgPSAwOyByIDwgYmxvY2tSZXMucm93cy5sZW5ndGg7IHIrKykge1xuICAgICAgICAgICAgY29uc3QgaW5fcm93ID0gYmxvY2tSZXMucm93c1tyXTtcbiAgICAgICAgICAgIGxldCB0cyA9IGRhdGEucGFyc2UoaW5fcm93LnRzKTtcblxuICAgICAgICAgICAgLyogU2FuaXR5IGNoZWNrLCBgdHNgIG11c3QgYmUgYSBEYXRlICovXG4gICAgICAgICAgICBpZiAoKHRzID09IG51bGwpIHx8ICEodHMgaW5zdGFuY2VvZiBEYXRlKSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgJ0V4cGVjdGVkIGRhdGUvdGltZSBmb3IgdHMgY29sdW1uLCBnb3Q6ICcgKyBpbl9yb3cudHNcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKiBFeHRyYWN0IG1zIHRpbWUgKi9cbiAgICAgICAgICAgIHRzID0gdHMudmFsdWVPZigpO1xuICAgICAgICAgICAgbGV0IG91dF9yb3c7XG5cbiAgICAgICAgICAgIGlmIChzdGF0dXMucm93VHMuaGFzT3duUHJvcGVydHkodHMpKSB7XG4gICAgICAgICAgICAgICAgb3V0X3JvdyA9IHN0YXR1cy5yb3dUc1t0c107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBvdXRfcm93ID0ge3RzOiBpbl9yb3cudHN9O1xuICAgICAgICAgICAgICAgIHN0YXR1cy5yb3dUc1t0c10gPSBvdXRfcm93O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKiBDb3B5IHRoZSBjb2x1bW5zIGluICovXG4gICAgICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGJsb2NrSWRzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgdmFsID0gaW5fcm93Wyd2JyArIGNdO1xuXG4gICAgICAgICAgICAgICAgaWYgKHZhbCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGlkID0gYmxvY2tJZHNbY107XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNvbCA9IHN0YXR1cy5jb2xJZFtpZF07XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbCA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1VuZXhwZWN0ZWQgSUQgJyArIGlkKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIG91dF9yb3dbJ3YnICsgY29sXSA9IHZhbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgX2hpc1JlYWQoaWRzLCByYW5nZSkge1xuICAgICAgICBjb25zdCBjb25maWcgPSB7XG4gICAgICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICAgICAgICByYW5nZVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChpZHMubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICBjb25maWcucGFyYW1zLmlkID0gKG5ldyBkYXRhLlJlZihpZHNbMF0pKS50b0hTWklOQygpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWRzLmZvckVhY2goKGlkLCBpZHgpID0+IHtcbiAgICAgICAgICAgICAgICBjb25maWcucGFyYW1zWydpZCcgKyBpZHhdID0gKG5ldyBkYXRhLlJlZihpZCkpLnRvSFNaSU5DKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLnN1Ym1pdFJlcXVlc3QoXG4gICAgICAgICAgICAnR0VUJyxcbiAgICAgICAgICAgICcvYXBpL2hpc1JlYWQnLFxuICAgICAgICAgICAge30sXG4gICAgICAgICAgICBjb25maWdcbiAgICAgICAgKTtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogUGVyZm9ybSBhIGhpc3Rvcnkgd3JpdGUgcmVxdWVzdC5cbiAgICAgKlxuICAgICAqIEBwYXJhbSAgIHJlY29yZHMgICAgIFJlY29yZHMgdG8gYmUgd3JpdHRlbiBrZXllZCBieSB0aW1lc3RhbXAgKG9iamVjdClcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICBFYWNoIHJlY29yZCB2YWx1ZSBzaG91bGQgbWFwIHRoZSBwb2ludCB0byBpdHMgdmFsdWVcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICBmb3IgdGhhdCB0aW1lIHJlY29yZC4gUmVjb3JkcyBzaG91bGQgaGF2ZSB0aGUgZm9ybWF0IG9mOlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgPHRpbWU+OiB7XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aWQ+OiA8dmFsdWVUb0JlV3JpdHRlbj4sXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuLi5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgLi4uXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgIHdoZXJlIGVhY2ggb2YgdGhlICc8PicgdmFsdWVzIGFyZSBpbiBIYXlTdGFjayBmb3JtYXQuXG4gICAgICogQHJldHVybnMgUHJvbWlzZSB0aGF0IHJlc29sdmVzIHRvIHRoZSByYXcgZ3JpZC5cbiAgICAgKi9cbiAgICBoaXNXcml0ZShyZWNvcmRzKSB7XG4gICAgICAgIGNvbnN0IGNvbHMgPSB7fSwgb3V0Q29scyA9IFt7bmFtZTogJ3RzJ31dO1xuICAgICAgICBjb25zdCByb3dzID0gT2JqZWN0LmtleXMocmVjb3JkcykubWFwKGZ1bmN0aW9uICh0cykge1xuICAgICAgICAgICAgY29uc3QgcmVjID0gcmVjb3Jkc1t0c107XG4gICAgICAgICAgICBjb25zdCByb3cgPSB7dHM6IHRzfTtcblxuICAgICAgICAgICAgT2JqZWN0LmtleXMocmVjKS5zb3J0KCkuZm9yRWFjaCgoaWQpID0+IHtcbiAgICAgICAgICAgICAgICAvKiBEZXRlcm1pbmUgY29sdW1uICovXG4gICAgICAgICAgICAgICAgbGV0IGNvbCA9IGNvbHNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChjb2wgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICBjb2wgPSAndicgKyAob3V0Q29scy5sZW5ndGggLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgb3V0Q29scy5wdXNoKHtuYW1lOiBjb2wsIGlkOiBpZH0pO1xuICAgICAgICAgICAgICAgICAgICBjb2xzW2lkXSA9IGNvbDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAvKiBJbnNlcnQgKi9cbiAgICAgICAgICAgICAgICByb3dbY29sXSA9IHJlY1tpZF07XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIHJvdztcbiAgICAgICAgfSkuc29ydCgocjEsIHIyKSA9PiB7XG4gICAgICAgICAgICAvKlxuICAgICAgICAgICAgICogVGhpcyBmdW5jdGlvbiBpcyBhdCB0aGUgbWVyY3kgb2YgdGhlIHNvcnRpbmcgYWxnb3JpdGhtXG4gICAgICAgICAgICAgKiBzbyBpcyBub3QgZ3VhcmFudGVlZCB0byB1c2UgYWxsIGNvZGUgcGF0aHMuXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGlmIChyMS50cyA8IHIyLnRzKVxuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgICAgICBpZiAocjEudHMgPiByMi50cylcbiAgICAgICAgICAgICAgICByZXR1cm4gMTtcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovXG4gICAgICAgICAgICByZXR1cm4gMFxuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gdGhpcy5zdWJtaXRSZXF1ZXN0KFxuICAgICAgICAgICAgJ1BPU1QnLFxuICAgICAgICAgICAgJy9hcGkvaGlzV3JpdGUnLFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIG1ldGE6IHt2ZXI6ICcyLjAnfSxcbiAgICAgICAgICAgICAgICBjb2xzOiBvdXRDb2xzLFxuICAgICAgICAgICAgICAgIHJvd3M6IHJvd3NcbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICpcbiAgICAgKiBAcGFyYW0gaWQgKHN0cmluZykgSWRlbnRpZmllciBvZiB0aGUgb2JqZWN0IHBvaW50LlxuICAgICAqIEBwYXJhbSB0cyAoc3RyaW5nKSBUaW1lc3RhbXAgd2hpY2ggdGhlIHVwbG9hZCB3aWxsIHBlcmZvcm0gYWdhaW5zdCB0aGUgb2JqZWN0IHBvaW50LlxuICAgICAqIEBwYXJhb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tZG93bmxvYWRpbmcgaXQgYWdhaW4uXG4gICAgICogQHBhcmFtIGZvcmNlIChib29sZWFuKSBPcHRpb25hbC4gV2hlbiB0cnVlLCB0aGUgc2VydmVyIHdpbGwgZm9yY2VmdWxseSBvdmVyd3JpdGUgYSBwcmV2aW91c2x5IHN0b3JlZCBmaWxlIHRoYXQgc2hhcmVzXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICB0aGUgc2FtZSBnaXZlbiB0cy4gRGVmYXVsdCBpcyBmYWxzZS5cbiAgICAgKiBAcGFyYW0gdGFncyAob2JqZWN0KSBPcHRpb25hbC4gQW4gb2JqZWN0IGNvbnNpc3Rpbmcgb2YgYWRkaXRpb25hbCBmaWxlIHRhZ3MgdGhhdCB3aWxsIGdvIHdpdGggdGhlIHVwbG9hZC5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICBLZXkgb2YgdGhlIG9iamVjdCBpcyB0aGUgdGFnTmFtZSB3aGlsZSB2YWx1ZSBpcyBpdHMgdGFnVmFsdWUuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgRS5nLiB7ICdVcGxvYWRlZEJ5JzogJ0F1dGhvckFCQyd9XG4gICAgICovXG4gICAgZmlsZVVwbG9hZCAoaWQsXG4gICAgICAgICAgICAgICAgdHMsXG4gICAgICAgICAgICAgICAgZmlsZSxcbiAgICAgICAgICAgICAgICBmaWxlbmFtZSxcbiAgICAgICAgICAgICAgICBtZWRpYVR5cGUsXG4gICAgICAgICAgICAgICAgaW5saW5lUmV0cmlldmFsPXRydWUsXG4gICAgICAgICAgICAgICAgY2FjaGVNYXhBZ2U9MTgwMCwgICAgICAgLy8gMzAgbWludXRlc1xuICAgICAgICAgICAgICAgIGZvcmNlPWZhbHNlLFxuICAgICAgICAgICAgICAgIHRhZ3M9e30pIHtcblxuICAgICAgICBpZiAodHlwZW9mIGZpbGUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAvLyBBc3N1bWUgYW4gYWJzb2x1dGUgZml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gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignQ2FjaGVNYXhBZ2UgbXVzdCBiZSBtb3JlIHRoYW4gb3IgZXF1YWxzIHRvIDAuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIHRhZ3MgIT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFRhZ3MgbXVzdCBiZSBhbiBvYmplY3Qgbm90ICR7dHlwZW9mIHRhZ3N9LmApO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgcmVxdWVzdFRhZ3MgPSBbXTtcblxuICAgICAgICBjb25zdCB0YWdLZXlzID0gT2JqZWN0LmtleXModGFncyk7XG4gICAgICAgIGZvciAobGV0IGluZGV4ID0gMDsgaW5kZXggPCB0YWdLZXlzLmxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAgY29uc3QgdGFnS2V5ID0gdGFnS2V5c1tpbmRleF07XG4gICAgICAgICAgICBjb25zdCB0YWdWYWwgPSB0YWdzW3RhZ0tleV07XG5cbiAgICAgICAgICAgIGlmICh0eXBlb2YgdGFnVmFsICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVGFnIHZhbHVlIGZvciBrZXkgJyArIHRhZ0tleSArICcgbXVzdCBiZSBzdHJpbmcuJyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJlcXVlc3RUYWdzLnB1c2goYCR7dGFnS2V5fT0ke3RhZ1ZhbH1gKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBjb250ZW50RGlzcG9zaXRpb24gPSBpbmxpbmVSZXRyaWV2YWwgPyAnaW5saW5lJzogJ2F0dGFjaG1lbnQnO1xuICAgICAgICBpZiAoIWlubGluZVJldHJpZXZhbCAmJiBmaWxlbmFtZSkge1xuICAgICAgICAgICAgLy8gZS5nLiBhdHRhY2htZW50OyBmaWxlbmFtZ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gICAgICAgICAgICAgIGZvcm1EYXRhLmFwcGVuZChrZXksIHZhbHVlLCB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGVuYW1lLFxuICAgICAgICAgICAgICAgICAgICAnY29udGVudFR5cGUnOiBtZWRpYVR5cGVcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGZvcm1EYXRhLmFwcGVuZChrZXksIHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLnN1Ym1pdFJlcXVlc3QoXG4gICAgICAgICAgICAnUFVUJyxcbiAgICAgICAgICAgICcvYXBpL2ZpbGUvc3RvcmFnZScsXG4gICAgICAgICAgICBmb3JtRGF0YSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnbXVsdGlwYXJ0L2Zvcm0tZGF0YSdcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmV0cmlldmUgYSBwcmV2aW91c2x5IHN0b3JlZCBmaWxlIHRoZSBjb25maWd1cmVkIFdpZGVTa3kgc2VydmVyLlxuICAgICAqIFRoaXMgQVBJIHdpbGwgcmV0dXJuIGFuIG9iamVjdCBrZXllZCBieSB0aGUgcmVxdWVzdGVkIHBvaW50IGlkcyxcbiAgICAgKiB3aGVyZSB0aGUgdmFsdWUgaXMgYW4gYXJyYXkgb2YgZmlsZSBVUkxzIHdoaWNoIGNhbiBiZSB1c2VkIHRvIHJldHJpZXZlXG4gICAgICogdGhlIGZpbGUgZGF0YSB2aWEgdGhlIEhUVFAgR0VUIG1ldGhvZC5cbiAgICAgKlxuICAgICAqIERhdGUgaW5wdXRzIGZvciB0aGlzIGZ1bmN0aW9uIGlzIHR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KiAgICAgICAgIHVybHM6IFtcbiAgICAgKiAgICAgICAgICAgICB0aW1lOiAyMDg3OTExODAwLFxuICAgICAqICAgICAgICAgICAgIHZhbHVlOiBodHRwczovL2FiYy5vbi53aWRlc2t5LmNsb3VkL2FwaS9maWxlL3N0b3JhZ2UvMjA4NzkxMTgwMF96eGN2Ym4uLi5cbiAgICAgKiAgICAgICAgIF1cbiAgICAgKiAgICAgfVxuICAgICAqIF1cbiAgICAgKi9cbiAgICBmaWxlUmV0cmlldmUocG9pbnRJZHMsIGZyb20sIHRvLCBwcmVzaWduZWQ9dHJ1ZSwgcHJlc2lnbkV4cGlyeT0xODAwKSB7XG4gICAgICAgIGlmICghKEFycmF5LmlzQXJyYXkocG9pbnRJZHMpKSkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBwb2ludElkcyAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFBvaW50IGlkICR7cG9pbnRJZHN9IG11c3QgYmUgYSBzdHJpbmcuYCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHBvaW50SWRzID0gW3BvaW50SWRzXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGZvciAobGV0IGluZGV4ID0gMDsgaW5kZXggPCBwb2ludElkcy5sZW5ndGg7IGluZGV4KyspIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBvaW50SWRzW2luZGV4XSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdQb2ludCBpZCAnICsgcG9pbnRJZHNbaW5kZXhdICsgJyBtdXN0IGJlIHN0cmluZy4nKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBtRnJvbSA9IG1vbWVudChmcm9tKTtcbiAgICAgICAg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XcgRXJyb3IoJ1ByZXNpZ25FeHBpcnkgdmFsdWUgJyArIHByZXNpZ25FeHBpcnkgKyAnIG11c3QgYmUgYSBudW1iZXInKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHByZXNpZ25FeHBpcnkgPCAwKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdQcmVzaWduRXhwaXJ5IHZhbHVlICcgKyBwcmVzaWduRXhwaXJ5ICsgJyBtdXN0IGJlIGdyZWF0ZXIgdGhhbiB6ZXJvLicpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuc3VibWl0UmVxdWVzdChcbiAgICAgICAgICAgICdHRVQnLFxuICAgICAgICAgICAgJy9hcGkvZmlsZS9zdG9yYWdlJyxcbiAgICAgICAgICAgIHt9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHBhcmFtczoge1xuICAgICAgICAgICAgICAgICAgICBwb2ludElkczogSlNPTi5zdHJpbmdpZnkocG9pbnRJZHMpLFxuICAgICAgICAgICAgICAgICAgICBmcm9tOiBtRnJvbS51dGMoKS5mb3JtYXQoTU9NRU5UX0ZPUk1BVF9NU19QUkVDSVNJT04pLFxuICAgICAgICAgICAgICAgICAgICB0bzogbVRvLnV0YygpLmZvcm1hdChNT01FTlRfRk9STUFUX01TX1BSRUNJU0lPTiksXG4gICAgICAgICAgICAgICAgICAgIHByZXNpZ25lZDogcHJlc2lnbmVkLnRvU3RyaW5nKCksXG4gICAgICAgICAgICAgICAgICAgIHByZXNpZ25FeHBpcnk6IHByZXNpZ25FeHBpcnkudG9TdHJpbmcoKVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBJbml0aWF0ZSBhIGhheXN0YWNrIHdhdGNoU3ViIG9wIGJhc2VkIG9uIHRoZSBnaXZlbiBsaXN0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bn1gLFxuICAgICAgICAgICAgICAgICAgICBsZWFzZTogbGVhc2VcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIGNvbHM6IFtcbiAgICAgICAgICAgICAgICAgICAge25hbWU6ICdpZCd9XG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICByb3dzOiByb3dzXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY29uZmlnXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogSW5pdGlhdGUgYSBoYXlzdGFjayB3YXRjaFN1YiBvcCB0byBleHRlbmQgYSB3YXRjaCBnaXZlbiB0aGUgd2F0Y2hJZFxuICAgICAqIGFuZCBsZWFzZS5cbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gd2F0Y2hJZCBJRCBvZiB0aGUgb3BlbmVkIHdhdGNoLlxuICAgICAqIEBwYXJhbSB7Kn0gcG9pbnRJZHMgU3RyaW5nIG9yIEFycmF5LiBUaGUgcG9pbnRzLlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSBsZWFzZSBEdXJhdGlvbiAobXMpIHRoZSB3YXRjaCB3YXMgY3JlYXRlZCB3aXRoLlxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBjb25maWcgQ29uZmlndXJhdGlvbiBvcHRpb25zIHVzZWQgaW4gYHN1Ym1pdFJlcXVlc3QoKWBcbiAgICAgKiBAcmV0dXJucyBQcm9taXNlXG4gICAgICovXG4gICAgd2F0Y2hFeHRlbmQod2F0Y2hJZCwgcG9pbnRJZHMsIGxlYXNlLCBjb25maWcgPSB7fSkge1xuICAgICAgICBpZiAoIShBcnJheS5pc0FycmF5KHBvaW50SWRzKSkpIHtcbiAgICAgICAgICAgIHBvaW50SWRzID0gW3BvaW50SWRzXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IHJvd3MgPSBwb2ludElkcy5tYXAoKGlkKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4ge2lkOiBgcjoke2lkfWB9O1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gdGhpcy5zdWJtaXRSZXF1ZXN0KFxuICAgICAgICAgICAgJ1BPU1QnLFxuICAgICAgICAgICAgJy9hcGkvd2F0Y2hTdWInLFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIG1ldGE6IHtcbiAgICAgICAgICAgICAgICAgICAgdmVyOiAnMi4wJyxcbiAgICAgICAgICAgICAgICAgICAgd2F0Y2hJZDogYHM6JHt3YXRjaElkfWAsXG4gICAgICAgICAgICAgICAgICAgIGxlYXNlOiBsZWFzZVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgY29sczogW3tuYW1lOiAnaWQnfV0sXG4gICAgICAgICAgICAgICAgcm93czogcm93c1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNvbmZpZ1xuICAgICAgICApO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEluaXRpYXRlIGEgd2F0Y2hVbnN1YiBvcCB1c2luZyB0aGUgZ2l2ZW4gd2F0Y2hJZC5cbiAgICAgKiBJZiBkZWxldGVQb2ludElkcyBpcyBzZXQsIHRoZW4gdGhlIGxpc3RlZCBwb2ludHMgd2lsbCBiZSByZW1vdmVkXG4gICAgICogZnJvbSB0aGUgd2F0Y2guXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IHdhdGNoSWQgSUQgb2YgdGhlIG9wZW5lZCB3YXRjaC5cbiAgICAgKiBAcGFyYW0geyp9IGRlbGV0ZVBvaW50SWRzIFN0cmluZyBvciBBcnJheS4gVGhlIHBvaW50cyB0byBiZSBkZWxldGVkLlxuICAgICAqIEBwYXJhbSB7Ym9vbGVhbn0gY2xvc2UgSWYgdHJ1ZSwgdGhlIHdhdGNoIHNlc3Npb24gd2lsbCBiZSBjbG9zZWQuXG4gICAgICogQHBhcmFtIHtPYmplY3R9IGNvbmZpZyBDb25maWd1cmF0aW9uIG9wdGlvbnMgdXNlZCBpbiBgc3VibWl0UmVxdWVzdCgpYFxuICAgICAqIEByZXR1cm5zIFByb21pc2VcbiAgICAgKi9cbiAgICB3YXRjaFVuc3ViKHdhdGNoSWQsIGRlbGV0ZVBvaW50SWRzLCBjbG9zZSA9IHRydWUsIGNvbmZpZyA9IHt9KSB7XG4gICAgICAgIGlmICghKEFycmF5LmlzQXJyYXkoZGVsZXRlUG9pbnRJZHMpKSkge1xuICAgICAgICAgICAgZGVsZXRlUG9pbnRJZHMgPSBbZGVsZXRlUG9pbnRJZHNdO1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgcGF5bG9hZCA9IHtcbiAgICAgICAgICAgIG1ldGE6IHtcbiAgICAgICAgICAgICAgICB2ZXI6ICcyLjAnLFxuICAgICAgICAgICAgICAgIHdhdGNoSWQ6IGBzOmAgKyB3YXRjaElkLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNvbHM6IFtdLFxuICAgICAgICAgICAgcm93czogW11cbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoZGVsZXRlUG9pbnRJZHMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgcGF5bG9hZC5jb2xzLnB1c2goe25hbWU6ICdpZCd9KTtcblxuICAgICAgICAgICAgZm9yIChsZXQgaW5kZXggPSAwOyBpbmRleCA8IGRlbGV0ZVBvaW50SWRzLmxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAgICAgIHBheWxvYWQucm93cy5wdXNoKHtpZDogJ3I6JyArIGRlbGV0ZVBvaW50SWRzW2luZGV4XX0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcGF5bG9hZC5jb2xzLnB1c2goe25hbWU6ICdlbXB0eSd9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjbG9zZSkge1xuICAgICAgICAgICAgcGF5bG9hZC5tZXRhWydjbG9zZSddID0gJ206JztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aG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nKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFZhbGlkYXRlIHRoZSByYW5nZVxuICAgICAgICBjb25zdCByYW5nZV9lcnIgPSAnQW4gaW52YWxpZCBoaXNSZWFkIHJhbmdlIGlucHV0IHdhcyBnaXZlbjogJztcbiAgICAgICAgaWYgKCFyYW5nZS5zdGFydHNXaXRoKCdzOicpKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IocmFuZ2VfZXJyICsgJ01pc3NpbmcgYHM6YC4nKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IHJhbmdlX3ZhbCA9IHJhbmdlLnJlcGxhY2UoJ3M6JywgJycpO1xuICAgICAgICBpZiAocmFuZ2VfdmFsID09PSAnJykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKHJhbmdlX2VyciArICdObyByYW5nZSB3YXMgZ2l2ZW4uJyk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIShyYW5nZV92YWwgPT09ICdsYXN0JyB8fFxuICAgICAgICAgICAgICByYW5nZV92YWwgPT09ICdmaXJzdCcgfHxcbiAgICAgICAgICAgICAgcmFuZ2VfdmFsID09PSAndG9kYXknIHx8XG4gICAgICAgICAgICAgIHJhbmdlX3ZhbCA9PT0gJ3llc3RlcmRheScpKSB7XG5cbiAgICAgICAgICAgIGlmIChyYW5nZV92YWwuaW5jbHVkZXMoJywnKSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJhbmdlcyA9IHJhbmdlX3ZhbC5zcGxpdCgnLCcpO1xuXG4gICAgICAgICAgICAgICAgLy8gU2hvdWxkIG5vdCBiZSBtb3JlIG9yIGxlc3MgdGhhbiAyIGRhdGUodGltZSkgdmFsdWVzIGluIGEgcmFuZ2UuXG4gICAgICAgICAgICAgICAgaWYgKHJhbmdlcy5sZW5ndGggIT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKHJhbmdlX2VyciArICdOdW1iZXIgb2YgdGltZXN0YW1wcyBjYW5ub3QgZXhjZWVkIDIuJyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCB0cyBpbiByYW5nZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJhbmdlc1t0c10uaW5jbHVkZXMoJyAnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2VzW3RzXSA9IHJhbmdlc1t0c10udHJpbVN0YXJ0KCkuc3BsaXQoJyAnKVswXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIW1vbWVudChyYW5nZXNbdHNdLnRyaW0oKSwgbW9tZW50LklTT184NjAxKS5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihyYW5nZV9lcnIgKyAnSW52YWxpZCBJU084NjAxIHRpbWVzdGFtcC4nKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoIW1vbWVudChyYW5nZV92YWwsIG1vbWVudC5JU09fODYwMSkuaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihyYW5nZV9lcnIgKyAnSW52YWxpZCBJU084NjAxIHRpbWVzdGFtcC4nKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBOb3JtYWxpc2UgdGhlIElEcyBpbnRvIHN0YW5kYXJkIGZvcm1cbiAgICAgICAgaWRzID0gaWRzLm1hcChmdW5jdGlvbiAoaWQpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgZGF0YS5SZWYoaWQpLnRvSFNKU09OKCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIC8vIEJ1aWxkIHJlcXVlc3QgYm9keVxuICAgICAgICBjb25zdCBwYXlsb2FkID0ge1xuICAgICAgICAgICAgbWV0YToge1xuICAgICAgICAgICAgICAgIHZlcjogJzIuMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY29sczogW1xuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogJ3JhbmdlJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHJvd3M6IFtcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIHJhbmdlOiByYW5nZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgXSxcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoaWRzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgcGF5bG9hZC5yb3dzWzBdLmlkID0gbmV3IGRhdGEuUmVmKGlkc1swXSkudG9IU0pTT04oKTtcbiAgICAgICAgICAgIHBheWxvYWQuY29scy5wdXNoKHtuYW1lOiAnaWQnfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZHMuZm9yRWFjaCgoaWQsIGlkeCkgPT4ge1xuICAgICAgICAgICAgICAgIHBheWxvYWQucm93c1swXVsnaWQnICsgaWR4XSA9IG5ldyBkYXRhLlJlZihpZCkudG9IU0pTT04oKTtcbiAgICAgICAgICAgICAgICBwYXlsb2FkLmNvbHMucHVzaCh7bmFtZTogJ2lkJyArIGlkeH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5zdWJtaXRSZXF1ZXN0KCdQT1NUJywgJy9hcGkvaGlzRGVsZXRlJywgcGF5bG9hZCwge30pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEdldCB0aGUgbnVtYmVyIG9mIGVudGl0aWVzIHRvIGJlIHJldHVybmVkIGZyb20gYSBmaWx0ZXIuXG4gICAgICogQHBhcmFtIGZpbHRlciBGaWx0Z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YXNNb3JlOiAoZnVuY3Rpb24oKTogYm9vbGVhbiksIGdldE5leHR9fVxuICovXG5mdW5jdGlvbiBjcmVhdGVCYXRjaEl0ZXJhdG9yKG9wLCBwYXlsb2FkLCBjbGllbnRBcmdzLCBiYXRjaFNpemUsIHRyYW5zZm9ybWVyKSB7XG4gICAgbGV0IGhhc01vcmUsIGdldE5leHQsIHAxO1xuICAgIGlmIChBcnJheS5pc0FycmF5KHBheWxvYWQpKSB7XG4gICAgICAgIGdldE5leHQgPSAoKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBuZXh0ID0gcGF5bG9hZC5zcGxpY2UoMCwgYmF0Y2hTaXplKTtcbiAgICAgICAgICAgIGlmIChvcCA9PT0gXCJoaXNEZWxldGVcIikge1xuICAgICAgICAgICAgICAgIC8vIHNwZWNpYWwgY2FzZSBkdWUgdG8gdGhlIGFyZ3VtZW50cyByZXF1aXJlZFxuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQ6IHRyYW5zZm9ybWVyKG5leHQpLFxuICAgICAgICAgICAgICAgICAgICBzaXplOiBuZXh0Lmxlbmd0aFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQ6IFt0cmFuc2Zvcm1lcihuZXh0KSwgLi4uY2xpZW50QXJnc10sXG4gICAgICAgICAgICAgICAgICAgIHNpemU6IG5leHQubGVuZ3RoXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgaGFzTW9yZSA9ICgpID0+IHBheWxvYWQubGVuZ3RoID4gMDtcblxuICAgICAgICBpZiAodGhpcy5pc1Byb2dyZXNzRW5hYmxlZCkge1xuICAgICAgICAgICAgcDEgPSB0aGlzLnByb2dyZXNzQ3JlYXRlKHBheWxvYWQubGVuZ3RoKTtcbiAgICAgICAg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AgICAgICAgICAgICAgaWYgKGtleVZhbHVlUmVtYWluaW5nW2N1cnJLZXlJbmRleF0gPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gYWxsIGRhdGEgZmV0Y2hlZCBmcm9tIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgY3VycktleUluZGV4Kys7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnN0IGN1cnJLZXkgPSBwYXlsb2FkS2V5c1tjdXJyS2V5SW5kZXhdO1xuICAgICAgICAgICAgICAgIGNvbnN0IGN1cnJLZXlFbnRyaWVzID0gT2JqZWN0LmVudHJpZXMocGF5bG9hZFtjdXJyS2V5XSk7XG4gICAgICAgICAgICAgICAgY29uc3Qga2V5UmVtYWluaW5nID0ga2V5VmFsdWVSZW1haW5pbmdbY3VycktleUluZGV4XTtcbiAgICAgICAgICAgICAgICBjb25zdCBrZXlNYXggPSBrZXlWYWx1ZUxlbmd0aFtjdXJyS2V5SW5kZXhdXG4gICAgICAgICAgICAgICAgY29uc3Qga2V5VmFsdWVTdGFydEZyb20gPSBrZXlNYXggLSBrZXlSZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJLZXlFbnRyaWVzLmxlbmd0aCA+IChiYXRjaFNpemUgLSB0b3RhbFJvd3MpIHx8IGtleVZhbHVlU3RhcnRGcm9tICE9PSBPYmplY3Qua2V5cyhwYXlsb2FkW2N1cnJLZXldKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gdGFrZSBwYXJ0IG9mIHRoZSBzZXQgdGhhdCBkb2Vzbid0IGV4Y2VlZCB0aGUgY3VycmVudCBiYXRjaCBzaXplXG4gICAgICAgICAgICAgICAgICAgIGlmIChuZXh0W2N1cnJLZXldID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHRbY3VycktleV0gPSB7fTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCB0YWtlbiA9IDA7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhcnRUYWtlID0gYmF0Y2hTaXplIC0gdG90YWxSb3dzO1xuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0ga2V5VmFsdWVTdGFydEZyb207IGkgLSBrZXlWYWx1ZVN0YXJ0RnJvbSA8IHBhcnRUYWtlICYmIGkgPCBrZXlNYXg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dFtjdXJyS2V5XVtjdXJyS2V5RW50cmllc1tpXVswXV0gPSBjdXJyS2V5RW50cmllc1tpXVsxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRha2VuKys7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAga2V5VmFsdWVSZW1haW5pbmdbY3VycktleUluZGV4XSAtPSB0YWtlbjtcbiAgICAgICAgICAgICAgICAgICAgdG90YWxSb3dzICs9IHRha2VuO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHRbY3VycktleV0gPSBwYXlsb2FkW2N1cnJLZXldO1xuICAgICAgICAgICAgICAgICAgICBrZXlWYWx1ZVJlbWFpbmluZ1tjdXJyS2V5SW5kZXhdID0gMDtcbiAgICAgICAgICAgICAgICAgICAgdG90YWxSb3dzICs9IGN1cnJLZXlFbnRyaWVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgY3VycktleUluZGV4Kys7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIG5leHQ6IFt0cmFuc2Zvcm1lcihuZXh0KSwgLi4uY2xpZW50QXJnc10sXG4gICAgICAgICAgICAgICAgc2l6ZTogdG90YWxSb3dzXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICA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gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBkYXRhLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIGNvbnN0IHJlcyA9IGRhdGFbaV07XG4gICAgICAgIGlmIChpZHMubGVuZ3RoID09PSAxIHx8IG9wdGlvbnMuYmF0Y2hTaXplID09PSAxKSB7XG4gICAgICAgICAgICByZXN1bHRCeUVudGl0eVtpXSA9IHJlcy5yb3dzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFpc1Jvd3NTb3J0ZWQocmVzLnJvd3MpKSB7XG4gICAgICAgICAgICAgICAgLy8gaXNzdWVzIGZvdW5kIHdpdGggcm93cyBub3QgYmVpbmcgc29ydGVkIGJ5IHRoZWlyIHJlc3BlY3RpdmUgdGltZSBzdGFtcFxuICAgICAgICAgICAgICAgIC8vIHdoZW4gZG9pbmcgbXVsdGkgaGlzUmVhZC4gTm90IGEgY29tbW9uIHVzZSBzY2VuYXJpbyBidXQgdGhpcyBhbiBleHBlY3RhdGlvbiBmb3IgYWxsXG4gICAgICAgICAgICAgICAgLy8gZnVuY3Rpb24gdGhhdCB1c2UgV2lkZVNreUNsaWVudC5iYXRjaC5oaXNSZWFkXG4gICAgICAgICAgICAgICAgcmVzLnJvd3Muc29ydCgocm93QSwgcm93QikgPT4ge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCB0aW1lQSA9IERhdGUucGFyc2UoSHMucmVtb3ZlUHJlZml4KHJvd0EudHMpKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdGltZUIgPSBEYXRlLnBhcnNlKEhzLnJlbW92ZVByZWZpeChyb3dCLnRzKSk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVBID4gdGltZUIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAxO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRpbWVBIDwgdGltZUIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvciAoY29uc3Qgcm93IG9mIHJlcy5yb3dzKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgeyB0cyB9ID0gcm93O1xuICAgICAgICAgICAgICAgIGZvciAoY29uc3QgW3ZJZCwgdmFsXSBvZiBPYmplY3QuZW50cmllcyhyb3cpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh2SWQgPT09IFwidHNcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBjb25zdCBpbmRleCA9IE51bWJlcih2SWQuc2xpY2UoMSkpO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRCeUVudGl0eVtpbmRleF0ucHVzaCh7dHMsIHZhbH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICAgIHN1Y2Nlc3M6IHJlc3VsdEJ5RW50aXR5LFxuICAgICAgICBlcnJvcnM6IGVycm9yc1xuICAgIH07XG59XG5cbi8qKlxuICogRmluZCB0aGUgbnVtYmVyIG9mIHJvd3MgYmV0d2VlbiB0aGUgZ2l2ZW4gdGltZXMgdGltZVN0YXJ0IGFuZCB0aW1lRW5kLlxuICogQHBhcmFtIGRhdGEgRGF0YSB0byBzZWFyY2ggd2l0aGluLlxuICogQHBhcmFtIHRpbWVTdGFydCBTdGFydGluZyBlcG9jaCB0aW1lIHJhbmdlLlxuICogQHBhcmFtIHRpbWVFbmQgRW5kaW5nIGVwb2NoIHRpbWUgcmFuZ2UuXG4gKiBAcmV0dXJucyB7bnVtYmVyfSBOdW1i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3dDb3VudHM7XG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzb3J0QnlSYW5nZS5sZW5ndGg7IGkrKykge1xuICAgICAgICBpZiAoY3VyTWF4ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGVuZFJhbmdlID0gc29ydEJ5UmFuZ2VbaV07XG4gICAgICAgICAgICBkZWxldGVSb3dDb3VudHMgPSBkYXRhU2V0XG4gICAgICAgICAgICAgICAgLm1hcCgoZGF0YSkgPT4gcm93c0JldHdlZW5SYW5nZShkYXRhLCBncmFiRnJvbSwgc29ydEJ5UmFuZ2VbaV0pKTtcbiAgICAgICAgICAgIGN1ck1heCA9IE1hdGgubWF4KC4uLmRlbGV0ZVJvd0NvdW50cyk7XG4gICAgICAgICAgICBpZiAoY3VyTWF4ID4gYmF0Y2hTaXplKSB7XG4gICAgICAgICAgICAgICAgLy8gdGhpcyBhaW4ndCBpdCBjaGllZlxuICAgICAgICAgICAgICAgIGN1ck1heCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY3VyTWF4ID09PSBiYXRjaFNpemUpIHtcbiAgICAgICAgICAgICAgICAvLyBhbHJlYWR5IGF0IG1heGltdW0gYmF0Y2ggc2l6ZVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IGdldERhdGFDb3VudCA9IGRhdGFTZXQubWFwKChkYXRhKSA9PlxuICAgICAgICAgICAgcm93c0JldHdlZW5SYW5nZShkYXRhLCBncmFiRnJvbSwgc29ydEJ5UmFuZ2VbaV0pKTtcbiAgICAgICAgY29uc3QgbWF4RGF0YUNvdW50ID0gTWF0aC5tYXgoLi4uZ2V0RGF0YUNvdW50KTtcbiAgICAgICAgaWYgKG1heERhdGFDb3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GEgPSBbXTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChkYXRhW2ldLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgICBuZXdJZHMucHVzaChpZHNJbkJhdGNoW2ldKTtcbiAgICAgICAgICAgICAgICAgICAgbmV3RGF0YS5wdXNoKGRhdGFbaV0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGRhdGEgPSBuZXdEYXRhO1xuICAgICAgICAgICAgaWRzSW5CYXRjaCA9IG5ld0lkcztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpZHNJbkJhdGNoLmxlbmd0aCA9PT0gMCB8fCBkYXRhLmZpbHRlcigoZGF0YVNldCkgPT4gZGF0YVNldC5sZW5ndGggPiAwKS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIC8vIG5vIGRhdGEgdG8gZGVsZXRlXG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNyZWF0ZVRpbWVSYW5nZXMoXG4gICAgICAgICAgICBkYXRhLFxuICAgICAgICAgICAgaWRzSW5CYXRjaCxcbiAgICAgICAgICAgIGJhdGNoZXNbaV0sXG4gICAgICAgICAgICBiYXRjaFNpemUsXG4gICAgICAgICAgICBmaW5kU3RhcnRUaW1lKGRhdGEpLFxuICAgICAgICAgICAgdGltZUVuZFxuICAgICAgICApO1xuICAgIH1cblxuICAgIGlmIChiYXRjaGVzLmZpbHRlcigoaWRCYXRjaCkgPT4gaWRCYXRjaC5sZW5ndGggPiAwKS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHN1Y2Nlc3M6IFtdLFxuICAgICAgICAgICAgZXJyb3JzOiBlcnJvcnNFbmNvdW50ZXJlZFxuICAgICAgICB9O1xuICAgIH1cblxuICAgI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KTtcbiAgICBvcHRpb25zID0gZGVyaXZlRnJvbURlZmF1bHRzKHRoaXMuY2xpZW50T3B0aW9ucy5iYXRjaC5hZGRDaGlsZHJlbkJ5RmlsdGVyLCBvcHRpb25zKTtcbiAgICBjb25zdCB7IGxpbWl0IH0gPSBvcHRpb25zO1xuXG4gICAgY29uc3QgcGFyZW50cyA9IGF3YWl0IHRoaXMudjIuZmluZChmaWx0ZXIsIGxpbWl0KTtcbiAgICBjb25zdCBjcmVhdGVQYXlsb2FkID0gW107XG4gICAgZm9yIChjb25zdCBwYXJlbnQgb2YgcGFyZW50cykge1xuICAgICAgICBmb3IgKGNvbnN0IGNoaWxkIG9mIEpTT04ucGFyc2UoSlNPTi5zdHJpbmdpZnkoY2hpbGRyZW4pKSkge1xuICAgICAgICAgICAgbGV0IGFkZGVkID0gZmFsc2U7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IFt0YWdPZlBhcmVudCwgdG9UYWdPbkNoaWxkXSBvZiB0YWdNYXApIHtcbiAgICAgICAgICAgICAgICBpZiAocGFyZW50W3RhZ09mUGFyZW50XSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGFkZGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgY2hpbGRbdG9UYWdPbkNoaWxkXSA9IHBhcmVudFt0YWdPZlBhcmVudF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoYWRkZWQpIHtcbiAgICAgICAgICAgICAgICBjcmVhdGVQYXlsb2FkLnB1c2goY2hpbGQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGNyZWF0ZVBheWxvYWQubGVuZ3RoID4gMCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wZXJmb3JtT3BJbkJhdGNoKFxuICAgICAgICAgICAgXCJjcmVhdGVcIixcbiAgICAgICAgICAgIFtjcmVhdGVQYXlsb2FkXSxc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J5XCIsXG4gICAgICAgIFtxdWVyaWVzXSxcbiAgICAgICAge1xuICAgICAgICAgICAgLi4ub3B0aW9ucyxcbiAgICAgICAgICAgIHJldHVyblJlc3VsdDogdHJ1ZSxcbiAgICAgICAgICAgIHRyYW5zZm9ybWVyXG4gICAgICAgIH1cbiAgICApXG5cbiAgICAvLyBwYXJzZSB0aGUgYmF0Y2hlZCByZXN1bHRzXG4gICAgY29uc3QgcGFyc2VkUmVzdWx0ID0gW107XG4gICAgZm9yIChjb25zdCByZXMgb2Ygc3VjY2Vzcykge1xuICAgICAgICBmb3IgKGNvbnN0IGZpbHRlciBvZiBPYmplY3QudmFsdWVzKHJlcy5kYXRhLmhheXN0YWNrKSkge1xuICAgICAgICAgICAgY29uc3QgZmlsdGVyUmVzdWx0ID0gW107XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGVudGl0eSBvZiBmaWx0ZXIuZW50aXR5KSB7XG4gICAgICAgICAgICAgICAgY29uc3QgbmV3RW50aXR5ID0ge307XG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCB7bmFtZSwgdmFsdWUsIGtpbmRWYWx1ZX0gb2YgZW50aXR5LnRhZ3MpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGtpbmRUeXBlID0gXCJaZXJvXCI7XG4gICAgICAgICAgICAgICAgICAgIGlmIChraW5kVmFsdWUgIT09IG51bGwgJiYga2luZFZhbHVlICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGtpbmRUeXBlID0ga2luZFZhbHVlW1wiX190eXBlbmFtZVwiXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuZXdFbnRpdHlbbmFtZV0gPSBIcy50b0hheXN0YWNrKHZhbHVlLCBraW5kVHlwZSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZmlsdGVyUmVzdWx0LnB1c2gobmV3RW50aXR5KTtcbiAgICAgICAgICAgIH1cblxuIC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m9yIGVudGl0eSAlcy5cIiwgdGFnLCB2YWx1ZSwgbmV3RW50aXR5LmlkKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG9sZEVudGl0eVt0YWddID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHVwZGF0ZVBheWxvYWRbdGFnXSA9IHZhbHVlO1xuICAgICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkodmFsdWUpICYmIEFycmF5LmlzQXJyYXkob2xkRW50aXR5W3RhZ10pKSB7XG4gICAgICAgICAgICBpZiAodmFsdWUubGVuZ3RoICE9PSBvbGRFbnRpdHlbdGFnXS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAvLyBOb3QgdGhlIHNhbWUsIG5vIG5lZWQgdG8gdmVyaWZ5XG4gICAgICAgICAgICAgICAgdXBkYXRlUGF5bG9hZFt0YWddID0gdmFsdWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIHZlcmlmeSBsaXN0IGNoYW5nZXNcbiAgICAgICAgICAgIGxldCBpc0RpZmZlcmVudCA9IGZhbHNlO1xuICAgICAgICAgICAgZm9yIChjb25zdCBpdGVtIG9mIHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCEob2xkRW50aXR5W3RhZ10uaW5jbHVkZXMoaXRlbSkpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlzRGlmZmVyZW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoaXNEaWZmZXJlbnQpIHtcbiAgICAgICAgICAgICAgICB1cGRhdGVQYXlsb2FkW3RhZ10gPSB2YWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChvbGRFbnRpdHlbdGFnXSAhPT0gdmFsdWUpIHtcbiAgICAgICAgICAgIG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4gICAgICAgICAgICBpZHNGaWx0ZXIucHVzaChbYGlkPT1AJHtIcy5nZXRJZChlbnRpdHkpfWAsIDFdKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBjb25zdCB7XG4gICAgICAgIHN1Y2Nlc3M6IGN1cnJlbnRFbnRpdGllcyxcbiAgICAgICAgZXJyb3JzOiBmaW5kRXJyb3JzXG4gICAgfSA9IGF3YWl0IHRoaXMuYmF0Y2gubXVsdGlGaW5kKGlkc0ZpbHRlcik7XG4gICAgaWYgKGZpbmRFcnJvcnMubGVuZ3RoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBzdWNjZXNzOiBbXSxcbiAgICAgICAgICAgIGVycm9yczogZmluZEVycm9yc1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZW50aXRpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgaWYgKHNraXBJbmRleFtpXSkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBlbnRpdHkgPSBlbnRpdGllc1tpXTtcbiAgICAgICAgY29uc3QgZXhpc3RpbmdFbnRpdHkgPSBjdXJyZW50RW50aXRpZXNbaV1bMF07XG5cbiAgICAgICAgaWYgKGV4aXN0aW5nRW50aXR5ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGNyZWF0ZVBheWxvYWQucHVzaChlbnRpdHkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29uc3QgZW50aXR5VXBkYXRlID0gY3JlYXRlVXBkYXRlUGF5bG9hZChleGlzdGluZ0VudGl0eSwgZW50aXR5LCB0aGlzLmxvZ2dlcik7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMoZW50aXR5VXBkYXRlKS5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAgICAgdXBkYXRlUGF5bG9hZC5wdXNoKGVudGl0eVVwZGF0ZSk7XG4gICAg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JzZSh2YWx1ZSkge1xuICAgIGlmICgodmFsdWUgPT09IG51bGwpIHx8ICh0eXBlb2YodmFsdWUpID09PSAnYm9vbGVhbicpKSB7XG4gICAgICAgIC8qIFJhdyB0eXBlcyAqL1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfSBlbHNlIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIC8qIENhdGNoIGFuZCBoYW5kbGUgbnVsbCB0eXBlICovXG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH0gZWxzZSBpZiAodHlwZW9mKHZhbHVlKSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgcmV0dXJuIF9wYXJzZVN0cmluZyh2YWx1ZSk7XG4gICAgfSBlbHNlXG4gICAgLyogTm90IGxpa2VseSB0byBiZSBhbnl0aGluZyBlbHNlICovXG4gICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICBpZiAodHlwZW9mKHZhbHVlKSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkodmFsdWUpKSB7XG4gICAgICAgICAgICAvKiBQYXJzZSB0aGUgZWxlbWVudHMgKi9cbiAgICAgICAgICAgIHJldHVybiBfcGFyc2VMaXN0KHZhbHVlKTtcbiAgICAgICAgfSBlbHNlIGlmICh2YWx1ZS5oYXNPd25Qcm9wZXJ0eSgnbWV0YScpXG4gICAgICAgICAgICAgICAgICAgICYmIHZhbHVlLmhhc093blByb3BlcnR5KCdjb2xzJylcbiAgICAgICAgICAgICAgICAgICAgJiYgdmFsdWUuaGFzT3duUHJvcGVydHkoJ3Jvd3MnKSkge1xuICAgICAgICAgICAgLyogVGhpcyBpcyBhIGdyaWQgKi9cbiAgICAgICAgICAgIHJldHVybiBfcGFyc2VHcmlkKHZhbHVlKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8qIFRoaXMgaXMgYSBkaWN0ICovXG4gICAgICAgICAgICByZ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zV2l0aCgnbjonKSkge1xuICAgICAgICAgICAgY29uc3Qgc3BhY2UgPSBzdHIuaW5kZXhPZignICcpO1xuICAgICAgICAgICAgbGV0IHN0ck51bSA9IG51bGw7XG4gICAgICAgICAgICBsZXQgdW5pdCA9IHVuZGVmaW5lZDtcblxuICAgICAgICAgICAgaWYgKHNwYWNlID49IDApIHtcbiAgICAgICAgICAgICAgICBzdHJOdW0gPSBzdHIuc3Vic3RyaW5nKDIsc3BhY2UpO1xuICAgICAgICAgICAgICAgIHVuaXQgPSBzdHIuc3Vic3RyaW5nKHNwYWNlKzEpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzdHJOdW0gPSBzdHIuc3Vic3RyaW5nKDIpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoc3RyTnVtLmluZGV4T2YoJy4nKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhpcy52YWx1ZSA9IE51bWJlci5wYXJzZUZsb2F0KHN0ck51bSk7XG4gICAgICAgICAgICAgICAgdGhpcy51bml0ID0gdW5pdDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy52YWx1ZSA9IE51bWJlci5wYXJzZUludChzdHJOdW0pO1xuICAgICAgICAgICAgICAgIHRoaXMudW5pdCA9IHVuaXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgbSA9IHN0ci5tYXRjaChIU19aSU5DX05VTSk7XG4gICAgICAgICAgICBpZiAobVsxXS5pbmRleE9mKCcuJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHRoaXMudmFsdWUgPSBOdW1iZXIucGFyc2VGbG9hdChtWzFdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy52YWx1ZSA9IE51bWJlci5wYXJzZUludChtWzFdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHR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eXBlLiAgQSByZWZlcmVuY2UgdG8gYW5vdGhlciBlbnRpdHkuXG4gKi9cbmNsYXNzIFJlZiB7XG4gICAgSFNfWklOQ19QUkVGSVggPSAnQCc7XG4gICAgSFNfSlNPTl9QUkVGSVggPSAncjonO1xuXG4gICAgY29uc3RydWN0b3IoaWQsIGRpcykge1xuICAgICAgICBpZiAoKHR5cGVvZiBpZCkgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAvKiBDbG9uZSBjb25zdHJ1Y3RvciAqL1xuICAgICAgICAgICAgaWYgKGRpcyAhPT0gdW5kZWZpbmVkKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY2xvbmUgY29uc3RydWN0b3IgdGFrZXMgYSBSZWYgb25seScpO1xuXG4gICAgICAgICAgICBpZiAoKHR5cGVvZiBpZC5pZCkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgJ2Nsb25lZSBvYmplY3QgXFwnaWRcXCcgcHJvcGVydHkgbXVzdCBiZSBhIHN0cmluZydcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICBpZiAoaWQuZGlzICYmICgodHlwZW9mIGlkLmRpcykgIT09ICdzdHJpbmcnKSlcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICdjbG9uZWUgb2JqZWN0IFxcJ2Rpc1xcJyBwcm9wZXJ0eSBtdXN0IGJlIG51bGwgb3IgYSBzdHJpbmcnXG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgdGhpcy5pZCA9IGlkLmlkO1xuICAgICAgICAgICAgdGhpcy5kaXMgPSBpZC5kaXM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvKiBpZCBtdXN0IGJlIGEgc3RyaW5nICovXG4gICAgICAgICAgICBpZiAoKHR5cGVvZiBpZCkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignaWQgaXMgbm90IGEgc3RyaW5nJyk7XG5cbiAgICAgICAgICAgIHZhciBzcGFjZSA9IGlkLmluZGV4T2YoJyAnKTtcbiAgICAgICAgICAgIGlmIChzcGFjZSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgaWYgKGRpcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignaWQgbWF5IG5vdCBjb250YWluIHNwYWNlcycpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8qIFNwbGl0IG9uIHRoZSBzcGFjZSAqL1xuICAgICAgICAgICAgICAgIGRpcyA9IGlkLnN1YnN0cmluZyhzcGFjZSsxKTtcbiAgICAgICAgICAgICAgICBpZCA9IGlkLnN1YnN0cmluZygwLCBzcGFjZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChpZC5zdGFydHNXaXRoKHRoaXMuSFNfSlNPTl9QUkVGSVgpKSB7XG4gICAgICAgICAgICAgICAgLyogSlNPTiBSZWYgKi9cbiAgICAgICAgICAgICAgICB0aGlzLmlkID0gaWQuc3Vic3RyaW5nKDIpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChpZC5zdGFydHNXaXRoKHRoaXMuSFNfWklOQ19QUkVGSVgpKSB7XG4gICAgICAgICAgICAgICAgLyogWklOQyBSZWYgKi9cbiAgICAgICAgICAgICAgICB0aGlzLmlkID0gaWQuc3Vic3RyaW5nKDEpO1xuICAgICAgICAgICAgICAgIGlmIChkaXMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEoZGlzLnN0YXJ0c1dpdGgoJ1wiJykgJiYgZGlzLmVuZHNXaXRoKCdcIicpKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignZGlzIG11c3QgYmUgYSB2YWxpZCBaSU5DIHN0cmluZycpO1xuICAgICAgICAgICAgICAgICAgICBkaXMgPSBKU09OLnBhcnNlKGRpcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvKiBSYXcgSUQgKi9cbiAgICAgICAgICAgICAgICB0aGlzLmlkID0gaWQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qIERlc2NyaXB0aXZlIHRleHQgKi9cbiAgICAgICAgICAgIHRoaXMuZGlzID0gZGlzIHx8IG51bGw7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB0b0hTSlNPTigpIHtcbiAgICAgICAgbGV0IHJlcyA9IHRoaXMuSFNfSlNPTl9QUkVGSVggKyB0aGlzLmlkO1xuICAgICAgICBpZiAodGhpcy5kaXMpIHtcbiAgICAgICAgICAgIHJlcyArPSAnICcgKyB0aGlzLmRpcztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfTtcblxuICAgIHRvSFNaSU5DKCkge1xuICAgICAgICBsZXQgcmVzID0gdGhpcy5IU19aSU5DX1BSRUZJWCArIHRoaXMuaWQ7XG4gICAgICAgIGlmICh0aGlzLmRpcykge1xuICAgICAgICAgICAgcmVzICs9ICcgJyArIHRoaXMuZGlzLnRvSFNaSU5DKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH07XG59XG5cbm1vZHVsZS5leHBvcnRzID0gUmVmO1xuIiwiLypcbiAqIHZpbTogc2V0IHR3PTEwMCBldCB0cz00IHN3PTQgc2kgZmlsZWVuY29kaW5nPXV0Zi04OlxuICogwqkgMjAyMiBXaWRlU2t5LkNsb3VkIFB0eSBMdGRcbiAqIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBNSVRcbiAqL1xuJ3VzZSBzdHJpY3QnO1xuXG5jb25zdCBWRVJfMyA9ICczLjAnO1xuXG4vKipcbiAqIFJlbW92ZSBkYXRhIHR5cGUsIGEgc2luZ2xldG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FzaC5oYXMocmVxRXJyb3IsIFwicmVzcG9uc2UuZGF0YVwiKSkge1xuICAgICAgICAgICAgY29uc3QgeyBkYXRhIH0gPSByZXFFcnJvci5yZXNwb25zZTtcbiAgICAgICAgICAgIGlmIChsb2Rhc2guaGFzKGRhdGEsIFwibWV0YS5kaXNcIikpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEhheXN0YWNrRXJyb3IoZGF0YS5tZXRhLmRpcy5zdWJzdHJpbmcoMiksIHJlcUVycm9yKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGRhdGEuZXJyb3JzICE9PSB1bmRlZmluZWQgJiYgQXJyYXkuaXNBcnJheShkYXRhLmVycm9ycykgJiYgZGF0YS5lcnJvcnMubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGxldCBlcnJNc2cgPSBcIk1vcmUgdGhhbiAxIEdyYXBoUUxFcnJvciBlbmNvdW50ZXJlZFwiO1xuICAgICAgICAgICAgICAgIGlmIChkYXRhLmVycm9ycy5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgZXJyTXNnID0gZGF0YS5lcnJvcnNbMF0ubWVzc2FnZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsb2dnZXIuZGVidWcoXCJSYXcgR3JhcGhRTCBlcnJvciByZXNwb25zZTogJWpcIiwgZGF0YSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBHcmFwaFFMRXJyb3IoZXJyTXNnLnJlcGxhY2UoL1xcbi9nLCBcIlwiKSwgcmVxRXJyb3IpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gTmVpdGhlciBhIHZhbGlkIEhheXN0YWNrIG9mIEdyYXBoUUwgZXJyb3JcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVxRXJyb3I7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1c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IGEgdmFsaWQgZGF0ZXRpbWUgc3RyaW5nIHdoaWNoIG1vbWVudEpTIGFjY2VwdHNcbiAgICAvLyBvclxuICAgIC8vIDIpIGEgZGF0ZXRpbWUgZXhwcmVzc2lvbiBzdWNoIGFzIG5vdygpLCBub3cgLSAyaFxuICAgIC8vXG4gICAgLy8gSXQgcGFyc2VzIHRoZSBleHByZXNzaW9uIGFuZCByZXR1cm5zIGN1cnJlbnQgZXBvY2hcbiAgICAvLyBpbiBJU084NjAxIGRhdGUgdGltZSBmb3JtYXQuXG4gICAgc3RhdGljIHBhcnNlRHQoXG4gICAgICAgIGRhdGV0aW1lRXhwcixcbiAgICAgICAgdGltZXpvbmUpIHtcbiAgICAgICAgbW9tZW50LnN1cHByZXNzRGVwcmVjYXRpb25XYXJuaW5ncyA9IHRydWU7XG4gICAgICAgIGxldCBlcG9jaDtcbiAgICAgICAgbGV0IG1vbWVudERhdGUgPSBtb21lbnQoZGF0ZXRpbWVFeHByKTtcblxuICAgICAgICBpZiAobW9tZW50RGF0ZS5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIGVwb2NoID0gbW9tZW50RGF0ZVxuICAgICAgICAgICAgICAgICAgICAgIC50eih0aW1lem9uZSlcbiAgICAgICAgICAgICAgICAgICAgICAudG9JU09TdHJpbmcoKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGVwb2NoID0gRXhwclBhcnNlci5hc1dpZGVza3lEVChcbiAgICAgICAgICAgICAgICBkYXRldGltZUV4cHIsXG4gICAgICAgICAgICAgICAgdGltZXpvbmUpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGVwb2NoO1xuICAgIH1cblxuICAgIC8vIFJldHVybnMgYW4gZXBvY2ggdGltZSBiYXNlZCBvbiBhXG4gICAgLy8gZ2l2ZW4gV2lkZXNreSBkYXRldGltZSBleHByZXNzaW9uLlxuICAgIC8vXG4gICAgLy8gRXhhbXBsZSBzeW50YXhcbiAgICA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ICAgICAgICAgICBFeHByUGFyc2VyLmNvbnN1bWVDaGFyKHBvc2l0aW9uKTsgLy8gblxuICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lQ2hhcihwb3NpdGlvbik7IC8vIG9cbiAgICAgICAgICAgIEV4cHJQYXJzZXIuY29uc3VtZUNoYXIocG9zaXRpb24pOyAvLyB3XG4gICAgICAgICAgICBFeHByUGFyc2VyLmNvbnN1bWVXaGl0ZXNwYWNlcyhcbiAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgbGV0IG1vbWVudER0ID0gbW9tZW50KCkudHoodGltZXpvbmUpO1xuXG4gICAgICAgICAgICB3aGlsZSAoRXhwclBhcnNlci5oYXNDaGFyKGNoYXJBcnIsIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICAgIGlmIChFeHByUGFyc2VyLmlzS2V5d29yZEFkZChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lQ2hhcihwb3NpdGlvbik7IC8vICtcbiAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lV2hpdGVzcGFjZXMoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbnVtYmVyU3RyID0gRXhwclBhcnNlci5jb25zdW1lTnVtYmVycyhcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIW51bWJlclN0cikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuYEludmFsaWQgZGF0ZXRpbWUgZXhwcmVzc2lvbiAke2V4cHJ9LlxuRXhwZWN0aW5nIG51bWJlcnMgZm9sbG93ZWQgYnkgdGhlICsgc2lnbi5gKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIEV4cHJQYXJzZXIuY29uc3VtZVdoaXRlc3BhY2VzKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFycixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5pdCA9IEV4cHJQYXJzZXIuY29uc3VtZURhdGV0aW1lVW5pdChcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIXVuaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbmBJbnZhbGlkIGRhdGV0aW1lIGV4cHJlc3Npb24gJHtleHByfS5cbk1pc3NpbmcgdW5pdCBhZnRlciAnKyR7bnVtYmVyU3RyfSdgKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCBtb21lbnRVbml0ID0gRXhwclBhcnNlci50b01vbWVudFVuaXQodW5pdCk7XG4gICAgICAgICAgICAgICAgICAgIG1vbWVudER0LmFkZChcbiAgICAgICAgICAgICAgICAgICAgICAgIE51bWJlci5wYXJzZUludChudW1iZXJTdHIpLCBtb21lbnRVbml0KTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoRXhwclBhcnNlci5oYXNDaGFyKGNoYXJBcnIsIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEV4cHJQYXJzZXIuaXNLZXl3b3JkU3VmZml4SW5kKGNoYXJBcnIsIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4cHJQYXJzZXIuY29uc3VtZUNoYXIocG9zaXRpb24pOyAvLyB0aGUgLyBjaGFyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lV2hpdGVzcGFjZXMoY2hhckFyciwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdWZmaXhVbml0ID0gRXhwclBhcnNlci5jb25zdW1lRGF0ZXRpbWVVbml0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbik7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoRXhwclBhcnNlci5oYXNDaGFyKGNoYXJBcnIsIHBvc2l0aW9uKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG5gSW52YWxpZCBkYXRldGltZSBleHByZXNzaW9uICR7ZXhwcn0uXG5VbmV4cGVjdGVkIHZhbHVlIGZvdW5kIGFmdGVyIC8ke3N1ZmZpeFVuaXR9LmApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdWZmaXhNVW5pdCA9IEV4cHJQYXJzZXIudG9Nb21lbnRVbml0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWZmaXhVbml0KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vbWVudER0LnN0YXJ0T2Yoc3VmZml4TVVuaXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuYEludmFsaWQgZGF0ZXRpbWUgZXhwcmVzc2lvbiAke2V4cHJ9LlxuRXhwZWN0aW5nIGEgZGF0ZXRpbWUgdW5pdCBhZnRlciB0aGUgJy8nIGNoYXIuYCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoRXhwclBhcnNlci5pc0tleXdvcmRTdWIoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgIEV4cHJQYXJzZXIuY29uc3VtZUNoYXIocG9zaXRpb24pOyAvLyAtXG4gICAgICAgICAgICAgICAgICAgIEV4cHJQYXJzZXIuY29uc3VtZVdoaXRlc3BhY2VzKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFycixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgbnVtYmVyU3RyID0gRXhwclBhcnNlci5jb25zdW1lTnVtYmVycyhcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIW51bWJlclN0cikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuYEludmFsaWQgZGF0ZXRpbWUgZXhwcmVzc2lvbiAke2V4cHJ9LlxuRXhwZWN0aW5nIG51bWJlcnMgZm9sbG93ZWQgYnkgdGhlIC0gc2lnbi5gKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIEV4cHJQYXJzZXIuY29uc3VtZVdoaXRlc3BhY2VzKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFycixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5pdCA9IEV4cHJQYXJzZXIuY29uc3VtZURhdGV0aW1lVW5pdChcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIXVuaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbmBJbnZhbGlkIGRhdGV0aW1lIGV4cHJlc3Npb24gJHtleHByfS5cbk1pc3NpbmcgdW5pdCBhZnRlciAnLSR7bnVtYmVyU3RyfSdgKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCBtb21lbnRVbml0ID0gRXhwclBhcnNlci50b01vbWVudFVuaXQodW5pdCk7XG4gICAgICAgICAgICAgICAgICAgIG1vbWVudER0LnN1YnRyYWN0KFxuICAgICAgICAgICAgICAgICAgICAgICAgTnVtYmVyLnBhcnNlSW50KG51bWJlclN0ciksIG1vbWVudFVuaXQpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChFeHByUGFyc2VyLmhhc0NoYXIoY2hhckFyciwgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoRXhwclBhcnNlci5pc0tleXdvcmRTdWZmaXhJbmQoY2hhckFyciwgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lQ2hhcihwb3NpdGlvbik7IC8vIHRoZSAvIGNoYXJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHByUGFyc2VyLmNvbnN1bWVXaGl0ZXNwYWNlcyhjaGFyQXJyLCBwb3NpdGlvbik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN1ZmZpeFVuaXQgPSBFeHByUGFyc2VyLmNvbnN1bWVEYXRldGltZVVuaXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChFeHByUGFyc2VyLmhhc0NoYXIoY2hhckFyciwgcG9zaXRpb24pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbmBJbnZhbGlkIGRhdGV0aW1lIGV4cHJlc3Npb24gJHtleHByfS5cblVuZXhwZWN0ZWQgdmFsdWUgZm91bmQgYWZ0ZXIgLyR7c3VmZml4VW5pdH0uYCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN1ZmZpeE1Vbml0ID0gRXhwclBhcnNlci50b01vbWVudFVuaXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1ZmZpeFVuaXQpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9tZW50RHQuc3RhcnRPZihzdWZmaXhNVW5pdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG5gSW52YWxpZCBkYXRldGltZSBleHByZXNzaW9uICR7ZXhwcn0uXG5FeHBlY3RpbmcgYSBkYXRldGltZSB1bml0IGFmdGVyIHRoZSAnLycgY2hhci5gKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChFeHByUGFyc2VyLmlzS2V5d29yZFN1ZmZpeEluZChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJBcnIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lQ2hhcihwb3NpdGlvbik7IC8vIC9cbiAgICAgICAgICAgICAgICAgICAgRXhwclBhcnNlci5jb25zdW1lV2hpdGVzcGFjZXMoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyQXJyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3VmZml4VW5pdCA9IEV4cHJQYXJzZXIuY29uc3VtZURhdGV0aW1lVW5pdChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFycixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24pO1xuXG4gICAgICAgICAgICAgICAgICAgIEV4cHJQYXJzZXIuY29uc3VtZVdoaXRlc3BhY2VzKFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hhckFycixcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uKTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgc3VmZml4TVVuaXQgPSBFeHByUGFyc2VyLnRvTW9tZW50VW5pdChcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1ZmZpeFVuaXQpO1xuXG4gICAgICAgICAgICAgICAgICAgIG1vbWVudER0LnN0YXJ0T2Yoc3VmZml4TVVuaXQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuYEludmFsaWQgZGF0ZXRpbWUgZXhwcmVzc2lvbiAke2V4cHJ9LlxuRXhwZWN0aW5nICcrJywnLScgb3IgJy8nIHNpZ24gYWZ0ZXIgbm93LmApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG1vbWVudER0LnRvSVNPU3RyaW5nKCk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG5gSW52YWxpZCBkYXRlIHRpbWUgZXhwcmVzc2lvbigke2V4cHJ9KSwgaXQgbXVzdCBzdGFydCB3aXRoIGtleXdvcmQgJ25vdydgKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHN0YXRpYyBoYXNDaGFyKGNoYXJBcnIsIHBvcykge1xuICAgICAgICBsZXQgcmVzdWx0ID0gdHJ1ZTtcblxuICAgICAgICBpZiAoY2hhckFycltwb3MuY3VycmVudF0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgLy8gbm8gbW9yZSBsZWZ0XG4gICAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgc3RhdGljIHRvTW9tZW50VW5pdChleHByVW5pdCkge1xuICAgICAgICBsZXQgbVVuaXQ7XG5cbiAgICAgICAgaWYgKGV4cHJVbml0ID09PSAnbScpIHtcbiAgICAgICAgICAgIG1Vbml0ID0gJ21pbnV0ZXMnO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKGV4cHJVbml0ID09PSAncycpIHtcbiAgICAgICAgICAgIG1Vbml0ID0gJ3NlY29uZHMnXG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoZXhwclVuaXQgPT09ICdkJykge1xuICAgICAgICAgICAgbVVuaXQgPSAnZGF5cydcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChleHByVW5pdCA9PT0gJ2gnKSB7XG4gICAgICAgICAgICBtVW5pdCA9ICdob3VycydcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChleHByVW5pdCA9PT0gJ00nKSB7XG4gICAgICAgICAgICBtVW5pdCA9ICdtb250aHMnXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbVVuaXQ7XG4gICAgfVxuXG4gICAgc3RhdGljIGNvbnN1bWVEYXRldGltZVVuaXQoY2hhckFyciwgcG9zKSB7XG4gICAgICAgIGxldCB1bml0ID0gbnVsbDtcblxuICAgICAgICBsZXQgY3VyckNoYXIgPSBjaGFyQXJyW3Bvcy5jdXJyZW50XTtcblxuICAgICAgICBpZiAoRXhwclBhcnNlci5pc0tleXdvcmRTZWMoY3VyckNoYXIpKSB7XG4gICAgICAgICAgICB1bml0ID0gJ3MnO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKEV4cHJQYXJzZXIuaXNLZXl3b3JkTWluKGN1cnJDaGFyKSkge1xuICAgICAgICAgICAgdW5pdCA9ICdtJztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChFeHByUGFyc2VyLmlzS2V5d29yZEhvdXIoY3VyckNoYXIpKSB7XG4gICAgICAgICAgICB1bml0ID0gJ2gnO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKEV4cHJQYXJzZXIuaXNLZXl3b3JkRGF5KGN1cnJDaGFyKSkge1xuICAgICAgICAgICAgdW5pdCA9ICdkJztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChFeHByUGFyc2VyLmlzS2V5d29yZE1vbnRoKGN1cnJDaGFyKSkge1xuICAgICAgICAgICAgdW5pdCA9ICdNJztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIC8vIE5vbmUgb2YgdGhlIGFib3ZlXG4gICAgICAgICAgICByZXR1cm4gdW5pdDtcbiAgICAgICAgfVxuXG4gICAgICAgIEV4cHJQYXJzZXIuY29uc3VtZUNoYXIocG9zKTtcbiAgICAgICAgcmV0dXJuIHVuaXQ7XG4gICAgfVxuXG4gICAgLy8gcmV0dXJucyBhIHN0cmluZyBvZiBudW1iZXJzXG4gICAgc3RhdGljIGNvbnN1bWVOdW1iZXJzKGNoYXJBcnIsIHBvcykge1xuICAgICAgICBsZXQgbnVtYmVyU3RyID0gJyc7XG4gICAgICAgIGxldCBjb25zdW1lZCA9IDA7XG5cbiAgICAgICAgZm9yIChsZXQgaW5kZXggPSBwb3MuY3VycmVudDtcbiAgICAgICAgICAgIGluZGV4IDwgY2hhckFyci5sZW5ndGg7XG4gICAgICAgICAgICBpbmRleCArKykge1xuICAgICAgICAgICAgbGV0IGN1cnJDaGFyID0gY2hhckFycltpbmRleF07XG5cbiAgICAgICAgICAgIGlmICghaXNOYU4oY3VyckNoYXIpKSB7XG4gICAgICAgICAgICAgICAgbnVtYmVyU3RyID0gbnVtYmVyU3RyICsgY3VyckNoYXI7XG4gICAgICAgICAgICAgICAgY29uc3VtZWQgKz0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIE5vIG1vcmUgbnVtYmVyc1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcG9zLmN1cnJlbnQgKz0gY29uc3VtZWQ7XG4gICAgICAgIHJldHVybiBudW1iZXJTdHI7XG4gICAgfVxuXG4gICAgc3RhdGljIGNvbnN1bWVDaGFyKHBvc2l0aW9uKSB7XG4gICAgICAgIHBvc2l0aW9uLmN1cnJlbnQgKz0gMTtcbiAgICB9XG5cbiAgICBzdGF0aWMgY29uc3VtZVdoaXRlc3BhY2VzKGNoYXJBcnIsIHBvcykge1xuICAgICAgICBsZXQgY29uc3VtZWQgPSAwO1xuXG4gICAgICAgIGZvciAobGV0IGluZGV4ID0gcG9zLmN1cnJlbnQ7XG4gICAgICAgICAgICBpbmRleCA8IGNoYXJBcnIubGVuZ3RoO1xuICAgICAgICAgICAgaW5kZXggKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyQ2hhciA9IGNoYXJBcnJbaW5kZXhdO1xuXG4gICAgICAgICAgICBpZiAoY3VyckNoYXIgPT09IFdISVRFU1BBQ0UpIHtcbiAgICAgICAgICAgICAgICBjb25zdW1lZCArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gTm8gbW9yZSB3aGl0ZXNwYWNlXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBwb3MuY3VycmVudCArPSBjb25zdW1lZDtcbiAgICB9XG5cbiAgICBzdGF0aWMgaXNLZXl3b3JkRGF5KGNoYXIpIHtcbiAgICAgICAgcmV0dXJuIGNoYXIgPT09ICdkJztcbiAgICB9XG5cbiAgICBzdGF0aWMgaXNLZXl3b3JkU2VjKGNoYXIpIHtcbiAgICAgICAgcmV0dXJuIGNoYXIgPT09ICdzJztcbiAgICB9XG5cbiAgICBzdGF0aWMgaXNLZXl3b3JkTWluKGNoYXIpIHtcbiAgICAgICAgcmV0dXJuIGNoYXIgPT09ICdtJztcbiAgICB9XG5cbiAgICBzdGF0aWMgaXNLZXl3b3JkSG91cihjaGFyKSB7XG4gICAgICAgIHJldHVybiBjaGFyID09PSAnaCc7XG4gICAgfVxuXG4gICAgc3RhdGljIGlzS2V5d29yZE1vbnRoKGNoYXIpIHtcbiAgICAgICAgcmV0dXJuIGNoYXIgPT09ICdNJztcbiAgICB9XG5cbiAgICBzdGF0aWMgaXNLZXl3b3JkU3VmZml4SW5kKGNoYXJBcnIsIHBvcykge1xuICAgICAgICBsZXQgaXNTdWZmaXhJbmQgPSBmYWxzZTtcblxuICAgICAgICBpZiAoY2hhckFycltwb3MuY3VycmVudF0gPT09ICcvJykge1xuICAgICAgICAgICAgaXNTdWZmaXhJbmQgPSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGlzU3VmZml4SW5kO1xuICAgIH1cblxuICAgIHN0YXRpYyBpc0tleXdvcmRBZGQoY2hhckFyciwgcG9zKSB7XG4gICAgICAgIGxldCBpc0FkZGl0aW9uID0gZmFsc2U7XG5cbiAgICAgICAgaWYgKGNoYXJBcnJbcG9zLmN1cnJlbnRdID09PSAnKycpIHtcbiAgICAgICAgICAgIGlzQWRkaXRpb24gPSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGlzQWRkaXRpb247XG4gICAgfVxuXG4gICAgc3RhdGljIGlzS2V5d29yZFN1YihjaGFyQXJyLCBwb3MpIHtcbiAgICAgICAgbGV0IGlzU3VidHJhY3QgPSBmYWxzZTtcblxuICAgICAgICBpZiAoY2hhckFycltwb3MuY3VycmVudF0gPT09ICctJykge1xuICAgICAgICAgICAgaXNTdWJ0cmFjdCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaXNTdWJ0cmFjdDtcbiAgICB9XG5cbiAgICBzdGF0aWMgaXNLZXl3b3JkTm93KGNoYXJBcnIsIHBvcykge1xuICAgICAgICBsZXQgaXNOb3cgPSBmYWxzZTtcblxuICAgICAgICBpZiAoY2hhckFycltwb3MuY3VycmVudF0udG9Mb3dlckNhc2UoKSA9PT0gJ24nICYmXG4gICAgICAgICAgICBjaGFyQXJyW3Bvcy5jdXJyZW50ICsgMV0udG9Mb3dlckNhc2UoKSA9PT0gJ28nICYmXG4gICAgICAgICAgICBjaGFyQXJyW3Bvcy5jdXJyZW50ICsgMl0udG9Mb3dlckNhc2UoKSA9PT0gJ3cnKSB7XG4gICAgICAgICAgICBpc05vdyA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaXNOb3c7XG4gICAgfVxuXG4gICAgc3RhdGljIHRvTXNFcG9jaChpc284NjAxKSB7XG4gICAgICAgIHJldHVybiBtb21lbnQoaXNvODYwMSkudmFsdWVPZigpO1xuICAgIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBFeHByUGFyc2VyO1xuXG4iLCIvKlxuICogdmltOiBzZXQgdHc9MTAwIGV0IHRzPTQgc3c9NCBzaSBmaWxlZW5jb2Rpbmc9dXRmLTg6XG4gKiDCqSAyMDIyIFdpZGVTa3kuQ2xvdW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Bub2RlKG5vZGVOYW1lLCBncmFwaHFsUmVzcCwgd2Fsa0FsbCkge1xuICAgICAgICBjb25zdCBmb3VuZCA9IHtcbiAgICAgICAgICAgIHRhcmdldDogbnVsbCxcbiAgICAgICAgICAgIHBhdGg6ICcnXG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKF8uaXNTdHJpbmcoZ3JhcGhxbFJlc3ApKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGdyYXBocWxSZXNwID0gSlNPTi5wYXJzZShncmFwaHFsUmVzcCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAvLyBJbnZhbGlkIGdyYXBoIHJlc3AgLSBkb250IGJvdGhlciBsb29raW5nIGZ1cnRoZXJcbiAgICAgICAgICAgICAgICBub2RlTmFtZSA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobm9kZU5hbWUpIHtcbiAgICAgICAgICAgIHdhbGtHcmFwaCh3YWxrQWxsLCBub2RlTmFtZSwgZ3JhcGhxbFJlc3AsICcnLCBmb3VuZCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gZm91bmQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogTG9jYXRlIHRoZSB0aW1lc2VyaWVzIG5vZGUgYmFzZWQgb24gYW4gYWxpYXNlZCBub2RlIG5hbWUuXG4gICAgICpcbiAgICAgKiBAcGFyYW0gYWxpYXNOYW1lIE5hbWUgb2YgdGhlIG5vZGUgeW91IGhhdmUgYWxpYXNlZCBvbiB0aGUgZ3JhcGhxbCByZXF1ZXN0LlxuICAgICAqIEBwYXJhbSBncmFwaHFsUmVzcCBSZXNwb25zZSBvZiB5b3VyIGdyYXBocWwgcXVlcnkuXG4gICAgICogQHJldHVybnMge3twYXRoOiBzdHJpbmcsIHRhcmdldDogbnVsbH19XG4gICAgICogVGFyZ2V0IGlzIHRoZSBmb3VuZCB0aW1lc2VyaWVzIG5vZGUuXG4gICAgICogUGF0aCB0aGF0IGNhbiBiZSB1c2VkIGZvciBsb2NhdGluZyB0aGUgZm91bmQgdGltZXNlcmllcyBub2RlLlxuICAgICAqL1xuICAgIHN0YXRpYyB0aW1lc2VyaWVzTm9kZShhbGlhc05hbWUsIGdyYXBocWxSZXNwKSB7XG4gICAgICAgIGNvbnN0IGZvdW5kID0ge1xuICAgICAgICAgICAgdGFyZ2V0OiBudWxsLFxuICAgICAgICAgICAgcGF0aDogJydcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoXy5pc1N0cmluZyhncmFwaHFsUmVzcCkpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgZ3JhcGhxbFJlc3AgPSBKU09OLnBhcnNlKGdyYXBocWxSZXNwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgICAgIC8vIEludmFsaWQgZ3JhcGggcmVzcCAtIGRvbnQgYm90aGVyIGxvb2tpbmcgZnVydGhlclxuICAgICAgICAgICAgICAgIGFsaWFzTmFtZSA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYWxpYXNOYW1lKSB7XG4gICAgICAgICAgICBjb25zdCBhbGlhc05vZGUgPSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0OiBudWxsLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcnXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgd2Fsa0dyYXBoKGZhbHNlLCBhbGlhc05hbWUsIGdyYXBocWxSZXNwLCAnJywgYWxpYXNOb2RlKTtcblxuICAgICAgICAgICAgaWYgKGFsaWFzTm9kZS50YXJnZXQpIHtcbiAgICAgICAgICAgICAgICB3YWxrR3JhcGgodHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgVElNRVNFUklFU19OT0RFX05BTUUsIGFsaWFzTm9kZ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BoaXN0SW5wdXQgPSBfLnJlcGxhY2UoXG4gICAgICAgICAgICAgICAgICAgICAgICBoaXN0SW5wdXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnJGZyb20nLFxuICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKHRvKSB7XG4gICAgICAgICAgICAgICAgICAgIGhpc3RJbnB1dCA9IF8ucmVwbGFjZShcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpc3RJbnB1dCxcbiAgICAgICAgICAgICAgICAgICAgICAgICckdG8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgdG8pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiBoaXN0SW5wdXQ7XG4gICAgICAgICAgICB9KTtcbiAgICB9XG5cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBSZXBsYWNlO1xuIiwiY2xhc3MgRW50aXR5Q3JpdGVyaWEge1xuXG4gICAgLyoqXG4gICAgICogRW50aXR5Q3JpdGVyaWEgY2xhc3MgY29uc3RydWN0b3JcbiAgICAgKiBAcGFyYW0gbmFtZSBOYW1lIG9mIGNyaXRlcmlhXG4gICAgICogQHBhcmFtIGNvbmRpdGlvbmFsRnVuYyBBIGZ1bmN0aW9uIHRvIGRldGVybWluZSBpZiBhIGdpdmVuIGVudGl0eSBpcyBhcHBsaWNhYmxlIGZvciB0aGUgY3JpdGVyaWEuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICBUYWtlcyAxIGFyZ3VtZW50IGFzIHRoZSBlbnRpdHkuIFJldHVybnMgdHJ1ZSBvciBmYWxzZS5cbiAgICAgKiBAcGFyYW0gcmVzdWx0RnVuYyBBIGZ1bmN0aW9uIHRvIGFwcGx5IGNoYW5nZSB0byB0aGUgZW50aXR5IGlmIGRldGVybWluZWQgdG8gYmUgYXBwbGljYWJsZS5cbiAgICAgKiAgICAgICAgICAgICAgICAgICB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gICAgICAuc3RyaWN0KClcbiAgICAgICAgICAgIC5taW4oMSlcbiAgICAgICAgICAgIC5tYXgobWF4U2l6ZSlcbiAgICAgICAgICAgIC5kZWZhdWx0KGRlZmF1bHRTaXplKVxuICAgIH1cbn07XG5cbmNvbnN0IGdldFJldHVyblJlc3VsdFByb3AgPSAoZGVmYXVsdFZhbCkgPT4ge1xuICAgIHJldHVybiB7XG4gICAgICAgIHJldHVyblJlc3VsdDogeXVwLmJvb2xlYW4oKVxuICAgICAgICAgICAgLnN0cmljdCgpXG4gICAgICAgICAgICAuZGVmYXVsdChkZWZhdWx0VmFsKVxuICAgIH1cbn07XG5cbi8vIFNoYXJlZCBPYmplY3RzXG5jb25zdCBQRVJGT1JNX09QX0lOX0JBVENIX09CSiA9IHtcbiAgICAuLi5nZXRCYXRjaFByb3AoUEVSRk9STV9PUF9JTl9CQVRDSF9CQVRDSF9TSVpFLCBQRVJGT1JNX09QX0lOX0JBVENIX01BWF9CQVRDSF9TSVpFKSxcbiAgICBiYXRjaERlbGF5OiB5dXAubnVtYmVyKClcbiAgICAgICAgLm5vdFJlcXVpcmVkKClcbiAgICAgICAgLm51bGxhYmxlKClcbiAgICAgICAgLnN0cmljdCgpXG4gICAgICAgIC5taW4oMClcbiAgICAgICAgLmRlZmF1bHQoMCksXG4gICAgcGFyYWxsZWw6IHl1cC5udW1iZXIoKVxuICAgICAgICAuc3RyaWN0KClcbiAgICAgICAgLm1pbigxKVxuICAgICAgICAubWF4KFBFUkZPUk1fT1BfSU5fQkFUQ0hfTUFYX1BBUkFMTEVMKVxuICAgICAgICAuZGVmYXVsdCgxKSxcbiAgICBwYXJhbGxlbERlbGF5OiB5dXAubnVtYmVyKClcbiAgICAgICAgLm5vdFJlcXVpcmVkKClcbiAgICAgICAgLm51bGxhYmxlKClcbiAgICAgICAgLnN0cmljdCgpXG4gICAgICAgIC5taW4oMClcbiAgICAgICAgLmRlZmF1bHQoMClcbn07XG5cbi8vIENsaWVudCBmdW5jdGlvbi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WJsZSgpXG4gICAgICAgIC5ub3RSZXF1aXJlZCgpXG4gICAgICAgIC5zdHJpY3QoKVxuICAgICAgICAuZGVmYXVsdChcImluY3JlbWVudFwiKSxcbiAgICBjcmVhdGU6IHl1cC5zdHJpbmcoKVxuICAgICAgICAubnVsbGFibGUoKVxuICAgICAgICAubm90UmVxdWlyZWQoKVxuICAgICAgICAuc3RyaWN0KClcbiAgICAgICAgLmRlZmF1bHQoXCJjcmVhdGVcIiksXG4gICAgdXBkYXRlOiB5dXAuc3RyaW5nKClcbiAgICAgICAgLm51bGxhYmxlKClcbiAgICAgICAgLm5vdFJlcXVpcmVkKClcbiAgICAgICAgLnN0cmljdCgpXG4gICAgICAgIC5kZWZhdWx0KFwidXBkYXRlXCIpXG59O1xuXG5jb25zdCBDTElFTlRfU0NIRU1BID0geXVwLm9iamVjdCh7XG4gICAgaW1wZXJzb25hdGVBczogeXVwLnN0cmluZygpXG4gICAgICAgIC5udWxsYWJsZSgpXG4gICAgICAgIC5ub3RSZXF1aXJlZCgpXG4gICAgICAgIC5zdHJpY3QoKVxuICAgICAgICAuZGVmYXVsdChudWxsKSxcbiAgICBhY2NlcHRHemlwOiB5dXAuYm9vbGVhbigpXG4gICAgICAgIC5udWxsYWJsZSgpXG4gICAgICAgIC5ub3RSZXF1aXJlZCgpXG4gICAgICAgIC5zdHJpY3QoKVxuICAgICAgICAuZGVmYXVsdCh0cnVlKSxcbiAgICBwcm9ncmVzczogeXVwLm9iamVjdChQUk9HUkVTU19PQkopLFxuICAgIGJhdGNoOiB5dXAub2JqZWN0KHtcbiAgICAgICAgaGlzUmVhZDogQkFUQ0hfSElTX1JFQURfU0NIRU1BLFxuICAgICAgICBoaXNXcml0ZTogQkFUQ0hfSElTX1dSSVRFX1NDSEVNQSxcbiAgICAgICAgaGlzRGVsZXRlOiBCQVRDSF9ISVNfREVMRVRFX1NDSEVNQSxcbiAgICAgICAgY3JlYXRlOiBCQVRDSF9DUkVBVEVfU0NIRU1BLFxuICAgIC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gdG9IYXlzdGFjayh2YWx1ZSwga2luZCkge1xuICAgIHN3aXRjaCAoa2luZCkge1xuICAgICAgICBjYXNlIFwiU3RyXCI6XG4gICAgICAgICAgICByZXR1cm4gYHM6JHt2YWx1ZX1gO1xuICAgICAgICBjYXNlIFwiUmVmXCI6XG4gICAgICAgICAgICByZXR1cm4gYHI6JHt2YWx1ZX1gO1xuICAgICAgICBjYXNlIFwiTnVtYmVyXCI6XG4gICAgICAgICAgICByZXR1cm4gYG46JHt2YWx1ZX1gO1xuICAgICAgICBjYXNlIFwiTWFya2VyXCI6XG4gICAgICAgICAgICByZXR1cm4gXCJtOlwiO1xuICAgICAgICBjYXNlIFwiQ29vcmRcIjpcbiAgICAgICAgICAgIHJldHVybiBgYzoke3ZhbHVlfWA7XG4gICAgICAgIGNhc2UgXCJUaW1lXCI6XG4gICAgICAgICAgICByZXR1cm4gYGg6JHt2YWx1ZX1gO1xuICAgICAgICBjYXNlIFwiRGF0ZVwiOlxuICAgICAgICAgICAgcmV0dXJuIGBkOiR7dmFsdWV9YDtcbiAgICAgICAgY2FzZSBcIkRhdGVUaW1lXCI6XG4gICAgICAgICAgICByZXR1cm4gYHQ6JHt2YWx1ZX1gO1xuICAgICAgICBjYXNlIFwiWmVyb1wiOlxuICAgICAgICAgICAgcmV0dXJuIFwiejpcIjtcbiAgICAgICAgY2FzZSBcIkJvb2xcIjpcbiAgICAgICAgICAgIHJldHVybiBgJHt2YWx1ZX1gO1xuICAgICAgICBjYXNlIFwiVXJpXCI6XG4gICAgICAgICAgICByZXR1cm4gYHU6JHt2YWx1ZX1gO1xuICAgICAgICBjYXNlIFwiTGlzdFwiOlxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlLnN1YnN0cmluZygxLCB2YWx1ZS5sZW5ndGggLSAxKVxuICAgICAgICAgICAgICAgIC5zcGxpdChcIixcIilcbiAgICAgICAgICAgICAgICAubWFwKCh2YWwpID0+IHZhbC50cmltKCkpXG4gICAgICAgICAgICAgICAgLm1hc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XlzdGFjayBwcmVmaXggYXBwbGllZC5cbiAgICAgKi9cbiAgICBhZGQoaWQsIGRhdGEpIHtcbiAgICAgICAgZm9yIChjb25zdCB7dHMsIHZhbH0gb2YgZGF0YSkge1xuICAgICAgICAgICAgaWYgKHRzID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJSb3cgaW4gZGF0YSBtaXNzaW5nICd0cycgcHJvcGVydHlcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh2YWwgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIlJvdyBpbiBkYXRhIG1pc3NpbmcgJ3ZhbCcgcHJvcGVydHlcIik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLnBheWxvYWRbdHNdID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnBheWxvYWRbdHNdID0ge307XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGxldCBwYXJzZWRWYWwgPSB2YWw7XG4gICAgICAgICAgICBpZiAodmFsLnN1YnN0cmluZygwLCAyKSA9PT0gXCJuOlwiICYmIHZhbC5pbmNsdWRlcyhcIiBcIikpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpbmRleD0gdmFsLmluZGV4T2YoXCIgXCIpO1xuICAgICAgICAgICAgICAgIGlmIChpbmRleCAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gdmFsIGhhcyB1bml0IGFwcGxpZWQsIHJlbW92ZVxuICAgICAgICAgICAgICAgICAgICBwYXJzZWRWYWwgPSB2YWwuc3Vic3RyaW5nKDAsIHZhbC5pbmRleE9mKFwiIFwiKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy4jcGF5bG9hZFt0c11baWRdID0gcGFyc2VkVmFsO1xuICA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ICAgZGVsZXRlIHJlYy5jbGllbnRfcmVxO1xuICAgICAgaGVhZGVycyA9IGNsaWVudF9yZXEuaGVhZGVycztcbiAgICAgIHMgPSAnJztcbiAgICAgIGlmIChjbGllbnRfcmVxLmFkZHJlc3MpIHtcbiAgICAgICAgaG9zdEhlYWRlckxpbmUgPSAnSG9zdDogJyArIGNsaWVudF9yZXEuYWRkcmVzcztcbiAgICAgICAgaWYgKGNsaWVudF9yZXEucG9ydClcbiAgICAgICAgICBob3N0SGVhZGVyTGluZSArPSAnOicgKyBjbGllbnRfcmVxLnBvcnQ7XG4gICAgICAgIGhvc3RIZWFkZXJMaW5lICs9ICdcXG4nO1xuICAgICAgfVxuICAgICAgZGVsZXRlIGNsaWVudF9yZXEuaGVhZGVycztcbiAgICAgIGRlbGV0ZSBjbGllbnRfcmVxLmFkZHJlc3M7XG4gICAgICBkZWxldGUgY2xpZW50X3JlcS5wb3J0O1xuICAgICAgcyArPSBmb3JtYXQoJyVzICVzIEhUVFAvJXNcXG4lcyVzJywgY2xpZW50X3JlcS5tZXRob2QsXG4gICAgICAgIGNsaWVudF9yZXEudXJsLFxuICAgICAgICBjbGllbnRfcmVxLmh0dHBWZXJzaW9uIHx8ICcxLjEnLFxuICAgICAgICBob3N0SGVhZGVyTGluZSxcbiAgICAgICAgKGhlYWRlcnMgP1xuICAgICAgICAgIE9iamVjdC5rZXlzKGhlYWRlcnMpLm1hcChcbiAgICAgICAgICAgIGZ1bmN0aW9uIChoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBoICsgJzogJyArIGhlYWRlcnNbaF07XG4gICAgICAgICAgICB9KS5qb2luKCdcXG4nKSA6XG4gICAgICAgICAgJycpKTtcbiAgICAgIGRlbGV0ZSBjbGllbnRfcmVxLm1ldGhvZDtcbiAgICAgIGRlbGV0ZSBjbGllbnRfcmVxLnVybDtcbiAgICAgIGRlbGV0ZSBjbGllbnRfcmVxLmh0dHBWZXJzaW9uO1xuICAgICAgaWYgKGNsaWVudF9yZXE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WxzLmxlbmd0aCA/IGRldGFpbHMuam9pbignXFxuICAtLVxcbicpICsgJ1xcbicgOiAnJyksICdicmlnaHRCbGFjaycpO1xuICAgIGlmICghc2hvcnQpXG4gICAgICByZXR1cm4gZm9ybWF0KCclcyAlczogJXMgb24gJXMlczolcyVzXFxuJXMnLFxuICAgICAgICB0aW1lLFxuICAgICAgICBsZXZlbCxcbiAgICAgICAgbmFtZVN0cixcbiAgICAgICAgaG9zdG5hbWUgfHwgJzxuby1ob3N0bmFtZT4nLFxuICAgICAgICBzcmMsXG4gICAgICAgIG9uZWxpbmVNc2csXG4gICAgICAgIGV4dHJhcyxcbiAgICAgICAgZGV0YWlscyk7XG4gICAgZWxzZVxuICAgICAgcmV0dXJuIGZvcm1hdCgnJXMgJXMgJXM6JXMlc1xcbiVzJyxcbiAgICAgICAgdGltZSxcbiAgICAgICAgbGV2ZWwsXG4gICAgICAgIG5hbWVTdHIsXG4gICAgICAgIG9uZWxpbmVNc2csXG4gICAgICAgIGV4dHJhcyxcbiAgICAgICAgZGV0YWlscyk7XG4gICAgYnJlYWs7XG5cbiAgY2FzZSBPTV9JTlNQRUNUOlxuICAgIHJldHVybiB1dGlsLmluc3BlY3QocmVjLCBmYWxzZSwgSW5maW5pdHksIHRydWUpICsgJ1xcbic7XG5cbiAgY2FzZSBPTV9CVU5ZQU46XG4gICAgaWYgKG9wdHMubGV2ZWxJblN0cmluZykge1xuICAgICAgcmVjLmxldmVsID0gbWFwTGV2ZWxUb05hbWUocmVjLmxldmVsKTtcbiAgICB9XG4gICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHJlYywgbnVsbCwgMCkgKyAnXFxuJztcblxuICBjYXNlIE9NX0pTT046XG4gICAgaWYgKG9wdHMubGV2ZWxJblN0cmluZykge1xuICAgICAgcmVjLmxldmVsID0gbWFwTGV2ZWxUb05hbWUocmVjLmxldmVsKTtcbiAgICB9XG4gICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHJlYywgbnVsbCwgb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sZW4pXG4gICAgICAgICAgICAgICAgcmV0dXJuIHg7XG4gICAgICAgICAgICBzd2l0Y2ggKHgpIHtcbiAgICAgICAgICAgICAgICBjYXNlICclcyc6IHJldHVybiBTdHJpbmcoYXJnc1tpKytdKTtcbiAgICAgICAgICAgICAgICBjYXNlICclZCc6IHJldHVybiBOdW1iZXIoYXJnc1tpKytdKTtcbiAgICAgICAgICAgICAgICBjYXNlICclaic6IHJldHVybiBmYXN0QW5kU2FmZUpzb25TdHJpbmdpZnkoYXJnc1tpKytdKTtcbiAgICAgICAgICAgICAgICBjYXNlICclJSc6IHJldHVybiAnJSc7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBmb3IgKHZhciB4ID0gYXJnc1tpXTsgaSA8IGxlbjsgeCA9IGFyZ3NbKytpXSkge1xuICAgICAgICAgICAgaWYgKHggPT09IG51bGwgfHwgdHlwZW9mICh4KSAhPT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICBzdHIgKz0gJyAnICsgeDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3RyICs9ICcgJyArIGluc3BlY3QoeCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHN0cjtcbiAgICB9O1xufVxuXG5cbi8qKlxuICogR2F0aGVyIHNvbWUgY2FsbGVyIGluZm8gMyBzdGFjayBsZXZlbHMgdXAuXG4gKiBTZWUgPGh0dHA6Ly9jb2RlLmdvb2dsZS5jb20vcC92OC93aWtpL0phdmFTY3JpcHRTdGFja1RyYWNlQXBpPi5cbiAqL1xuZnVuY3Rpb24gZ2V0Q2FsbGVyM0luZm8oKSB7XG4gICAgaWYgKHRoaXMgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAvLyBDYW5ub3QgYWNjZXNzIGNhbGxlciBpbmZv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gICAgfSk7XG4gICAgfSBlbHNlIGlmIChwYXJlbnQgJiYgb3B0aW9ucy5sZXZlbCkge1xuICAgICAgICB0aGlzLmxldmVsKG9wdGlvbnMubGV2ZWwpO1xuICAgIH0gZWxzZSBpZiAoIXBhcmVudCkge1xuICAgICAgICBpZiAocnVudGltZUVudiA9PT0gJ2Jyb3dzZXInKSB7XG4gICAgICAgICAgICAvKlxuICAgICAgICAgICAgICogSW4gdGhlIGJyb3dzZXIgd2UnbGwgYmUgZW1pdHRpbmcgdG8gY29uc29sZS5sb2cgYnkgZGVmYXVsdC5cbiAgICAgICAgICAgICAqIEFueSBjb25zb2xlLmxvZyB3b3J0aCBpdHMgc2FsdCB0aGVzZSBkYXlzIGNhbiBuaWNlbHkgcmVuZGVyXG4gICAgICAgICAgICAgKiBhbmQgaW50cm9zcGVjdCBvYmplY3RzIChlLmcuIHRoZSBGaXJlZm94IGFuZCBDaHJvbWUgY29uc29sZSlcbiAgICAgICAgICAgICAqIHNvIGxldCdzIGVtaXQgdGhlIHJhdyBsb2cgcmVjb3JkLiBBcmUgdGhlcmUgYnJvd3NlcnMgZm9yIHdoaWNoXG4gICAgICAgICAgICAgKiB0aGF0IGJyZWFrcyB0aGluZ3M/XG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHNlbGYuYWRkU3RyZWFtKHtcbiAgICAgICAgICAgICAgICB0eXBlOiAncmF3JyxcbiAgICAgICAgICAgICAgICBzdHJlYW06IG5ldyBDb25zb2xlUmF3U3RyZWFtKCksXG4gICAgICAgICAgICAgICAgY2xvc2VPbkV4aXQ6IGZhbHNlLFxuICAgICAgICAgICAgICAgIGxldmVsOiBvcHRpb25zLmxldmVsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNlbGYuYWRkU3RyZWFtKHtcbiAgICAgICAgICAgICAgICB0eXBlOiAnc3RyZWFtJyxcbiAgICAgICAgICAgICAgICBzdHJlYW06IHByb2Nlc3Muc3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5cbi8qKlxuICogQnVpbGQgYSBsb2cgZW1pdHRlciBmdW5jdGlvbiBmb3IgbGV2ZWwgbWluTGV2ZWwuIEkuZS4gdGhpcyBpcyB0aGVcbiAqIGNyZWF0b3Igb2YgYGxvZy5pbmZvYCwgYGxvZy5lcnJvcmAsIGV0Yy5cbiAqL1xuZnVuY3Rpb24gbWtMb2dFbWl0dGVyKG1pbkxldmVsKSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGxvZyA9IHRoaXM7XG4gICAgICAgIHZhciBzdHIgPSBudWxsO1xuICAgICAgICB2YXIgcmVjID0gbnVsbDtcblxuICAgICAgICBpZiAoIXRoaXMuX2VtaXQpIHtcbiAgICAgICAgICAgIC8qXG4gICAgICAgICAgICAgKiBTaG93IHRoaXMgaW52YWxpZCBCdW55YW4gdXNhZ2Ugd2FybmluZyAqb25jZSouXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogU2VlIDxodHRwczovL2dpdGh1Yi5jb20vdHJlbnRtL25vZGUtYnVueWFuL2lzc3Vlcy8xMDA+IGZvclxuICAgICAgICAgICAgICogYW4gZXhhbXBsZSBvZiBob3cgdGhpcyBjYW4gaGFwcGVuLlxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB2YXIgZGVkdXBLZXkgPSAndW5ib3VuZCc7XG4gICAgICAgICAgICBpZiAoIV9oYXZlV2FybmVkW2RlZHVwS2V5XSkge1xuICAgICAgICAgICAgICAgIHZhciBjYWxsZXIgPSBnZXRDYWxsZXIzSW5mbygpO1xuICAgICAgICAgICAgICAgIF93YXJuKGZvcm1hdCgnYnVueWFuIHVzYWdlIGVycm9yOiAlczolczogYXR0ZW1wdCB0byBsb2cgJ1xuICAgICAgICAgICAgICAgICAgICArICd3aXRoIGFuIHVuYm91bmQgbG9nIG1ldGhvZDogYHRoaXNgIGlzOiAlcycsXG4gICAgICAgICAgICAgICAgICAgIGNhbGxlci5maWxlLCBjYWxsZXIubGluZS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AgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAoc2FmZUpzb25TdHJpbmdpZnkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc2FmZUpzb25TdHJpbmdpZnkocmVjKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGRlZHVwS2V5ID0gZS5zdGFjay5zcGxpdCgvXFxuL2csIDMpLmpvaW4oJ1xcbicpO1xuICAgICAgICAgICAgICAgIF93YXJuKCdidW55YW46IEVSUk9SOiBFeGNlcHRpb24gaW4gJ1xuICAgICAgICAgICAgICAgICAgICArICdgSlNPTi5zdHJpbmdpZnkocmVjKWAuIFlvdSBjYW4gaW5zdGFsbCB0aGUgJ1xuICAgICAgICAgICAgICAgICAgICArICdcInNhZmUtanNvbi1zdHJpbmdpZnlcIiBtb2R1bGUgdG8gaGF2ZSBCdW55YW4gZmFsbGJhY2sgJ1xuICAgICAgICAgICAgICAgICAgICArICd0byBzYWZlciBzdHJpbmdpZmljYXRpb24uIFJlY29yZDpcXG4nXG4gICAgICAgICAgICAgICAgICAgICsgX2luZGVudChmb3JtYXQoJyVzXFxuJXMnLCB1dGlsLmluc3BlY3QocmVjKSwgZS5zdGFjaykpLFxuICAgICAgICAgICAgICAgICAgICBkZWR1cEtleSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZvcm1hdCgnKEV4Y2VwdGlvbiBpbiBKU09OLnN0cmluZ2lmeShyZWMpOiAlai4gJ1xuICAgICAgICAgICAgICAgICAgICArICdTZWUgc3RkZXJyIGZvciBkZXRhaWxzLiknLCBlLm1lc3NhZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufVxuXG5cbnZhciBSb3RhdGluZ0ZpbGVTdHJlYW0gPSBudWxsO1xuaWYgKG12KSB7XG5cblJvdGF0aW5nRmlsZVN0cmVhbSA9IGZ1bmN0aW9uIFJvdGF0aW5nRmlsZVN0cmVhbShvcHRpb25zKSB7XG4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yAnaG91cmx5JyAoMWgpLCAnZGFpbHknICgxZCksIFwid2Vla2x5XCIgKDF3KSxcbiAgICAgICAgLy8gJ21vbnRobHknICgxbSkgYW5kICd5ZWFybHknICgxeSlcbiAgICAgICAgdmFyIHBlcmlvZCA9IHtcbiAgICAgICAgICAgICdob3VybHknOiAnMWgnLFxuICAgICAgICAgICAgJ2RhaWx5JzogJzFkJyxcbiAgICAgICAgICAgICd3ZWVrbHknOiAnMXcnLFxuICAgICAgICAgICAgJ21vbnRobHknOiAnMW0nLFxuICAgICAgICAgICAgJ3llYXJseSc6ICcxeSdcbiAgICAgICAgfVtvcHRpb25zLnBlcmlvZF0gfHwgb3B0aW9ucy5wZXJpb2Q7XG4gICAgICAgIHZhciBtID0gL14oWzEtOV1bMC05XSopKFtoZHdteV18bXMpJC8uZXhlYyhwZXJpb2QpO1xuICAgICAgICBpZiAoIW0pIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihmb3JtYXQoJ2ludmFsaWQgcGVyaW9kOiBcIiVzXCInLCBvcHRpb25zLnBlcmlvZCkpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMucGVyaW9kTnVtID0gTnVtYmVyKG1bMV0pO1xuICAgICAgICB0aGlzLnBlcmlvZFNjb3BlID0gbVsyXTtcbiAgICB9IGVsc2Uge1xuICAgICAgICB0aGlzLnBlcmlvZE51bSA9IDE7XG4gICAgICAgIHRoaXMucGVyaW9kU2NvcGUgPSAnZCc7XG4gICAgfVxuXG4gICAgdmFyIGxhc3RNb2RpZmllZCA9IG51bGw7XG4gICAgdHJ5IHtcbiAgICAgICAgdmFyIGZpbGVJbmZvID0gZnMuc3RhdFN5bmModGhpcy5wYXRoKTtcbiAgICAgICAgbGFzdE1vZGlmaWVkID0gZmlsZUluZm8ubXRpbWUuZ2V0VGltZSgpO1xuICAgIH1cbiAgICBjYXRjaCAoZXJyKSB7XG4gICAgICAgIC8vIGZpbGUgZG9lc24ndCBleGlzdFxuICAgIH1cbiAgICB2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cbiAgICAgICAgICAgIC8vIEZpcnN0IHRpbWU6IHRvcCBvZiB0aGUgbmV4dCBob3VyLlxuICAgICAgICAgICAgcm90QXQgPSBEYXRlLlVUQyhkLmdldFVUQ0Z1bGxZZWFyKCksIGQuZ2V0VVRDTW9udGgoKSxcbiAgICAgICAgICAgICAgICBkLmdldFVUQ0RhdGUoKSwgZC5nZXRVVENIb3VycygpICsgcGVyaW9kT2Zmc2V0KTtcbiAgICAgICAgfVxuICAgICAgICBicmVhaztcbiAgICBjYXNlICdkJzpcbiAgICAgICAgaWYgKHRoaXMucm90QXQpIHtcbiAgICAgICAgICAgIHJvdEF0ID0gdGhpcy5yb3RBdCArIHRoaXMucGVyaW9kTnVtICogMjQgKiA2MCAqIDYwICogMTAwMFxuICAgICAgICAgICAgICAgICogcGVyaW9kT2Zmc2V0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gRmlyc3QgdGltZTogc3RhcnQgb2YgdG9tb3Jyb3cgKGkuZS4gYXQgdGhlIGNvbWluZyBtaWRuaWdodCkgVVRDLlxuICAgICAgICAgICAgcm90QXQgPSBEYXRlLlVUQyhkLmdldFVUQ0Z1bGxZZWFyKCksIGQuZ2V0VVRDTW9udGgoKSxcbiAgICAgICAgICAgICAgICBkLmdldFVUQ0RhdGUoKSArIHBlcmlvZE9mZnNldCk7XG4gICAgICAgIH1cbiAgICAgICAgYnJlYWs7XG4gICAgY2FzZSAndyc6XG4gICAgICAgIC8vIEN1cnJlbnRseSwgYWx3YXlzIG9uIFN1bmRheSBtb3JuaW5nIGF0IDAwOjAwOjAwIChVVEMpLlxuICAgICAgICBpZiAodGhpcy5yb3RBdCkge1xuICAgICAgICAgICAgcm90QXQgPSB0aGlzLnJvdEF0ICsgdGhpcy5wZXJpb2ROdW0gKiA3ICogMjQgKiA2MCAqIDYwICogMTAwMFxuICAgICAgICAgICAgICAgICogcGVyaW9kT2Zmc2V0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gRmlyc3QgdGltZTogdGhpcyBjb21pbmcgU3VuZGF5LlxuICAgICAgICAgICAgdmFyIGRheU9mZnNldCA9ICg3IC0gZC5nZXRVVENEYXkoKSk7XG4gICAgICAgICAgICBpZiAocGVyaW9kT2Zmc2V0IDwgMSkge1xuICAgICAgICAgICAgICAgIGRheU9mZnNldCA9IC1kLmdldFVUQ0RheSgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHBlcmlvZE9mZnNldCA+IDEgfHwgcGVyaW9kT2Zmc2V0IDwgLTEpIHtcbiAgICAgICAgICAgICAgICBkYXlPZmZzZXQgKz0gNyAqIHBlcmlvZE9mZnNldDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJvdEF0ID0gRGF0ZS5VVEMoZC5nZXRVVENGdWxsWWVhcigpLCBkLmdldFVUQ01vbnRoKCksXG4gICAgICAgICAgICAgICAgZC5nZXRVVENEYXRlKCkgKyBkYXlPZmZzZXQpO1xuICAgICAgICB9XG4gICAgICAgIGJyZWFrO1xuICAgIGNhc2UgJ20nOlxuICAgICAgICBpZiAodGhpcy5yb3RBdCkge1xuICAgICAgICAgICAgcm90QXQgPSBEYXRlLlVUQyhkLmdldFVUQ0Z1bGxZZWFyKCksXG4gICAgICAgICAgICAgICAgZC5nZXRVVENNb250aCgpICsgdGhpcy5wZXJpb2ROdW0gKiBwZXJpb2RPZmZzZXQsIDEpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gRmlyc3QgdGltZTogdGhlIHN0YXJ0IG9mIHRoZSBuZXh0IG1vbnRoLlxuICAgICAgICAgICAgcm90QXQgPSBEYXRlLlVUQyhkLmdldFVUQ0Z1bGxZZWFyKCksXG4gICAgICAgICAgICAgICAgZC5nZXRVVENNb250aCgpICsgcGVyaW9kT2Zmc2V0LCAxKTtcbiAgICAgICAgfVxuICAgICAgICBicmVhaztcbiAgICBjYXNlICd5JzpcbiAgICAgICAgaWYgKHRoaXMucm90QXQpIH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gZXhpc3RzXG4gICAgICAgICAgICBtb3ZlcygpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtb3ZlcygpIHtcbiAgICAgICAgaWYgKHNlbGYuY291bnQgPT09IDAgfHwgbiA8IDApIHtcbiAgICAgICAgICAgIHJldHVybiBmaW5pc2goKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgYmVmb3JlID0gc2VsZi5wYXRoO1xuICAgICAgICB2YXIgYWZ0ZXIgPSBzZWxmLnBhdGggKyAnLicgKyBTdHJpbmcobik7XG4gICAgICAgIGlmIChuID4gMCkge1xuICAgICAgICAgICAgYmVmb3JlICs9ICcuJyArIFN0cmluZyhuIC0gMSk7XG4gICAgICAgIH1cbiAgICAgICAgbiAtPSAxO1xuICAgICAgICBmcy5leGlzdHMoYmVmb3JlLCBmdW5jdGlvbiAoZXhpc3RzKSB7XG4gICAgICAgICAgICBpZiAoIWV4aXN0cykge1xuICAgICAgICAgICAgICAgIG1vdmVzKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNlbGYuX2RlYnVnKCcgIG12ICVzICVzJywgYmVmb3JlLCBhZnRlcik7XG4gICAgICAgICAgICAgICAgbXYoYmVmb3JlLCBhZnRlciwgZnVuY3Rpb24gKG12RXJyKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtdkVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5lbWl0KCdlcnJvcicsIG12RXJyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbmlzaCgpOyAvLyBYWFggZmluaXNoIGhlcmU/XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb3ZlcygpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZmluaXNoKC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IGxpbmUgd3JwYXBpbmcgP1xuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmxpbmV3cmFwID09PSBmYWxzZSl7XG4gICAgICAgICAgICB0aGlzLnRlcm1pbmFsLmxpbmVXcmFwcGluZyh0cnVlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHJlc2V0IGN1cnNvclxuICAgICAgICB0aGlzLnRlcm1pbmFsLmN1cnNvclJlbGF0aXZlUmVzZXQoKTtcblxuICAgICAgICAvLyB0cmlnZ2VyIGV2ZW50XG4gICAgICAgIHRoaXMuZW1pdCgnc3RvcC1wcmUtY2xlYXInKTtcblxuICAgICAgICAvLyBjbGVhciBsaW5lIG9uIGNvbXBsZXRlID9cbiAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5jbGVhck9uQ29tcGxldGUpe1xuICAgICAgICAgICAgLy8gY2xlYXIgYWxsIGJhcnNcbiAgICAgICAgICAgIHRoaXMudGVybWluYWwuY2xlYXJCb3R0b20oKTtcbiAgICAgICAgICAgIFxuICAgICAgICAvLyBvciBzaG93IGZpbmFsIHByb2dyZXNzID9cbiAgICAgICAgfWVsc2V7XG4gICAgICAgICAgICAvLyB1cGRhdGUgZWFjaCBiYXJcbiAgICAgICAgICAgIGZvciAobGV0IGk9MDsgaTwgdGhpcy5iYXJzLmxlbmd0aDsgaSsrKXtcbiAgICAgICAgICAgICAgICAvLyBhZGQgbmV3IGxpbmUgP1xuICAgICAgICAgICAgICAgIGlmIChpID4gMCl7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudGVybWluYWwubmV3bGluZSgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIHRyaWdnZXIgZmluYWwgcmVuZGVyaW5nXG4gICAgICAgICAgICAgICAgdGhpcy5iYXJzW2ldLnJlbmRlcigpO1xuXG4gICAgICAgICAgICAgICAgLy8gc3RvcFxuICAgICAgICAgICAgICAgIHRoaXMuYmFyc1tpXS5zdG9wKCk7XG4gICAgICAgICAg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hY2spe1xuICAgICAgICAgICAgcHJvY2Vzcy5yZW1vdmVMaXN0ZW5lcignU0lHSU5UJywgdGhpcy5zaWdpbnRDYWxsYmFjayk7XG4gICAgICAgICAgICBwcm9jZXNzLnJlbW92ZUxpc3RlbmVyKCdTSUdURVJNJywgdGhpcy5zaWdpbnRDYWxsYmFjayk7XG4gICAgICAgICAgICB0aGlzLnNpZ2ludENhbGxiYWNrID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHRyaWdnZXIgZmluYWwgcmVuZGVyaW5nXG4gICAgICAgIHRoaXMucmVuZGVyKCk7XG5cbiAgICAgICAgLy8gcmVzdG9yZSBzdGF0ZVxuICAgICAgICBzdXBlci5zdG9wKCk7XG5cbiAgICAgICAgLy8gc3RvcCB0aW1lclxuICAgICAgICBjbGVhclRpbWVvdXQodGhpcy50aW1lcik7XG4gICAgICAgIHRoaXMudGltZXIgPSBudWxsO1xuXG4gICAgICAgIC8vIGN1cnNvciBoaWRkZW4gP1xuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmhpZGVDdXJzb3IgPT09IHRydWUpe1xuICAgICAgICAgICAgdGhpcy50ZXJtaW5hbC5jdXJzb3IodHJ1ZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyByZS1lbmFibGUgbGluZSB3cmFwcGluZyA/XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMubGluZXdyYXAgPT09IGZhbHNlKXtcbiAgICAgICAgICAgIHRoaXMudGVybWluYWwubGluZVdyYXBwaW5nKHRydWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gcmVzdG9yZSBjdXJzb3Igb24gY29tcGxldGUgKHBvc2l0aW9uICsgc2V0dGluZ3MpXG4gICAgICAgIHRoaXMudGVybWluYWwuY3Vyc29yUmVzdG9yZSgpO1xuXG4gICAgICAgIC8vIGNsZWFyIGxpbmUgb24gY29tcGxldGUgP1xuICAgICAgICBpZiAodGhpcy5vcHRpb25zLmNsZWFyT25Db21wbGV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gzRFxcdURDNjkoPzpcXHVEODNDW1xcdURGRkItXFx1REZGRl0pfFxcdUQ4M0NcXHVEREYyKD86XFx1RDgzQ1tcXHVEREU2XFx1RERFOC1cXHVEREVEXFx1RERGMC1cXHVEREZGXSl8XFx1RDgzQ1xcdURERTYoPzpcXHVEODNDW1xcdURERTgtXFx1RERFQ1xcdURERUVcXHVEREYxXFx1RERGMlxcdURERjRcXHVEREY2LVxcdURERkFcXHVEREZDXFx1RERGRFxcdURERkZdKXxcXHVEODNDXFx1RERGMCg/OlxcdUQ4M0NbXFx1RERFQVxcdURERUMtXFx1RERFRVxcdURERjJcXHVEREYzXFx1RERGNVxcdURERjdcXHVEREZDXFx1RERGRVxcdURERkZdKXxcXHVEODNDXFx1RERFRCg/OlxcdUQ4M0NbXFx1RERGMFxcdURERjJcXHVEREYzXFx1RERGN1xcdURERjlcXHVEREZBXSl8XFx1RDgzQ1xcdURERTkoPzpcXHVEODNDW1xcdURERUFcXHVEREVDXFx1RERFRlxcdURERjBcXHVEREYyXFx1RERGNFxcdURERkZdKXxcXHVEODNDXFx1RERGRSg/OlxcdUQ4M0NbXFx1RERFQVxcdURERjldKXxcXHVEODNDXFx1RERFQyg/OlxcdUQ4M0NbXFx1RERFNlxcdURERTdcXHVEREU5LVxcdURERUVcXHVEREYxLVxcdURERjNcXHVEREY1LVxcdURERkFcXHVEREZDXFx1RERGRV0pfFxcdUQ4M0NcXHVEREY4KD86XFx1RDgzQ1tcXHVEREU2LVxcdURERUFcXHVEREVDLVxcdURERjRcXHVEREY3LVxcdURERjlcXHVEREZCXFx1RERGRC1cXHVEREZGXSl8XFx1RDgzQ1xcdURERUIoPzpcXHVEODNDW1xcdURERUUtXFx1RERGMFxcdURERjJcXHVEREY0XFx1RERGN10pfFxcdUQ4M0NcXHVEREY1KD86XFx1RDgzQ1tcXHVEREU2XFx1RERFQS1cXHVEREVEXFx1RERGMC1cXHVEREYzXFx1RERGNy1cXHVEREY5XFx1RERGQ1xcdURERkVdKXxcXHVEODNDXFx1RERGQig/OlxcdUQ4M0NbXFx1RERFNlxcdURERThcXHVEREVBXFx1RERFQ1xcdURERUVcXHVEREYzXFx1RERGQV0pfFxcdUQ4M0NcXHVEREYzKD86XFx1RDgzQ1tcXHVEREU2XFx1RERFOFxcdURERUEtXFx1RERFQ1xcdURERUVcXHVEREYxXFx1RERGNFxcdURERjVcXHVEREY3XFx1RERGQVxcdURERkZdKXxcXHVEODNDXFx1RERFOCg/OlxcdUQ4M0NbXFx1RERFNlxcdURERThcXHVEREU5XFx1RERFQi1cXHVEREVFXFx1RERGMC1cXHVEREY1XFx1RERGN1xcdURERkEtXFx1RERGRl0pfFxcdUQ4M0NcXHVEREYxKD86XFx1RDgzQ1tcXHVEREU2LVxcdURERThcXHVEREVFXFx1RERGMFxcdURERjctXFx1RERGQlxcdURERkVdKXxcXHVEODNDXFx1RERGRig/OlxcdUQ4M0NbXFx1RERFNlxcdURERjJcXHVEREZDXSl8XFx1RDgzQ1xcdURERkMoPzpcXHVEODNDW1xcdURERUJcXHVEREY4XSl8XFx1RDgzQ1xcdURERkEoPzpcXHVEODNDW1xcdURERTZcXHVEREVDXFx1RERGMlxcdURERjNcXHVEREY4XFx1RERGRVxcdURERkZdKXxcXHVEODNDXFx1RERFRSg/OlxcdUQ4M0NbXFx1RERFOC1cXHVEREVBXFx1RERGMS1cXHVEREY0XFx1RERGNi1cXHVEREY5XSl8XFx1RDgzQ1xcdURERUYoPzpcXHVEODNDW1xcdURERUFcXHVEREYyXFx1RERGNFxcdURERjVdKXwoPzpcXHVEODNDW1xcdURGQzNcXHVERkM0XFx1REZDQV18XFx1RDgzRFtcXHVEQzZFXFx1REM3MVxcdURDNzNcXHVEQzc3XFx1REM4MVxcdURDODJcXHVEQzg2XFx1REM4N1xcdURFNDUtXFx1REU0N1xcdURFNEJcXHVERTREXFx1REU0RVxcdURFQTNcXHVERUI0LVxcdURFQjZdfFxcdUQ4M0VbXFx1REQyNlxcdUREMzctXFx1REQzOVxcdUREM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EXFx1MzI5N1xcdTMyOTldfFxcdUQ4M0NbXFx1REMwNFxcdURDQ0ZcXHVERDcwXFx1REQ3MVxcdUREN0VcXHVERDdGXFx1REQ4RVxcdUREOTEtXFx1REQ5QVxcdURERTYtXFx1RERGRlxcdURFMDFcXHVERTAyXFx1REUxQVxcdURFMkZcXHVERTMyLVxcdURFM0FcXHVERTUwXFx1REU1MVxcdURGMDAtXFx1REYyMVxcdURGMjQtXFx1REY5M1xcdURGOTZcXHVERjk3XFx1REY5OS1cXHVERjlCXFx1REY5RS1cXHVERkYwXFx1REZGMy1cXHVERkY1XFx1REZGNy1cXHVERkZGXXxcXHVEODNEW1xcdURDMDAtXFx1RENGRFxcdURDRkYtXFx1REQzRFxcdURENDktXFx1REQ0RVxcdURENTAtXFx1REQ2N1xcdURENkZcXHVERDcwXFx1REQ3My1cXHVERDdBXFx1REQ4N1xcdUREOEEtXFx1REQ4RFxcdUREOTBcXHVERDk1XFx1REQ5NlxcdUREQTRcXHVEREE1XFx1RERBOFxcdUREQjFcXHVEREIyXFx1RERCQ1xcdUREQzItXFx1RERDNFxcdURERDEtXFx1REREM1xcdUREREMtXFx1RERERVxcdURERTFcXHVEREUzXFx1RERFOFxcdURERUZcXHVEREYzXFx1RERGQS1cXHVERTRGXFx1REU4MC1cXHVERUM1XFx1REVDQi1cXHVERUQyXFx1REVENVxcdURFRTAtXFx1REVFNVxcdURFRTlcXHVERUVCXFx1REVFQ1xcdURFRjBcXHVERUYzLVxcdURFRkFcXHVERkUwLVxcdURGRUJdfFxcdUQ4M0VbXFx1REQwRC1cXHVERDNBXFx1REQzQy1cXHVERDQ1XFx1REQ0Ny1cXHVERDcxXFx1REQ3My1cXHVERDc2XFx1REQ3QS1cXHVEREEyXFx1RERBNS1cXHVEREFBXFx1RERBRS1cXHVERENBXFx1RERDRC1cXHVEREZGXFx1REU3MC1cXHVERTczXFx1REU3OC1cXHVERTdBXFx1REU4MC1cXHVERTgyXFx1REU5MC1cXHVERTk1XSlcXHV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xpc3RlbmVyKVxuICAgICAgICAgICAgdGhpcy5lbWl0KCdyZW1vdmVMaXN0ZW5lcicsIHR5cGUsIGxpc3QubGlzdGVuZXIgfHwgbGlzdGVuZXIpO1xuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKHR5cGVvZiBsaXN0ICE9PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIHBvc2l0aW9uID0gLTE7XG5cbiAgICAgICAgZm9yIChpID0gbGlzdC5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xuICAgICAgICAgIGlmIChsaXN0W2ldID09PSBsaXN0ZW5lciB8fCBsaXN0W2ldLmxpc3RlbmVyID09PSBsaXN0ZW5lcikge1xuICAgICAgICAgICAgb3JpZ2luYWxMaXN0ZW5lciA9IGxpc3RbaV0ubGlzdGVuZXI7XG4gICAgICAgICAgICBwb3NpdGlvbiA9IGk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAocG9zaXRpb24gPCAwKVxuICAgICAgICAgIHJldHVybiB0aGlzO1xuXG4gICAgICAgIGlmIChwb3NpdGlvbiA9PT0gMClcbiAgICAgICAgICBsaXN0LnNoaWZ0KCk7XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIHNwbGljZU9uZShsaXN0LCBwb3NpdGlvbik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobGlzdC5sZW5ndGggPT09IDEpXG4gICAgICAgICAgZXZlbnRzW3R5cGVdID0gbGlzdFswXTtcblxuICAgICAgICBpZiAoZXZlbnRzLnJlbW92ZUxpc3RlbmVyICE9PSB1bmRlZmluZWQpXG4gICAgICAgICAgdGhpcy5lbWl0KCdyZW1vdmVMaXN0ZW5lcicsIHR5cGUsIG9yaWdpbmFsTGlzdGVuZXIgfHwgbGlzdGVuZXIpO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gdGhpcztcbiAgICB9O1xuXG5FdmVudEVtaXR0ZXIucHJvdG90eXBlLm9mZiA9IEV2ZW50RW1pdHRlci5wcm90b3R5cGUucmVtb3ZlTGlzdGVuZXI7XG5cbkV2ZW50RW1pdHRlci5wcm90b3R5cGUucmVtb3ZlQWxsTGlzdGVuZXJzID1cbiAgICBmdW5jdGlvbiByZW1vdmVBbGxMaXN0ZW5lcnModHlwZSkge1xuICAgICAgdmFyIGxpc3RlbmVycywgZXZlbnRzLCBpO1xuXG4gICAgICBldmVudHMgPSB0aGlzLl9ldmVudHM7XG4gICAgICBpZiAoZXZlbnRzID09PSB1bmRlZmluZWQpXG4gICAgICAgIHJldHVybiB0aGlzO1xuXG4gICAgICAvLyBub3QgbGlzdGVuaW5nIGZvciByZW1vdmVMaXN0ZW5lciwgbm8gbmVlZCB0byBlbWl0XG4gICAgICBpZiAoZXZlbnRzLnJlbW92ZUxpc3RlbmVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICB0aGlzLl9ldmVudHMgPSBPYmplY3QuY3JlYXRlKG51bGwpO1xuICAgICAgICAgIHRoaXMuX2V2ZW50c0NvdW50ID0gMDtcbiAgICAgICAgfSBlbHNlIGlmIChldmVudHNbdHlwZV0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGlmICgtLXRoaXMuX2V2ZW50c0NvdW50ID09PSAwKVxuICAgICAgICAgICAgdGhpcy5fZXZlbnRzID0gT2JqZWN0LmNyZWF0ZShudWxsKTtcbiAgICAgICAgICBlbHNlXG4gICAgICAgICAgICBkZWxldGUgZXZlbnRzW3R5cGVdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgfVxuXG4gICAgICAvLyBlbWl0IHJlbW92ZUxpc3RlbmVyIGZvciBhbGwgbGlzdGVuZXJzIG9uIGFsbCBldmVudHNcbiAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0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luZy5cbiAgICAgICAgaWYgKHJlY2VpdmVyID09IG51bGwpIHtcbiAgICAgICAgICAgIGl0ZXJhdG9yKHN0cmluZy5jaGFyQXQoaSksIGksIHN0cmluZyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpdGVyYXRvci5jYWxsKHJlY2VpdmVyLCBzdHJpbmcuY2hhckF0KGkpLCBpLCBzdHJpbmcpO1xuICAgICAgICB9XG4gICAgfVxufTtcblxudmFyIGZvckVhY2hPYmplY3QgPSBmdW5jdGlvbiBmb3JFYWNoT2JqZWN0KG9iamVjdCwgaXRlcmF0b3IsIHJlY2VpdmVyKSB7XG4gICAgZm9yICh2YXIgayBpbiBvYmplY3QpIHtcbiAgICAgICAgaWYgKGhhc093blByb3BlcnR5LmNhbGwob2JqZWN0LCBrKSkge1xuICAgICAgICAgICAgaWYgKHJlY2VpdmVyID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpdGVyYXRvcihvYmplY3Rba10sIGssIG9iamVjdCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGl0ZXJhdG9yLmNhbGwocmVjZWl2ZXIsIG9iamVjdFtrXSwgaywgb2JqZWN0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG5cbnZhciBmb3JFYWNoID0gZnVuY3Rpb24gZm9yRWFjaChsaXN0LCBpdGVyYXRvciwgdGhpc0FyZykge1xuICAgIGlmICghaXNDYWxsYWJsZShpdGVyYXRvcikpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignaXRlcmF0b3IgbXVzdCBiZSBhIGZ1bmN0aW9uJyk7XG4gICAgfVxuXG4gICAgdmFyIHJlY2VpdmVyO1xuICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID49IDMpIHtcbiAgICAgICAgcmVjZWl2ZXIgPSB0aGlzQXJnO1xuICAgIH1cblxuICAgIGlmICh0b1N0ci5jYWxsKGxpc3QpID09PSAnW29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gICAgdGhpcyxcbiAgICAgICAgICAgICAgICBjb25jYXR0eShhcmdzLCBhcmd1bWVudHMpXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgaWYgKE9iamVjdChyZXN1bHQpID09PSByZXN1bHQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRhcmdldC5hcHBseShcbiAgICAgICAgICAgIHRoYXQsXG4gICAgICAgICAgICBjb25jYXR0eShhcmdzLCBhcmd1bWVudHMpXG4gICAgICAgICk7XG5cbiAgICB9O1xuXG4gICAgdmFyIGJvdW5kTGVuZ3RoID0gbWF4KDAsIHRhcmdldC5sZW5ndGggLSBhcmdzLmxlbmd0aCk7XG4gICAgdmFyIGJvdW5kQXJncyA9IFtdO1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYm91bmRMZW5ndGg7IGkrKykge1xuICAgICAgICBib3VuZEFyZ3NbaV0gPSAnJCcgKyBpO1xuICAgIH1cblxuICAgIGJvdW5kID0gRnVuY3Rpb24oJ2JpbmRlcicsICdyZXR1cm4gZnVuY3Rpb24gKCcgKyBqb2lueShib3VuZEFyZ3MsICcsJykgKyAnKXsgcmV0dXJuIGJpbmRlci5hcHBseSh0aGlzLGFyZ3VtZW50cyk7IH0nKShiaW5kZXIpO1xuXG4gICAgaWYgKHRhcmdldC5wcm90b3R5cGUpIHtcbiAgICAgICAgdmFyIEVtcHR5ID0gZnVuY3Rpb24gRW1wdHkoKSB7fTtcbiAgICAgICAgRW1wdHkucHJvdG90eXBlID0gdGFyZ2V0LnByb3RvdHlwZTtcbiAgICAgICAgYm91bmQucHJvdG90eXBlID0gbmV3IEVtcHR5KCk7XG4gICAgICAgIEVtcHR5LnByb3RvdHlwZSA9IG51bGw7XG4gICAgfVxuXG4gICAgcmV0dXJuIGJvdW5kO1xufTtcbiIsIid1c2Ugc3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lKSAmJiAhKHZhbHVlIGluc3RhbmNlb2YgTGF6eVdyYXBwZXIpKSB7XG4gICAgICAgIGlmICh2YWx1ZSBpbnN0YW5jZW9mIExvZGFzaFdyYXBwZXIpIHtcbiAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGhhc093blByb3BlcnR5LmNhbGwodmFsdWUsICdfX3dyYXBwZWRfXycpKSB7XG4gICAgICAgICAgcmV0dXJuIHdyYXBwZXJDbG9uZSh2YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBuZXcgTG9kYXNoV3JhcHBlcih2YWx1ZSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uY3JlYXRlYCB3aXRob3V0IHN1cHBvcnQgZm9yIGFzc2lnbmluZ1xuICAgICAqIHByb3BlcnRpZXMgdG8gdGhlIGNyZWF0ZWQgb2JqZWN0LlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gcHJvdG8gVGhlIG9iamVjdCB0byBpbmhlcml0IGZyb20uXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgbmV3IG9iamVjdC5cbiAgICAgKi9cbiAgICB2YXIgYmFzZUNyZWF0ZSA9IChmdW5jdGlvbigpIHtcbiAgICAgIGZ1bmN0aW9uIG9iamVjdCgpIHt9XG4gICAgICByZXR1cm4gZnVuY3Rpb24ocHJvdG8pIHtcbiAgICAgICAgaWYgKCFpc09iamVjdChwcm90bykpIHtcbiAgICAgICAgICByZXR1cm4ge307XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9iamVjdENyZWF0ZSkge1xuICAgICAgICAgIHJldHVybiBvYmplY3RDcmVhdGUocHJvdG8pO1xuICAgICAgICB9XG4gICAgICAgIG9iamVjdC5wcm90b3R5cGUgPSBwcm90bztcbiAgICAgICAgdmF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50ID0gbmF0aXZlTWluKGxlbmd0aCwgdGhpcy5fX3Rha2VDb3VudF9fKTtcblxuICAgICAgaWYgKCFpc0FyciB8fCAoIWlzUmlnaHQgJiYgYXJyTGVuZ3RoID09IGxlbmd0aCAmJiB0YWtlQ291bnQgPT0gbGVuZ3RoKSkge1xuICAgICAgICByZXR1cm4gYmFzZVdyYXBwZXJWYWx1ZShhcnJheSwgdGhpcy5fX2FjdGlvbnNfXyk7XG4gICAgICB9XG4gICAgICB2YXIgcmVzdWx0ID0gW107XG5cbiAgICAgIG91dGVyOlxuICAgICAgd2hpbGUgKGxlbmd0aC0tICYmIHJlc0luZGV4IDwgdGFrZUNvdW50KSB7XG4gICAgICAgIGluZGV4ICs9IGRpcjtcblxuICAgICAgICB2YXIgaXRlckluZGV4ID0gLTEsXG4gICAgICAgICAgICB2YWx1ZSA9IGFycmF5W2luZGV4XTtcblxuICAgICAgICB3aGlsZSAoKytpdGVySW5kZXggPCBpdGVyTGVuZ3RoKSB7XG4gICAgICAgICAgdmFyIGRhdGEgPSBpdGVyYXRlZXNbaXRlckluZGV4XSxcbiAgICAgICAgICAgICAgaXRlcmF0ZWUgPSBkYXRhLml0ZXJhdGVlLFxuICAgICAgICAgICAgICB0eXBlID0gZGF0YS50eXBlLFxuICAgICAgICAgICAgICBjb21wdXRlZCA9IGl0ZXJhdGVlKHZhbHVlKTtcblxuICAgICAgICAgIGlmICh0eXBlID09IExBWllfTUFQX0ZMQUcpIHtcbiAgICAgICAgICAgIHZhbHVlID0gY29tcHV0ZWQ7XG4gICAgICAgICAgfSBlbHNlIGlmICghY29tcHV0ZWQpIHtcbiAgICAgICAgICAgIGlmICh0eXBlID09IExBWllfRklMVEVSX0ZMQUcpIHtcbiAgICAgICAgICAgICAgY29udGludWUgb3V0ZXI7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBicmVhayBvdXRlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiA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gKGNvbXBhcmF0b3IgfHwgdmFsdWUgIT09IDApID8gdmFsdWUgOiAwO1xuICAgICAgICBpZiAoIShzZWVuXG4gICAgICAgICAgICAgID8gY2FjaGVIYXMoc2VlbiwgY29tcHV0ZWQpXG4gICAgICAgICAgICAgIDogaW5jbHVkZXMocmVzdWx0LCBjb21wdXRlZCwgY29tcGFyYXRvcilcbiAgICAgICAgICAgICkpIHtcbiAgICAgICAgICBvdGhJbmRleCA9IG90aExlbmd0aDtcbiAgICAgICAgICB3aGlsZSAoLS1vdGhJbmRleCkge1xuICAgICAgICAgICAgdmFyIGNhY2hlID0gY2FjaGVzW290aEluZGV4XTtcbiAgICAgICAgICAgIGlmICghKGNhY2hlXG4gICAgICAgICAgICAgICAgICA/IGNhY2hlSGFzKGNhY2hlLCBjb21wdXRlZClcbiAgICAgICAgICAgICAgICAgIDogaW5jbHVkZXMoYXJyYXlzW290aEluZGV4XSwgY29tcHV0ZWQsIGNvbXBhcmF0b3IpKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICBjb250aW51ZSBvdXRlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNlZW4pIHtcbiAgICAgICAgICAgIHNlZW4ucHVzaChjb21wdXRlZCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdC5wdXNoKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGUgYmFzZSBpbXBsZW1lbnRhdGlvbiBvZiBgXy5pbnZlcnRgIGFuZCBgXy5pbnZlcnRCeWAgd2hpY2ggaW52ZXJ0c1xuICAgICAqIGBvYmplY3RgIHdpdGggdmFsdWVzIHRyYW5zZm9ybWVkIGJ5IGBpdGVyYXRlZWAgYW5kIHNldCBieSBgc2V0dGVyYC5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQHBh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AgICAqL1xuICAgIGZ1bmN0aW9uIGJhc2VJc0VxdWFsRGVlcChvYmplY3QsIG90aGVyLCBiaXRtYXNrLCBjdXN0b21pemVyLCBlcXVhbEZ1bmMsIHN0YWNrKSB7XG4gICAgICB2YXIgb2JqSXNBcnIgPSBpc0FycmF5KG9iamVjdCksXG4gICAgICAgICAgb3RoSXNBcnIgPSBpc0FycmF5KG90aGVyKSxcbiAgICAgICAgICBvYmpUYWcgPSBvYmpJc0FyciA/IGFycmF5VGFnIDogZ2V0VGFnKG9iamVjdCksXG4gICAgICAgICAgb3RoVGFnID0gb3RoSXNBcnIgPyBhcnJheVRhZyA6IGdldFRhZyhvdGhlcik7XG5cbiAgICAgIG9ialRhZyA9IG9ialRhZyA9PSBhcmdzVGFnID8gb2JqZWN0VGFnIDogb2JqVGFnO1xuICAgICAgb3RoVGFnID0gb3RoVGFnID09IGFyZ3NUYWcgPyBvYmplY3RUYWcgOiBvdGhUYWc7XG5cbiAgICAgIHZhciBvYmpJc09iaiA9IG9ialRhZyA9PSBvYmplY3RUYWcsXG4gICAgICAgICAgb3RoSXNPYmogPSBvdGhUYWcgPT0gb2JqZWN0VGFnLFxuICAgICAgICAgIGlzU2FtZVRhZyA9IG9ialRhZyA9PSBvdGhUYWc7XG5cbiAgICAgIGlmIChpc1NhbWVUYWcgJiYgaXNCdWZmZXIob2JqZWN0KSkge1xuICAgICAgICBpZiAoIWlzQnVmZmVyKG90aGVyKSkge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgICBvYmpJc0FyciA9IHRydWU7XG4gICAgICAgIG9iaklzT2JqID0gZmFsc2U7XG4gICAgICB9XG4gICAgICBpZiAoaXNTYW1lVGFnICYmICFvYmpJc09iaikge1xuICAgICAgICBzdGFjayB8fCAoc3RhY2sgPSBuZXcgU3RhY2spO1xuICAgICAgICByZXR1cm4gKG9iaklzQXJyIHx8IGlzVHlwZWRBcnJheShvYmplY3QpKVxuICAgICAgICAgID8gZ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gICAgICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGBvYmplY3RgIGlzIGEgbWF0Y2gsIGVsc2UgYGZhbHNlYC5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBiYXNlSXNNYXRjaChvYmplY3QsIHNvdXJjZSwgbWF0Y2hEYXRhLCBjdXN0b21pemVyKSB7XG4gICAgICB2YXIgaW5kZXggPSBtYXRjaERhdGEubGVuZ3RoLFxuICAgICAgICAgIGxlbmd0aCA9IGluZGV4LFxuICAgICAgICAgIG5vQ3VzdG9taXplciA9ICFjdXN0b21pemVyO1xuXG4gICAgICBpZiAob2JqZWN0ID09IG51bGwpIHtcbiAgICAgICAgcmV0dXJuICFsZW5ndGg7XG4gICAgICB9XG4gICAgICBvYmplY3QgPSBPYmplY3Qob2JqZWN0KTtcbiAgICAgIHdoaWxlIChpbmRleC0tKSB7XG4gICAgICAgIHZhciBkYXRhID0gbWF0Y2hEYXRhW2luZGV4XTtcbiAgICAgICAgaWYgKChub0N1c3RvbWl6ZXIgJiYgZGF0YVsyXSlcbiAgICAgICAgICAgICAgPyBkYXRhWzFdICE9PSBvYmplY3RbZGF0YVswXV1cbiAgICAgICAgICAgICAgOiAhKGRhdGFbMF0gaW4gb2JqZWN0KVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICBkYXRhID0gbWF0Y2hEYXRhW2luZGV4XTtcbiAgICAgICAgdmFyIGtleSA9IGRhdGFbMF0sXG4gICAgICAgICAgICBvYmpWYWx1ZSA9IG9iamVjdFtrZXldLFxuICAgICAgICAgICAgc3JjVmFsdWUgPSBkYXRhWzFdO1xuXG4gICAgICAgIGlmIChub0N1c3RvbWl6ZXIgJiYgZGF0YVsyXSkge1xuICAgICAgICAgIGlmIChvYmpWYWx1ZSA9PT0gdW5kZWZpbmV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BhcmF0b3IgaW52b2tlZCBwZXIgZWxlbWVudC5cbiAgICAgKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIG5ldyBhcnJheSBvZiB2YWx1ZXMuXG4gICAgICovXG4gICAgZnVuY3Rpb24gYmFzZVhvcihhcnJheXMsIGl0ZXJhdGVlLCBjb21wYXJhdG9yKSB7XG4gICAgICB2YXIgbGVuZ3RoID0gYXJyYXlzLmxlbmd0aDtcbiAgICAgIGlmIChsZW5ndGggPCAyKSB7XG4gICAgICAgIHJldHVybiBsZW5ndGggPyBiYXNlVW5pcShhcnJheXNbMF0pIDogW107XG4gICAgICB9XG4gICAgICB2YXIgaW5kZXggPSAtMSxcbiAgICAgICAgICByZXN1bHQgPSBBcnJheShsZW5ndGgpO1xuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIgYXJyYXkgPSBhcnJheXNbaW5kZXhdLFxuICAgICAgICAgICAgb3RoSW5kZXggPSAtMTtcblxuICAgICAgICB3aGlsZSAoKytvdGhJbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgIGlmIChvdGhJbmRleCAhPSBpbmRleCkge1xuICAgICAgICAgICAgcmVzdWx0W2luZGV4XSA9IGJhc2VEaWZmZXJlbmNlKHJlc3VsdFtpbmRleF0gfHwgYXJyYXksIGFycmF5c1tvdGhJbmRleF0sIGl0ZXJhdGVlLCBjb21wYXJhdG9yKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBiYXNlVW5pcShiYXNlRmxhdHRlbihyZXN1bHQsIDEpLCBpdGVyYXRlZSwgY29tcGFyYXRvcik7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhpcyBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLnppcE9iamVjdGAgd2hpY2ggYXNzaWducyB2YWx1ZXMgdXNpbmcgYGFzc2lnbkZ1bmNgLlxuICAgICAqXG4gICAgICogQHBya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S5sZW5ndGggJiYgZGF0YVs5XSA9PSAxXG4gICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgd3JhcHBlciA9IHdyYXBwZXJbZ2V0RnVuY05hbWUoZGF0YVswXSldLmFwcGx5KHdyYXBwZXIsIGRhdGFbM10pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB3cmFwcGVyID0gKGZ1bmMubGVuZ3RoID09IDEgJiYgaXNMYXppYWJsZShmdW5jKSlcbiAgICAgICAgICAgICAgPyB3cmFwcGVyW2Z1bmNOYW1lXSgpXG4gICAgICAgICAgICAgIDogd3JhcHBlci50aHJ1KGZ1bmMpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGFyZ3MgPSBhcmd1bWVudHMsXG4gICAgICAgICAgICAgIHZhbHVlID0gYXJnc1swXTtcblxuICAgICAgICAgIGlmICh3cmFwcGVyICYmIGFyZ3MubGVuZ3RoID09IDEgJiYgaXNBcnJheSh2YWx1ZSkpIHtcbiAgICAgICAgICAgIHJldHVybiB3cmFwcGVyLnBsYW50KHZhbHVlKS52YWx1ZSgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICB2YXIgaW5kZXggPSAwLFxuICAgICAgICAgICAgICByZXN1bHQgPSBsZW5ndGggPyBmdW5jc1tpbmRleF0uYXBwbHkodGhpcywgYXJncykgOiB2YWx1ZTtcblxuICAgICAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICByZXN1bHQgPSBmdW5jc1tpbmRleF0uY2FsbCh0aGlzLCByZXN1bHQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9O1xuICAgICAgfSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ3JlYXRlcyBhIGZ1bmN0aW9uIHRoYXQgd3JhcHMgYGZ1bmNgIHRvIGludm9r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uICAgICAgICAgICAgOiBjdXN0b21pemVyKGFyclZhbHVlLCBvdGhWYWx1ZSwgaW5kZXgsIGFycmF5LCBvdGhlciwgc3RhY2spO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb21wYXJlZCAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgaWYgKGNvbXBhcmVkKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgLy8gUmVjdXJzaXZlbHkgY29tcGFyZSBhcnJheXMgKHN1c2NlcHRpYmxlIHRvIGNhbGwgc3RhY2sgbGltaXRzKS5cbiAgICAgICAgaWYgKHNlZW4pIHtcbiAgICAgICAgICBpZiAoIWFycmF5U29tZShvdGhlciwgZnVuY3Rpb24ob3RoVmFsdWUsIG90aEluZGV4KSB7XG4gICAgICAgICAgICAgICAgaWYgKCFjYWNoZUhhcyhzZWVuLCBvdGhJbmRleCkgJiZcbiAgICAgICAgICAgICAgICAgICAgKGFyclZhbHVlID09PSBvdGhWYWx1ZSB8fCBlcXVhbEZ1bmMoYXJyVmFsdWUsIG90aFZhbHVlLCBiaXRtYXNrLCBjdXN0b21pemVyLCBzdGFjaykpKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gc2Vlbi5wdXNoKG90aEluZGV4KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pKSB7XG4gICAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmICghKFxuICAgICAgICAgICAgICBhcnJWYWx1ZSA9PT0gb3RoVmFsdWUgfHxcbiAgICAgICAgICAgICAgICBlcXVhbEZ1bmMoYXJyVmFsdWUsIG90aFZhbHVlLCBiaXRtYXNrLCBjdXN0b21pemVyLCBzdGFjaylcbiAg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b0FycmF5KTtcblxuICAgICAgICAgIGlmIChvYmplY3Quc2l6ZSAhPSBvdGhlci5zaXplICYmICFpc1BhcnRpYWwpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gQXNzdW1lIGN5Y2xpYyB2YWx1ZXMgYXJlIGVxdWFsLlxuICAgICAgICAgIHZhciBzdGFja2VkID0gc3RhY2suZ2V0KG9iamVjdCk7XG4gICAgICAgICAgaWYgKHN0YWNrZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBzdGFja2VkID09IG90aGVyO1xuICAgICAgICAgIH1cbiAgICAgICAgICBiaXRtYXNrIHw9IENPTVBBUkVfVU5PUkRFUkVEX0ZMQUc7XG5cbiAgICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIG9iamVjdHMgKHN1c2NlcHRpYmxlIHRvIGNhbGwgc3RhY2sgbGltaXRzKS5cbiAgICAgICAgICBzdGFjay5zZXQob2JqZWN0LCBvdGhlcik7XG4gICAgICAgICAgdmFyIHJlc3VsdCA9IGVxdWFsQXJyYXlzKGNvbnZlcnQob2JqZWN0KSwgY29udmVydChvdGhlciksIGJpdG1hc2ssIGN1c3RvbWl6ZXIsIGVxdWFsRnVuYywgc3RhY2spO1xuICAgICAgICAgIHN0YWNrWydkZWxldGUnXShvYmplY3QpO1xuICAgICAgICAgIHJldHVybiByZXN1bHQ7XG5cbiAgICAgICAgY2FzZSBzeW1ib2xUYWc6XG4gICAgICAgICAgaWYgKHN5bWJvbFZhbHVlT2YpIHtcbiAgICAgICAgICAgIHJldHVybiBzeW1ib2xWYWx1ZU9mLmNhbGwob2JqZWN0KSA9PSBzeW1ib2xWYWx1ZU9mLmNhbGwob3RoZXIpO1xuICAgICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBBIHNwZWNpYWxpemVkIHZlcnNpb24gb2YgYGJhc2V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W5kZXhdO1xuICAgICAgICB2YXIgb2JqVmFsdWUgPSBvYmplY3Rba2V5XSxcbiAgICAgICAgICAgIG90aFZhbHVlID0gb3RoZXJba2V5XTtcblxuICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgIHZhciBjb21wYXJlZCA9IGlzUGFydGlhbFxuICAgICAgICAgICAgPyBjdXN0b21pemVyKG90aFZhbHVlLCBvYmpWYWx1ZSwga2V5LCBvdGhlciwgb2JqZWN0LCBzdGFjaylcbiAgICAgICAgICAgIDogY3VzdG9taXplcihvYmpWYWx1ZSwgb3RoVmFsdWUsIGtleSwgb2JqZWN0LCBvdGhlciwgc3RhY2spO1xuICAgICAgICB9XG4gICAgICAgIC8vIFJlY3Vyc2l2ZWx5IGNvbXBhcmUgb2JqZWN0cyAoc3VzY2VwdGlibGUgdG8gY2FsbCBzdGFjayBsaW1pdHMpLlxuICAgICAgICBpZiAoIShjb21wYXJlZCA9PT0gdW5kZWZpbmVkXG4gICAgICAgICAgICAgID8gKG9ialZhbHVlID09PSBvdGhWYWx1ZSB8fCBlcXVhbEZ1bmMob2JqVmFsdWUsIG90aFZhbHVlLCBiaXRtYXNrLCBjdXN0b21pemVyLCBzdGFjaykpXG4gICAgICAgICAgICAgIDogY29tcGFyZWRcbiAgICAgICAgICAgICkpIHtcbiAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBza2lwQ3RvciB8fCAoc2tpcEN0b3IgPSBrZXkgPT0gJ2NvbnN0cnVjdG9yJyk7XG4gICAgICB9XG4gICAgICBpZiAocmVzdWx0ICYmICFza2lwQ3Rvcikge1xuICAgICAgICB2YXIgb2JqQ3RvciA9IG9iamVjdC5jb25zdHJ1Y3RvcixcbiAgICAgICAgICAgIG90aEN0b3IgPSBvdGhlci5jb25zdHJ1Y3RvcjtcblxuICAgICAgICAvLyBOb24gYE9iamVjdGAgb2JqZWN0IGluc3RhbmNlcyB3aX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ID0ge1xuICAgICAqICAgJ3VzZXInOiAnZnJlZCcsXG4gICAgICogICAnZ3JlZXQnOiBmdW5jdGlvbihncmVldGluZywgcHVuY3R1YXRpb24pIHtcbiAgICAgKiAgICAgcmV0dXJuIGdyZWV0aW5nICsgJyAnICsgdGhpcy51c2VyICsgcHVuY3R1YXRpb247XG4gICAgICogICB9XG4gICAgICogfTtcbiAgICAgKlxuICAgICAqIHZhciBib3VuZCA9IF8uYmluZEtleShvYmplY3QsICdncmVldCcsICdoaScpO1xuICAgICAqIGJvdW5kKCchJyk7XG4gICAgICogLy8gPT4gJ2hpIGZyZWQhJ1xuICAgICAqXG4gICAgICogb2JqZWN0LmdyZWV0ID0gZnVuY3Rpb24oZ3JlZXRpbmcsIHB1bmN0dWF0aW9uKSB7XG4gICAgICogICByZXR1cm4gZ3JlZXRpbmcgKyAneWEgJyArIHRoaXMudXNlciArIHB1bmN0dWF0aW9uO1xuICAgICAqIH07XG4gICAgICpcbiAgICAgKiBib3VuZCgnIScpO1xuICAgICAqIC8vID0+ICdoaXlhIGZyZWQhJ1xuICAgICAqXG4gICAgICogLy8gQm91bmQgd2l0aCBwbGFjZWhvbGRlcnMuXG4gICAgICogdmFyIGJvdW5kID0gXy5iaW5kS2V5KG9iamVjdCwgJ2dyZWV0JywgXywgJyEnKTtcbiAgICAgKiBib3VuZCgnaGknKTtcbiAgICAgKiAvLyA9PiAnaGl5YSBmcmVkISdcbiAgICAgKi9cbiAgICB2YXIgYmluZEtleSA9IGJhc2VSZXN0KGZ1bmN0aW9uKG9iamVjdCwga2V5LCBwYXJ0aWFscykge1xuICAgICAgdmFyIGJpdG1hc2sgPSBXUkFQX0JJTkRfRkxBRyB8IFdSQVBfQklORF9LRVlfRkxBRztcbiAgICAgIGlmIChwYXJ0aWFscy5sZW5ndGgpIHtcbiAgICAgICAgdmFyIGhvbGRlcnMgPSByZXBsYWNlSG9sZGVycyhwYXJ0aWFscywgZ2V0SG9sZGVyKGJpbmRLZXkpKTtcbiA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mFpbGluZ0VkZ2Uobm93KCkpO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBkZWJvdW5jZWQoKSB7XG4gICAgICAgIHZhciB0aW1lID0gbm93KCksXG4gICAgICAgICAgICBpc0ludm9raW5nID0gc2hvdWxkSW52b2tlKHRpbWUpO1xuXG4gICAgICAgIGxhc3RBcmdzID0gYXJndW1lbnRzO1xuICAgICAgICBsYXN0VGhpcyA9IHRoaXM7XG4gICAgICAgIGxhc3RDYWxsVGltZSA9IHRpbWU7XG5cbiAgICAgICAgaWYgKGlzSW52b2tpbmcpIHtcbiAgICAgICAgICBpZiAodGltZXJJZCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXR1cm4gbGVhZGluZ0VkZ2UobGFzdENhbGxUaW1lKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKG1heGluZykge1xuICAgICAgICAgICAgLy8gSGFuZGxlIGludm9jYXRpb25zIGluIGEgdGlnaHQgbG9vcC5cbiAgICAgICAgICAgIGNsZWFyVGltZW91dCh0aW1lcklkKTtcbiAgICAgICAgICAgIHRpbWVySWQgPSBzZXRUaW1lb3V0KHRpbWVyRXhwaXJlZCwgd2FpdCk7XG4gICAgICAgICAgICByZXR1cm4gaW52b2tlRnVuYyhsYXN0Q2FsbFRpbWUpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGltZXJJZCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgdGltZXJJZCA9IHNldFRpbWVvdXQodGltZXJFeHBpcmVkLCB3YWl0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgfVxuICAgICAgZGVib3VuY2VkLmNhbmNlbCA9IGNhbmNlbDtcbiAgICAgIGRlYm91bmNlZC5mbHVzaCA9IGZsdXNoO1xuICAgICAgcmV0dXJuIGRlYm91bmNlZDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBEZWZlcnMgaW52b2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VyY2UpLCBvYmplY3QpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICBmb3IgKHZhciBrZXkgaW4gc291cmNlKSB7XG4gICAgICAgIGlmIChoYXNPd25Qcm9wZXJ0eS5jYWxsKHNvdXJjZSwga2V5KSkge1xuICAgICAgICAgIGFzc2lnblZhbHVlKG9iamVjdCwga2V5LCBzb3VyY2Vba2V5XSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIGlzIGxpa2UgYF8uYXNzaWduYCBleGNlcHQgdGhhdCBpdCBpdGVyYXRlcyBvdmVyIG93biBhbmRcbiAgICAgKiBpbmhlcml0ZWQgc291cmNlIHByb3BlcnRpZXMuXG4gICAgICpcbiAgICAgKiAqKk5vdGU6KiogVGhpcyBtZXRob2QgbXV0YXRlcyBgb2JqZWN0YC5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjAuMFxuICAgICAqIEBhbGlhcyBleHRlbmRcbiAgICAgKiBAY2F0ZWdvcnkgT2JqZWN0XG4gICAgICogQHBhcmFtIHtPYmplY3R9IG9iamVjdCBUaGUgZGVzdGluYXRpb24gb2JqZWN0LlxuICAgICAqIEBwYXJhbSB7Li4uT2JqZWN0fSBbc291cmNlc10gVGhlIHNvdXJjZSBvYmplY3RzLlxuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgYG9iamVjdGAuXG4gICAgICogQHNlZSBfLmFzc2lnblxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBmdW5jdGlvbiBGb28oKSB7XG4gICAgICogICB0aGlzLmEgPSAxO1xuICAgICAqIH1cbiAgICAgKlxuICAgICAqIGZ1bmN0aW9uIEJhcigpIHtcbiAgICAgKiAgIHRoaXMuYyA9IDM7XG4gICAgICogfVxuICAgICAqXG4gICAgICogRm9vLnByb3Rvd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cHR5IHN0cmluZ3MuXG4gICAgICBzb3VyY2UgPSAoaXNFdmFsdWF0aW5nID8gc291cmNlLnJlcGxhY2UocmVFbXB0eVN0cmluZ0xlYWRpbmcsICcnKSA6IHNvdXJjZSlcbiAgICAgICAgLnJlcGxhY2UocmVFbXB0eVN0cmluZ01pZGRsZSwgJyQxJylcbiAgICAgICAgLnJlcGxhY2UocmVFbXB0eVN0cmluZ1RyYWlsaW5nLCAnJDE7Jyk7XG5cbiAgICAgIC8vIEZyYW1lIGNvZGUgYXMgdGhlIGZ1bmN0aW9uIGJvZHkuXG4gICAgICBzb3VyY2UgPSAnZnVuY3Rpb24oJyArICh2YXJpYWJsZSB8fCAnb2JqJykgKyAnKSB7XFxuJyArXG4gICAgICAgICh2YXJpYWJsZVxuICAgICAgICAgID8gJydcbiAgICAgICAgICA6ICdvYmogfHwgKG9iaiA9IHt9KTtcXG4nXG4gICAgICAgICkgK1xuICAgICAgICBcInZhciBfX3QsIF9fcCA9ICcnXCIgK1xuICAgICAgICAoaXNFc2NhcGluZ1xuICAgICAgICAgICA/ICcsIF9fZSA9IF8uZXNjYXBlJ1xuICAgICAgICAgICA6ICcnXG4gICAgICAgICkgK1xuICAgICAgICAoaXNFdmFsdWF0aW5nXG4gICAgICAgICAgPyAnLCBfX2ogPSBBcnJheS5wcm90b3R5cGUuam9pbjtcXG4nICtcbiAgICAgICAgICAgIFwiZnVuY3Rpb24gcHJpbnQoKSB7IF9fcCArPSBfX2ouY2FsbChhcmd1bWVudHMsICcnKSB9XFxuXCJcbiAgICAgICAgICA6ICc7XFxuJ1xuICAgICAgICApICtcbiAgICAgICAgc291cmNlICtcbiAgICAgICAgJ3JldHVybiBfX3BcXG59JztcblxuICAgICAgdmFyIHJlc3VsdCA9IGF0dGVtcHQoZnVuY3Rpb24oKSB7XG4gICAgICAgIHJldHVybiBGdW5jdGlvbihpbXBvcnRzS2V5cywgc291cmNlVVJMICsgJ3JldHVybiAnICsgc291cmNlKVxuICAgICAgICAgIC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xuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnU29uX01hYV9EaW5fV29lX0Rvbl9WcnlfU2F0Jy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ1NvX01hX0RpX1dvX0RvX1ZyX1NhJy5zcGxpdCgnXycpLFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvdm18bm0vaSxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gL15ubSQvaS50ZXN0KGlucHV0KTtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VycywgbWludXRlcywgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXJzIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/ICd2bScgOiAnVk0nO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/ICdubScgOiAnTk0nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW1ZhbmRhZyBvbV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tNw7RyZSBvbV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtvbV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tHaXN0ZXIgb21dIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW0xhYXNdIGRkZGQgW29tXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ29vciAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgZ2VsZWRlJyxcbiAgICAgICAgICAgIHM6IFwiJ24gcGFhciBzZWtvbmRlc1wiLFxuICAgICAgICAgICAgc3M6ICclZCBzZWtvbmRlcycsXG4gICAgICAgICAgICBtOiBcIiduIG1pbnV1dFwiLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGUnLFxuICAgICAgICAgICAgaDogXCInbiB1dXJcIixcbiAgICAgICAgICAgIGhoOiAnJWQgdXJlJyxcbiAgICAgICAgICAgIGQ6IFwiJ24gZGFnXCIsXG4gICAgICAgICAgICBkZDogJyVkIGRhZScsXG4gICAgICAgICAgICBNOiBcIiduIG1hYW5kXCIsXG4gICAgICAgICAgICBNTTogJyVkIG1hYW5kZScsXG4gICAgICAgICAgICB5OiBcIiduIGphYXJcIixcbiAgICAgICAgICAgIHl5OiAnJWQgamFhcicsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShzdGV8ZGUpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICBudW1iZXIgK1xuICAgICAgICAgICAgICAgIChudW1iZXIgPT09IDEgfHwgbnVtYmVyID09PSA4IHx8IG51bWJlciA+PSAyMCA/ICdzdGUnIDogJ2RlJylcbiAgICAgICAgICAgICk7IC8vIFRoYW5rcyB0byBKb3JpcyBSw7ZsaW5nIDogaHR0cHM6Ly9naXRodWIuY29tL2pqdXBpdGVyX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uICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgcGx1cmFsRm9ybSA9IGZ1bmN0aW9uIChuKSB7XG4gICAgICAgICAgICByZXR1cm4gbiA9PT0gMFxuICAgICAgICAgICAgICAgID8gMFxuICAgICAgICAgICAgICAgIDogbiA9PT0gMVxuICAgICAgICAgICAgICAgICAgPyAxXG4gICAgICAgICAgICAgICAgICA6IG4gPT09IDJcbiAgICAgICAgICAgICAgICAgICAgPyAyXG4gICAgICAgICAgICAgICAgICAgIDogbiAlIDEwMCA+PSAzICYmIG4gJSAxMDAgPD0gMTBcbiAgICAgICAgICAgICAgICAgICAgICA/IDNcbiAgICAgICAgICAgICAgICAgICAgICA6IG4gJSAxMDAgPj0gMTFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gNFxuICAgICAgICAgICAgICAgICAgICAgICAgOiA1O1xuICAgICAgICB9LFxuICAgICAgICBwbHVyYWxzID0ge1xuICAgICAgICAgICAgczogW1xuICAgICAgICAgICAgICAgICfYo9mC2YQg2YXZhiDYq9in2YbZitipJyxcbiAgICAgICAgICAgICAgICAn2KvYp9mG2YrYqSDZiNin2K3Yr9ipJyxcbiAgICAgICAgICAgICAgICBbJ9ir2KfZhtmK2KrYp9mGJywgJ9ir2KfZhtmK2KrZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINir2YjYp9mGJyxcbiAgICAgICAgICAgICAgICAnJWQg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICAgICAgJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIG06IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICAgICAgJ9iv2YLZitmC2Kkg2YjYp9it2K/YqScsXG4gICAgICAgICAgICAgICAgWyfYr9mC2YrZgtiq2KfZhicsICfYr9mC2YrZgtiq2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYr9mC2KfYptmCJyxcbiAgICAgICAgICAgICAgICAnJWQg2K/ZgtmK2YLYqScsXG4gICAgICAgICAgICAgICAgJyVkINiv2YLZitmC2KknLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIGg6IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2LPYp9i52KknLFxuICAgICAgICAgICAgICAgICfYs9in2LnYqSDZiNin2K3Yr9ipJyxcbiAgICAgICAgICAgICAgICBbJ9iz2KfYudiq2KfZhicsICfYs9in2LnYqtmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2LPYp9i52KfYqicsXG4gICAgICAgICAgICAgICAgJyVkINiz2KfYudipJyxcbiAgICAgICAgICAgICAgICAnJWQg2LPYp9i52KknLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIGQ6IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2YrZiNmFJyxcbiAgICAgICAgICAgICAgICAn2YrZiNmFINmI2KfYrdivJyxcbiAgICAgICAgICAgICAgICBbJ9mK2YjZhdin2YYnLCAn2YrZiNmF2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYo9mK2KfZhScsXG4gICAgICAgICAgICAgICAgJyVkINmK2YjZhdmL2KcnLFxuICAgICAgICAgICAgICAgICclZCDZitmI2YUnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIE06IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2LTZh9ixJyxcbiAgICAgICAgICAgICAgICAn2LTZh9ixINmI2KfYrdivJyxcbiAgICAgICAgICAgICAgICBbJ9i02YfYsdin2YYnLCAn2LTZh9ix2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYo9i02YfYsScsXG4gICAgICAgICAgICAgICAgJyVkINi02YfYsdinJyxcbiAgICAgICAgICAgICAgICAnJWQg2LTZh9ixJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB5OiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINi52KfZhScsXG4gICAgICAgICAgICAgICAgJ9i52KfZhSDZiNin2K3YrycsXG4gICAgICAgICAgICAgICAgWyfYudin2YXYp9mGJywgJ9i52KfZhdmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2KPYudmI2KfZhScsXG4gICAgICAgICAgICAgICAgJyVkINi52KfZhdmL2KcnLFxuICAgICAgICAgICAgICAgICclZCDYudin2YUnLFxuICAgICAgICAgICAgXSxcbiAgICAgICAgfSxcbiAgICAgICAgcGx1cmFsaXplID0gZnVuY3Rpb24gKHUpIHtcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAobnVtYmVyLCB3aXRob3V0U3VmZml4LCBzdHJpbmcsIGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgdmFyIGYgPSBwbHVyYWxGb3JtKG51bWJlciksXG4gICAgICAgICAgICAgICAgICAgIHN0ciA9IHBsdXJhbHNbdV1bcGx1cmFsRm9ybShudW1iZXIpXTtcbiAgICAgICAgICAgICAgICBpZiAoZiA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICBzdHIgPSBzdHJbd2l0aG91dFN1ZmZpeCA/IDAgOiAxXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0ci5yZXBsYWNlKC8lZC9pLCBudW1iZXIpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzID0gW1xuICAgICAgICAgICAgJ9is2KfZhtmB2YonLFxuICAgICAgICAgICAgJ9mB2YrZgdix2YonLFxuICAgICAgICAgICAgJ9mF2KfYsdizJyxcbiAgICAgICAgICAgICfYo9mB2LHZitmEJyxcbiAgICAgICAgICAgICfZhdin2YonLFxuICAgICAgICAgICAgJ9is2YjYp9mGJyx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VkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv2LV82YUvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAn2YUnID09PSBpbnB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9i1JztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfZhSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2YTZitmI2YUg2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYutiv2YvYpyDYudmG2K8g2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9i52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2KPZhdizINi52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfYqNi52K8gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ9mF2YbYsCAlcycsXG4gICAgICAgICAgICBzOiBwbHVyYWxpemUoJ3MnKSxcbiAgICAgICAgICAgIHNzOiBwbHVyYWxpemUoJ3MnKSxcbiAgICAgICAgICAgIG06IHBsdXJhbGl6ZSgnbSc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V/Yp9mE2LPYqNiqJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAn2KfYrdivX9in2KrZhtmK2YZf2KvZhNin2KvYp9ihX9in2LHYqNi52KfYoV/YrtmF2YrYs1/YrNmF2LnYqV/Ys9io2KonLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn2K1f2YZf2Ktf2LFf2K5f2Kxf2LMnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2YTZitmI2YUg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYutiv2Kcg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9ij2YXYsyDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW9i52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn2YHZiiAlcycsXG4gICAgICAgICAgICBwYXN0OiAn2YXZhtiwICVzJyxcbiAgICAgICAgICAgIHM6ICfYq9mI2KfZhicsXG4gICAgICAgICAgICBzczogJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgbTogJ9iv2YLZitmC2KknLFxuICAgICAgICAgICAgbW06ICclZCDYr9mC2KfYptmCJyxcbiAgICAgICAgICAgIGg6ICfYs9in2LnYqScsXG4gICAgICAgICAgICBoaDogJyVkINiz2KfYudin2KonLFxuICAgICAgICAgICAgZDogJ9mK2YjZhScsXG4gICAgICAgICAgICBkZDogJyVkINij2YrYp9mFJyxcbiAgICAgICAgICAgIE06ICfYtNmH2LEnLFxuICAgICAgICAgICAgTU06ICclZCDYo9i02YfYsScsXG4gICAgICAgICAgICB5OiAn2LPZhtipJyxcbiAgICAgICAgICAgIHl5OiAnJWQg2LPZhtmI2KfYqicsXG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMCwgLy8gU3VuZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDEyLCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiAxMnRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGFyS3c7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogQXJhYmljIChMaWJ5YSkgW2FyLWx5XVxuLy8hIGF1dGhvciA6IEFsaSBIbWVyOiBodHRwczovL2dpdGh1Yi5jb20va2lrb2FuaXNcblxuOyhmdW5jdGlvbiAoZ2xvYmFsLCBmYWN0b3J5KSB7XG4gICB0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZSAhPT0gJ3VuZGVmaW5lZCdcbiAgICAgICAmJiB0eXBlb2YgcmVxdWlyZSA9PT0gJ2Z1bmN0aW9uJyA/IGZhY3RvcnkocmVxdWlyZSgnLi4vbW9tZW50JykpIDpcbiAgIHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBzeW1ib2xNYXAgPSB7XG4gICAgICAgICAgICAxOiAnMScsXG4gICAgICAgICAgICAyOiAnMicsXG4gICAgICAgICAgICAzOiAnMycsXG4gICAgICAgICAgICA0OiAnNCcsXG4gICAgICAgICAgICA1OiAnNScsXG4gICAgICAgICAgICA2OiAnNicsXG4gICAgICAgICAgICA3OiAnNycsXG4gICAgICAgICAgICA4OiAnOCcsXG4gICAgICAgICAgICA5OiAnOScsXG4gICAgICAgICAgICAwOiAnMCcsXG4gICAgICAgIH0sXG4gICAgICAgIHBsdXJhbEZvcm0gPSBmdW5jdGlvbiAobikge1xuICAgICAgICAgICAgcmV0dXJuIG4gPT09IDBcbiAgICAgICAgICAgICAgICA/IDBcbiAgICAgICAgICAgICAgICA6IG4gPT09IDFcbiAgICAgICAgICAgICAgICAgID8gMVxuICAgICAgICAgICAgICAgICAgOiBuID09PSAyXG4gICAgICAgICAgICAgICAgICAgID8gMlxuICAgICAgICAgICAgICAgICAgICA6IG4gJSAxMDAgPj0gMyAmJiBuICUgMTAwIDw9IDEwXG4gICAgICAgICAgICAgICAgICAgICAgPyAzXG4gICAgICAgICAgICAgICAgICAgICAgOiBuICUgMTAwID49IDExXG4gICAgICAgICAgICAgICAgICAgICAgICA/IDRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogNTtcbiAgICAgICAgfSxcbiAgICAgICAgcGx1cmFscyA9IHtcbiAgICAgICAgICAgIHM6IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICAgICAgJ9ir2KfZhtmK2Kkg2YjYp9it2K/YqScsXG4gICAgICAgICAgICAgICAgWyfYq9in2YbZitiq2KfZhicsICfYq9in2YbZitiq2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYq9mI2KfZhicsXG4gICAgICAgICAgICAgICAgJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgICAgICclZCDYq9in2YbZitipJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBtOiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINiv2YLZitmC2KknLFxuICAgICAgICAgICAgICAgICfYr9mC2YrZgtipINmI2KfYrdiv2KknLFxuICAgICAgICAgICAgICAgIFsn2K/ZgtmK2YLYqtin2YYnLCAn2K/ZgtmK2YLYqtmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2K/Zgtin2KbZgicsXG4gICAgICAgICAgICAgICAgJyVkINiv2YLZitmC2KknLFxuICAgICAgICAgICAgICAgICclZCDYr9mC2YrZgtipJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBoOiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINiz2KfYudipJyxcbiAgICAgICAgICAgICAgICAn2LPYp9i52Kkg2YjYp9it2K/YqScsXG4gICAgICAgICAgICAgICAgWyfYs9in2LnYqtin2YYnLCAn2LPYp9i52KrZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINiz2KfYudin2KonLFxuICAgICAgICAgICAgICAgICclZCDYs9in2LnYqScsXG4gICAgICAgICAgICAgICAgJyVkINiz2KfYudipJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBkOiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINmK2YjZhScsXG4gICAgICAgICAgICAgICAgJ9mK2YjZhSDZiNin2K3YrycsXG4gICAgICAgICAgICAgICAgWyfZitmI2YXYp9mGJywgJ9mK2YjZhdmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2KPZitin2YUnLFxuICAgICAgICAgICAgICAgICclZCDZitmI2YXZi9inJyxcbiAgICAgICAgICAgICAgICAnJWQg2YrZiNmFJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBNOiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINi02YfYsScsXG4gICAgICAgICAgICAgICAgJ9i02YfYsSDZiNin2K3YrycsXG4gICAgICAgICAgICAgICAgWyfYtNmH2LHYp9mGJywgJ9i02YfYsdmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2KPYtNmH2LEnLFxuICAgICAgICAgICAgICAgICclZCDYtNmH2LHYpycsXG4gICAgICAgICAgICAgICAgJyVkINi02YfYsScsXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgeTogW1xuICAgICAgICAgICAgICAgICfYo9mC2YQg2YXZhiDYudin2YUnLFxuICAgICAgICAgICAgICAgICfYudin2YUg2YjYp9it2K8nLFxuICAgICAgICAgICAgICAgIFsn2LnYp9mF2KfZhicsICfYudin2YXZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINij2LnZiNin2YUnLFxuICAgICAgICAgICAgICAgICclZCDYudin2YXZi9inJyxcbiAgICAgICAgICAgICAgICAnJWQg2LnYp9mFJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgIH0sXG4gICAgICAgIHBsdXJhbGl6ZSA9IGZ1bmN0aW9uICh1KSB7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKG51bWJlciwgd2l0aG91dFN1ZmZpeCwgc3RyaW5nLCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgICAgIHZhciBmID0gcGx1cmFsRm9ybShudW1iZXIpLFxuICAgICAgICAgICAgICAgICAgICBzdHIgPSBwbHVyYWxzW3VdW3BsdXJhbEZvcm0obnVtYmVyKV07XG4gICAgICAgICAgICAgICAgaWYgKGYgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgc3RyID0gc3RyW3dpdGhvdXRTdWZmaXggPyAwIDogMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHIucmVwbGFjZSgvJWQvaSwgbnVtYmVyKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRocyA9IFtcbiAgICAgICAgICAgICfZitmG2KfZitixJyxcbiAgICAgICAgICAgICfZgdio2LHYp9mK2LEnLFxuICAgICAgICAgICAgJ9mF2KfYsdizJyxcbiAgICAgICAgICAgICfYo9io2LHZitmEJyxcbiAgICAgICAgICAgICfZhdin2YrZiCcsXG4gICAgICAgICAgICAn2YrZiNmG2YrZiCcsXG4gICAgICAgICAgICAn2YrZiNmE2YrZiCcsXG4gICAgICAgICAgICAn2KPYutiz2LfYsycsXG4gICAgICAgICAgICAn2LPYqNiq2YXYqNixJyxcbiAgICAgICAgICAgICfYo9mD2KrZiNio2LEnLFxuICAgICAgICAgICAgJ9mG2YjZgdmF2KjYsScsXG4gICAgICAgICAgICAn2K/Zitiz2YXYqNixJyxcbiAgICAgICAgXTtcblxuICAgIHZhciBhckx5ID0gbW9tZW50LmRlZmluZUxvY2FsZSgnYXItbHknLCB7XG4gICAgICAgIG1vbnRoczogbW9udGhzLFxuICAgICAgICBtb250aHNTaG9ydDogbW9udGhzLFxuICAgICAgICB3ZWVrZGF5czogJ9in2YTYo9it2K9f2KfZhNil2KvZhtmK2YZf2KfZhNir2YTYp9ir2KfYoV/Yp9mE2KPYsdio2LnYp9ihX9in2YTYrtmF2YrYs1/Yp9mE2KzZhdi52Klf2KfZhNiz2KjYqicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ9ij2K3Yr1/Ypdir2YbZitmGX9ir2YTYp9ir2KfYoV/Yo9ix2KjYudin2KFf2K7ZhdmK2LNf2KzZhdi52Klf2LPYqNiqJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ9itX9mGX9irX9ixX9iuX9isX9izJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdEL1xcdTIwMEZNL1xcdTIwMEZZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv2LV82YUvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAn2YUnID09PSBpbnB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9i1JztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfZhSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2YTZitmI2YUg2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYutiv2YvYpyDYudmG2K8g2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9i52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2KPZhdizINi52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfYqNi52K8gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ9mF2YbYsCAlcycsXG4gICAgICAgICAgICBzOiBwbHVyYWxpemUoJ3MnKSxcbiAgICAgICAgICAgIHNzOiBwbHVyYWxpemUoJ3MnKSxcbiAgICAgICAgICAgIG06IHBsdXJhbGl6ZSgnbScpLFxuICAgICAgICAgICAgbW06IHBsdXJhbGl6ZSgnbScpLFxuICAgICAgICAgICAgaDogcGx1cmFsaXplKCdoJyksXG4gICAgICAgICAgICBoaDogcGx1cmFsaXplKCdoJyksXG4gICAgICAgICAgICBkOiBwbHVyYWxpemUoJ2QnKSxcbiAgICAgICAgICAgIGRkOiBwbHVyYWxpemUoJ2QnKSxcbiAgICAgICAgICAgIE06IHBsdXJhbGl6ZSgnTScpLFxuICAgICAgICAgICAgTU06IHBsdXJhbGl6ZSgnTScpLFxuICAgICAgICAgICAgeTogcGx1cmFsaXplKCd5JyksXG4gICAgICAgICAgICB5eTogcGx1cmFsaXplKCd5JyksXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL9iML2csICcsJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmc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qJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ9itX9mGX9irX9ixX9iuX9isX9izJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vYp9mE2YrZiNmFINi52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb2LrYr9inINi52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vYo9mF2LMg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFvYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ9mB2YogJXMnLFxuICAgICAgICAgICAgcGFzdDogJ9mF2YbYsCAlcycsXG4gICAgICAgICAgICBzOiAn2KvZiNin2YYnLFxuICAgICAgICAgICAgc3M6ICclZCDYq9in2YbZitipJyxcbiAgICAgICAgICAgIG06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HR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBzeW1ib2xNYXAgPSB7XG4gICAgICAgICAgICAxOiAn2aEnLFxuICAgICAgICAgICAgMjogJ9miJyxcbiAgICAgICAgICAgIDM6ICfZoycsXG4gICAgICAgICAgICA0OiAn2aQnLFxuICAgICAgICAgICAgNTogJ9mlJyxcbiAgICAgICAgICAgIDY6ICfZpicsXG4gICAgICAgICAgICA3OiAn2acnLFxuICAgICAgICAgICAgODogJ9moJyxcbiAgICAgICAgICAgIDk6ICfZqScsXG4gICAgICAgICAgICAwOiAn2aAnLFxuICAgICAgICB9LFxuICAgICAgICBudW1iZXJNYXAgPSB7XG4gICAgICAgICAgICAn2aEnOiAnMScsXG4gICAgICAgICAgICAn2aInOiAnMicsXG4gICAgICAgICAgICAn2aMnOiAnMycsXG4gICAgICAgICAgICAn2aQnOiAnNCcsXG4gICAgICAgICAgICAn2aUnOiAnNScsXG4gICAgICAgICAgICAn2aYnOiAnNicsXG4gICAgICAgICAgICAn2acnOiAnNycsXG4gICAgICAgICAgICAn2agnOiAnOCcsXG4gICAgICAgICAgICAn2aknOiAnOScsXG4gICAgICAgICAgICAn2aAnOiAnMCcsXG4gICAgICAgIH07XG5cbiAgICB2YXIgYXJQcyA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2FyLXBzJywge1xuICAgICAgICBtb250aHM6ICfZg9in2YbZiNmGINin2YTYq9in2YbZil/YtNio2KfYt1/Yotiw2KfYsV/ZhtmK2LPYp9mGX9ij2YrZkdin2LFf2K3YstmK2LHYp9mGX9iq2YXZkd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VkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv2LV82YUvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAn2YUnID09PSBpbnB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9i1JztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfZhSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2YTZitmI2YUg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYutiv2Kcg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9ij2YXYsyDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW9i52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn2YHZiiAlcycsXG4gICAgICAgICAgICBwYXN0OiAn2YXZhtiwICVzJyxcbiAgICAgICAgICAgIHM6ICfYq9mI2KfZhicsXG4gICAgICAgICAgICBzczogJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgbTogJ9iv2YLZitmC2KknLFxuICAgICAgICAgICAgbW06ICclZCDYr9mC2KfYptmCJyxcbiAgICAgICAgICAgIGg6ICfYs9in2LnYqScsXG4gICAgICAgICAgICBoaDogJyVkINiz2KfYudin2KonLFxuICAgICAgICAgICAgZDogJ9mK2YjZhScsXG4gICAgICAgICAgICBkZDogJyVkINij2YrYp9mFJyxcbiAgICAgICAgICAgIE06ICfYtNmH2LEnLFxuICAgICAgICAgICAgTU06ICclZCDYo9i02YfYsScsXG4gICAgICAgICAgICB5OiAn2LPZhtipJyxcbiAgICAgICAgICAgIHl5OiAnJWQg2LPZhtmI2KfYqicsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL1vZo9mk2aXZptmn2ajZqdmgXS9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuc3BsaXQoJycpIC8vIHJldmVyc2VkIHNpbmNlIG5lZ2F0aXZlIGxvb2tiZWhpbmQgbm90IHN1cHBvcnRlZCBldmVyeXdoZXJlXG4gICAgICAgICAgICAgICAgLnJldmVyc2UoKVxuICAgICAgICAgICAgICAgIC5qb2luKCcnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9b2aHZol0oPyFbXFx1MDYyYVxcdTA2NDNdKS9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuc3BsaXQoJycpXG4gICAgICAgICAgICAgICAgLnJldmVyc2UoKVxuICAgICAgICAgICAgICAgIC5qb2luKCcnKVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC/YjC9nL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W1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHN5bWJvbE1hcCA9IHtcbiAgICAgICAgICAgIDE6ICfZoScsXG4gICAgICAgICAgICAyOiAn2aInLFxuICAgICAgICAgICAgMzogJ9mjJyxcbiAgICAgICAgICAgIDQ6ICfZpCcsXG4gICAgICAgICAgICA1OiAn2aUnLFxuICAgICAgICAgICAgNjogJ9mmJyxcbiAgICAgICAgICAgIDc6ICfZpycsXG4gICAgICAgICAgICA4OiAn2agnLFxuICAgICAgICAgICAgOTogJ9mpJyxcbiAgICAgICAgICAgIDA6ICfZoCcsXG4gICAgICAgIH0sXG4gICAgICAgIG51bWJlck1hcCA9IHtcbiAgICAgICAgICAgICfZoSc6ICcxJyxcbiAgICAgICAgICAgICfZoic6ICcyJyxcbiAgICAgICAgICAgICfZoyc6ICczJyxcbiAgICAgICAgICAgICfZpCc6ICc0JyxcbiAgICAgICAgICAgICfZpSc6ICc1JyxcbiAgICAgICAgICAgICfZpic6ICc2JyxcbiAgICAgICAgICAgICfZpyc6ICc3JyxcbiAgICAgICAgICAgICfZqCc6ICc4JyxcbiAgICAgICAgICAgICfZqSc6ICc5JyxcbiAgICAgICAgICAgICfZoCc6ICcwJyxcbiAgICAgICAgfTtcblxuICAgIHZhciBhclNhID0gbW9tZW50LmRlZmluZUxvY2FsZSgnYXItc2EnLCB7XG4gICAgICAgIG1vbnRoczogJ9mK2YbYp9mK2LFf2YHYqNix2KfZitixX9mF2KfYsdizX9ij2KjYsdmK2YRf2YXYp9mK2Yhf2YrZiNmG2YrZiF/ZitmI2YTZitmIX9ij2LrYs9i32LNf2LPYqNiq2YXYqNixX9ij2YPYqtmI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WVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv2LV82YUvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAn2YUnID09PSBpbnB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9i1JztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfZhSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2YTZitmI2YUg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYutiv2Kcg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9ij2YXYsyDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW9i52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn2YHZiiAlcycsXG4gICAgICAgICAgICBwYXN0OiAn2YXZhtiwICVzJyxcbiAgICAgICAgICAgIHM6ICfYq9mI2KfZhicsXG4gICAgICAgICAgICBzczogJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgbTogJ9iv2YLZitmC2KknLFxuICAgICAgICAgICAgbW06ICclZCDYr9mC2KfYptmCJyxcbiAgICAgICAgICAgIGg6ICfYs9in2LnYqScsXG4gICAgICAgICAgICBoaDogJyVkINiz2KfYudin2KonLFxuICAgICAgICAgICAgZDogJ9mK2YjZhScsXG4gICAgICAgICAgICBkZDogJyVkINij2YrYp9mFJyxcbiAgICAgICAgICAgIE06ICfYtNmH2LEnLFxuICAgICAgICAgICAgTU06ICclZCDYo9i02YfYsScsXG4gICAgICAgICAgICB5OiAn2LPZhtipJyxcbiAgICAgICAgICAgIHl5OiAnJWQg2LPZhtmI2KfYqicsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL1vZodmi2aPZpNml2abZp9mo2anZoF0vZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL9iML2csICcsJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmdcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sTWFwW21hdGNoXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8sL2csICfYjCcpO1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDAsIC8vIFN1bmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA2LCAvLyBUaGUg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yOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2YTZitmI2YUg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vYutiv2Kcg2LnZhNmJINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9ij2YXYsyDYudmE2Ykg2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW9i52YTZiSDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn2YHZiiAlcycsXG4gICAgICAgICAgICBwYXN0OiAn2YXZhtiwICVzJyxcbiAgICAgICAgICAgIHM6ICfYq9mI2KfZhicsXG4gICAgICAgICAgICBzczogJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgbTogJ9iv2YLZitmC2KknLFxuICAgICAgICAgICAgbW06ICclZCDYr9mC2KfYptmCJyxcbiAgICAgICAgICAgIGg6ICfYs9in2LnYqScsXG4gICAgICAgICAgICBoaDogJyVkINiz2KfYudin2KonLFxuICAgICAgICAgICAgZDogJ9mK2YjZhScsXG4gICAgICAgICAgICBkZDogJyVkINij2YrYp9mFJyxcbiAgICAgICAgICAgIE06ICfYtNmH2LEnLFxuICAgICAgICAgICAgTU06ICclZCDYo9i02YfYsScsXG4gICAgICAgICAgICB5OiAn2LPZhtipJyxcbiAgICAgICAgICAgIHl5OiAnJWQg2LPZhtmI2KfYqicsXG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWs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AgICAgICAgNTogJ9mlJyxcbiAgICAgICAgICAgIDY6ICfZpicsXG4gICAgICAgICAgICA3OiAn2acnLFxuICAgICAgICAgICAgODogJ9moJyxcbiAgICAgICAgICAgIDk6ICfZqScsXG4gICAgICAgICAgICAwOiAn2aAnLFxuICAgICAgICB9LFxuICAgICAgICBudW1iZXJNYXAgPSB7XG4gICAgICAgICAgICAn2aEnOiAnMScsXG4gICAgICAgICAgICAn2aInOiAnMicsXG4gICAgICAgICAgICAn2aMnOiAnMycsXG4gICAgICAgICAgICAn2aQnOiAnNCcsXG4gICAgICAgICAgICAn2aUnOiAnNScsXG4gICAgICAgICAgICAn2aYnOiAnNicsXG4gICAgICAgICAgICAn2acnOiAnNycsXG4gICAgICAgICAgICAn2agnOiAnOCcsXG4gICAgICAgICAgICAn2aknOiAnOScsXG4gICAgICAgICAgICAn2aAnOiAnMCcsXG4gICAgICAgIH0sXG4gICAgICAgIHBsdXJhbEZvcm0gPSBmdW5jdGlvbiAobikge1xuICAgICAgICAgICAgcmV0dXJuIG4gPT09IDBcbiAgICAgICAgICAgICAgICA/IDBcbiAgICAgICAgICAgICAgICA6IG4gPT09IDFcbiAgICAgICAgICAgICAgICAgID8gMVxuICAgICAgICAgICAgICAgICAgOiBuID09PSAyXG4gICAgICAgICAgICAgICAgICAgID8gMlxuICAgICAgICAgICAgICAgICAgICA6IG4gJSAxMDAgPj0gMyAmJiBuICUgMTAwIDw9IDEwXG4gICAgICAgICAgICAgICAgICAgICAgPyAzXG4gICAgICAgICAgICAgICAgICAgICAgOiBuICUgMTAwID49IDExXG4gICAgICAgICAgICAgICAgICAgICAgICA/IDRcbiAgICAgICAgICAgICAgICAgICAgICAgIDogNTtcbiAgICAgICAgfSxcbiAgICAgICAgcGx1cmFscyA9IHtcbiAgICAgICAgICAgIHM6IFtcbiAgICAgICAgICAgICAgICAn2KPZgtmEINmF2YYg2KvYp9mG2YrYqScsXG4gICAgICAgICAgICAgICAgJ9ir2KfZhtmK2Kkg2YjYp9it2K/YqScsXG4gICAgICAgICAgICAgICAgWyfYq9in2YbZitiq2KfZhicsICfYq9in2YbZitiq2YrZhiddLFxuICAgICAgICAgICAgICAgICclZCDYq9mI2KfZhicsXG4gICAgICAgICAgICAgICAgJyVkINir2KfZhtmK2KknLFxuICAgICAgICAgICAgICAgICclZCDYq9in2YbZitipJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBtOiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINiv2YLZitmC2KknLFxuICAgICAgICAgICAgICAgICfYr9mC2YrZgtipINmI2KfYrdiv2KknLFxuICAgICAgICAgICAgICAgIFsn2K/ZgtmK2YLYqtin2YYnLCAn2K/ZgtmK2YLYqtmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2K/Zgtin2KbZgicsXG4gICAgICAgICAgICAgICAgJyVkINiv2YLZitmC2KknLFxuICAgICAgICAgICAgICAgICclZCDYr9mC2YrZgtipJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBoOiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINiz2KfYudipJyxcbiAgICAgICAgICAgICAgICAn2LPYp9i52Kkg2YjYp9it2K/YqScsXG4gICAgICAgICAgICAgICAgWyfYs9in2LnYqtin2YYnLCAn2LPYp9i52KrZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINiz2KfYudin2KonLFxuICAgICAgICAgICAgICAgICclZCDYs9in2LnYqScsXG4gICAgICAgICAgICAgICAgJyVkINiz2KfYudipJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBkOiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINmK2YjZhScsXG4gICAgICAgICAgICAgICAgJ9mK2YjZhSDZiNin2K3YrycsXG4gICAgICAgICAgICAgICAgWyfZitmI2YXYp9mGJywgJ9mK2YjZhdmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2KPZitin2YUnLFxuICAgICAgICAgICAgICAgICclZCDZitmI2YXZi9inJyxcbiAgICAgICAgICAgICAgICAnJWQg2YrZiNmFJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBNOiBbXG4gICAgICAgICAgICAgICAgJ9ij2YLZhCDZhdmGINi02YfYsScsXG4gICAgICAgICAgICAgICAgJ9i02YfYsSDZiNin2K3YrycsXG4gICAgICAgICAgICAgICAgWyfYtNmH2LHYp9mGJywgJ9i02YfYsdmK2YYnXSxcbiAgICAgICAgICAgICAgICAnJWQg2KPYtNmH2LEnLFxuICAgICAgICAgICAgICAgICclZCDYtNmH2LHYpycsXG4gICAgICAgICAgICAgICAgJyVkINi02YfYsScsXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgeTogW1xuICAgICAgICAgICAgICAgICfYo9mC2YQg2YXZhiDYudin2YUnLFxuICAgICAgICAgICAgICAgICfYudin2YUg2YjYp9it2K8nLFxuICAgICAgICAgICAgICAgIFsn2LnYp9mF2KfZhicsICfYudin2YXZitmGJ10sXG4gICAgICAgICAgICAgICAgJyVkINij2LnZiNin2YUnLFxuICAgICAgICAgICAgICAgICclZCDYudin2YXZi9inJyxcbiAgICAgICAgICAgICAgICAnJWQg2LnYp9mFJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgIH0sXG4gICAgICAgIHBsdXJhbGl6ZSA9IGZ1bmN0aW9uICh1KSB7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKG51bWJlciwgd2l0aG91dFN1ZmZpeCwgc3RyaW5nLCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgICAgIHZhciBmID0gcGx1cmFsRm9ybShudW1iZXIpLFxuICAgICAgICAgICAgICAgICAgICBzdHIgPSBwbHVyYWxzW3VdW3BsdXJhbEZvcm0obnVtYmVyKV07XG4gICAgICAgICAgICAgICAgaWYgKGYgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgc3RyID0gc3RyW3dpdGhvdXRTdWZmaXggPyAwIDogMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBzdHIucmVwbGFjZSgvJWQvaSwgbnVtYmVyKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRocyA9IFtcbiAgICAgICAgICAgICfZitmG2KfZitixJyxcbiAgICAgICAgICAgICfZgdio2LHYp9mK2LEnLFxuICAgICAgICAgICAgJ9mF2KfYsdizJyxcbiAgICAgICAgICAgICfYo9io2LHZitmEJyxcbiAgICAgICAgICAgICfZhdin2YrZiCcsXG4gICAgICAgICAgICAn2YrZiNmG2YrZiCcsXG4gICAgICAgICAgICAn2YrZiNmE2YrZiCcsXG4gICAgICAgICAgICAn2KPYutiz2LfYsycsXG4gICAgICAgICAgICAn2LPYqNiq2YXYqNixJyxcbiAgICAgICAgICAgICfYo9mD2KrZiNio2LEnLFxuICAgICAgICAgICAgJ9mG2YjZgdmF2KjYsScsXG4gICAgICAgICAgICAn2K/Zitiz2YXYqNixJyxcbiAgICAgICAgXTtcblxuICAgIHZhciBhciA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2FyJywge1xuICAgICAgICBtb250aHM6IG1vbnRocyxcbiAgICAgICAgbW9udGhzU2hvcnQ6IG1vbnRocyxcbiAgICAgICAgd2Vla2RheXM6ICfYp9mE2KPYrdivX9in2YTYpdir2YbZitmGX9in2YTYq9mE2KfYq9in2KFf2KfZhNij2LHYqNi52KfYoV/Yp9mE2K7ZhdmK2LNf2KfZhNis2YXYudipX9in2YTYs9io2KonLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfYo9it2K9f2KXYq9mG2YrZhl/Yq9mE2KfYq9in2KFf2KPYsdio2LnYp9ihX9iu2YXZitizX9is2YXYudipX9iz2KjYqicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfYrV/Zhl/Yq1/YsV/Yrl/YrF/Ysycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnRC9cXHUyMDBGTS9cXHUyMDBGWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL9i1fNmFLyxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gJ9mFJyA9PT0gaW5wdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfYtSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn2YUnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vYp9mE2YrZiNmFINi52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb2LrYr9mL2Kcg2LnZhtivINin2YTYs9in2LnYqV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvYudmG2K8g2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9ij2YXYsyDYudmG2K8g2KfZhNiz2KfYudipXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW9i52YbYryDYp9mE2LPYp9i52KldIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn2KjYudivICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICfZhdmG2LAgJXMnLFxuICAgICAgICAgICAgczogcGx1cmFsaXplKCdzJyksXG4gICAgICAgICAgICBzczogcGx1cmFsaXplKCdzJyksXG4gICAgICAgICAgICBtOiBwbHVyYWxpemUoJ20nKSxcbiAgICAgICAgICAgIG1tOiBwbHVyYWxpemUoJ20nKSxcbiAgICAgICAgICAgIGg6IHBsdXJhbGl6ZSgnaCcpLFxuICAgICAgICAgICAgaGg6IHBsdXJhbGl6ZSgnaCcpLFxuICAgICAgICAgICAgZDogcGx1cmFsaXplKCdkJyksXG4gICAgICAgICAgICBkZDogcGx1cmFsaXplKCdkJyksXG4gICAgICAgICAgICBNOiBwbHVyYWxpemUoJ00nKSxcbiAgICAgICAgICAgIE1NOiBwbHVyYWxpemUoJ00nKSxcbiAgICAgICAgICAgIHk6IHBsdXJhbGl6ZSgneScpLFxuICAgICAgICAgICAgeXk6IHBsdXJhbGl6ZSgneScpLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZ1xuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9b2aHZotmj2aTZpdmm2afZqNmp2aBdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTWFwW21hdGNoXTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC/YjC9nLCAnLCcpO1xuICAgICAgICB9LFxuICAgICAgICBwb3N0Zm9ybWF0OiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZ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bnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHN1ZmZpeGVzID0ge1xuICAgICAgICAxOiAnLWluY2knLFxuICAgICAgICA1OiAnLWluY2knLFxuICAgICAgICA4OiAnLWluY2knLFxuICAgICAgICA3MDogJy1pbmNpJyxcbiAgICAgICAgODA6ICctaW5jaScsXG4gICAgICAgIDI6ICctbmNpJyxcbiAgICAgICAgNzogJy1uY2knLFxuICAgICAgICAyMDogJy1uY2knLFxuICAgICAgICA1MDogJy1uY2knLFxuICAgICAgICAzOiAnLcO8bmPDvCcsXG4gICAgICAgIDQ6ICctw7xuY8O8JyxcbiAgICAgICAgMTAwOiAnLcO8bmPDvCcsXG4gICAgICAgIDY6ICctbmPEsScsXG4gICAgICAgIDk6ICctdW5jdScsXG4gICAgICAgIDEwOiAnLXVuY3UnLFxuICAgICAgICAzMDogJy11bmN1JyxcbiAgICAgICAgNjA6ICctxLFuY8SxJyxcbiAgICAgICAgOTA6ICctxLFuY8SxJyxcbiAgICB9O1xuXG4gICAgdmFyIGF6ID0gbW9tZW50LmRlZmluZUxvY2FsZSgnYXonLCB7XG4gICAgICAgIG1vbnRoczogJ3lhbnZhcl9mZXZyYWxfbWFydF9hcHJlbF9tYXlfaXl1bl9peXVsX2F2cXVzdF9zZW50eWFicl9va3R5YWJyX25veWFicl9kZWthYnInLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OiAneWFuX2Zldl9tYXJfYXByX21heV9peW5faXlsX2F2cV9zZW5fb2t0X25veV9kZWsnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzOlxuICAgICAgICAgICAgJ0JhemFyX0JhemFyIGVydMmZc2lfw4fJmXLFn8mZbmLJmSBheMWfYW3EsV/Dh8mZcsWfyZluYsmZX0PDvG3JmSBheMWfYW3EsV9Dw7xtyZlfxZ7JmW5iyZknLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ0Jhel9CekVfw4dBeF/Dh8mZcl9DQXhfQ8O8bV/FnsmZbicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdCel9CRV/Dh0Ffw4fJmV9DQV9Dw7xfxZ7JmScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2J1Z8O8biBzYWF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW3NhYmFoIHNhYXRdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnW2fJmWzJmW4gaMmZZnTJmV0gZGRkZCBbc2FhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tkw7xuyZluXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1trZcOnyZluIGjJmWZ0yZldIGRkZGQgW3NhYXRdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMgc29ucmEnLFxuICAgICAgICAgICAgcGFzdDogJyVzIMmZdnbJmWwnLFxuICAgICAgICAgICAgczogJ2JpciBuZcOnyZkgc2FuaXnJmScsXG4gICAgICAgICAgICBzczogJyVkIHNhbml5yZknLFxuICAgICAgICAgICAgbTogJ2JpciBkyZlxaXHJmScsXG4gICAgICAgICAgICBtbTogJyVkIGTJmXFpccmZJyxcbiAgICAgICAgICAgIGg6ICdiaXIgc2FhdCcsXG4gICAgICAgICAgICBoaDogJyVkIHNhYXQnLFxuICAgICAgICAgICAgZDogJ2JpciBnw7xuJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZ8O8bicsXG4gICAgICAgICAgICBNOiAnYmlyIGF5JyxcbiAgICAgICAgICAgIE1NOiAnJWQgYXknLFxuICAgICAgICAgICAgeTogJ2JpciBpbCcsXG4gICAgICAgICAgICB5eTogJyVkIGlsJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL2dlY8mZfHPJmWjJmXJ8Z8O8bmTDvHp8YXjFn2FtLyxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gL14oZ8O8bmTDvHp8YXjFn2FtKSQvLnRlc3QoaW5wdXQpO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdnZWPJmSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAnc8mZaMmZcic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNykge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZ8O8bmTDvHonO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2F4xZ9hbSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfS0oxLFuY8SxfGluY2l8bmNpfMO8bmPDvHxuY8SxfHVuY3UpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMCkge1xuICAgICAgICAgICAgICAgIC8vIHNwZWNpYWwgY2FzZSBmb3IgemVyb1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLcSxbmPEsSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgYSA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIGIgPSAobnVtYmVyICUgMTAwKSAtIGEsXG4gICAgICAgICAgICAgICAgYyA9IG51bWJlciA+PSAxMDAgPyAxMDAgOiBudWxsO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIChzdWZmaXhlc1thXSB8fCBzdWZmaXhlc1tiXSB8fCBzdWZmaXhlc1tjXSk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDcsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDd0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBhejtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBCZWxhcnVzaWFuIFtiZV1cbi8vISBhdXRob3IgOiBEbWl0cnkgRGVtaWRvdiA6IGh0dHBzOi8vZ2l0aHViLmNvbS9kZW1pZG92OTFcbi8vISBhdXRob3I6IFByYWxlc2thOiBodHRwOi8vcHJhbG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WVkg0LMuLCBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9Ch0ZHQvdC90Y8g0Z5dIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb0JfQsNGe0YLRgNCwINGeXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9Cj0YfQvtGA0LAg0Z5dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdb0KNdIGRkZGQgW9GeXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0KMg0LzRltC90YPQu9GD0Y5dIGRkZGQgW9GeXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vQoyDQvNGW0L3Rg9C70YtdIGRkZGQgW9GeXSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn0L/RgNCw0LcgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzINGC0LDQvNGDJyxcbiAgICAgICAgICAgIHM6ICfQvdC10LrQsNC70YzQutGWINGB0LXQutGD0L3QtCcsXG4gICAgICAgICAgICBtOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgbW06IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBoOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgaGg6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBkOiAn0LTQt9C10L3RjCcsXG4gICAgICAgICAgICBkZDogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIE06ICfQvNC10YHRj9GGJyxcbiAgICAgICAgICAgIE1NOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgeTogJ9Cz0L7QtCcsXG4gICAgICAgICAgICB5eTogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL9C90L7Rh9GLfNGA0LDQvdGW0YbRi3zQtNC90Y980LLQtdGH0LDRgNCwLyxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gL14o0LTQvdGPfNCy0LXRh9Cw0YDQsCkkLy50ZXN0KGlucHV0KTtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgNCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0L3QvtGH0YsnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9GA0LDQvdGW0YbRiyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNykge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0LTQvdGPJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfQstC10YfQsNGA0LAnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0tKNGWfNGLfNCz0LApLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RERCc6XG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAobnVtYmVyICUgMTAgPT09IDIgfHwgbnVtYmVyICUgMTAgPT09IDMpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBudW1iZXIgJSAxMDAgIT09IDEyICYmXG4gICAgICAgICAgICAgICAgICAgICAgICBudW1iZXIgJSAxMDAgIT09IDEzXG4gICAgICAgICAgICAgICAgICAgICAgICA/IG51bWJlciArICct0ZYnXG4gICAgICAgICAgICAgICAgICAgICAgICA6IG51bWJlciArICct0YsnO1xuICAgICAgICAgICAgICAgIGNhc2UgJ0QnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3Qs9CwJztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA3LC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UJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb0LJdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb0JLRh9C10YDQsCDQsl0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9Cc0LjQvdCw0LvQsNGC0LBdIGRkZGQgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9Cc0LjQvdCw0LvQuNGPXSBkZGRkIFvQsl0gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ9GB0LvQtdC0ICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICfQv9GA0LXQtNC4ICVzJyxcbiAgICAgICAgICAgIHM6ICfQvdGP0LrQvtC70LrQviDRgdC10LrRg9C90LTQuCcsXG4gICAgICAgICAgICBzczogJyVkINGB0LXQutGD0L3QtNC4JyxcbiAgICAgICAgICAgIG06ICfQvNC40L3Rg9GC0LAnLFxuICAgICAgICAgICAgbW06ICclZCDQvNC40L3Rg9GC0LgnLFxuICAgICAgICAgICAgaDogJ9GH0LDRgScsXG4gICAgICAgICAgICBoaDogJyVkINGH0LDRgdCwJyxcbiAgICAgICAgICAgIGQ6ICfQtNC10L0nLFxuICAgICAgICAgICAgZGQ6ICclZCDQtNC10L3QsCcsXG4gICAgICAgICAgICB3OiAn0YHQtdC00LzQuNGG0LAnLFxuICAgICAgICAgICAgd3c6ICclZCDRgdC10LTQvNC40YbQuCcsXG4gICAgICAgICAgICBNOiAn0LzQtdGB0LXRhicsXG4gICAgICAgICAgICBNTTogJyVkINC80LXRgdC10YbQsCcsXG4gICAgICAgICAgICB5OiAn0LPQvtC00LjQvdCwJyxcbiAgICAgICAgICAgIHl5OiAnJWQg0LPQvtC00LjQvdC4JyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9LSjQtdCyfNC10L180YLQuHzQstC4fNGA0Lh80LzQuCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgbGFzdERpZ2l0ID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgbGFzdDJEaWdpdHMgPSBudW1iZXIgJSAxMDA7XG4gICAgICAgICAgICBpZiAobnVtYmVyID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct0LXQsic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGxhc3QyRGlnaXRzID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct0LXQvSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGxhc3QyRGlnaXRzID4gMTAgJiYgbGFzdDJEaWdpdHMgPCAyMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdGC0LgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChsYXN0RGlnaXQgPT09IDEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3QstC4JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiA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WVknLFxuICAgICAgICAgICAgTExMOiAnTU1NTSBbdGlsZV0gRCBbc2FuXSBZWVlZIFtsyZtyyZtdIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIE1NTU0gW3RpbGVdIEQgW3Nhbl0gWVlZWSBbbMmbcsmbXSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0JpIGzJm3LJm10gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tTaW5pIGzJm3LJm10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtkb24gbMmbcsmbXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0t1bnUgbMmbcsmbXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW3TJm23Jm25lbiBsyZtyyZtdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMga8mUbsmUJyxcbiAgICAgICAgICAgIHBhc3Q6ICdhIGLJmyAlcyBiyZQnLFxuICAgICAgICAgICAgczogJ3NhbmdhIGRhbWEgZGFtYScsXG4gICAgICAgICAgICBzczogJ3Nla29uZGkgJWQnLFxuICAgICAgICAgICAgbTogJ21pbml0aSBrZWxlbicsXG4gICAgICAgICAgICBtbTogJ21pbml0aSAlZCcsXG4gICAgICAgICAgICBoOiAnbMmbcsmbIGtlbGVuJyxcbiAgICAgICAgICAgIGhoOiAnbMmbcsmbICVkJyxcbiAgICAgICAgICAgIGQ6ICd0aWxlIGtlbGVuJyxcbiAgICAgICAgICAgIGRkOiAndGlsZSAlZCcsXG4gICAgICAgICAgICBNOiAna2FsbyBrZWxlbicsXG4gICAgICAgICAgICBNTTogJ2thbG8gJWQnLFxuICAgICAgICAgICAgeTogJ3NhbiBrZWx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gICAgICAgICAgICAyOiAn4KeoJyxcbiAgICAgICAgICAgIDM6ICfgp6knLFxuICAgICAgICAgICAgNDogJ+CnqicsXG4gICAgICAgICAgICA1OiAn4KerJyxcbiAgICAgICAgICAgIDY6ICfgp6wnLFxuICAgICAgICAgICAgNzogJ+CnrScsXG4gICAgICAgICAgICA4OiAn4KeuJyxcbiAgICAgICAgICAgIDk6ICfgp68nLFxuICAgICAgICAgICAgMDogJ+CnpicsXG4gICAgICAgIH0sXG4gICAgICAgIG51bWJlck1hcCA9IHtcbiAgICAgICAgICAgICfgp6cnOiAnMScsXG4gICAgICAgICAgICAn4KeoJzogJzInLFxuICAgICAgICAgICAgJ+CnqSc6ICczJyxcbiAgICAgICAgICAgICfgp6onOiAnNCcsXG4gICAgICAgICAgICAn4KerJzogJzUnLFxuICAgICAgICAgICAgJ+CnrCc6ICc2JyxcbiAgICAgICAgICAgICfgp60nOiAnNycsXG4gICAgICAgICAgICAn4KeuJzogJzgnLFxuICAgICAgICAgICAgJ+Cnryc6ICc5JyxcbiAgICAgICAgICAgICfgp6YnOiAnMCcsXG4gICAgICAgIH07XG5cbiAgICB2YXIgYm5CZCA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2JuLWJkJywge1xuICAgICAgICBtb250aHM6ICfgppzgpr7gpqjgp4Hgp5/gpr7gprDgpr9f4Kar4KeH4Kas4KeN4Kaw4KeB4Kef4Ka+4Kaw4Ka/X+CmruCmvuCmsOCnjeCmml/gpo/gpqrgp43gprDgpr/gprJf4Kau4KeHX+CmnOCngeCmqF/gppzgp4HgprLgpr7gpodf4KaG4KaX4Ka44KeN4KafX+CmuOCnh+CmquCnjeCmn+Cnh+CmruCnjeCmrOCmsF/gpoXgppXgp43gpp/gp4vgpqzgprBf4Kao4Kat4KeH4Kau4KeN4Kas4KawX+CmoeCmv+CmuOCnh+CmruCnjeCmrOCmsCcuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU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AgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSwgQSBoOm1tIOCmuOCmruCnnycsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVksIEEgaDptbSDgprjgpq7gp58nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vgpobgppxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb4KaG4KaX4Ka+4Kau4KeA4KaV4Ka+4KayXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQsIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb4KaX4Kak4KaV4Ka+4KayXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vgppfgpqRdIGRkZGQsIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg4Kaq4Kaw4KeHJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDgpobgppfgp4cnLFxuICAgICAgICAgICAgczogJ+CmleCnn+Cnh+CmlSDgprjgp4fgppXgp4fgpqjgp43gpqEnLFxuICAgICAgICAgICAgc3M6ICclZCDgprjgp4fgppXgp4fgpqjgp43gpqEnLFxuICAgICAgICAgICAgbTogJ+Cmj+CmlSDgpq7gpr/gpqjgpr/gpp8nLFxuICAgICAgICAgICAgbW06ICclZCDgpq7gpr/gpqjgpr/gpp8nLFxuICAgICAgICAgICAgaDogJ+Cmj+CmlSDgppjgpqjgp43gpp/gpr4nLFxuICAgICAgICAgICAgaGg6ICclZCDgppjgpqjgp43gpp/gpr4nLFxuICAgICAgICAgICAgZDogJ+Cmj+CmlSDgpqbgpr/gpqgnLFxuICAgICAgICAgICAgZGQ6ICclZCDgpqbgpr/gpqgnLFxuICAgICAgICAgICAgTTogJ+Cmj+CmlSDgpq7gpr7gprgnLFxuICAgICAgICAgICAgTU06ICclZCDgpq7gpr7gprgnLFxuICAgICAgICAgICAgeTogJ+Cmj+CmlSDgpqzgppvgprAnLFxuICAgICAgICAgICAgeXk6ICclZCDgpqzgppvgprAnLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC9b4Ken4Keo4Kep4Keq4Ker4Kes4Ket4Keu4Kev4KemXS9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTWFwW21hdGNoXTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBwb3N0Zm9ybWF0OiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1xcZC9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sTWFwW21hdGNoXTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gprDgpr7gpqR84Kat4KeL4KawfOCmuOCmleCmvuCmsnzgpqbgp4Hgpqrgp4HgprB84Kas4Ka/4KaV4Ka+4KayfOCmuOCmqOCnjeCmp+CnjeCmr+CmvnzgprDgpr7gpqQvLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWVyaWRpZW0gPT09ICfgprDgpr7gpqQnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPCA0ID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgpq3gp4vgprAnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4Ka44KaV4Ka+4KayJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CmpuCngeCmquCngeCmsCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAzID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgpqzgpr/gppXgpr7gprInKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgprjgpqjgp43gpqfgp43gpq/gpr4nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgprDgpr7gpqQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgNikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Kat4KeL4KawJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgprjgppXgpr7gprInO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTUpIHtcbiAgICAgICAgICAgICAgICByZXR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iYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBzeW1ib2xNYXAgPSB7XG4gICAgICAgICAgICAxOiAn4KenJyxcbiAgICAgICAgICAgIDI6ICfgp6gnLFxuICAgICAgICAgICAgMzogJ+CnqScsXG4gICAgICAgICAgICA0OiAn4KeqJyxcbiAgICAgICAgICAgIDU6ICfgp6snLFxuICAgICAgICAgICAgNjogJ+CnrCcsXG4gICAgICAgICAgICA3OiAn4KetJyxcbiAgICAgICAgICAgIDg6ICfgp64nLFxuICAgICAgICAgICAgOTogJ+CnrycsXG4gICAgICAgICAgICAwOiAn4KemJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ+Cnpyc6ICcxJyxcbiAgICAgICAgICAgICfgp6gnOiAnMicsXG4gICAgICAgICAgICAn4KepJzogJzMnLFxuICAgICAgICAgICAgJ+Cnqic6ICc0JyxcbiAgICAgICAgICAgICfgp6snOiAnNScsXG4gICAgICAgICAgICAn4KesJzogJzYnLFxuICAgICAgICAgICAgJ+CnrSc6ICc3JyxcbiAgICAgICAgICAgICfgp64nOiAnOCcsXG4gICAgICAgICAgICAn4KevJzogJzknLFxuICAgICAgICAgICAgJ+Cnpic6ICcwJyxcbiAgICAgICAgfTtcblxuICAgIHZhciBibiA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2JuJywge1xuICAgICAgICBtb250aHM6ICfgppzgpr7gpqjgp4Hgp5/gpr7gprDgpr9f4Kar4KeH4Kas4KeN4Kaw4KeB4Kef4Ka+4Kaw4Ka/X+CmruCmvuCmsOCnjeCmml/gpo/gpqrgp43gprDgpr/gpr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n4Kaw4Kas4Ka/X+CmuOCni+Cmrl/gpq7gppngp43gppfgprJf4Kas4KeB4KanX+CmrOCng+CmuV/gprbgp4HgppXgp43gprBf4Ka24Kao4Ka/Jy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdBIGg6bW0g4Ka44Kau4KefJyxcbiAgICAgICAgICAgIExUUzogJ0EgaDptbTpzcyDgprjgpq7gp58nLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSwgQSBoOm1tIOCmuOCmruCnnycsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVksIEEgaDptbSDgprjgpq7gp58nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vgpobgppxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb4KaG4KaX4Ka+4Kau4KeA4KaV4Ka+4KayXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQsIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb4KaX4Kak4KaV4Ka+4KayXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vgppfgpqRdIGRkZGQsIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg4Kaq4Kaw4KeHJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDgpobgppfgp4cnLFxuICAgICAgICAgICAgczogJ+CmleCnn+Cnh+CmlSDgprjgp4fgppXgp4fgpqjgp43gpqEnLFxuICAgICAgICAgICAgc3M6ICclZCDgprjgp4fgppXgp4fgpqjgp43gpqEnLFxuICAgICAgICAgICAgbTogJ+Cmj+CmlSDgpq7gpr/gpqjgpr/gpp8nLFxuICAgICAgICAgICAgbW06ICclZCDgpq7gpr/gpqjgpr/gpp8nLFxuICAgICAgICAgICAgaDogJ+Cmj+CmlSDgppjgpqjgp43gpp/gpr4nLFxuICAgICAgICAgICAgaGg6ICclZCDgppjgpqjgp43gpp/gpr4nLFxuICAgICAgICAgICAgZDogJ+Cmj+CmlSDgpqbgpr/gpqgnLFxuICAgICAgICAgICAgZGQ6ICclZCDgpqbgpr/gpqgnLFxuICAgICAgICAgICAgTTogJ+Cmj+CmlSDgpq7gpr7gprgnLFxuICAgICAgICAgICAgTU06ICclZCDgpq7gpr7gprgnLFxuICAgICAgICAgICAgeTogJ+Cmj+CmlSDgpqzgppvgprAnLFxuICAgICAgICAgICAgeXk6ICclZCDgpqzgppvgprAnLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC9b4Ken4Keo4Kep4Keq4Ker4Kes4Ket4Keu4Kev4KemXS9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTWFwW21hdGNoXTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBwb3N0Zm9ybWF0OiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1xcZC9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sTWFwW21hdGNoXTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv4Kaw4Ka+4KakfOCmuOCmleCmvuCmsnzgpqbgp4Hgpqrgp4HgprB84Kas4Ka/4KaV4Ka+4KayfOCmsOCmvuCmpC8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAobWVyaWRpZW0gPT09ICfgprDgpr7gpqQnICYmIGhvdXIgPj0gNCkgfHxcbiAgICAgICAgICAgICAgICAobWVyaWRpZW0gPT09ICfgpqbgp4Hgpqrgp4HgprAnICYmIGhvdXIgPCA1KSB8fFxuICAgICAgICAgICAgICAgIG1lcmlkaWVtID09PSAn4Kas4Ka/4KaV4Ka+4KayJ1xuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CmsOCmvuCmpCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Ka44KaV4Ka+4KayJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE3KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgpqbgp4Hgpqrgp4HgprAnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMjApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CmrOCmv+CmleCmvuCmsic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Kaw4Ka+4KakJztcbi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AgICAzOiAn4LyjJyxcbiAgICAgICAgICAgIDQ6ICfgvKQnLFxuICAgICAgICAgICAgNTogJ+C8pScsXG4gICAgICAgICAgICA2OiAn4LymJyxcbiAgICAgICAgICAgIDc6ICfgvKcnLFxuICAgICAgICAgICAgODogJ+C8qCcsXG4gICAgICAgICAgICA5OiAn4LypJyxcbiAgICAgICAgICAgIDA6ICfgvKAnLFxuICAgICAgICB9LFxuICAgICAgICBudW1iZXJNYXAgPSB7XG4gICAgICAgICAgICAn4LyhJzogJzEnLFxuICAgICAgICAgICAgJ+C8oic6ICcyJyxcbiAgICAgICAgICAgICfgvKMnOiAnMycsXG4gICAgICAgICAgICAn4LykJzogJzQnLFxuICAgICAgICAgICAgJ+C8pSc6ICc1JyxcbiAgICAgICAgICAgICfgvKYnOiAnNicsXG4gICAgICAgICAgICAn4LynJzogJzcnLFxuICAgICAgICAgICAgJ+C8qCc6ICc4JyxcbiAgICAgICAgICAgICfgvKknOiAnOScsXG4gICAgICAgICAgICAn4LygJzogJzAnLFxuICAgICAgICB9O1xuXG4gICAgdmFyIGJvID0gbW9tZW50LmRlZmluZUxvY2FsZSgnYm8nLCB7XG4gICAgICAgIG1vbnRoczogJ+C9n+C+s+C8i+C9luC8i+C9keC9hOC8i+C9lOC9vF/gvZ/gvrPgvIvgvZbgvIvgvYLgvYngvbLgvabgvIvgvZRf4L2f4L6z4LyL4L2W4LyL4L2C4L2m4L204L2Y4LyL4L2UX+C9n+C+s+C8i+C9luC8i+C9luC9nuC9suC8i+C9lF/gvZ/gvrPgvIvgvZbgvIvgvaPgvpTgvIvgvZRf4L2f4L6z4LyL4L2W4LyL4L2R4L6y4L204L2C4LyL4L2UX+C9n+C+s+C8i+C9luC8i+C9luC9keC9tOC9k+C8i+C9lF/gvZ/gvrPgvIvgvZbgvIvgvZbgvaLgvpLgvrHgvZHgvIvgvZRf4L2f4L6z4LyL4L2W4LyL4L2R4L2C4L204LyL4L2UX+C9n+C+s+C8i+C9luC8i+C9luC9heC9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mVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDgvaPgvIsnLFxuICAgICAgICAgICAgcGFzdDogJyVzIOC9puC+lOC9k+C8i+C9oycsXG4gICAgICAgICAgICBzOiAn4L2j4L2Y4LyL4L2m4L2EJyxcbiAgICAgICAgICAgIHNzOiAnJWQg4L2m4L6Q4L2i4LyL4L2G4LyNJyxcbiAgICAgICAgICAgIG06ICfgvabgvpDgvaLgvIvgvZjgvIvgvYLgvYXgvbLgvYInLFxuICAgICAgICAgICAgbW06ICclZCDgvabgvpDgvaLgvIvgvZgnLFxuICAgICAgICAgICAgaDogJ+C9huC9tOC8i+C9muC9vOC9keC8i+C9guC9heC9suC9gicsXG4gICAgICAgICAgICBoaDogJyVkIOC9huC9tOC8i+C9muC9vOC9kScsXG4gICAgICAgICAgICBkOiAn4L2J4L2y4L2T4LyL4L2C4L2F4L2y4L2CJyxcbiAgICAgICAgICAgIGRkOiAnJWQg4L2J4L2y4L2T4LyLJyxcbiAgICAgICAgICAgIE06ICfgvZ/gvrPgvIvgvZbgvIvgvYLgvYXgvbLgvYInLFxuICAgICAgICAgICAgTU06ICclZCDgvZ/gvrPgvIvgvZYnLFxuICAgICAgICAgICAgeTogJ+C9o+C9vOC8i+C9guC9heC9suC9gicsXG4gICAgICAgICAgICB5eTogJyVkIOC9o+C9vCcsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1vgvKHgvKLgvKPgvKTgvKXgvKbgvKfgvKjgvKngvKBdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gvZjgvZrgvZPgvIvgvZjgvbx84L2e4L284L2C4L2m4LyL4L2A4L2mfOC9ieC9suC9k+C8i+C9guC9tOC9hHzgvZHgvYLgvbzgvYTgvIvgvZHgvYJ84L2Y4L2a4L2T4LyL4L2Y4L28LyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIChtZXJpZGllbSA9PT0gJ+C9mOC9muC9k+C8i+C9mOC9vCcgJiYgaG91ciA+PSA0KSB8fFxuICAgICAgICAgICAgICAgIChtZXJpZGllbSA9PT0gJ+C9ieC9suC9k+C8i+C9guC9tOC9hCcgJiYgaG91ciA8IDUpIHx8XG4gICAgICAgICAgICAgICAgbWVyaWRpZW0gPT09ICfgvZHgvYLgvbzgvYTgvIvgvZHgvYInXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgNCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4L2Y4L2a4L2T4LyL4L2Y4L28JztcbiAgICAgICAgICAgI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cXVpcmUoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICBmdW5jdGlvbiByZWxhdGl2ZVRpbWVXaXRoTXV0YXRpb24obnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXkpIHtcbiAgICAgICAgdmFyIGZvcm1hdCA9IHtcbiAgICAgICAgICAgIG1tOiAnbXVudXRlbm4nLFxuICAgICAgICAgICAgTU06ICdtaXonLFxuICAgICAgICAgICAgZGQ6ICdkZXZlemgnLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gbnVtYmVyICsgJyAnICsgbXV0YXRpb24oZm9ybWF0W2tleV0sIG51bWJlcik7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNwZWNpYWxNdXRhdGlvbkZvclllYXJzKG51bWJlcikge1xuICAgICAgICBzd2l0Y2ggKGxhc3ROdW1iZXIobnVtYmVyKSkge1xuICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgY2FzZSA5OlxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnIGJsb2F6JztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcgdmxvYXonO1xuICAgICAgICB9XG4gICAgfVxuICAgIGZ1bmN0aW9uIGxhc3ROdW1iZXIobnVtYmVyKSB7XG4gICAgICAgIGlmIChudW1iZXIgPiA5KSB7XG4gICAgICAgICAgICByZXR1cm4gbGFzdE51bWJlcihudW1iZXIgJSAxMCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICB9XG4gICAgZnVuY3Rpb24gbXV0YXRpb24odGV4dCwgbnVtYmVyKSB7XG4gICAgICAgIGlmIChudW1iZXIgPT09IDIpIHtcbiAgICAgICAgICAgIHJldHVybiBzb2Z0TXV0YXRpb24odGV4dCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRleHQ7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHNvZnRNdXRhdGlvbih0ZXh0KSB7XG4gICAgICAgIHZhciBtdXRhdGlvblRhYmxlID0ge1xuICAgICAgICAgICAgbTogJ3YnLFxuICAgICAgICAgICAgYjogJ3YnLFxuICAgICAgICAgICAgZDogJ3onLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobXV0YXRpb25UYWJsZVt0ZXh0LmNoYXJBdCgwKV0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcmV0dXJuIHRleHQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG11dGF0aW9uVGFibGVbdGV4dC5jaGFyQXQoMCldICsgdGV4dC5zdWJzdHJpbmcoMSk7XG4gICAgfVxuXG4gICAgdmFyIG1vbnRoc1BhcnNlID0gW1xuICAgICAgICAgICAgL15nZW4vaSxcbiAgICAgICAgICAgIC9eY1vKvFxcJ11od2UvaSxcbiAgICAgICAgICAgIC9ebWV1L2ksXG4gICAgICAgICAgICAvXmVici9pLFxuICAgICAgICAgICAgL15tYWUvaSxcbiAgICAgICAgICAgIC9eKG1lenxldmUpL2ksXG4gICAgICAgICAgICAvXmdvdS9pLFxuICAgICAgICAgICAgL15lb3MvaSxcbiAgICAgICAgICAgIC9eZ3dlL2ksXG4gICAgICAgICAgICAvXmhlci9pLFxuICAgICAgICAgICAgL15kdS9pLFxuICAgICAgICAgICAgL15rZXIvaSxcbiAgICAgICAgXSxcbiAgICA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2RheXNQYXJzZSxcblxuICAgICAgICBtb250aHNSZWdleDogbW9udGhzUmVnZXgsXG4gICAgICAgIG1vbnRoc1Nob3J0UmVnZXg6IG1vbnRoc1JlZ2V4LFxuICAgICAgICBtb250aHNTdHJpY3RSZWdleDogbW9udGhzU3RyaWN0UmVnZXgsXG4gICAgICAgIG1vbnRoc1Nob3J0U3RyaWN0UmVnZXg6IG1vbnRoc1Nob3J0U3RyaWN0UmVnZXgsXG4gICAgICAgIG1vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgbG9uZ01vbnRoc1BhcnNlOiBtb250aHNQYXJzZSxcbiAgICAgICAgc2hvcnRNb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG5cbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIFthIHZpel0gTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgW2Egdml6XSBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgW2Egdml6XSBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tIaXppdiBkYV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tXYXJjyrxob2F6aCBkYV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtkYV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tEZWPKvGggZGFdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbcGFzZXQgZGFdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnYS1iZW5uICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDKvHpvJyxcbiAgICAgICAgICAgIHM6ICd1biBuZWJldWQgc2Vnb25kZW5ub8O5JyxcbiAgICAgICAgICAgIHNzOiAnJWQgZWlsZW5uJyxcbiAgICAgICAgICAgIG06ICd1ciB2dW51dGVubicsXG4gICAgICAgICAgICBtbTogcmVsYXRpdmVUaW1lV2l0aE11dGF0aW9uLFxuICAgICAgICAgICAgaDogJ3VuIGV1cicsXG4gICAgICAgICAgICBoaDogJyVkIGV1cicsXG4gICAgICAgICAgICBkOiAndW4gZGV2ZXpoJyxcbiAgICAgICAgICAgIGRkOiByZWxhdGl2ZVRpbWVXaXRoTXV0YXRpb24sXG4gICAgICAgICAgICBNOiAndXIgbWl6JyxcbiAgICAgICAgICAgIE1NOiByZWxhdGl2ZVRpbWVXaXRoTXV0YXRpb24sXG4gICAgICAgICAgICB5OiAndXIgYmxvYXonLFxuICAgICAgICAgICAgeXk6IHNwZWNpYWxNdXRhdGlvbkZvclllYXJzLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oYcOxfHZldCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgb3V0cHV0ID0gbnVtYmVyID09PSAxID8gJ2HDsScgOiAndmV0JztcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBv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G9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICBmdW5jdGlvbiBwcm9jZXNzUmVsYXRpdmVUaW1lKG51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5LCBpc0Z1dHVyZSkge1xuICAgICAgICBzd2l0Y2ggKGtleSkge1xuICAgICAgICAgICAgY2FzZSAnbSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXhcbiAgICAgICAgICAgICAgICAgICAgPyAnamVkbmEgbWludXRhJ1xuICAgICAgICAgICAgICAgICAgICA6IGlzRnV0dXJlXG4gICAgICAgICAgICAgICAgICAgICAgPyAnamVkbnUgbWludXR1J1xuICAgICAgICAgICAgICAgICAgICAgIDogJ2plZG5lIG1pbnV0ZSc7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiB0cmFuc2xhdGUobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXkpIHtcbiAgICAgICAgdmFyIHJlc3VsdCA9IG51bWJlciArICcgJztcbiAgICAgICAgc3dpdGNoIChrZXkpIHtcbiAgICAgICAgICAgIGNhc2UgJ3NzJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnc2VrdW5kYSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIgfHwgbnVtYmVyID09PSAzIHx8IG51bWJlciA9PT0gNCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ3Nla3VuZGUnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnc2VrdW5kaSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ21pbnV0YSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIgfHwgbnVtYmVyID09PSAzIHx8IG51bWJlciA9PT0gNCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ21pbnV0ZSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdtaW51dGEnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgY2FzZSAnaCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyAnamVkYW4gc2F0JyA6ICdqZWRhbiBzYXQnO1xuICAgICAgICAgICAgY2FzZSAnaGgnOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdzYXQnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyID09PSAyIHx8IG51bWJlciA9PT0gMyB8fCBudW1iZXIgPT09IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdzYXRhJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ3NhdGknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgY2FzZSAnZGQnOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdkYW4nO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnZGFuYSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICdNTSc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ21qZXNlYyc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIgfHwgbnVtYmVyID09PSAzIHx8IG51bWJlciA9PT0gNCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ21qZXNlY2EnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnbWplc2VjaSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICd5eSc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ2dvZGluYSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIgfHwgbnVtYmVyID09PSAzIHx8IG51bWJlciA9PT0gNCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ2dvZGluZSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdnb2RpbmEnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmFyIGJzID0gbW9tZW50LmRlZmluZUxvY2FsZSgnYnMnLCB7XG4gICAgICAgIG1vbnRoczogJ2phbnVhcl9mZWJydWFyX21hcnRfYXByaWxfbWFqX2p1bmlfanVsaV9hdWd1c3Rfc2VwdGVtYmFyX29rdG9iYXJfbm92ZW1iYXJfZGVjZW1iYXInLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ2phbi5fZmViLl9tYXIuX2Fwci5fbWFqLl9qdW4uX2p1bC5fYXVnLl9zZXAuX29rdC5fbm92Ll9kZWMuJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIG1vbnRoc1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIHdlZWtkYXlzOiAnbmVkamVsamFfcG9uZWRqZWxqYWtfdXRvcmFrX3NyaWplZGFfxI1ldHZydGFrX3BldGFrX3N1Ym90YScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ25lZC5fcG9uLl91dG8uX3NyaS5fxI1ldC5fcGV0Ll9zdWIuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ25lX3BvX3V0X3NyX8SNZV9wZV9zdScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdELiBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRC4gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQuIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbZGFuYXMgdV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tzdXRyYSB1XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBbbmVkamVsanVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIFtzcmlqZWR1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBbc3Vib3R1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBkZGRkIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbanXEjWVyIHVdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbcHJvxaFsdV0gZGRkZCBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1twcm/FoWxlXSBbc3Vib3RlXSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1twcm/FoWxpXSBkZGRkIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnemEgJXMnLFxuICAgICAgICAgICAgcGFzdDogJ3ByaWplICVzJyxcbiAgICAgICAgICAgIHM6ICdwYXIgc2VrdW5kaScsXG4gICAgICAgICAgICBzczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIG1tOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoaDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZDogJ2RhbicsXG4gICAgICAgICAgICBkZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTTogJ21qZXNlYycsXG4gICAgICAgICAgICBNTTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgeTogJ2dvZGludScsXG4gICAgICAgICAgICB5eTogdHJhbnNsYXRlLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn1cXC4vLFxuICAgICAgICBvcmRpbmFsOiAnJWQuJyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN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gICApLFxuICAgICAgICAgICAgZm9ybWF0OiBcImRlIGdlbmVyX2RlIGZlYnJlcl9kZSBtYXLDp19kJ2FicmlsX2RlIG1haWdfZGUganVueV9kZSBqdWxpb2xfZCdhZ29zdF9kZSBzZXRlbWJyZV9kJ29jdHVicmVfZGUgbm92ZW1icmVfZGUgZGVzZW1icmVcIi5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICBpc0Zvcm1hdDogL0Rbb0RdPyhcXHMpK01NTU0vLFxuICAgICAgICB9LFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICdnZW4uX2ZlYnIuX21hcsOnX2Fici5fbWFpZ19qdW55X2p1bC5fYWcuX3NldC5fb2N0Ll9ub3YuX2Rlcy4nLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgbW9udGhzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgd2Vla2RheXM6XG4gICAgICAgICAgICAnZGl1bWVuZ2VfZGlsbHVuc19kaW1hcnRzX2RpbWVjcmVzX2Rpam91c19kaXZlbmRyZXNfZGlzc2FidGUnLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ2RnLl9kbC5fZHQuX2RjLl9kai5fZHYuX2RzLicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdkZ19kbF9kdF9kY19kal9kdl9kcycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gW2RlXSBZWVlZJyxcbiAgICAgICAgICAgIGxsOiAnRCBNTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gW2RlXSBZWVlZIFthIGxlc10gSDptbScsXG4gICAgICAgICAgICBsbGw6ICdEIE1NTSBZWVlZLCBIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBbZGVdIFlZWVkgW2EgbGVzXSBIOm1tJyxcbiAgICAgICAgICAgIGxsbGw6ICdkZGQgRCBNTU0gWVlZWSwgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbYXZ1aSBhICcgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ2xlcycgOiAnbGEnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXh0RGF5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbZGVtw6AgYSAnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdsZXMnIDogJ2xhJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2RkZGQgW2EgJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAnbGVzJyA6ICdsYScpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1thaGlyIGEgJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAnbGVzJyA6ICdsYScpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgJ1tlbF0gZGRkZCBbcGFzc2F0IGEgJyArXG4gICAgICAgICAgICAgICAgICAgICh0aGlzLmhvdXJzKCkgIT09IDEgPyAnbGVzJyA6ICdsYScpICtcbiAgICAgICAgICAgICAgICAgICAgJ10gTFQnXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogXCJkJ2FxdcOtICVzXCIsXG4gICAgICAgICAgICBwYXN0OiAnZmEgJXMnLFxuICAgICAgICAgICAgczogJ3VucyBzZWdvbnMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWdvbnMnLFxuICAgICAgICAgICAgbTogJ3VuIG1pbnV0JyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRzJyxcbiAgICAgICAgICAgIGg6ICd1bmEgaG9yYScsXG4gICAgICAgICAgICBoaDogJyVkIGhvcmVzJyxcbiAgICAgICAgICAgIGQ6ICd1biBkaWEnLFxuICAgICAgICAgICAgZGQ6ICclZCBkaWVzJyxcbiAgICAgICAgICAgIE06ICd1biBtZXMnLFxuICAgICAgICAgICAgTU06ICclZCBtZXNvcycsXG4gICAgICAgICAgICB5OiAndW4gYW55JyxcbiAgICAgICAgICAgIHl5OiAnJWQgYW55cycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShyfG58dHzDqHxhKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgdmFyIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgbnVtYmVyID09PSAxXG4gICAgICAgICAgICAgICAgICAgID8gJ3InXG4gICAgICAgICAgICAgICAgICAgIDogbnVtYmVyID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgPyAnbidcbiAgICAgICAgICAgICAgICAgICAgICA6IG51bWJlciA9PT0gM1xuICAgICAgICAgICAgICAgICAgICAgICAgPyAncidcbiAgICAgICAgICAgICAgICAgICAgICAgIDogbnVtYmVyID09PSA0XG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3QnXG4gICAgICAgICAgICAgICAgICAgICAgICAgIDogJ8OoJztcbiAgICAgICAgICAgIGlmIChwZXJpb2QgPT09ICd3JyB8fCBwZXJpb2QgPT09ICdXJykge1xuICAgICAgICAgICAgICAgIG91dHB1dCA9ICdhJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBjYTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBDemVjaCBbY3NdXG4vLyEgYXV0aG9yIDogcGV0cmJlbGEgOiBodHRwczovL2dpdGh1Yi5jb20vcGV0cmJlbGFcblxuOyhmdW5jdGlvbiAoZ2xvYmFsLCBmYWN0b3J5KSB7XG4gICB0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZSAhPT0gJ3VuZGVmaW5lZCdcbiAgICAgICAmJiB0eXBlb2YgcmVxdWlyZSA9PT0gJ2Z1bmN0aW9uJyA/IGZhY3RvcnkocmVxdWlyZSgn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gICB2YXIgcmVzdWx0ID0gbnVtYmVyICsgJyAnO1xuICAgICAgICBzd2l0Y2ggKGtleSkge1xuICAgICAgICAgICAgY2FzZSAncyc6IC8vIGEgZmV3IHNlY29uZHMgLyBpbiBhIGZldyBzZWNvbmRzIC8gYSBmZXcgc2Vjb25kcyBhZ29cbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdww6FyIHNla3VuZCcgOiAncMOhciBzZWt1bmRhbWknO1xuICAgICAgICAgICAgY2FzZSAnc3MnOiAvLyA5IHNlY29uZHMgLyBpbiA5IHNlY29uZHMgLyA5IHNlY29uZHMgYWdvXG4gICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdzZWt1bmR5JyA6ICdzZWt1bmQnKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ3Nla3VuZGFtaSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSAnbSc6IC8vIGEgbWludXRlIC8gaW4gYSBtaW51dGUgLyBhIG1pbnV0ZSBhZ29cbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdtaW51dGEnIDogaXNGdXR1cmUgPyAnbWludXR1JyA6ICdtaW51dG91JztcbiAgICAgICAgICAgIGNhc2UgJ21tJzogLy8gOSBtaW51dGVzIC8gaW4gOSBtaW51dGVzIC8gOSBtaW51dGVzIGFnb1xuICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAnbWludXR5JyA6ICdtaW51dCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnbWludXRhbWknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgJ2gnOiAvLyBhbiBob3VyIC8gaW4gYW4gaG91ciAvIGFuIGhvdXIgYWdvXG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyAnaG9kaW5hJyA6IGlzRnV0dXJlID8gJ2hvZGludScgOiAnaG9kaW5vdSc7XG4gICAgICAgICAgICBjYXNlICdoaCc6IC8vIDkgaG91cnMgLyBpbiA5IGhvdXJzIC8gOSBob3VycyBhZ29cbiAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ2hvZGlueScgOiAnaG9kaW4nKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ2hvZGluYW1pJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlICdkJzogLy8gYSBkYXkgLyBpbiBhIGRheSAvIGEgZGF5IGFnb1xuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ2RlbicgOiAnZG5lbSc7XG4gICAgICAgICAgICBjYXNlICdkZCc6IC8vIDkgZGF5cyAvIGluIDkgZGF5cyAvIDkgZGF5cyBhZ29cbiAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ2RueScgOiAnZG7DrScpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnZG55JztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlICdNJzogLy8gYSBtb250aCAvIGluIGEgbW9udGggLyBhIG1vbnRoIGFnb1xuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ23Em3PDrWMnIDogJ23Em3PDrWNlbSc7XG4gICAgICAgICAgICBjYXNlICdNTSc6IC8vIDkgbW9udGhzIC8gaW4gOSBtb250aHMgLyA5IG1vbnRocyBhZ29cbiAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ23Em3PDrWNlJyA6ICdtxJtzw61jxa8nKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ23Em3PDrWNpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlICd5JzogLy8gYSB5ZWFyIC8gaW4gYSB5ZWFyIC8gYSB5ZWFyIGFnb1xuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ3JvaycgOiAncm9rZW0nO1xuICAgICAgICAgICAgY2FzZSAneXknOiAvLyA5IHllYXJzIC8gaW4gOSB5ZWFycyAvIDkgeWVhcnMgYWdvXG4gICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdyb2t5JyA6ICdsZXQnKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ2xldHknO1xuICAgICAgIC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cbiAgICAgICAgc2hvcnRNb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG4gICAgICAgIHdlZWtkYXlzOiAnbmVkxJtsZV9wb25kxJtsw61fw7p0ZXLDvV9zdMWZZWRhX8SNdHZydGVrX3DDoXRla19zb2JvdGEnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICduZV9wb1/DunRfc3RfxI10X3DDoV9zbycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICduZV9wb1/DunRfc3RfxI10X3DDoV9zbycuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSDptbScsXG4gICAgICAgICAgICBMVFM6ICdIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRC4gTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QuIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQuIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgICAgIGw6ICdELiBNLiBZWVlZJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbZG5lcyB2XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW3rDrXRyYSB2XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2IG5lZMSbbGkgdl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ZdIGRkZGQgW3ZdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdmUgc3TFmWVkdSB2XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ZlIMSNdHZydGVrIHZdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdiBww6F0ZWsgdl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2IHNvYm90dSB2XSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbdsSNZXJhIHZdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW21pbnVsb3UgbmVkxJtsaSB2XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbbWludWzDqV0gZGRkZCBbdl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1ttaW51bG91IHN0xZllZHUgdl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW21pbnVsw71dIGRkZGQgW3ZdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbbWludWxvdSBzb2JvdHUgdl0gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ3phICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdwxZllZCAlcycsXG4gICAgICAgICAgICBzOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBzczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbW06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGg6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGhoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBkOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBkZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTU06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIHk6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIHl5OiB0cmFuc2xhdGUsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfVxcLi8sXG4gICAgICAgIG9yZGluYWw6ICclZC4nLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gIC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dGC0YDQtV0nLFxuICAgICAgICAgICAgbmV4dERheTogJ1vQq9GA0LDQvV0gTFQgW9GB0LXRhdC10YLRgNC1XScsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9OW0L3QtdGAXSBMVCBb0YHQtdGF0LXRgtGA0LVdJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnW9Kq0LjRgtC10YFdIGRkZGQgTFQgW9GB0LXRhdC10YLRgNC1XScsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vQmNGA0YLQvdOXXSBkZGRkIExUIFvRgdC10YXQtdGC0YDQtV0nLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6IGZ1bmN0aW9uIChvdXRwdXQpIHtcbiAgICAgICAgICAgICAgICB2YXIgYWZmaXggPSAv0YHQtdGF0LXRgiQvaS5leGVjKG91dHB1dClcbiAgICAgICAgICAgICAgICAgICAgPyAn0YDQtdC9J1xuICAgICAgICAgICAgICAgICAgICA6IC/Sq9GD0LskL2kuZXhlYyhvdXRwdXQpXG4gICAgICAgICAgICAgICAgICAgICAgPyAn0YLQsNC9J1xuICAgICAgICAgICAgICAgICAgICAgIDogJ9GA0LDQvSc7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG91dHB1dCArIGFmZml4O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDQutCw0Y/Qu9C70LAnLFxuICAgICAgICAgICAgczogJ9C/05fRgC3QuNC6INKr0LXQutC60YPQvdGCJyxcbiAgICAgICAgICAgIHNzOiAnJWQg0qvQtdC60LrRg9C90YInLFxuICAgICAgICAgICAgbTogJ9C/05fRgCDQvNC40L3Rg9GCJyxcbiAgICAgICAgICAgIG1tOiAnJWQg0LzQuNC90YPRgicsXG4gICAgICAgICAgICBoOiAn0L/Tl9GAINGB0LXRhdC10YInLFxuICAgICAgICAgICAg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c2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgLy8gdGltZSBmb3JtYXRzIGFyZSB0aGUgc2FtZSBhcyBlbi1nYlxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0hlZGRpdyBhbV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tZZm9yeSBhbV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFthbV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tEZG9lIGFtXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW2Rpd2V0aGFmIGFtXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ21ld24gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIHluIMO0bCcsXG4gICAgICAgICAgICBzOiAneWNoeWRpZyBlaWxpYWRhdScsXG4gICAgICAgICAgICBzczogJyVkIGVpbGlhZCcsXG4gICAgICAgICAgICBtOiAnbXVudWQnLFxuICAgICAgICAgICAgbW06ICclZCBtdW51ZCcsXG4gICAgICAgICAgICBoOiAnYXdyJyxcbiAgICAgICAgICAgIGhoOiAnJWQgYXdyJyxcbiAgICAgICAgICAgIGQ6ICdkaXdybm9kJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGl3cm5vZCcsXG4gICAgICAgICAgICBNOiAnbWlzJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbWlzJyxcbiAgICAgICAgICAgIHk6ICdibHd5ZGR5bicsXG4gICAgICAgICAgICB5eTogJyVkIGZseW5lZGQnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oZmVkfGFpbnxhZnxpbHx5ZGR8ZWR8ZWcpLyxcbiAgICAgICAgLy8gdHJhZGl0aW9uYWwgb3JkaW5hbCBudW1iZXJzIGFib3ZlIDMxIGFyZSBub3QgY29tbW9ubHkgdXNlZCBpbiBjb2xsb3F1aWFsIFdlbHNoXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9ICcnLFxuICAgICAgICAgICAgICAgIGxvb2t1cCA9IFtcbiAgICAgICAgICAgICAgICAgICAgJycsXG4gICAgICAgICAgICAgICAgICAgICdhZicsXG4gICAgICAgICAgICAgICAgICAgICdpbCcsXG4gICAgICAgICAgICAgICAgICAgICd5ZGQnLFxuICAgICAgICAgICAgICAgICAgICAneWRkJyxcbiAgICAgICAgICAgICAgICAgICAgJ2VkJyxcbiAgICAgICAgICAgICAgICAgICAgJ2VkJyxcbiAgICAgICAgICAgICAgICAgICAgJ2VkJyxcbiAgICAgICAgICAgICAgICAgICAgJ2ZlZCcsXG4gICAgICAgICAgICAgICAgICAgICdmZWQnLFxuICAgICAgICAgICAgICAgICAgICAnZmVkJywgLy8gMWFmIHRvIDEwZmVkXG4gICAgICAgICAgICAgICAgICAgICdlZycsXG4gICAgICAgICAgICAgICAgICAgICdmZWQnLFxuICAgICAgICAgICAgICAgICAgICAnZWcnLFxuICAgICAgICAgICAgICAgICAgICAnZWcnLFxuICAgICAgICAgICAgICAgICAgICAnZmVkJyxcbiAgICAgICAgICAgICAgICAgICAgJ2VnJyxcbiAgICAgICAgICAgICAgICAgICAgJ2VnJyxcbiAgICAgICAgICAgICAgICAgICAgJ2ZlZCcsXG4gICAgICAgICAgICAgICAgICAgICdlZycsXG4gICAgICAgICAgICAgICAgICAgICdmZWQnLCAvLyAxMWVnIHRvIDIwZmVkXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIGlmIChiID4gMjApIHtcbiAgICAgICAgICAgICAgICBpZiAoYiA9PT0gNDAgfHwgYiA9PT0gNTAgfHwgYiA9PT0gNjAgfHwgYiA9PT0gODAgfHwgYiA9PT0gMTAwKSB7XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICdmZWQnOyAvLyBub3QgMzBhaW4sIDcwYWluIG9yIDkwYWluXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ2Fpbic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChiID4gMCkge1xuICAgICAgICAgICAgICAgIG91dHB1dCA9IGxvb2t1cFtiXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBjeTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBEYW5pc2ggW2RhXVxuLy8hIGF1dGhvciA6I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yJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ3PDuF9tYV90aV9vbl90b19mcl9sw7gnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRC4gTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QuIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBbZC5dIEQuIE1NTU0gWVlZWSBba2wuXSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2kgZGFnIGtsLl0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tpIG1vcmdlbiBrbC5dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAncMOlIGRkZGQgW2tsLl0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tpIGfDpXIga2wuXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tpXSBkZGRkW3Mga2wuXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ29tICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBzaWRlbicsXG4gICAgICAgICAgICBzOiAnZsOlIHNla3VuZGVyJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VrdW5kZXInLFxuICAgICAgICAgICAgbTogJ2V0IG1pbnV0JyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXR0ZXInLFxuICAgICAgICAgICAgaDogJ2VuIHRpbWUnLFxuICAgICAgICAgICAgaGg6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BMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QuIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdELiBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQuIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2hldXRlIHVtXSBMVCBbVWhyXScsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICAgICAgbmV4dERheTogJ1ttb3JnZW4gdW1dIExUIFtVaHJdJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbdW1dIExUIFtVaHJdJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbZ2VzdGVybiB1bV0gTFQgW1Vocl0nLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbbGV0enRlbl0gZGRkZCBbdW1dIExUIFtVaHJdJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdpbiAlcycsXG4gICAgICAgICAgICBwYXN0OiAndm9yICVzJyxcbiAgICAgICAgICAgIHM6ICdlaW4gcGFhciBTZWt1bmRlbicsXG4gICAgICAgICAgICBzczogJyVkIFNla3VuZGVuJyxcbiAgICAgICAgICAgIG06IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBtbTogJyVkIE1pbnV0ZW4nLFxuICAgICAgICAgICAgaDogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIGhoOiAnJWQgU3R1bmRlbicsXG4gICAgICAgICAgICBkOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgZGQ6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICB3OiBwcm9jZXNzUmVsYXRpdmVUaW1lLFx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GFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2hldXRlIHVtXSBMVCBbVWhyXScsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICAgICAgbmV4dERheTogJ1ttb3JnZW4gdW1dIExUIFtVaHJdJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbdW1dIExUIFtVaHJdJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbZ2VzdGVybiB1bV0gTFQgW1Vocl0nLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbbGV0enRlbl0gZGRkZCBbdW1dIExUIFtVaHJdJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdpbiAlcycsXG4gICAgICAgICAgICBwYXN0OiAndm9yICVzJyxcbiAgICAgICAgICAgIHM6ICdlaW4gcGFhciBTZWt1bmRlbicsXG4gICAgICAgICAgICBzczogJyVkIFNla3VuZGVuJyxcbiAgICAgICAgICAgIG06IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBtbTogJyVkIE1pbnV0ZW4nLFxuICAgICAgICAgICAgaDogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIGhoOiAnJWQgU3R1bmRlbicsXG4gICAgICAgICAgICBkOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgZGQ6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICB3OiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgd3c6ICclZCBXb2NoZW4nLFxuICAgICAgICAgICAgTTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIE1NOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgeTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIHl5OiBwcm9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eit6s3oTesN6D3qreh96m3oPeqScsXG4gICAgICAgICAgICAn3onep96D3qjel96qJyxcbiAgICAgICAgICAgICfeh96t3pXesN6D3qnejd6qJyxcbiAgICAgICAgICAgICfeid6tJyxcbiAgICAgICAgICAgICfelt6r3oLesCcsXG4gICAgICAgICAgICAn3pbeqt6N3qbeh96oJyxcbiAgICAgICAgICAgICfeh96v3o7ept6Q3rDek96qJyxcbiAgICAgICAgICAgICfekN6s3pXesN6T3qzeid6w3oTept6D3qonLFxuICAgICAgICAgICAgJ96H3q7eht6w3pPer96E3qbeg96qJyxcbiAgICAgICAgICAgICfegt6u3ojerN6J3rDehN6m3oPeqicsXG4gICAgICAgICAgICAn3pHeqN6Q3qzeid6w3oTept6D3qonLFxuICAgICAgICBdLFxuICAgICAgICB3ZWVrZGF5cyA9IFtcbiAgICAgICAgICAgICfeh96n3oveqN6H3rDejN6mJyxcbiAgICAgICAgICAgICfegN6v3onepicsXG4gICAgICAgICAgICAn3ofept6C3rDejt6n3oPepicsXG4gICAgICAgICAgICAn3oTeqt6L3qYnLFxuICAgICAgICAgICAgJ96E3qreg96n3pDesN6K3qbejN6oJyxcbiAgICAgICAgICAgICfegN6q3obeqt6D3qonLFxuICAgICAgICAgICAgJ96A3q7egt6o3oDeqN6D3qonLFxuICAgICAgICBdO1xuXG4gICAgdmFyIGR2ID0gbW9tZW50LmRlZmluZUxvY2FsZSgnZHYnLCB7XG4gICAgICAgIG1vbnRoczogbW9udGhzLFxuICAgICAgICBtb250aHNTaG9ydDogbW9udGhzLFxuICAgICAgICB3ZWVrZGF5czogd2Vla2RheXMsXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6IHdlZWtkYXlzLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ96H3qfei96oX96A3q/eid6mX96H3qbegt6wX96E3qrei96mX96E3qreg96nX96A3qreht6qX96A3q7egt6oJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnRC9NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/eid6GfN6J3oovLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAn3oneiicgPT09IGlucHV0O1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn3onehic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn3oneiic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW96J3qjeh96m3oveql0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1veid6n3ovept6J3qddIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW96H3qjeh96w3pTerF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb3orep96H3qjejN6q3ojeqF0gZGRkZCBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ96M3qzeg96t3o7ept6H3qggJXMnLFxuICAgICAgICAgICAgcGFzdDogJ96G3qreg96o3oLesCAlcycsXG4gICAgICAgICAgICBzOiAn3pDeqN6G3qregt6w3ozeqt6G3q7ehd6s3ofesCcsXG4gICAgICAgICAgICBzczogJ2QlIN6Q3qjeht6q3oLesN6M3qonLFxuICAgICAgICAgICAgbTogJ96J3qjegt6o3pPerN6H3rAnLFxuICAgICAgICAgICAgbW06ICfeid6o3oLeqN6T3qogJWQnLFxuICAgICAgICAgICAgaDogJ96O3qbekd6o3ofeqN6D3qzeh96wJyxcbiAgICAgICAgICAgIGhoOiAn3o7ept6R3qjeh96o3oPeqiAlZCcsXG4gICAgICAgICAgICBkOiAn3oveqt6I3qbegN6s3ofesCcsXG4gICAgICAgICAgICBkZDogJ96L3qreiN6m3pDesCAlZCcsXG4gICAgICAgICAgICBNOiAn3onept6A3qzeh96wJyxcbiAgICAgICAgICAgIE1NOiAn3onept6Q3rAgJWQnLFxuICAgICAgICAgICAgeTogJ96H3qbegN6m3oPerN6H3rAnLFxuICAgICAgICAgICAgeXk6ICfeh96m3oDept6D3qogJWQnLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC/YjC9nLCAnLCcpO1xuICAgICAgICB9LFxuICAgICAgICBwb3N0Zm9ybWF0OiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoLywvZywgJ9iMJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogNywgLy8gU3VuZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDEyLCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiAxMnRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4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gICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/ICfOvM68JyA6ICfOnM6cJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzTG93ZXIgPyAnz4DOvCcgOiAnzqDOnCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuIChpbnB1dCArICcnKS50b0xvd2VyQ2FzZSgpWzBdID09PSAnzrwnO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAvW86gzpxdXFwuP86cP1xcLj8vaSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnaDptbSBBJyxcbiAgICAgICAgICAgIExUUzogJ2g6bW06c3MgQScsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIGg6bW0gQScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgaDptbSBBJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXJFbDoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vOo86uzrzOtc+BzrEge31dIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbzpHPjc+BzrnOvyB7fV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFt7fV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vOp864zrXPgiB7fV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbz4TOvyDPgM+Bzr/Ot86zzr/Pjc68zrXOvc6/XSBkZGRkIFt7fV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbz4TOt869IM+Az4HOv863zrPOv8+NzrzOtc69zrddIGRkZGQgW3t9XSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiBmdW5jdGlvbiAoa2V5LCBtb20pIHtcbiAgICAgICAgICAgIHZhciBvdXRwdXQgPSB0aGlzLl9jYWxlbmRhckVsW2tleV0sXG4gICAgICAgICAgICAgICAgaG91cnMgPSBtb20gJiYgbW9tLmhvdXJzKCk7XG4gICAgICAgICAgICBpZiAoaXNGdW5jdGlvbihvdXRwdXQpKSB7XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gb3V0cHV0LmFwcGx5KG1vbSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gb3V0cHV0LnJlcGxhY2UoJ3t9JywgaG91cnMgJSAxMiA9PT0gMSA/ICfPg8+EzrcnIDogJ8+Dz4TOuc+CJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnz4POtSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgz4DPgc65zr0nLFxuICAgICAgICAgICAgczogJ867zq/Os86xIM60zrXPhc+EzrXPgc+MzrvOtc+Az4TOsScsXG4gICAgICAgICAgICBzczogJyVkIM60zrXPhc+EzrXPgc+MzrvOtc+Az4TOsScsXG4gICAgICAgICAgICBtOiAnzq3Ovc6xIM67zrXPgM+Ez4wnLFxuICAgICAgICAgICAgbW06ICclZCDOu861z4DPhM6sJyxcbiAgICAgICAgICAgIGg6ICfOvM6vzrEgz47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AgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBoOm1tIEEnLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIGg6bW0gQScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW1RvZGF5IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW1RvbW9ycm93IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW1llc3RlcmRheSBhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbTGFzdF0gZGRkZCBbYXRdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnaW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGFnbycsXG4gICAgICAgICAgICBzOiAnYSBmZXcgc2Vjb25kcycsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZHMnLFxuICAgICAgICAgICAgbTogJ2EgbWludXRlJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgICAgICBoOiAnYW4gaG91cicsXG4gICAgICAgICAgICBoaDogJyVkIGhvdXJzJyxcbiAgICAgICAgICAgIGQ6ICdhIGRheScsXG4gICAgICAgICAgICBkZDogJyVkIGRheXMnLFxuICAgICAgICAgICAgTTogJ2EgbW9udGgnLFxuICAgICAgICAgICAgTU06ICclZCBtb250aHMnLFxuICAgICAgICAgICAgeTogJ2EgeWVhcicsXG4gICAgICAgICAgICB5eTogJyVkIHllYXJzJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0fG5kfHJkfHRoKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICAgICAgfn4oKG51bWJlciAlIDEwMCkgLyAxMCkgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ3RoJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3N0J1xuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICduZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAndGgnO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAwLCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGVuQXU7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogRW5nbGlzaCAoQ2FuYWRhKSBbZW4tY2FdXG4vLyEgYXV0aG9yIDogSm9uYXRoYW4gQWJvdXJiaWggOiBodHRw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9GcmlfU2F0Jy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ1N1X01vX1R1X1dlX1RoX0ZyX1NhJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdoOm1tIEEnLFxuICAgICAgICAgICAgTFRTOiAnaDptbTpzcyBBJyxcbiAgICAgICAgICAgIEw6ICdZWVlZLU1NLUREJyxcbiAgICAgICAgICAgIExMOiAnTU1NTSBELCBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ01NTU0gRCwgWVlZWSBoOm1tIEEnLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIE1NTU0gRCwgWVlZWSBoOm1tIEEnLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tUb2RheSBhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tUb21vcnJvdyBhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFthdF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tZZXN0ZXJkYXkgYXRdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW0xhc3RdIGRkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2luICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBhZ28nLFxuICAgICAgICAgICAgczogJ2EgZmV3IHNlY29uZHMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRzJyxcbiAgICAgICAgICAgIG06ICdhIG1pbnV0ZScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZXMnLFxuICAgICAgICAgICAgaDogJ2FuIGhvdXInLFxuICAgICAgICAgICAgaGg6ICclZCBob3VycycsXG4gICAgICAgICAgICBkOiAnYSBkYXknLFxuICAgICAgICAgICAgZGQ6ICclZCBkYXlzJyxcbiAgICAgICAgICAgIE06ICdhIG1vbnRoJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbW9udGhzJyxcbiAgICAgICAgICAgIHk6ICdhIHllYXInLFxuICAgICAgICAgICAgeXk6ICclZCB5ZWFycycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShzdHxuZHxyZHx0aCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYiA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgICAgIH5+KChudW1iZXIgJSAxMDApIC8gMTApID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICd0aCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdzdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnbmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdyZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ3RoJztcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZW5DYTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBFbmdsaXNoIChVbml0ZWQgS2luZ2RvbSkgW2VuLWdiXVxuLy8hIGF1dGhvciA6IENocmlzIEdlZHJpbSA6IGh0dHBzOi8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nb25fVHVlX1dlZF9UaHVfRnJpX1NhdCcuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdTdV9Nb19UdV9XZV9UaF9Gcl9TYScuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tUb2RheSBhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tUb21vcnJvdyBhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFthdF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tZZXN0ZXJkYXkgYXRdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW0xhc3RdIGRkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2luICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBhZ28nLFxuICAgICAgICAgICAgczogJ2EgZmV3IHNlY29uZHMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRzJyxcbiAgICAgICAgICAgIG06ICdhIG1pbnV0ZScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZXMnLFxuICAgICAgICAgICAgaDogJ2FuIGhvdXInLFxuICAgICAgICAgICAgaGg6ICclZCBob3VycycsXG4gICAgICAgICAgICBkOiAnYSBkYXknLFxuICAgICAgICAgICAgZGQ6ICclZCBkYXlzJyxcbiAgICAgICAgICAgIE06ICdhIG1vbnRoJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbW9udGhzJyxcbiAgICAgICAgICAgIHk6ICdhIHllYXInLFxuICAgICAgICAgICAgeXk6ICclZCB5ZWFycycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShzdHxuZHxyZHx0aCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYiA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgICAgIH5+KChudW1iZXIgJSAxMDApIC8gMTApID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICd0aCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdzdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnbmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdyZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ3RoJztcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZ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AgICAgIHBhc3Q6ICclcyBhZ28nLFxuICAgICAgICAgICAgczogJ2EgZmV3IHNlY29uZHMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRzJyxcbiAgICAgICAgICAgIG06ICdhIG1pbnV0ZScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZXMnLFxuICAgICAgICAgICAgaDogJ2FuIGhvdXInLFxuICAgICAgICAgICAgaGg6ICclZCBob3VycycsXG4gICAgICAgICAgICBkOiAnYSBkYXknLFxuICAgICAgICAgICAgZGQ6ICclZCBkYXlzJyxcbiAgICAgICAgICAgIE06ICdhIG1vbnRoJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbW9udGhzJyxcbiAgICAgICAgICAgIHk6ICdhIHllYXInLFxuICAgICAgICAgICAgeXk6ICclZCB5ZWFycycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShzdHxuZHxyZHx0aCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYiA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgICAgIH5+KChudW1iZXIgJSAxMDApIC8gMTApID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICd0aCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdzdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnbmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdyZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ3RoJztcbiAgICAgICAgICAgIHJldHVybiBudW1iZXI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gbGFzdERheTogJ1tZZXN0ZXJkYXkgYXRdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW0xhc3RdIGRkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2luICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBhZ28nLFxuICAgICAgICAgICAgczogJ2EgZmV3IHNlY29uZHMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRzJyxcbiAgICAgICAgICAgIG06ICdhIG1pbnV0ZScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZXMnLFxuICAgICAgICAgICAgaDogJ2FuIGhvdXInLFxuICAgICAgICAgICAgaGg6ICclZCBob3VycycsXG4gICAgICAgICAgICBkOiAnYSBkYXknLFxuICAgICAgICAgICAgZGQ6ICclZCBkYXlzJyxcbiAgICAgICAgICAgIE06ICdhIG1vbnRoJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbW9udGhzJyxcbiAgICAgICAgICAgIHk6ICdhIHllYXInLFxuICAgICAgICAgICAgeXk6ICclZCB5ZWFycycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShzdHxuZHxyZHx0aCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYiA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgICAgIH5+KChudW1iZXIgJSAxMDApIC8gMTApID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICd0aCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdzdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnbmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdyZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ3RoJztcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZW5JbDtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBFbmdsaXNoIChJbmRpYSkgW2VuLWluXVxuLy8hIGF1dGhvciA6IEphdGluIEFncmF3YWwgOiBodHRwczovL2dpdGh1Yi5jb20vamF0aW5hZzIyXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnXG4gICAgICAgJiYgdHlwZW9mIHJlcXVpcmUgPT09ICdmdW5jdGlvbicgPyBmYWN0b3J5KHJlcXVpcmUoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgZW5JbiA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2VuLWluJywge1xuICAgICAgICBtb250aHM6ICdKYW51YXJ5X0ZlYnJ1YXJ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0ZXJkYXkgYXRdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW0xhc3RdIGRkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2luICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBhZ28nLFxuICAgICAgICAgICAgczogJ2EgZmV3IHNlY29uZHMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRzJyxcbiAgICAgICAgICAgIG06ICdhIG1pbnV0ZScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZXMnLFxuICAgICAgICAgICAgaDogJ2FuIGhvdXInLFxuICAgICAgICAgICAgaGg6ICclZCBob3VycycsXG4gICAgICAgICAgICBkOiAnYSBkYXknLFxuICAgICAgICAgICAgZGQ6ICclZCBkYXlzJyxcbiAgICAgICAgICAgIE06ICdhIG1vbnRoJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbW9udGhzJyxcbiAgICAgICAgICAgIHk6ICdhIHllYXInLFxuICAgICAgICAgICAgeXk6ICclZCB5ZWFycycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShzdHxuZHxyZHx0aCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYiA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgICAgIH5+KChudW1iZXIgJSAxMDApIC8gMTApID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICd0aCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdzdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiB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lZIGg6bW0gQScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW1RvZGF5IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW1RvbW9ycm93IGF0XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2F0XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW1llc3RlcmRheSBhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbTGFzdF0gZGRkZCBbYXRdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnaW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGFnbycsXG4gICAgICAgICAgICBzOiAnYSBmZXcgc2Vjb25kcycsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZHMnLFxuICAgICAgICAgICAgbTogJ2EgbWludXRlJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgICAgICBoOiAnYW4gaG91cicsXG4gICAgICAgICAgICBoaDogJyVkIGhvdXJzJyxcbiAgICAgICAgICAgIGQ6ICdhIGRheScsXG4gICAgICAgICAgICBkZDogJyVkIGRheXMnLFxuICAgICAgICAgICAgTTogJ2EgbW9udGgnLFxuICAgICAgICAgICAgTU06ICclZCBtb250aHMnLFxuICAgICAgICAgICAgeTogJ2EgeWVhcicsXG4gICAgICAgICAgICB5eTogJyVkIHllYXJzJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0fG5kfHJkfHRoKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICAgICAgfn4oKG51bWJlciAlIDEwMCkgLyAxMCkgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ3RoJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3N0J1xuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICduZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAndGgnO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGVuTno7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogRW5nbGlzaCAoU2luZ2Fwb3JlKSBbZW4tc2ddXG4vLyEgYXV0aG9yIDogTWF0dGhldyBDYXN0cmlsbG9uLU1hZHJpZ2FsIDogaHR0cHM6Ly9naXRodWIuY29tL3RlY2hkaW1lbnNpb25cblxuOyhmdW5jdGlvbiAoZ2xvYmFsLCBmYWN0b3J5KSB7XG4gICB0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZS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iB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbVG9kYXkgYXRdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbVG9tb3Jyb3cgYXRdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbYXRdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbWWVzdGVyZGF5IGF0XSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tMYXN0XSBkZGRkIFthdF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdpbiAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgYWdvJyxcbiAgICAgICAgICAgIHM6ICdhIGZldyBzZWNvbmRzJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vjb25kcycsXG4gICAgICAgICAgICBtOiAnYSBtaW51dGUnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGVzJyxcbiAgICAgICAgICAgIGg6ICdhbiBob3VyJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaG91cnMnLFxuICAgICAgICAgICAgZDogJ2EgZGF5JyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGF5cycsXG4gICAgICAgICAgICBNOiAnYSBtb250aCcsXG4gICAgICAgICAgICBNTTogJyVkIG1vbnRocycsXG4gICAgICAgICAgICB5OiAnYSB5ZWFyJyxcbiAgICAgICAgICAgIHl5OiAnJWQgeWVhcnMnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oc3R8bmR8cmR8dGgpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIGIgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBvdXRwdXQgPVxuICAgICAgICAgICAgICAgICAgICB+figobnVtYmVyICUgMTAwKSAvIDEwKSA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgPyAndGgnXG4gICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnc3QnXG4gICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ25kJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gM1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAncmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICd0aCc7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgb3V0cHV0O1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZW5TZztcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUg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BtZXJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91cnMgPiAxMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0xvd2VyID8gJ3AudC5tLicgOiAnUC5ULk0uJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzTG93ZXIgPyAnYS50Lm0uJyA6ICdBLlQuTS4nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tIb2RpYcWtIGplXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW01vcmdhxa0gamVdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZFtuIGplXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0hpZXJhxa0gamVdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW3Bhc2ludGFuXSBkZGRkW24gamVdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAncG9zdCAlcycsXG4gICAgICAgICAgICBwYXN0OiAnYW50YcWtICVzJyxcbiAgICAgICAgICAgIHM6ICdrZWxrYWogc2VrdW5kb2onLFxuICAgICAgICAgICAgc3M6ICclZCBzZWt1bmRvaicsXG4gICAgICAgICAgICBtOiAndW51IG1pbnV0bycsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0b2onLFxuICAgICAgICAgICAgaDogJ3VudSBob3JvJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaG9yb2onLFxuICAgICAgICAgICAgZDogJ3VudSB0YWdvJywgLy9uZSAnZGl1cm5vJywgxIlhciBlc3RhcyB1eml0YSBwb3IgcHJva3NpbXVtb1xuICAgICAgICAg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50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBtb250aHNTaG9ydERvdCA9XG4gICAgICAgICAgICAnZW5lLl9mZWIuX21hci5fYWJyLl9tYXkuX2p1bi5fanVsLl9hZ28uX3NlcC5fb2N0Ll9ub3YuX2RpYy4nLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQgPSAnZW5lX2ZlYl9tYXJfYWJyX21heV9qdW5fanVsX2Fnb19zZXBfb2N0X25vdl9kaWMnLnNwbGl0KCdfJyksXG4gICAgICAgIG1vbnRoc1BhcnNlID0gW1xuICAgICAgICAgICAgL15lbmUvaSxcbiAgICAgICAgICAgIC9eZmViL2ksXG4gICAgICAgICAgICAvXm1hci9pLFxuICAgICAgICAgICAgL15hYnIvaSxcbiAgICAgICAgICAgIC9ebWF5L2ksXG4gICAgICAgICAgICAvXmp1bi9pLFxuICAgICAgICAgICAgL15qdWwvaSxcbiAgICAgICAgICAgIC9eYWdvL2ksXG4gICAgICAgICAgICAvXnNlcC9pLFxuICAgICAgICAgICAgL15vY3QvaSxcbiAgICAgICAgICAgIC9ebm92L2ksXG4gICAgICAgICAgICAvXmRpYy9pLFxuICAgICAgICBdLFxuICAgICAgICBtb250aHNSZWdleCA9XG4gICAgICAgICAgICAvXihlbmVyb3xmZWJyZXJvfG1hcnpvfGFicmlsfG1heW98anVuaW98anVsaW98YWdvc3RvfHNlcHRpZW1icmV8b2N0dWJyZXxub3ZpZW1icmV8ZGljaWVtYnJlfGVuZVxcLj98ZmViXFwuP3xtYXJcXC4/fGFiclxcLj98bWF5XFwuP3xqdW5cXC4/fGp1bFxcLj98YWdvXFwuP3xzZXBcXC4/fG9jdFxcLj98bm92XFwuP3xkaWNcXC4/KS9pO1xuXG4gICAgdmFyIGVzRG8gPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdlcy1kbycsIHtcbiAgICAgICAgbW9udGhzOiAnZW5lcm9fZmVicmVyb19tYXJ6b19hYnJpbF9tYXlvX2p1bmlvX2p1bGlvX2Fnb3N0b19zZXB0aWVtYnJlX29jdHVicmVfbm92aWVtYnJlX2RpY2llbWJyZScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6IGZ1bmN0aW9uIChtLCBmb3JtYXQpIHtcbiAgICAgICAgICAgIGlmICghbSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydERvdDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoLy1NTU0tLy50ZXN0KGZvcm1hdCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU2hvcnRbbS5tb250aCgpXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0RG90W20ubW9udGgoKV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRoc1JlZ2V4OiBtb250aHNSZWdleCxcbiAgICAgICAgbW9udGhzU2hvcnRSZWdleDogbW9udGhzUmVnZXgsXG4gICAgICAgIG1vbnRoc1N0cmljdFJlZ2V4OlxuICAgICAgICAgICAgL14oZW5lcm98ZmVicmVyb3xtYXJ6b3xhYnJpbHxtYXlvfGp1bmlvfGp1bGlvfGFnb3N0b3xzZXB0aWVtYnJlfG9jdHVicmV8bm92aWVtYnJlfGRpY2llbWJyZSkvaSxcbiAgICAgICAgbW9udGhzU2hvcnRTdHJpY3RSZWdleDpcbiAgICAgICAgICAgIC9eKGVuZVxcLj98ZmViXFwuP3xtYXJcXC4/fGFiclxcLj98bWF5XFwuP3xqdW5cXC4/fGp1bFxcLj98YWdvXFwuP3xzZXBcXC4/fG9jdFxcLj98bm92XFwuP3xkaWNcXC4/KS9pLFxuICAgICAgICBtb250aHNQYXJzZTogbW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hIGEgbGEnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZGRkZCBbYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1theWVyIGEgbGEnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICdbZWxdIGRkZGQgW3Bhc2FkbyBhIGxhJyArXG4gICAgICAgICAgICAgICAgICAgICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgK1xuICAgICAgICAgICAgICAgICAgICAnXSBMVCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnZW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ2hhY2UgJXMnLFxuICAgICAgICAgICAgczogJ3Vub3Mgc2VndW5kb3MnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWd1bmRvcycsXG4gICAgICAgICAgICBtOiAndW4gbWludXRvJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRvcycsXG4gICAgICAgICAgICBoOiAndW5hIGhvcmEnLFxuICAgICAgICAgICAgaGg6ICclZCBob3JhcycsXG4gICAgICAgICAgICBkOiAndW4g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PT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBtb250aHNTaG9ydERvdCA9XG4gICAgICAgICAgICAnZW5lLl9mZWIuX21hci5fYWJyLl9tYXkuX2p1bi5fanVsLl9hZ28uX3NlcC5fb2N0Ll9ub3YuX2RpYy4nLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQgPSAnZW5lX2ZlYl9tYXJfYWJyX21heV9qdW5fanVsX2Fnb19zZXBfb2N0X25vdl9kaWMnLnNwbGl0KCdfJyksXG4gICAgICAgIG1vbnRoc1BhcnNlID0gW1xuICAgICAgICAgICAgL15lbmUvaSxcbiAgICAgICAgICAgIC9eZmViL2ksXG4gICAgICAgICAgICAvXm1hci9pLFxuICAgICAgICAgICAgL15hYnIvaSxcbiAgICAgICAgICAgIC9ebWF5L2ksXG4gICAgICAgICAgICAvXmp1bi9pLFxuICAgICAgICAgICAgL15qdWwvaSxcbiAgICAgICAgICAgIC9eYWdvL2ksXG4gICAgICAgICAgICAvXnNlcC9pLFxuICAgICAgICAgICAgL15vY3QvaSxcbiAgICAgICAgICAgIC9ebm92L2ksXG4gICAgICAgICAgICAvXmRpYy9pLFxuICAgICAgICBdLFxuICAgICAgICBtb250aHNSZWdleCA9XG4gICAgICAgICAgICAvXihlbmVyb3xmZWJyZXJvfG1hcnpvfGFicmlsfG1heW98anVuaW98anVsaW98YWdvc3RvfHNlcHRpZW1icmV8b2N0dWJyZXxub3ZpZW1icmV8ZGljaWVtYnJlfGVuZVxcLj98ZmViXFwuP3xtYXJcXC4/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oKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXh0RGF5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbbWHDsWFuYSBhIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2RkZGQgW2EgbGEnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbYXllciBhIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAnW2VsXSBkZGRkIFtwYXNhZG8gYSBsYScgK1xuICAgICAgICAgICAgICAgICAgICAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICtcbiAgICAgICAgICAgICAgICAgICAgJ10gTFQnXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2VuICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdoYWNlICVzJyxcbiAgICAgICAgICAgIHM6ICd1bm9zIHNlZ3VuZG9zJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VndW5kb3MnLFxuICAgICAgICAgICAgbTogJ3VuIG1pbnV0bycsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0b3MnLFxuICAgICAgICAgICAgaDogJ3VuYSBob3JhJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaG9yYXMnLFxuICAgICAgICAgICAgZDogJ3VuIGTDrWEnLFxuICAgICAgICAgICAgZGQ6ICclZCBkw61hcycsXG4gICAgICAgICAgICB3OiAndW5hIHNlbWFuYScsXG4gICAgICAgICAgICB3dzogJyVkIHNlbWFuYXMnLFxuICAgICAgICAgICAgTTogJ3VuIG1lcycsXG4gICAgICAgICAgICBNTTogJyVkIG1lc2VzJyxcbiAgICAgICAgICAgIHk6ICd1biBhw7FvJyxcbiAgICAgICAgICAgIHl5OiAnJWQgYcOxb3MnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn3Cui8sXG4gICAgICAgIG9yZGluYWw6ICclZMK6JyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAwLCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgICAgICBpbnZhbGlkRGF0ZTogJ0ZlY2hhIGludsOhbGlkYScsXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZXNNeDtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBTcGFuaXNoIChVbml0ZWQgU3RhdGVzKSBbZXMtdXNdXG4vLyEgYXV0aG9yIDogYnVzdHRhIDogaHR0cHM6Ly9naXRodWIuY29tL2J1c3R0YVxuLy8hIGF1dGhvciA6IGNocmlzcm9keiA6IGh0dH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gICAgICAvXnNlcC9pLFxuICAgICAgICAgICAgL15vY3QvaSxcbiAgICAgICAgICAgIC9ebm92L2ksXG4gICAgICAgICAgICAvXmRpYy9pLFxuICAgICAgICBdLFxuICAgICAgICBtb250aHNSZWdleCA9XG4gICAgICAgICAgICAvXihlbmVyb3xmZWJyZXJvfG1hcnpvfGFicmlsfG1heW98anVuaW98anVsaW98YWdvc3RvfHNlcHRpZW1icmV8b2N0dWJyZXxub3ZpZW1icmV8ZGljaWVtYnJlfGVuZVxcLj98ZmViXFwuP3xtYXJcXC4/fGFiclxcLj98bWF5XFwuP3xqdW5cXC4/fGp1bFxcLj98YWdvXFwuP3xzZXBcXC4/fG9jdFxcLj98bm92XFwuP3xkaWNcXC4/KS9pO1xuXG4gICAgdmFyIGVzVXMgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdlcy11cycsIHtcbiAgICAgICAgbW9udGhzOiAnZW5lcm9fZmVicmVyb19tYXJ6b19hYnJpbF9tYXlvX2p1bmlvX2p1bGlvX2Fnb3N0b19zZXB0aWVtYnJlX29jdHVicmVfbm92aWVtYnJlX2RpY2llbWJyZScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6IGZ1bmN0aW9uIChtLCBmb3JtYXQpIHtcbiAgICAgICAgICAgIGlmICghbSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydERvdDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoLy1NTU0tLy50ZXN0KGZvcm1hdCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU2hvcnRbbS5tb250aCgpXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0RG90W20ubW9udGgoKV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRoc1JlZ2V4OiBtb250aHNSZWdleCxcbiAg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1NIFtkZV0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIFtkZV0gTU1NTSBbZGVdIFlZWVkgaDptbSBBJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIFtkZV0gTU1NTSBbZGVdIFlZWVkgaDptbSBBJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1tob3kgYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHREYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1ttYcOxYW5hIGEgbGEnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZGRkZCBbYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1theWVyIGEgbGEnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICdbZWxdIGRkZGQgW3Bhc2FkbyBhIGxhJyArXG4gICAgICAgICAgICAgICAgICAgICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgK1xuICAgICAgICAgICAgICAgICAgICAnXSBMVCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnZW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ2hhY2UgJXMnLFxuICAgICAgICAgICAgczogJ3Vub3Mgc2VndW5kb3MnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWd1bmRvcycsXG4gICAgICAgICAgICBtOiAndW4gbWludXRvJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRvcycsXG4gICAgICAgICAgICBoOiAndW5hIGhvcmEnLFxuICAgICAgICAgICAgaGg6ICclZCBob3JhcycsXG4gICAgICAgICAgICBkOiAndW4gZMOtYScsXG4gICAgICAgICAgICBkZDogJyVkIGTDrWFzJyxcbiAgICAgICAgICAgIHc6ICd1bmEgc2VtYW5hJyxcbiAgICAgICAgICAgIHd3OiAnJWQgc2VtYW5hcycsXG4gICAgICAgICAgICBNOiAndW4gbWVzJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbWVzZXMnLFxuICAgICAgICAgICAgeTogJ3VuIGHDsW8nLFxuICAgICAgICAgICAgeXk6ICclZCBhw7FvcycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfcK6LyxcbiAgICAgICAgb3JkaW5hbDogJyVkwronLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDAsIC8vIFN1bmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA2LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA2dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gZXN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ICAgICAgICAgICAgL15hYnIvaSxcbiAgICAgICAgICAgIC9ebWF5L2ksXG4gICAgICAgICAgICAvXmp1bi9pLFxuICAgICAgICAgICAgL15qdWwvaSxcbiAgICAgICAgICAgIC9eYWdvL2ksXG4gICAgICAgICAgICAvXnNlcC9pLFxuICAgICAgICAgICAgL15vY3QvaSxcbiAgICAgICAgICAgIC9ebm92L2ksXG4gICAgICAgICAgICAvXmRpYy9pLFxuICAgICAgICBdLFxuICAgICAgICBtb250aHNSZWdleCA9XG4gICAgICAgICAgICAvXihlbmVyb3xmZWJyZXJvfG1hcnpvfGFicmlsfG1heW98anVuaW98anVsaW98YWdvc3RvfHNlcHRpZW1icmV8b2N0dWJyZXxub3ZpZW1icmV8ZGljaWVtYnJlfGVuZVxcLj98ZmViXFwuP3xtYXJcXC4/fGFiclxcLj98bWF5XFwuP3xqdW5cXC4/fGp1bFxcLj98YWdvXFwuP3xzZXBcXC4/fG9jdFxcLj98bm92XFwuP3xkaWNcXC4/KS9pO1xuXG4gICAgdmFyIGVzID0gbW9tZW50LmRlZmluZUxvY2FsZSgnZXMnLCB7XG4gICAgICAgIG1vbnRoczogJ2VuZXJvX2ZlYnJlcm9fbWFyem9fYWJyaWxfbWF5b19qdW5pb19qdWxpb19hZ29zdG9fc2VwdGllbWJyZV9vY3R1YnJlX25vdmllbWJyZV9kaWNpZW1icmUnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OiBmdW5jdGlvbiAobSwgZm9ybWF0KSB7XG4gICAgICAgICAgICBpZiAoIW0pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU2hvcnREb3Q7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKC8tTU1NLS8udGVzdChmb3JtYXQpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0W20ubW9udGgoKV07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICA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ICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgW2RlXSBNTU1NIFtkZV0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIFtkZV0gTU1NTSBbZGVdIFlZWVkgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBbZGVdIE1NTU0gW2RlXSBZWVlZIEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW2hveSBhIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW21hw7FhbmEgYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdkZGRkIFthIGxhJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAncycgOiAnJykgKyAnXSBMVCc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW2F5ZXIgYSBsYScgKyAodGhpcy5ob3VycygpICE9PSAxID8gJ3MnIDogJycpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgJ1tlbF0gZGRkZCBbcGFzYWRvIGEgbGEnICtcbiAgICAgICAgICAgICAgICAgICAgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICdzJyA6ICcnKSArXG4gICAgICAgICAgICAgICAgICAgICddIExUJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdlbiAlcycsXG4gICAgICAgICAgICBwYXN0OiAnaGFjZSAlcycsXG4gICAgICAgICAgICBzOiAndW5vcyBzZWd1bmRvcycsXG4gICAgICAgICAgICBzczogJyVkIHNlZ3VuZG9zJyxcbiAgICAgICAgICAgIG06ICd1biBtaW51dG8nLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dG9zJyxcbiAgICAgICAgICAgIGg6ICd1bmEgaG9yYScsXG4gICAgICAgICAgICBoaDogJyVkIGhvcmFzJyxcbiAgICAgICAgICAgIGQ6ICd1biBkw61hJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZMOtYXMnLFxuICAgICAgICAgICAgdzogJ3VuYSBzZW1hbmEnLFxuICAgICAgICAgICAgd3c6ICclZCBzZW1hbmFzJyxcbiAgICAgICAgICAgIE06ICd1biBtZXMnLFxuICAgICAgICAgICAgTU06ICclZCBtZXNlcycsXG4gICAgICAgICAgICB5OiAndW4gYcOxbycsXG4gICAgICAgICAgICB5eTogJyVkIGHDsW9zJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9wrovLFxuICAgICAgICBvcmRpbmFsOiAnJWTCuicsXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQg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BbJ23DtW5lIHNla3VuZGknLCAnbcO1bmkgc2VrdW5kJywgJ3BhYXIgc2VrdW5kaXQnXSxcbiAgICAgICAgICAgIHNzOiBbbnVtYmVyICsgJ3Nla3VuZGknLCBudW1iZXIgKyAnc2VrdW5kaXQnXSxcbiAgICAgICAgICAgIG06IFsnw7xoZSBtaW51dGknLCAnw7xrcyBtaW51dCddLFxuICAgICAgICAgICAgbW06IFtudW1iZXIgKyAnIG1pbnV0aScsIG51bWJlciArICcgbWludXRpdCddLFxuICAgICAgICAgICAgaDogWyfDvGhlIHR1bm5pJywgJ3R1bmQgYWVnYScsICfDvGtzIHR1bmQnXSxcbiAgICAgICAgICAgIGhoOiBbbnVtYmVyICsgJyB0dW5uaScsIG51bWJlciArICcgdHVuZGknXSxcbiAgICAgICAgICAgIGQ6IFsnw7xoZSBww6RldmEnLCAnw7xrcyBww6RldiddLFxuICAgICAgICAgICAgTTogWydrdXUgYWphJywgJ2t1dSBhZWdhJywgJ8O8a3Mga3V1J10sXG4gICAgICAgICAgICBNTTogW251bWJlciArICcga3V1JywgbnVtYmVyICsgJyBrdXVkJ10sXG4gICAgICAgICAgICB5OiBbJ8O8aGUgYWFzdGEnLCAnYWFzdGEnLCAnw7xrcyBhYXN0YSddLFxuICAgICAgICAgICAgeXk6IFtudW1iZXIgKyAnIGFhc3RhJywgbnVtYmVyICsgJyBhYXN0YXQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXgpIHtcbiAgICAgICAgICAgIHJldHVybiBmb3JtYXRba2V5XVsyXSA/IGZvcm1hdFtrZXldWzJdIDogZm9ybWF0W2tleV1bMV07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGlzRnV0dXJlID8gZm9ybWF0W2tleV1bMF0gOiBmb3JtYXRba2V5XVsxXTtcbiAgICB9XG5cbiAgICB2YXIgZXQgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdldCcsIHtcbiAgICAgICAgbW9udGhzOiAnamFhbnVhcl92ZWVicnVhcl9tw6RydHNfYXByaWxsX21haV9qdXVuaV9qdXVsaV9hdWd1c3Rfc2VwdGVtYmVyX29rdG9vYmVyX25vdmVtYmVyX2RldHNlbWJlcicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAnamFhbl92ZWVicl9tw6RydHNfYXByX21haV9qdXVuaV9qdXVsaV9hdWdfc2VwdF9va3Rfbm92X2RldHMnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzOlxuICAgICAgICAgICAgJ3DDvGhhcMOkZXZfZXNtYXNww6Rldl90ZWlzaXDDpGV2X2tvbG1hcMOkZXZfbmVsamFww6Rldl9yZWVkZV9sYXVww6Rldicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnUF9FX1RfS19OX1JfTCcuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdQX0VfVF9LX05fUl9MJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdELiBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRC4gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQuIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbVMOkbmEsXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW0hvbW1lLF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdbS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LFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICd1cnQuX290cy5fbWFyLl9hcGkuX21haS5fZWthLl91enQuX2FidS5faXJhLl91cnIuX2F6YS5fYWJlLicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICB3ZWVrZGF5czpcbiAgICAgICAgICAgICdpZ2FuZGVhX2FzdGVsZWhlbmFfYXN0ZWFydGVhX2FzdGVhemtlbmFfb3N0ZWd1bmFfb3N0aXJhbGFfbGFydW5iYXRhJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICdpZy5fYWwuX2FyLl9hei5fb2cuX29sLl9sci4nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnaWdfYWxfYXJfYXpfb2dfb2xfbHInLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ1lZWVktTU0tREQnLFxuICAgICAgICAgICAgTEw6ICdZWVlZW2tvXSBNTU1NW3Jlbl0gRFthXScsXG4gICAgICAgICAgICBMTEw6ICdZWVlZW2tvXSBNTU1NW3Jlbl0gRFthXSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgWVlZWVtrb10gTU1NTVtyZW5dIERbYV0gSEg6bW0nLFxuICAgICAgICAgICAgbDogJ1lZWVktTS1EJyxcbiAgICAgICAgICAgIGxsOiAnWVlZWVtrb10gTU1NIERbYV0nLFxuICAgICAgICAgICAgbGxsOiAnWVlZWVtrb10gTU1NIERbYV0gSEg6bW0nLFxuICAgICAgICAgICAgbGxsbDogJ2RkZCwgWVlZWVtrb10gTU1NIERbYV0gSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tnYXVyXSBMVFtldGFuXScsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2JpaGFyXSBMVFtldGFuXScsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgTFRbZXRhbl0nLFxuICAgICAgICAgICAgbGFzdERheTogJ1thdHpvXSBMVFtldGFuXScsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1thdXJyZWtvXSBkZGRkIExUW2V0YW5dJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMgYmFycnUnLFxuICAgICAgICAgICAgcGFzdDogJ2R1ZWxhICVzJyxcbiAgICAgICAgICAgIHM6ICdzZWd1bmRvIGJhdHp1aycsXG4gICAgICAgICAgICBzczogJyVkIHNlZ3VuZG8nLFxuICAgICAgICAgICAgbTogJ21pbnV0dSBiYXQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dHUnLFxuICAgICAgICAgICAgaDogJ29yZHUgYmF0JyxcbiAgICAgICAgICAgIGhoOiAnJWQgb3JkdScsXG4gICAgICAgICAgICBkOiAnZWd1biBiYXQnLFxuICAgICAgICAgICAgZGQ6ICclZCBlZ3VuJyxcbiAgICAgICAgICAgIE06ICdoaWxhYmV0ZSBiYXQnLFxuICAgICAgICAgICAgTU06ICclZCBoaWxhYmV0ZScsXG4gICAgICAgICAgICB5OiAndXJ0ZSBiYXQnLFxuICAgICAgICAgICAgeXk6ICclZCB1cnRlJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9XFwuLyxcbiAgICAgICAgb3JkaW5hbDogJy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AgICAgICAgIDU6ICfbtScsXG4gICAgICAgICAgICA2OiAn27YnLFxuICAgICAgICAgICAgNzogJ9u3JyxcbiAgICAgICAgICAgIDg6ICfbuCcsXG4gICAgICAgICAgICA5OiAn27knLFxuICAgICAgICAgICAgMDogJ9uwJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ9uxJzogJzEnLFxuICAgICAgICAgICAgJ9uyJzogJzInLFxuICAgICAgICAgICAgJ9uzJzogJzMnLFxuICAgICAgICAgICAgJ9u0JzogJzQnLFxuICAgICAgICAgICAgJ9u1JzogJzUnLFxuICAgICAgICAgICAgJ9u2JzogJzYnLFxuICAgICAgICAgICAgJ9u3JzogJzcnLFxuICAgICAgICAgICAgJ9u4JzogJzgnLFxuICAgICAgICAgICAgJ9u5JzogJzknLFxuICAgICAgICAgICAgJ9uwJzogJzAnLFxuICAgICAgICB9O1xuXG4gICAgdmFyIGZhID0gbW9tZW50LmRlZmluZUxvY2FsZSgnZmEnLCB7XG4gICAgICAgIG1vbnRoczogJ9qY2KfZhtmI24zZh1/ZgdmI2LHbjNmHX9mF2KfYsdizX9ii2YjYsduM2YRf2YXZh1/amNmI2KbZhl/amNmI2KbbjNmHX9in2YjYql/Ys9m+2KrYp9mF2KjYsV/Yp9qp2KrYqNixX9mG2YjYp9mF2KjYsV/Yr9iz2KfZhdio2LEnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ9qY2KfZhtmI24zZh1/ZgdmI2LHbjNmHX9mF2KfYsdizX9ii2YjYsduM2YRf2YXZh1/amNmI2KbZhl/amNmI2KbbjNmHX9in2YjYql/Ys9m+2KrYp9mF2KjYsV/Yp9qp2KrYqNixX9mG2YjYp9mF2KjYsV/Yr9iz2KfZhdio2LEnLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAg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9iyINi42YfYsS8udGVzdChpbnB1dCk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfZgtio2YQg2KfYsiDYuNmH2LEnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9io2LnYryDYp9iyINi42YfYsSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2YXYsdmI2LIg2LPYp9i52KpdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb2YHYsdiv2Kcg2LPYp9i52KpdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb2LPYp9i52KpdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2K/bjNix2YjYsiDYs9in2LnYql0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFvZvtuM2LRdIFvYs9in2LnYql0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfYr9ixICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDZvtuM2LQnLFxuICAgICAgICAgICAgczogJ9qG2YbYryDYq9in2YbbjNmHJyxcbiAgICAgICAgICAgIHNzOiAnJWQg2KvYp9mG24zZhycsXG4gICAgICAgICAgICBtOiAn24zaqSDYr9mC24zZgtmHJyxcbiAgICAgICAgICAgIG1tOiAnJWQg2K/ZgtuM2YLZhycsXG4gICAgICAgICAgICBoOiAn24zaqSDYs9in2LnYqicsXG4gICAgICAgICAgICBoaDogJyVkINiz2KfYudiqJyxcbiAgICAgICAgICAgIGQ6ICfbjNqpINix2YjYsicsXG4gICAgICAgICAgICBkZDogJyVkINix2YjYsicsXG4gICAgICAgICAgICBNOiAn24zaqSDZhdin2YcnLFxuICAgICAgICAgICAgTU06ICclZCDZhdin2YcnLFxuICAgICAgICAgICAgeTogJ9uM2qkg2LPYp9mEJyxcbiAgICAgICAgICAgIHl5OiAnJWQg2LPYp9mEJyxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmdcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvW9uwLdu5XS9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgv2IwvZywgJywnKTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZ1xuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXGQvZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoLywvZywgJ9iMJyk7XG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfdmFLyxcbiAgICAgICAgb3JkaW5hbDogJyVk2YUnLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDYsIC8vIFNhdHVyZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDEyLCAvLyBUaGUgd2VlayB0aGF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GVuJyxcbiAgICAgICAgICAgICdrYWhkZW4nLFxuICAgICAgICAgICAgJ2tvbG1lbicsXG4gICAgICAgICAgICAnbmVsasOkbicsXG4gICAgICAgICAgICAndmlpZGVuJyxcbiAgICAgICAgICAgICdrdXVkZW4nLFxuICAgICAgICAgICAgbnVtYmVyc1Bhc3RbN10sXG4gICAgICAgICAgICBudW1iZXJzUGFzdFs4XSxcbiAgICAgICAgICAgIG51bWJlcnNQYXN0WzldLFxuICAgICAgICBdO1xuICAgIGZ1bmN0aW9uIHRyYW5zbGF0ZShudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSwgaXNGdXR1cmUpIHtcbiAgICAgICAgdmFyIHJlc3VsdCA9ICcnO1xuICAgICAgICBzd2l0Y2ggKGtleSkge1xuICAgICAgICAgICAgY2FzZSAncyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzRnV0dXJlID8gJ211dXRhbWFuIHNla3VubmluJyA6ICdtdXV0YW1hIHNla3VudGknO1xuICAgICAgICAgICAgY2FzZSAnc3MnOlxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGlzRnV0dXJlID8gJ3Nla3VubmluJyA6ICdzZWt1bnRpYSc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgPyAnbWludXV0aW4nIDogJ21pbnV1dHRpJztcbiAgICAgICAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBpc0Z1dHVyZSA/ICdtaW51dXRpbicgOiAnbWludXV0dGlhJztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2gnOlxuICAgICAgICAgICAgICAgIHJldHVybiBpc0Z1dHVyZSA/ICd0dW5uaW4nIDogJ3R1bnRpJztcbiAgICAgICAgICAgIGNhc2UgJ2hoJzpcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBpc0Z1dHVyZSA/ICd0dW5uaW4nIDogJ3R1bnRpYSc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgPyAncMOkaXbDpG4nIDogJ3DDpGl2w6QnO1xuICAgICAgICAgICAgY2FzZSAnZGQnOlxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGlzRnV0dXJlID8gJ3DDpGl2w6RuJyA6ICdww6RpdsOkw6QnO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzRnV0dXJlID8gJ2t1dWthdWRlbicgOiAna3V1a2F1c2knO1xuICAgICAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGlzRnV0dXJlID8gJ2t1dWthdWRlbicgOiAna3V1a2F1dHRhJztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ3knOlxuICAgICAgICAgICAgICAgIHJldHVybiBpc0Z1dHVyZSA/ICd2dW9kZW4nIDogJ3Z1b3NpJztcbiAgICAgICAgICAgIGNhc2UgJ3l5JzpcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBpc0Z1dHVyZSA/ICd2dW9kZW4nIDogJ3Z1b3R0YSc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgcmVzdWx0ID0gdmVyYmFsTnVtYmVyKG51bWJlciwgaXNGdXR1cmUpICsgJyAnICsgcmVzdWx0O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cbiAgICBmdW5jdGlvbiB2ZXJiYWxOdW1iZXIobnVtYmVyLCBpc0Z1dHVyZSkge1xuICAgICAgICByZXR1cm4gbnVtYmVyIDwgMTBcbiAgICAgICAgICAgID8gaXNGdXR1cmVcbiAgICAgICAgICAgICAgICA/IG51bWJlcnNGdXR1cmVbbnVtYmVyXVxuICAgICAgICAgICAgICAgIDogbnVtYmVyc1Bhc3RbbnVtYmVyXVxuICAgICAgICAgICAgOiBudW1iZXI7XG4gICAgfVxuXG4gICAgdmFyIGZpID0gbW9tZW50LmRlZmluZUxvY2FsZSgnZmknLCB7XG4gICAgICAgIG1vbnRoczogJ3RhbW1pa3V1X2hlbG1pa3V1X21hYWxpc2t1dV9odWh0aWt1dV90b3Vrb2t1dV9rZXPDpGt1dV9oZWluw6RrdXVfZWxva3V1X3N5eXNrdXVfbG9rYWt1dV9tYXJyYXNrdXVfam91bHVrdXUnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ3RhbW1pX2hlbG1pX21hYWxpc19odWh0aV90b3Vrb19rZXPDpF9oZWluw6RfZWxvX3N5eXNfbG9rYV9tYXJyYXNfam91bHUnLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXM6XG4gICAgICAgICAgICAnc3VubnVudGFpX21hYW5hbnRhaV90aWlzdGFpX2tlc2tpdmlpa2tvX3RvcnN0YWlfcGVyamFudGFpX2xhdWFudGFpJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICdzdV9tYV90aV9rZV90b19wZV9sYScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdzdV9tYV90aV9rZV90b19wZV9sYScuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEgubW0nLFxuICAgICAgICAgICAgTFRTOiAnSEgubW0uc3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdEbyBNTU1NW3RhXSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0RvIE1NTU1bdGFdIFlZWVksIFtrbG9dIEhILm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEbyBNTU1NW3RhXSBZWVlZLCBba2xvXSBISC5tbScsXG4gICAgICAgICAgICBsOiAnRC5NLllZWVknLFxuICAgICAgICAgICAgbGw6ICdEbyBNTU0gWVlZWScsXG4gICAgICAgICAgICBsbGw6ICdEbyBNTU0gWVlZWSwgW2tsb10gSEgubW0nLFxuICAgICAgICAgICAgbGxsbDogJ2RkZCwgRG8gTU1NIFlZWVksIFtrbG9dIEhILm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbdMOkbsOkw6RuXSBba2xvXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2h1b21lbm5hXSBba2xvXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2tsb10gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tlaWxlbl0gW2tsb10gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbdmlpbWVdIGRkZGRbbmFdIFtrbG9dIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMgcMOkw6RzdMOkJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBzaXR0ZW4nLFxuICAgICAgICAgICAgczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgc3M6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG1tOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoaDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZDogdHJhbnNsYX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ICAgICAgICAgTExMOiAnTU1NTSBELCBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBNTU1NIERELCBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdMVCBbbmdheW9uZyBhcmF3XScsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW0J1a2FzIG5nXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ0xUIFtzYSBzdXN1bm9kIG5hXSBkZGRkJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdMVCBba2FoYXBvbl0nLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdMVCBbbm9vbmcgbmFrYXJhYW5nXSBkZGRkJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnc2EgbG9vYiBuZyAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgYW5nIG5ha2FsaXBhcycsXG4gICAgICAgICAgICBzOiAnaWxhbmcgc2VndW5kbycsXG4gICAgICAgICAgICBzczogJyVkIHNlZ3VuZG8nLFxuICAgICAgICAgICAgbTogJ2lzYW5nIG1pbnV0bycsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0bycsXG4gICAgICAgICAgICBoOiAnaXNhbmcgb3JhcycsXG4gICAgICAgICAgICBoaDogJyVkIG9yYXMnLFxuICAgICAgICAgICAgZDogJ2lzYW5nIGFyYXcnLFxuICAgICAgICAgICAgZGQ6ICclZCBhcmF3JyxcbiAgICAgICAgICAgIE06ICdpc2FuZyBidXdhbicsXG4gICAgICAgICAgICBNTTogJyVkIGJ1d2FuJyxcbiAgICAgICAgICAgIHk6ICdpc2FuZyB0YW9uJyxcbiAgICAgICAgICAgIHl5OiAnJWQgdGFvbicsXG4gICAgICAgIH0sXG4gIC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IE1NTU0sIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vDjSBkYWcga2wuXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW8ONIG1vcmdpbiBrbC5dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBba2wuXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW8ONIGdqw6FyIGtsLl0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbc8Otw7BzdHVdIGRkZGQgW2tsXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ3VtICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBzw63DsGFuaScsXG4gICAgICAgICAgICBzOiAnZsOhIHNla3VuZCcsXG4gICAgICAgICAgICBzczogJyVkIHNla3VuZGlyJyxcbiAgICAgICAgICAgIG06ICdlaW4gbWludXR0dXInLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dHRpcicsXG4gICAgICAgICAgICBoOiAnZWluIHTDrW1pJyxcbiAgICAgICAgICAgIGhoOiAnJWQgdMOtbWFyJyxcbiAgICAgICAgICAgIGQ6ICdlaW4gZGFndXInLFxuICAgICAgICAgICAgZGQ6ICclZCBkYWdhcicsXG4gICAgICAgICAgICBNOiAnZWluIG3DoW5hw7B1cicsXG4gICAgICAgICAgICBNTTogJyVkIG3DoW5hw7BpcicsXG4gICAgICAgICAgICB5OiAnZWl0dCDDoXInLFxuICAgICAgICAgICAgeXk6ICclZCDDoXInLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn1cXC4vLFxuICAgICAgICBvcmRpbmFsOiAnJWQuJyxcbiAgICAgICAgd2Vlazoge1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ZW1haW4gw6BdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbw6BdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbSGllciDDoF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFtkZXJuaWVyIMOgXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2RhbnMgJXMnLFxuICAgICAgICAgICAgcGFzdDogJ2lsIHkgYSAlcycsXG4gICAgICAgICAgICBzOiAncXVlbHF1ZXMgc2Vjb25kZXMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRlcycsXG4gICAgICAgICAgICBtOiAndW5lIG1pbnV0ZScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZXMnLFxuICAgICAgICAgICAgaDogJ3VuZSBoZXVyZScsXG4gICAgICAgICAgICBoaDogJyVkIGhldXJlcycsXG4gICAgICAgICAgICBkOiAndW4gam91cicsXG4gICAgICAgICAgICBkZDogJyVkIGpvdXJzJyxcbiAgICAgICAgICAgIE06ICd1biBtb2lzJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbW9pcycsXG4gICAgICAgICAgICB5OiAndW4gYW4nLFxuICAgICAgICAgICAgeXk6ICclZCBhbnMnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oZXJ8ZSkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgLy8gV29yZHMgd2l0aCBtYXNjdWxpbmUgZ3JhbW1hdGljYWwgZ2VuZGVyOiBtb2lzLCB0cmltZXN0cmUsIGpvdXJcbiAgICAgICAgICAgICAg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ExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tBdWpvdXJk4oCZaHVpIMOgXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW0RlbWFpbiDDoF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvDoF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tIaWVyIMOgXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW2Rlcm5pZXIgw6BdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnZGFucyAlcycsXG4gICAgICAgICAgICBwYXN0OiAnaWwgeSBhICVzJyxcbiAgICAgICAgICAgIHM6ICdxdWVscXVlcyBzZWNvbmRlcycsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZGVzJyxcbiAgICAgICAgICAgIG06ICd1bmUgbWludXRlJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgICAgICBoOiAndW5lIGhldXJlJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaGV1cmVzJyxcbiAgICAgICAgICAgIGQ6ICd1biBqb3VyJyxcbiAgICAgICAgICAgIGRkOiAnJWQgam91cnMnLFxuICAgICAgICAgICAgTTogJ3VuIG1vaXMnLFxuICAgICAgICAgICAgTU06ICclZCBtb2lzJyxcbiAgICAgICAgICAgIHk6ICd1biBhbicsXG4gICAgICAgICAgICB5eTogJyVkIGFucycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShlcnxlKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICAvLyBXb3JkcyB3aXRoIG1hc2N1bGluZSBncmFtbWF0aWNhbCBnZW5kZXI6IG1vaXMsIHRyaW1lc3RyZSwgam91clxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgY2FzZSAnUSc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIChudW1iZXIgPT09IDEgPyAnZXInIDogJ2UnKTtcblxuICAgICAgICAgICAgICAgIC8vIFdvcmRzIHdpdGggZmVtaW5pbmUgZ3JhbW1hdGljYWwgZ2VuZGVyOiBzZW1haW5lXG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAobnVtYmVyID09PSAxID8gJ3JlJyA6ICdlJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgIC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9pLFxuICAgICAgICBtb250aHNSZWdleCA9XG4gICAgICAgICAgICAvKGphbnZcXC4/fGbDqXZyXFwuP3xtYXJzfGF2clxcLj98bWFpfGp1aW58anVpbFxcLj98YW/Du3R8c2VwdFxcLj98b2N0XFwuP3xub3ZcXC4/fGTDqWNcXC4/fGphbnZpZXJ8ZsOpdnJpZXJ8bWFyc3xhdnJpbHxtYWl8anVpbnxqdWlsbGV0fGFvw7t0fHNlcHRlbWJyZXxvY3RvYnJlfG5vdmVtYnJlfGTDqWNlbWJyZSkvaSxcbiAgICAgICAgbW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXmphbnYvaSxcbiAgICAgICAgICAgIC9eZsOpdnIvaSxcbiAgICAgICAgICAgIC9ebWFycy9pLFxuICAgICAgICAgICAgL15hdnIvaSxcbiAgICAgICAgICAgIC9ebWFpL2ksXG4gICAgICAgICAgICAvXmp1aW4vaSxcbiAgICAgICAgICAgIC9eanVpbC9pLFxuICAgICAgICAgICAgL15hb8O7dC9pLFxuICAgICAgICAgICAgL15zZXB0L2ksXG4gICAgICAgICAgICAvXm9jdC9pLFxuICAgICAgICAgICAgL15ub3YvaSxcbiAgICAgICAgICAgIC9eZMOpYy9pLFxuICAgICAgICBdO1xuXG4gICAgdmFyIGZyID0gbW9tZW50LmRlZmluZUxvY2FsZSgnZnInLCB7XG4gICAgICAgIG1vbnRoczogJ2phbnZpZXJfZsOpdnJpZXJfbWFyc19hdnJpbF9tYWlfanVpbl9qdWlsbGV0X2Fvw7t0X3NlcHRlbWJyZV9vY3RvYnJlX25vdmVtYnJlX2TDqWNlbWJyZScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAnamFudi5fZsOpdnIuX21hcnNfYXZyLl9tYWlfanVpbl9qdWlsLl9hb8O7dF9zZXB0Ll9vY3QuX25vdi5fZMOpYy4nLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgbW9udGhzUmVnZXg6IG1vbnRoc1JlZ2V4LFxuICAgICAgICBtb250aHNTaG9ydFJlZ2V4OiBtb250aHNSZWdleCxcbiAgICAgICAgbW9udGhzU3RyaWN0UmVnZXg6IG1vbnRoc1N0cmljdFJlZ2V4LFxuICAgICAgICBtb250aHNTaG9ydFN0cmljdFJlZ2V4OiBtb250aHNTaG9ydFN0cmljdFJlZ2V4LFxuICAgICAgICBtb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG4gICAgICAgIGxvbmdNb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG4gICAgICAgIHNob3J0TW9udGhzUGFyc2U6IG1vbnRoc1BhcnNlLFxuICAgICAgICB3ZWVrZGF5czogJ2RpbWFuY2hlX2x1bmRpX21hcmRpX21lcmNyZWRpX2pldWRpX3ZlbmRyZWRpX3NhbWVkaScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ2RpbS5fbHVuLl9tYXIuX21lci5famV1Ll92ZW4uX3NhbS4nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnZGlfbHVfbWFfbWVfamVfdmVfc2EnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0F1am91cmTigJlodWkgw6BdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbRGVtYWluIMOgXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW8OgXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0hpZXIgw6BdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbZGVybmllciDDoF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdkYW5zICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdpbCB5IGEgJXMnLFxuICAgICAgICAgICAgczogJ3F1ZWxxdWVzIHNlY29uZGVzJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vjb25kZXMnLFxuICAgICAgICAgICAgbTogJ3VuZSBtaW51dGUnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGVzJyxcbiAgICAgICAgICAgIGg6ICd1bmUgaGV1cmUnLFxuICAgICAgICAgICAgaGg6ICclZCBoZXVyZXMnLFxuICAgICAgICAgICAgZDogJ3VuIGpvdXInLFxuICAgICAgICAgICAgZGQ6ICclZCBqb3VycycsXG4gICAgICAgICAgICB3OiAndW5lIHNlbWFpbmUnLFxuICAgICAgICAgICAgd3c6ICclZCBzZW1haW5lcycsXG4gICAgICAgICAgICBNOiAndW4gbW9pcycsXG4gICAgICAgICAgICBNTTogJyVkIG1vaXMnLFxuICAgICAgICAgICAgeTogJ3VuIGFuJyxcbiAgICAgICAgICAgIHl5OiAnJWQgYW5zJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KGVyfCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgLy8gVE9ETzogUmV0dXJuICdlJyB3aGVuIGRheSBvZiBtb250aCA+IDEuIE1vdmUgdGhpcyBjYXNlIGluc2lkZVxuICAgICAgICAgICAgICAgIC8vIGJsb2NrIGZvciBtYXNjdWxpbmUgd29yZHMgYmVsb3cuXG4gICAgICAgICAgICAgICAgLy8gU2VlIGh0dHBzOi8vZ2l0aHViLmNvbS9tb21lbnQvbW9tZW50L2lzc3Vlcy8zMzc1XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAobnVtYmVyID09PSAxID8gJ2VyJyA6ICcnKTtcblxuICAgICAgICAgICAgICAgIC8vIFdvcmRzIHdpdGggbWFzY3VsaW5lIGdyYW1tYXRpY2FsIGdlbmRlcjogbW9pcywgdHJpbWVzdHJlLCBqb3VyXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICBjYXNlICdRJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgKG51bWJlciA9PT0gMSA/ICdlcicgOiAnZScpO1xuXG4gICAgICAgICAgICAgICAgLy8gV29yZHMgd2l0aCBmZW1pbmluZSBncmFtbWF0aWNhbCBnZW5kZXI6IHNlbWFpbmVcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIChudW1iZXIgPT09IDEgPyAncmUnIDogJ2UnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcn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ICAnamFuX2ZlYl9tcnRfYXByX21haV9qdW5fanVsX2F1Z19zZXBfb2t0X25vdl9kZXMnLnNwbGl0KCdfJyk7XG5cbiAgICB2YXIgZnkgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdmeScsIHtcbiAgICAgICAgbW9udGhzOiAnamFubmV3YXJpc19mZWJyZXdhcmlzX21hYXJ0X2FwcmlsX21hYWllX2p1bnlfanVseV9hdWd1c3R1c19zZXB0aW1iZXJfb2t0b2Jlcl9ub3ZpbWJlcl9kZXNpbWJlcicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6IGZ1bmN0aW9uIChtLCBmb3JtYXQpIHtcbiAgICAgICAgICAgIGlmICghbSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydFdpdGhEb3RzO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvLU1NTS0vLnRlc3QoZm9ybWF0KSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydFdpdGhvdXREb3RzW20ubW9udGgoKV07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydFdpdGhEb3RzW20ubW9udGgoKV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRoc1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIHdlZWtkYXlzOiAnc25laW5fbW9hbmRlaV90aWlzZGVpX3dvYW5zZGVpX3RvbmdlcnNkZWlfZnJlZWRfc25lb24nLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICdzaS5fbW8uX3RpLl93by5fdG8uX2ZyLl9zby4nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnU2lfTW9fVGlfV29fVG9fRnJfU28nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELU1NLVlZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2hqb2VkIG9tXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW21vYXJuIG9tXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW29tXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2p1c3RlciBvbV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbw7RmcsO7bmVdIGRkZGQgW29tXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ29lciAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgbHluJyxcbiAgICAgICAgICAgIHM6ICdpbiBwZWFyIHNla29uZGVuJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vrb25kZW4nLFxuICAgICAgICAgICAgbTogJ2llbiBtaW7DunQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGVuJyxcbiAgICAgICAgICAgIGg6ICdpZW4gb2VyZScsXG4gICAgICAgICAgICBoaDogJyVkIG9lcmVuJyxcbiAgICAgICAgICAgIGQ6ICdpZW4gZGVpJyxcbiAgICAgICAgICAgIGRkOiA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mJiB0eXBlb2YgcmVxdWlyZSA9PT0gJ2Z1bmN0aW9uJyA/IGZhY3RvcnkocmVxdWlyZSgnLi4vbW9tZW50JykpIDpcbiAgIHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBtb250aHMgPSBbXG4gICAgICAgICAgICAnRWFuw6FpcicsXG4gICAgICAgICAgICAnRmVhYmhyYScsXG4gICAgICAgICAgICAnTcOhcnRhJyxcbiAgICAgICAgICAgICdBaWJyZcOhbicsXG4gICAgICAgICAgICAnQmVhbHRhaW5lJyxcbiAgICAgICAgICAgICdNZWl0aGVhbWgnLFxuICAgICAgICAgICAgJ0nDumlsJyxcbiAgICAgICAgICAgICdMw7puYXNhJyxcbiAgICAgICAgICAgICdNZcOhbiBGw7NtaGFpcicsXG4gICAgICAgICAgICAnRGVpcmVhZGggRsOzbWhhaXInLFxuICAgICAgICAgICAgJ1NhbWhhaW4nLFxuICAgICAgICAgICAgJ05vbGxhaWcnLFxuICAgICAgICBdLFxuICAgICAgICBtb250aHNTaG9ydCA9IFtcbiAgICAgICAgICAgICdFYW4nLFxuICAgICAgICAgICAgJ0ZlYWJoJyxcbiAgICAgICAgICAgICdNw6FydCcsXG4gICAgICAgICAgICAnQWliJyxcbiAgICAgICAgICAgICdCZWFsJyxcbiAgICAgICAgICAgICdNZWl0aCcsXG4gICAgICAgICAgICAnScO6aWwnLFxuICAgICAgICAgICAgJ0zDum4nLFxuICAgICAgICAgICAgJ00uRi4nLFxuICAgICAgICAgICAgJ0QuRi4nLFxuICAgICAgICAgICAgJ1NhbWgnLFxuICAgICAgICAgICAgJ05vbGwnLFxuICAgICAgICBdLFxuICAgICAgICB3ZWVrZGF5cyA9IFtcbiAgICAgICAgICAgICdEw6kgRG9taG5haWdoJyxcbiAgICAgICAgICAgICdEw6kgTHVhaW4nLFxuICAgICAgICAgICAgJ0TDqSBNw6FpcnQnLFxuICAgICAgICAgICAgJ0TDqSBDw6lhZGFvaW4nLFxuICAgICAgICAgICAgJ0TDqWFyZGFvaW4nLFxuICAgICAgICAgICAgJ0TDqSBoQW9pbmUnLFxuICAgICAgICAgICAgJ0TDqSBTYXRoYWlybicsXG4gICAgICAgIF0sXG4gICAgICAgIHdlZWtkYXlzU2hvcnQgPSBbJ0RvbWgnLCAnTHVhbicsICdNw6FpcnQnLCAnQ8OpYWQnLCAnRMOpYXInLCAnQW9pbmUnLCAnU2F0aCddLFxuICAgICAgICB3ZWVrZGF5c01pbiA9IFsnRG8nLCAnTHUnLCAnTcOhJywgJ0PDqScsICdEw6knLCAnQScsICdTYSddO1xuXG4gICAgdmFyIGdhID0gbW9tZW50LmRlZmluZUxvY2FsZSgnZ2EnLCB7XG4gICAgICAgIG1vbnRoczogbW9udGhzLFxuICAgICAgICBtb250aHNTaG9ydDogbW9udGhzU2hvcnQsXG4gICAgICAgIG1vbnRoc1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIHdlZWtkYXlzOiB3ZWVrZGF5cyxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogd2Vla2RheXNTaG9ydCxcbiAgICAgICAgd2Vla2RheXNNaW46IHdlZWtkYXlzTWluLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0lubml1IGFnXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW0Ftw6FyYWNoIGFnXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2FnXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0lubsOpIGFnXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW3NlbyBjYWl0ZV0gW2FnXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2kgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIMOzIHNoaW4nLFxuICAgICAgICAgICAgczogJ2PDunBsYSBzb2ljaW5kJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc29pY2luZCcsXG4gICAgICAgICAgICBtOiAnbsOzaW3DqWFkJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbsOzaW3DqWFkJyxcbiAgICAgICAgICAgIGg6ICd1YWlyIGFuIGNobG9pZycsXG4gICAgICAgICAgICBoaDogJyVkIHVhaXIgYW4gY2hsb2lnJyxcbiAgICAgICAgICAgIGQ6ICdsw6EnLFxuICAgICAgICAgICAgZGQ6ICclZCBsw6EnLFxuICAgICAgICAgICAgTTogJ23DrScsXG4gICAgICAgICAgICBNTTogJyVkIG3DrW9ubmEnLFxuICAgICAgICAgICAgeTogJ2JsaWFpbicsXG4gICAgICAgICAgICB5eTogJyVkIGJsaWFpbicsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShkfG5hfG1oKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW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G1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIG1vbnRocyA9IFtcbiAgICAgICAgICAgICdBbSBGYW9pbGxlYWNoJyxcbiAgICAgICAgICAgICdBbiBHZWFycmFuJyxcbiAgICAgICAgICAgICdBbSBNw6BydCcsXG4gICAgICAgICAgICAnQW4gR2libGVhbicsXG4gICAgICAgICAgICAnQW4gQ8OoaXRlYW4nLFxuICAgICAgICAgICAgJ0FuIHQtw5JnbWhpb3MnLFxuICAgICAgICAgICAgJ0FuIHQtSXVjaGFyJyxcbiAgICAgICAgICAgICdBbiBMw7luYXN0YWwnLFxuICAgICAgICAgICAgJ0FuIHQtU3VsdGFpbicsXG4gICAgICAgICAgICAnQW4gRMOgbWhhaXInLFxuICAgICAgICAgICAgJ0FuIHQtU2FtaGFpbicsXG4gICAgICAgICAgICAnQW4gRMO5YmhsYWNoZCcsXG4gICAgICAgIF0sXG4gICAgICAgIG1vbnRoc1Nob3J0ID0gW1xuICAgICAgICAgICAgJ0Zhb2knLFxuICAgICAgICAgICAgJ0dlYXInLFxuICAgICAgICAgICAgJ03DoHJ0JyxcbiAgICAgICAgICAgICdHaWJsJyxcbiAgICAgICAgICAgICdDw6hpdCcsXG4gICAgICAgICAgICAnw5JnbWgnLFxuICAgICAgICAgICAgJ0l1Y2gnLFxuICAgICAgICAgICAgJ0zDuW4nLFxuICAgICAgICAgICAgJ1N1bHQnLFxuICAgICAgICAgICAgJ0TDoG1oJyxcbiAgICAgICAgICAgICdTYW1oJyxcbiAgICAgICAgICAgICdEw7liaCcsXG4gICAgICAgIF0sXG4gICAgICAgIHdlZWtkYXlzID0gW1xuICAgICAgICAgICAgJ0RpZMOybWhuYWljaCcsXG4gICAgICAgICAgICAnRGlsdWFpbicsXG4gICAgICAgICAgICAnRGltw6BpcnQnLFxuICAgICAgICAgICAgJ0RpY2lhZGFpbicsXG4gICAgICAgICAgICAnRGlhcmRhb2luJyxcbiAgICAgICAgICAgICdEaWhhb2luZScsXG4gICAgICAgICAgICAnRGlzYXRoYWlybmUnLFxuICAgICAgICBdLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0ID0gWydEaWQnLCAnRGlsJywgJ0RpbScsICdEaWMnLCAnRGlhJywgJ0RpaCcsICdEaXMnXSxcbiAgICAgICAgd2Vla2RheXNNaW4gPSBbJ0TDsicsICdMdScsICdNw6AnLCAnQ2knLCAnQXInLCAnSGEnLCAnU2EnXTtcblxuICAgIHZhciBnZCA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2dkJywge1xuICAgICAgICBtb250aHM6IG1vbnRocyxcbiAgICAgICAgbW9udGhzU2hvcnQ6IG1vbnRoc1Nob3J0LFxuICAgICAgICBtb250aHNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICB3ZWVrZGF5czogd2Vla2RheXMsXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6IHdlZWtkYXlzU2hvcnQsXG4gICAgICAgIHdlZWtkYXlzTWluOiB3ZWVrZGF5c01pbixcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tBbi1kaXVnaCBhaWddIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbQS1tw6BpcmVhY2ggYWlnXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2FpZ10gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tBbi1kw6ggYWlnXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW3NlbyBjaGFpZGhdIFthaWddIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnYW5uIGFuICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdiaG8gY2hpb25uICVzJyxcbiAgICAgICAgICAgIHM6ICdiZWFnYW4gZGlvZ2FuJyxcbiAgICAgICAgICAgIHNzOiAnJWQgZGlvZ2FuJyxcbiAgICAgICAgICAgIG06ICdtaW9uYWlkJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWlvbmFpZGVhbicsXG4gICAgICAgICAgICBoOiAndWFpcicsXG4gICAgICAgICAgICBoaDogJyVkIHVhaXJlYW4nLFxuICAgICAgICAgICAgZDogJ2xhdGhhJyxcbiAgICAgICAgICAgIGRkOiAnJWQgbGF0aGEnLFxuICAgICAgICAgICAgTTogJ23DrG9zJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbcOsb3NhbicsXG4gICAgICAgICAgICB5OiAnYmxpYWRobmEnLFxuICAgICAgICAgICAgeXk6ICclZCBibGlhZGhuYScsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShkfG5hfG1oKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBvdXRwdXQgPSBudW1iZXIgPT09IDEgPyAnZCcgOiBudW1iZXIgJSAxMCA9PT0gMiA/ICduYScgOiAnbWgnO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5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uICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICd4YW4uX2ZlYi5fbWFyLl9hYnIuX21haS5feHXDsS5feHVsLl9hZ28uX3NldC5fb3V0Ll9ub3YuX2RlYy4nLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgbW9udGhzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgd2Vla2RheXM6ICdkb21pbmdvX2x1bnNfbWFydGVzX23DqXJjb3Jlc194b3Zlc192ZW5yZXNfc8OhYmFkbycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ2RvbS5fbHVuLl9tYXIuX23DqXIuX3hvdi5fdmVuLl9zw6FiLicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdkb19sdV9tYV9tw6lfeG9fdmVfc8OhJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgW2RlXSBNTU1NIFtkZV0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIFtkZV0gTU1NTSBbZGVdIFlZWVkgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBbZGVdIE1NTU0gW2RlXSBZWVlZIEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW2hveGUgJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAnw6FzJyA6ICfDoScpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHREYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ1ttYcOxw6EgJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAnw6FzJyA6ICfDoScpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdkZGRkIFsnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICfDoXMnIDogJ2EnKSArICddIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdbb250ZSAnICsgKHRoaXMuaG91cnMoKSAhPT0gMSA/ICfDoScgOiAnYScpICsgJ10gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgJ1tvXSBkZGRkIFtwYXNhZG8gJyArICh0aGlzLmhvdXJzKCkgIT09IDEgPyAnw6FzJyA6ICdhJykgKyAnXSBMVCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiBmdW5jdGlvbiAoc3RyKSB7XG4gICAgICAgICAgICAgICAgaWYgKHN0ci5pbmRleE9mKCd1bicpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnbicgKyBzdHI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAnZW4gJyArIHN0cjtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBwYXN0OiAnaGFpICVzJyxcbiAgICAgICAgICAgIHM6ICd1bnMgc2VndW5kb3MnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWd1bmRvcycsXG4gICAgICAgICAgICBtOiAndW4gbWludXRvJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRvcycsXG4gICAgICAgICAgICBoOiAndW5oYSBob3JhJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaG9yYXMnLFxuICAgICAgICAgICAgZDogJ3VuIGTDrWEnLFxuICAgICAgICAgICAgZGQ6ICclZCBkw61hcycsXG4gICAgICAgICAgICBNOiAndW4gbWVzJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbWVzZXMnLFxuICAgICAgICAgICAgeTogJ3VuIGFubycsXG4gICAgICAgICAgICB5eTogJyVkIGFub3MnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn3Cui8sXG4gICAgICAgIG9yZGluYWw6ICclZMK6JyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGdsO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IEtvbmthbmkgRGV2YW5hZ2FyaSBzY3JpcHQgW2dvbS1kZXZhXVxuLy8hIGF1dGhvciA6IFRoZSBEaXNjb3ZlcmVyIDogaHR0cHM6Ly9naXRodWIuY29tL1dpa2lEaXNjb3ZlcmVyXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9m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NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBkOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgZGQ6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBNOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgTU06IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICB5OiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgeXk6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSjgpLXgpYfgpLApLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIC8vIHRoZSBvcmRpbmFsICfgpLXgpYfgpLAnIG9ubHkgYXBwbGllcyB0byBkYXkgb2YgdGhlIG1vbnRoXG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn4KS14KWH4KSwJztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgIGNhc2UgJ1EnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RERCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMCwgLy8gU3VuZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWtcbiAgICAgICAgICAgIGRveTogMywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyICg3ICsgMCAtIDQpXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gpLDgpL7gpKTgpYB84KS44KSV4KS+4KSz4KWA4KSCfOCkpuCkqOCkquCkvuCksOCkvuCkgnzgpLjgpL7gpILgpJzgpYcvLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWVyaWRpZW0gPT09ICfgpLDgpL7gpKTgpYAnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPCA0ID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgpLjgpJXgpL7gpLPgpYDgpIInKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4KSm4KSo4KSq4KS+4KSw4KS+4KSCJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID4gMTIgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CkuOCkvuCkguCknOClhycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB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KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIGZ1bmN0aW9uIHByb2Nlc3NSZWxhdGl2ZVRpbWUobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXksIGlzRnV0dXJlKSB7XG4gICAgICAgIHZhciBmb3JtYXQgPSB7XG4gICAgICAgICAgICBzOiBbJ3Rob2RkZWEgc2Vrb25kYW1uaScsICd0aG9kZGUgc2Vrb25kJ10sXG4gICAgICAgICAgICBzczogW251bWJlciArICcgc2Vrb25kYW1uaScsIG51bWJlciArICcgc2Vrb25kJ10sXG4gICAgICAgICAgICBtOiBbJ2VrYSBtaW50YW4nLCAnZWsgbWludXQnXSxcbiAgICAgICAgICAgIG1tOiBbbnVtYmVyICsgJyBtaW50YW1uaScsIG51bWJlciArICcgbWludGFtJ10sXG4gICAgICAgICAgICBoOiBbJ2VrYSB2b3JhbicsICdlayB2b3InXSxcbiAgICAgICAgICAgIGhoOiBbbnVtYmVyICsgJyB2b3JhbW5pJywgbnVtYmVyICsgJyB2b3JhbSddLFxuICAgICAgICAgICAgZDogWydla2EgZGlzYW4nLCAnZWsgZGlzJ10sXG4gICAgICAgICAgICBkZDogW251bWJlciArICcgZGlzYW1uaScsIG51bWJlciArICcgZGlzJ10sXG4gICAgICAgICAgICBNOiBbJ2VrYSBtaG9pbmVhbicsICdlayBtaG9pbm8nXSxcbiAgICAgICAgICAgIE1NOiBbbnVtYmVyICsgJyBtaG9pbmVhbW5pJywgbnVtYmVyICsgJyBtaG9pbmUnXSxcbiAgICAgICAgICAgIHk6IFsnZWthIHZvcnNhbicsICdlayB2b3JvcyddLFxuICAgICAgICAgICAgeXk6IFtudW1iZXIgKyAnIHZvcnNhbW5pJywgbnVtYmVyICsgJyB2b3JzYW0nXSxcbiAgICAgICAgfTtcbiAgICAgICA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gICBzczogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIG06IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBtbTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIGg6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBoaDogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIGQ6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBkZDogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIE06IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBNTTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIHk6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICB5eTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KGVyKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICAvLyB0aGUgb3JkaW5hbCAnZXInIG9ubHkgYXBwbGllcyB0byBkYXkgb2YgdGhlIG1vbnRoXG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnZXInO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgY2FzZSAnUSc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAwLCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vla1xuICAgICAgICAgICAgZG95OiAzLCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIgKDcgKyAwIC0gNClcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL3JhdGl8c29rYWxsaW18ZG9ucGFyYW18c2FuamUvLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWVyaWRpZW0gPT09ICdyYXRpJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyIDwgNCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAnc29rYWxsaW0nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAnZG9ucGFyYW0nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPiAxMiA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAnc2FuamUnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9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aXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBzeW1ib2xNYXAgPSB7XG4gICAgICAgICAgICAxOiAn4KunJyxcbiAgICAgICAgICAgIDI6ICfgq6gnLFxuICAgICAgICAgICAgMzogJ+CrqScsXG4gICAgICAgICAgICA0OiAn4KuqJyxcbiAgICAgICAgICAgIDU6ICfgq6snLFxuICAgICAgICAgICAgNjogJ+CrrCcsXG4gICAgICAgICAgICA3OiAn4KutJyxcbiAgICAgICAgICAgIDg6ICfgq64nLFxuICAgICAgICAgICAgOTogJ+CrrycsXG4gICAgICAgICAgICAwOiAn4KumJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ+Crpyc6ICcxJyxcbiAgICAgICAgICAgICfgq6gnOiAnMicsXG4gICAgICAgICAgICAn4KupJzogJzMnLFxuICAgICAgICAgICAgJ+Crqic6ICc0JyxcbiAgICAgICAgICAgICfgq6snOiAnNScsXG4gICAgICAgICAgICAn4KusJzogJzYnLFxuICAgICAgICAgICAgJ+CrrSc6ICc3JyxcbiAgICAgICAgICAgICfgq64nOiAnOCcsXG4gICAgICAgICAgICAn4KuvJzogJzknLFxuICAgICAgICAgICAgJ+Crpic6ICcwJyxcbiAgICAgICAgfTtcblxuICAgIHZhciBndSA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2d1Jywge1xuICAgICAgICBtb250aHM6ICfgqpzgqr7gqqjgq43gqq/gq4HgqobgqrDgq4Bf4Kqr4KuH4Kqs4KuN4Kqw4KuB4KqG4Kqw4KuAX+CqruCqvuCqsOCrjeCqml/gqo/gqqrgq43gqrDgqr/gqrJf4Kqu4KuHX+CqnOCrguCqqF/gqpzgq4HgqrLgqr7gqohf4KqR4KqX4Kq44KuN4KqfX+CquOCqquCrjeCqn+Crh+CqruCrjeCqrOCq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xuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdBIGg6bW0g4Kq14Kq+4KqX4KuN4Kqv4KuHJyxcbiAgICAgICAgICAgIExUUzogJ0EgaDptbTpzcyDgqrXgqr7gqpfgq43gqq/gq4cnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSwgQSBoOm1tIOCqteCqvuCql+CrjeCqr+CrhycsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVksIEEgaDptbSDgqrXgqr7gqpfgq43gqq/gq4cnLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vgqobgqpxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb4KqV4Kq+4Kqy4KuHXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQsIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb4KqX4KqH4KqV4Kq+4Kqy4KuHXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vgqqrgqr7gqpvgqrLgqr5dIGRkZGQsIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg4Kqu4Kq+JyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDgqqrgqrngq4fgqrLgqr4nLFxuICAgICAgICAgICAgczogJ+CqheCqruCrgeCqlSDgqqrgqrPgq4snLFxuICAgICAgICAgICAgc3M6ICclZCDgqrjgq4fgqpXgqoLgqqEnLFxuICAgICAgICAgICAgbTogJ+Cqj+CqlSDgqq7gqr/gqqjgqr/gqp8nLFxuICAgICAgICAgICAgbW06ICclZCDgqq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aGFyJyBpdCBpcyBub3QgdXNlZCBhcyByaWdpZGx5IGluIG1vZGVybiBHdWphcmF0aS5cbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+CqsOCqvuCqpHzgqqzgqqrgq4vgqrB84Kq44Kq14Kq+4KqwfOCquOCqvuCqguCqnC8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+CqsOCqvuCqpCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA8IDQgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CquOCqteCqvuCqsCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgqqzgqqrgq4vgqrAnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPj0gMTAgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CquOCqvuCqguCqnCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgqrDgqr7gqqQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CquOCqteCqvuCqsCc7XG4g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/IGZhY3RvcnkocmVxdWlyZSgnLi4vbW9tZW50JykpIDpcbiAgIHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gICBmYWN0b3J5KGdsb2JhbC5tb21lbnQpXG59KHRoaXMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBoZSA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2hlJywge1xuICAgICAgICBtb250aHM6ICfXmdeg15XXkNeoX9ek15HXqNeV15DXqF/Xnteo16Vf15DXpNeo15nXnF/XnteQ15lf15nXldeg15lf15nXldec15lf15DXldeS15XXodeYX9eh16TXmNee15HXqF/XkNeV16fXmNeV15HXqF/XoNeV15HXnteR16hf15PXptee15HXqCcuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAn15nXoNeV17Nf16TXkdeo17Nf157XqNelX9eQ16TXqNezX9ee15DXmV/XmdeV16DXmV/XmdeV15zXmV/XkNeV15LXs1/Xodek15jXs1/XkNeV16fXs1/XoNeV15HXs1/Xk9em157Xsycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXM6ICfXqNeQ16nXldefX9ep16DXmV/Xqdec15nXqdeZX9eo15HXmdei15lf15fXnteZ16nXmV/XqdeZ16nXmV/XqdeR16onLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfXkNezX9eR17Nf15LXs1/Xk9ezX9eU17Nf15XXs1/XqdezJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ9eQX9eRX9eSX9eTX9eUX9eVX9epJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgW9eRXU1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIFvXkV1NTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgW9eRXU1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBsOiAnRC9NL1lZWVknLFxuICAgICAgICAgICAgbGw6ICdEIE1NTSBZWVlZJyxcbiAgICAgICAgICAgIGxsbDogJ0QgTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgbGxsbDogJ2RkZCwgRCBNTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9eU15nXldedINeR1r5dTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vXnteX16gg15HWvl1MVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9eR16nXoteUXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9eQ16rXnteV15wg15HWvl1MVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vXkdeZ15XXnV0gZGRkZCBb15TXkNeX16jXldefINeR16nXoteUXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ9eR16LXldeTICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICfXnNek16DXmSAlcycsXG4gICAgICAgICAgICBzOiAn157Xodek16gg16nXoNeZ15XXqicsXG4gICAgICAgICAgICBzczogJyVkINep16DXmdeV16onLFxuICAgICAgICAgICAgbTogJ9eT16fXlCcsXG4gICAgICAgICAgICBtbTogJyVkINeT16fXldeqJyxcbiAgICAgICAgICAgIGg6ICfXqdei15QnLFxuICAgICAgICAgICAgaGg6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAn16nXoteq15nXmdedJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcg16nXoteV16onO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGQ6ICfXmdeV150nLFxuICAgICAgICAgICAgZGQ6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAn15nXldee15nXmdedJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcg15nXnteZ150nO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIE06ICfXl9eV15PXqScsXG4gICAgICAgICAgICBNTTogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICfXl9eV15PXqdeZ15nXnSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnINeX15XXk9ep15nXnSc7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgeTogJ9ep16DXlCcsXG4gICAgICAgICAgICB5eTogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICfXqdeg16rXmdeZ150nO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyICUgMTAgPT09IDAgJiYgbnVtYmVyICE9PSAxMCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJyDXqdeg15QnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJyDXqdeg15nXnSc7XG4gICAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOlxuICAgICAgICAgICAgL9eQ15fXlFwi16Z815zXpNeg15RcItemfNeQ15fXqNeZINeU16bXlNeo15nXmdedfNec16TXoNeZINeU16bXlNeo15nXmdedfNec16TXoNeV16og15HXlden16h815HXkdeV16fXqHzXkdei16jXkS9pLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAvXijXkNeX15RcItemfNeQ15fXqNeZINeU16bXlNeo15nXmdedfNeR16LXqNeRKSQvLnRlc3QoaW5wdXQpO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA1KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfXnNek16DXldeqINeR15XXp9eoJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfXkdeR15XXp9eoJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzTG93ZXIgPyAn15zXpNeg15RcItemJyA6ICfXnNek16DXmSDXlNem15TXqNeZ15nXnSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxOCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpc0xvd2VyID8gJ9eQ15fXlFwi16YnIDogJ9eQ15fXqNeZINeU16bXlNeo15nXmdedJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gIC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n4KWmJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ+Clpyc6ICcxJyxcbiAgICAgICAgICAgICfgpagnOiAnMicsXG4gICAgICAgICAgICAn4KWpJzogJzMnLFxuICAgICAgICAgICAgJ+Clqic6ICc0JyxcbiAgICAgICAgICAgICfgpasnOiAnNScsXG4gICAgICAgICAgICAn4KWsJzogJzYnLFxuICAgICAgICAgICAgJ+ClrSc6ICc3JyxcbiAgICAgICAgICAgICfgpa4nOiAnOCcsXG4gICAgICAgICAgICAn4KWvJzogJzknLFxuICAgICAgICAgICAgJ+Clpic6ICcwJyxcbiAgICAgICAgfSxcbiAgICAgICAgbW9udGhzUGFyc2UgPSBbXG4gICAgICAgICAgICAvXuCknOCkqC9pLFxuICAgICAgICAgICAgL17gpKvgpLzgpLB84KSr4KSwL2ksXG4gICAgICAgICAgICAvXuCkruCkvuCksOCljeCkmi9pLFxuICAgICAgICAgICAgL17gpIXgpKrgpY3gpLDgpYgvaSxcbiAgICAgICAgICAgIC9e4KSu4KSIL2ksXG4gICAgICAgICAgICAvXuCknOClguCkqC9pLFxuICAgICAgICAgICAgL17gpJzgpYHgpLIvaSxcbiAgICAgICAgICAgIC9e4KSF4KSXL2ksXG4gICAgICAgICAgICAvXuCkuOCkv+CkpOCkgnzgpLjgpL/gpKQvaSxcbiAgICAgICAgICAgIC9e4KSF4KSV4KWN4KSf4KWCL2ksXG4gICAgICAgICAgICAvXuCkqOCktXzgpKjgpLXgpIIvaSxcbiAgICAgICAgICAgIC9e4KSm4KS/4KS44KSCfOCkpuCkv+CkuC9pLFxuICAgICAgICBdLFxuICAgICAgICBzaG9ydE1vbnRoc1BhcnNlID0gW1xuICAgICAgICAgICAgL17gpJzgpKgvaSxcbiAgICAgICAgICAgIC9e4KSr4KS84KSwL2ksXG4gICAgICAgICAgICAvXuCkruCkvuCksOCljeCkmi9pLFxuICAgICAgICAgICAgL17gpIXgpKrgpY3gpLDgpYgvaSxcbiAgICAgICAgICAgIC9e4KSu4KSIL2ksXG4gICAgICAgICAgICAvXuCknOClguCkqC9pLFxuICAgICAgICAgICAgL17gpJzgpYHgpLIvaSxcbiAgICAgICAgICAgIC9e4KSF4KSXL2ksXG4gICAgICAgICAgICAvXuCkuOCkv+CkpC9pLFxuICAgICAgICAgICAgL17gpIXgpJXgpY3gpJ/gpYIvaSxcbiAgICAgICAgICAgIC9e4KSo4KS1L2ksXG4gICAgICAgICAgICAvXuCkpuCkv+CkuC9pLFxuICAgICAgICBdO1xuXG4gICAgdmFyIGhpID0gbW9tZW50LmRlZmluZUxvY2FsZSgnaGknLCB7XG4gICAgICAgIG1vbnRoczoge1xuICAgICAgICAgICAgZm9ybWF0OiAn4KSc4KSo4KS14KSw4KWAX+Ckq+CkvOCksOCkteCksOClgF/gpK7gpL7gpLDgpY3gpJpf4KSF4KSq4KWN4KSw4KWI4KSyX+CkruCkiF/gpJzgpYLgpKhf4KSc4KWB4KSy4KS+4KSIX+CkheCkl+CkuOCljeCkpF/gpLjgpL/gpKTgpK7gpY3gpKzgpLBf4KSF4KSV4KWN4KSf4KWC4KSs4KSwX+CkqOCkteCkruCljeCkrOCksF/gpKbgpL/gpLjgpK7gpY3gpKzgpLAnLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgICAgIHN0YW5kYWxvbmU6XG4gICAgICAgICAgICAgICAgJ+CknOCkqOCkteCksOClgF/gpKvgpLDgpLXgpLDgpYBf4KSu4KS+4KSw4KWN4KSaX+CkheCkquCljeCksOCliOCksl/gpK7gpIhf4KSc4KWC4KSoX+CknOClgeCksuCkvuCkiF/gpIXgpJfgpLjgpY3gpKRf4KS44KS/4KSk4KSC4KSs4KSwX+CkheCkleCljeCkn+ClguCkrOCksF/gpKjgpLXgpILgpKzgpLBf4KSm4KS/4KS44KSC4KSs4KSwJy5zcGxpdChcbiAgICAgICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICA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ICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb4KSG4KScXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+CkleCksl0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkLCBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW+CkleCksl0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdb4KSq4KS/4KSb4KSy4KWHXSBkZGRkLCBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVzIOCkruClh+CkgicsXG4gICAgICAgICAgICBwYXN0OiAnJXMg4KSq4KS54KSy4KWHJyxcbiAgICAgICAgICAgIHM6ICfgpJXgpYHgpJsg4KS54KWAIOCkleCljeCkt+CkoycsXG4gICAgICAgICAgICBzczogJyVkIOCkuOClh+CkleCkguCkoScsXG4gICAgICAgICAgICBtOiAn4KSP4KSVIOCkruCkv+CkqOCknycsXG4gICAgICAgICAgICBtbTogJyVkIOCkruCkv+CkqOCknycsXG4gICAgICAgICAgICBoOiAn4KSP4KSVIOCkmOCkguCkn+CkvicsXG4gICAgICAgICAgICBoaDogJyVkIOCkmOCkguCkn+ClhycsXG4gICAgICAgICAgICBkOiAn4KSP4KSVIOCkpuCkv+CkqCcsXG4gICAgICAgICAgICBkZDogJyVkIOCkpuCkv+CkqCcsXG4gICAgICAgICAgICBNOiAn4KSP4KSVIOCkruCkueClgOCkqOClhycsXG4gICAgICAgICAgICBNTTogJyVkIOCkruCkueClgOCkqOClhycsXG4gICAgICAgICAgICB5OiAn4KSP4KSVIOCkteCksOCljeCktycsXG4gICAgICAgICAgICB5eTogJyVkIOCkteCksOCljeCktycsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1vgpafgpajgpangpargpavgpazgpa3gpa7gpa/gpaZdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIC8vIEhpbmRpIG5vdGF0aW9uIGZvciBtZXJpZGllbXMgYXJlIHF1aXRlIGZ1enp5IGluIHByYWN0aWNlLiBXaGlsZSB0aGVyZSBleGlzdHNcbiAgICAgICAgLy8gYSByaWdpZCBub3Rpb24gb2YgYSAnUGFoYXInIGl0IGlzIG5vdCB1c2VkIGFzIHJpZ2lkbHkgaW4gbW9kZXJuIEhpbmRpLlxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv4KSw4KS+4KSkfOCkuOClgeCkrOCkuXzgpKbgpYvgpKrgpLngpLB84KS24KS+4KSuLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn4KSw4KS+4KSkJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyIDwgNCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4KS44KWB4KSs4KS5Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CkpuCli+CkquCkueCksCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4KS24KS+4KSuJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CksOCkvuCkpCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4KS44KWB4KSs4KS5JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE3KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgpKbgpYvgpKrgpLngpLAnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMjApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CktuCkvuCkric7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4KSw4KS+4KSkJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAwLCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNiwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNnRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuIC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ICAgICAgICByZXN1bHQgKz0gJ3Nla3VuZGUnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnc2VrdW5kaSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdqZWRuYSBtaW51dGEnIDogJ2plZG5lIG1pbnV0ZSc7XG4gICAgICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ21pbnV0YSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIgfHwgbnVtYmVyID09PSAzIHx8IG51bWJlciA9PT0gNCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ21pbnV0ZSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdtaW51dGEnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgY2FzZSAnaCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyAnamVkYW4gc2F0JyA6ICdqZWRub2cgc2F0YSc7XG4gICAgICAgICAgICBjYXNlICdoaCc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ3NhdCc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIgfHwgbnVtYmVyID09PSAzIHx8IG51bWJlciA9PT0gNCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ3NhdGEnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnc2F0aSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICdkZCc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ2Rhbic7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdkYW5hJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ01NJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnbWplc2VjJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMiB8fCBudW1iZXIgPT09IDMgfHwgbnVtYmVyID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnbWplc2VjYSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdtamVzZWNpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ3l5JzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnZ29kaW5hJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMiB8fCBudW1iZXIgPT09IDMgfHwgbnVtYmVyID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAnZ29kaW5lJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gJ2dvZGluYSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIgaHIgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdocicsIHtcbiAgICAgICAgbW9udGhzOiB7XG4gICAgICAgICAgICBmb3JtYXQ6ICdzaWplxI1uamFfdmVsamHEjWVfb8W+dWprYV90cmF2bmphX3N2aWJuamFfbGlwbmphX3NycG5qYV9rb2xvdm96YV9ydWpuYV9saXN0b3BhZGFfc3R1ZGVub2dhX3Byb3NpbmNhJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgICAgICBzdGFuZGFsb25lOlxuICAgICAgICAgICAgICAgICdzaWplxI1hbmpfdmVsamHEjWFfb8W+dWpha190cmF2YW5qX3N2aWJhbmpfbGlwYW5qX3NycGFual9rb2xvdm96X3J1amFuX2xpc3RvcGFkX3N0dWRlbmlfcHJvc2luYWMnLnNwbGl0KFxuICAgICAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICAgICApLFxuICAgICAgICB9LFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICdzaWouX3ZlbGouX2/FvnUuX3RyYS5fc3ZpLl9saXAuX3NycC5fa29sLl9ydWouX2xpcy5fc3R1Ll9wcm8uJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIG1vbnRoc1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIHdlZWtkYXlzOiAnbmVkamVsamFfcG9uZWRqZWxqYWtfdXRvcmFrX3NyaWplZGFfxI1ldHZydGFrX3BldGFrX3N1Ym90YScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ25lZC5fcG9uLl91dG8uX3NyaS5fxI1ldC5fcGV0Ll9zdWIuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ25lX3BvX3V0X3NyX8SNZV9wZV9zdScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdEbyBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRG8gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIERvIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbZGFuYXMgdV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tzdXRyYSB1XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBbbmVkamVsanVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIFtzcmlqZWR1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBbc3Vib3R1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBkZGRkIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbanXEjWVyIHVdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3Byb8WhbHVdIFtuZWRqZWxqdV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbcHJvxaFsdV0gW3NyaWplZHVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3Byb8WhbGVdIFtzdWJvdGVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3Byb8WhbGldIGRkZGQgW3VdIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICd6YSAlcycsXG4gICAgICAgICAgICBwYXN0OiAncHJpamUgJXMnLFxuICAgICAg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gICAgICAgICAgICAgICAgICAgPyAnIG3DoXNvZHBlcmMnXG4gICAgICAgICAgICAgICAgICAgIDogJyBtw6Fzb2RwZXJjZSc7XG4gICAgICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2VneScgKyAoaXNGdXR1cmUgfHwgd2l0aG91dFN1ZmZpeCA/ICcgcGVyYycgOiAnIHBlcmNlJyk7XG4gICAgICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bSArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyBwZXJjJyA6ICcgcGVyY2UnKTtcbiAgICAgICAgICAgIGNhc2UgJ2gnOlxuICAgICAgICAgICAgICAgIHJldHVybiAnZWd5JyArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyDDs3JhJyA6ICcgw7Nyw6FqYScpO1xuICAgICAgICAgICAgY2FzZSAnaGgnOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW0gKyAoaXNGdXR1cmUgfHwgd2l0aG91dFN1ZmZpeCA/ICcgw7NyYScgOiAnIMOzcsOhamEnKTtcbiAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIHJldHVybiAnZWd5JyArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyBuYXAnIDogJyBuYXBqYScpO1xuICAgICAgICAgICAgY2FzZSAnZGQnOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW0gKyAoaXNGdXR1cmUgfHwgd2l0aG91dFN1ZmZpeCA/ICcgbmFwJyA6ICcgbmFwamEnKTtcbiAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgIHJldHVybiAnZWd5JyArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyBow7NuYXAnIDogJyBow7NuYXBqYScpO1xuICAgICAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgICAgICAgIHJldHVybiBudW0gKyAoaXNGdXR1cmUgfHwgd2l0aG91dFN1ZmZpeCA/ICcgaMOzbmFwJyA6ICcgaMOzbmFwamEnKTtcbiAgICAgICAgICAgIGNhc2UgJ3knOlxuICAgICAgICAgICAgICAgIHJldHVybiAnZWd5JyArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyDDqXYnIDogJyDDqXZlJyk7XG4gICAgICAgICAgICBjYXNlICd5eSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bSArIChpc0Z1dHVyZSB8fCB3aXRob3V0U3VmZml4ID8gJyDDqXYnIDogJyDDqXZlJyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuICcnO1xuICAgIH1cbiAgICBmdW5jdGlvbiB3ZWVrKGlzRnV0dXJlKSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAoaXNGdXR1cmUgPyAnJyA6ICdbbcO6bHRdICcpICtcbiAgICAgICAgICAgICdbJyArXG4gICAgICAgICAgICB3ZWVrRW5kaW5nc1t0aGlzLmRheSgpXSArXG4gICAgICAgICAgICAnXSBMVFsta29yXSdcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICB2YXIgaHUgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdodScsIHtcbiAgICAgICAgbW9udGhzOiAnamFudcOhcl9mZWJydcOhcl9tw6FyY2l1c1/DoXByaWxpc19tw6FqdXNfasO6bml1c19qw7psaXVzX2F1Z3VzenR1c19zemVwdGVtYmVyX29rdMOzYmVyX25vdmVtYmVyX2RlY2VtYmVyJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICdqYW4uX2ZlYi5fbcOhcmMuX8OhcHIuX23DoWouX2rDum4uX2rDumwuX2F1Zy5fc3plcHQuX29rdC5fbm92Ll9kZWMuJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG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1ZSA/ICdkdScgOiAnRFUnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1ttYV0gTFRbLWtvcl0nLFxuICAgICAgICAgICAgbmV4dERheTogJ1tob2xuYXBdIExUWy1rb3JdJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdlZWsuY2FsbCh0aGlzLCB0cnVlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiAnW3RlZ25hcF0gTFRbLWtvcl0nLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gd2Vlay5jYWxsKHRoaXMsIGZhbHNlKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVzIG3Dumx2YScsXG4gICAgICAgICAgICBwYXN0OiAnJXMnLFxuICAgICAgICAgICAgczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgc3M6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG1tOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoaDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZGQ6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIE06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIE1NOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICB5OiB0cmFuc2xhdGUsXG4gICAgICAgICAgICB5eTogdHJhbnNsYXRlLFxuICAgICAgICB9LFxu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qdWrX9W41oLWgNWi1aHVqV/Vt9Wh1aLVodWpJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfVr9aA1a9f1aXWgNWvX9Wl1oDWhF/VudaA1oRf1bDVttWjX9W41oLWgNWiX9W31aLVqScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfVr9aA1a9f1aXWgNWvX9Wl1oDWhF/VudaA1oRf1bDVttWjX9W41oLWgNWiX9W31aLVqScuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWSDVqS4nLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkg1akuLCBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkg1akuLCBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9Wh1bXVvdaF1oBdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb1b7VodWy1ahdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb1aXWgNWl1a9dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdkZGRkIFvWhdaA1agg1arVodW01ahdIExUJztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnW9Wh1bbWgdWh1a5dIGRkZGQgW9aF1oDVqCDVqtWh1bTVqF0gTFQnO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg1bDVpdW/1bgnLFxuICAgICAgICAgICAgcGFzdDogJyVzINWh1bzVodW7JyxcbiAgICAgICAgICAgIHM6ICfVtNWrINaE1aHVttWrINW+1aHVtdaA1a/VtdWh1bYnLFxuICAgICAgICAgICAgc3M6ICclZCDVvtWh1bXWgNWv1bXVodW2JyxcbiAgICAgICAgICAgIG06ICfWgNW41brVpScsXG4gICAgICAgICAgICBtbTogJyVkINaA1bjVutWlJyxcbiAgICAgICAgICAgIGg6ICfVqtWh1bQnLFxuICAgICAgICAgICAgaGg6ICclZCDVqtWh1bQnLFxuICAgICAgICAgICAgZDogJ9aF1oAnLFxuICAgICAgICAgICAgZGQ6ICclZCDWhdaAJyxcbiAgICAgICAgICAgIE06ICfVodW01avVvScsXG4gICAgICAgICAgICBNTTogJyVkINWh1bTVq9W9JyxcbiAgICAgICAgICAgIHk6ICfVv9Wh1oDVqycsXG4gICAgICAgICAgICB5eTogJyVkINW/1aHWgNWrJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL9Wj1avVt9Wl1oDVvtWhfNWh1bzVodW+1bjVv9W+1aF81oHVpdaA1aXVr9W+1aF81aXWgNWl1a/VuNW11aHVti8sXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuIC9eKNaB1aXWgNWl1a/VvtWhfNWl1oDVpdWv1bjVtdWh1bYpJC8udGVzdChpbnB1dCk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91cikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfVo9Wr1bfVpdaA1b7VoSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn1aHVvNWh1b7VuNW/1b7VoSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNykge1xuICAgICAgICAgICAgICAgIHJldHVybiAn1oHVpdaA1aXVr9W+1aEnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9Wl1oDVpdWv1bjVtdWh1bYnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn18XFxkezEsMn0tKNWr1bZ81oDVpCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICBjYXNlICdERERvJzpcbiAgICAgICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct1avVtic7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct1oDVpCc7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN3RoIGl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XI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAnc2lhbmcnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPj0gMTEgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ3NvcmUnIHx8IG1lcmlkaWVtID09PSAnbWFsYW0nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VycywgbWludXRlcywgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXJzIDwgMTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3BhZ2knO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VycyA8IDE1KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdzaWFuZyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXJzIDwgMTkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3NvcmUnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ21hbGFtJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSGFyaSBpbmkgcHVrdWxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbQmVzb2sgcHVrdWxdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbcHVrdWxdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbS2VtYXJpbiBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFtsYWx1IHB1a3VsXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2RhbGFtICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyB5YW5nIGxhbHUnLFxuICAgICAgICAgICAgczogJ2JlYmVyYXBhIGRldGlrJyxcbiAgICAgICAgICAgIHNzOiAnJWQgZGV0aWsnLFxuICAgICAgICAgICAgbTogJ3NlbWVuaXQnLFxuICAgICAgICAgICAgbW06ICclZCBtZW5pdCcsXG4gICAgICAgICAgICBoOiAnc2VqYW0nLFxuICAgICAgICAgICAgaGg6ICclZCBqYW0nLFxuICAgICAgICAgICAgZDogJ3NlaGFyaScsXG4gICAgICAgICAgICBkZDogJyVkIGhhcmknLFxuICAgICAgICAgICAgTTogJ3NlYnVsYW4nLFxuICAgICAgICAgICAgTU06ICclZCBidWxhbicsXG4gICAgICAgICAgICB5OiAnc2V0YWh1bicsXG4gICAgICAgICAgICB5eTogJyVkIHRhaHVuJyxcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAwLCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNiwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNnRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGlkO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IEljZWxhbmRpYyBbaXNdXG4vLyEgYXV0aG9yIDogSGlucmlrIMOWcm4gU2lndXLDsHNzb24gOiBodHRwczovL2dpdGh1Yi5jb20vaGlucmlrXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnXG4gICAgICAgJiYgdHlwZW9mIHJlcXVpcmUgPT09ICdmdW5jdGlvbicgPyBmYWN0b3J5KHJlcXVpcmUoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICBmdW5jdGlvbiBwbHVyYWwobikge1xuICAgICAgICBpZiAobiAlIDEwMCA9PT0gMTEpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKG4gJSAxMCA9PT0gMSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cbiAgICBmdW5jdGlvbiB0cmFuc2xhdGUobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXksIGlzRnV0dXJlKSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBudW1iZXIgKyAnICc7XG4gICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZVxuICAgICAgICAgICAgICAgICAgICA/ICdub2trcmFyIHNla8O6bmR1cidcbiAgICAgICAgICAgICAgICAgICAgOiAnbm9ra3J1bSBzZWvDum5kdW0nO1xuICAgICAgICAgICAgY2FzZSAnc3MnOlxuICAgICAgICAgICAgICAgIGlmIChwbHVyYWwobnVtYmVyKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICtcbiAgICAgICAgICAgICAgICAgICAgICAgICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ3Nla8O6bmR1cicgOiAnc2Vrw7puZHVtJylcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICdzZWvDum5kYSc7XG4gICAgICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdtw61uw7p0YScgOiAnbcOtbsO6dHUnO1xuICAgICAgICAgICAgY2FzZSAnbW0nOlxuICAgICAgICAgICAgICAgIGlmIChwbHVyYWwobnVtYmVyKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICsgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbcOtbsO6dHVyJyA6ICdtw61uw7p0dW0nKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2l0aG91dFN1ZmZpeCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ23DrW7DunRhJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICdtw61uw7p0dSc7XG4gICAgICAgICAgICBjYXNlICdoaCc6XG4gICAgICAgICAgICAgICAgaWYgKHBsdXJhbChudW1iZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgK1xuICAgICAgICAgICAgICAgICAgICAgICAgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdrbHVra3VzdHVuZGlyJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ2tsdWtrdXN0dW5kdW0nKVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ2tsdWtrdXN0dW5kJztcbiAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZGFndXInO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgPyAnZGFnJyA6ICdkZWdpJztcbiAgICAgICAgICAgIGNhc2UgJ2RkJzpcbiAgICAgICAgICAgICAgICBpZiAocGx1cmFsKG51bWJlcikpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnZGFnYXInO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAoaXNGdXR1cmUgPyAnZGFnYScgOiAnZMO2Z3VtJyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aXRob3V0U3VmZml4KSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnZGFndXInO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKGlzRnV0dXJlID8gJ2RhZycgOiAnZGVnaScpO1xuICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdtw6FudcOwdXInO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgPyAnbcOhbnXDsCcgOiAnbcOhbnXDsGknO1xuICAgICAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgICAgICAgIGlmIChwbHVyYWwobnVtYmVyKSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICdtw6FudcOwaXInO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAoaXNGdXR1cmUgPyAnbcOhbnXDsGknIDogJ23DoW51w7B1bScpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2l0aG91dFN1ZmZpeCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ23DoW51w7B1cic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAoaXNGdXR1cmUgPyAnbcOhbnXDsCcgOiAnbcOhbnXDsGknKTtcbiAgICAgICAgICAgIGNhc2UgJ3knOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ8OhcicgOiAnw6FyaSc7XG4gICAgICAgICAgICBjYXNlICd5eSc6XG4gICAgICAgICAgICAgICAgaWYgKHBsdXJhbChudW1iZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICfDoXInIDogJ8OhcnVtJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICfDoXInIDogJ8OhcmknKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBpcyA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2lzJywge1xuICAgICAgICBtb250aHM6ICdqYW7DumFyX2ZlYnLDumFyX21hcnNfYXByw61sX21hw61fasO6bsOtX2rDumzDrV/DoWfDunN0X3NlcHRlbWJlcl9va3TDs2Jlcl9uw7N2ZW1iZXJfZGVzZW1iZXInLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OiAnamFuX2ZlYl9tYXJfYXByX21hw61fasO6bl9qw7psX8OhZ8O6X3NlcF9va3RfbsOzdl9kZXMnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzOlxuICAgICAgICAgICAgJ3N1bm51ZGFndXJfbcOhbnVkYWd1cl/DvnJpw7BqdWRhZ3VyX21pw7B2aWt1ZGFndXJfZmltbXR1ZGFndXJfZsO2c3R1ZGFndXJfbGF1Z2FyZGFndXInLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ3N1bl9tw6FuX8O+cmlfbWnDsF9maW1fZsO2c19sYXUnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnU3VfTcOhX8Oecl9NaV9GaV9Gw7ZfTGEnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QuIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdELiBNTU1NIFlZWVkgW2tsLl0gSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRC4gTU1NTSBZWVlZIFtrbC5dIEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vDrSBkYWcga2wuXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW8OhIG1vcmd1biBrbC5dIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBba2wuXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW8OtIGfDpnIga2wuXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tzw63DsGFzdGFdIGRkZGQgW2tsLl0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdlZnRpciAlcycsXG4gICAgICAgICAgICBwYXN0OiAnZnlyaXIgJXMgc8Otw7BhbicsXG4gICAgICAgICAgICBzOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBzczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbW06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGg6ICdrbHVra3VzdHVuZCcsXG4gICAgICAgICAgICBoaDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZGQ6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIE06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIE1NOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICB5OiB0cmFuc2xhdGUsXG4gICAgICAgICAgICB5eTogdHJhbnNsYXRlLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn1cXC4vLFxuICAgICAgICBvcmRpbmFsOiAnJWQuJyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlz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dfZ2l1X2x1Z19hZ29fc2V0X290dF9ub3ZfZGljJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5czogJ2RvbWVuaWNhX2x1bmVkw6xfbWFydGVkw6xfbWVyY29sZWTDrF9naW92ZWTDrF92ZW5lcmTDrF9zYWJhdG8nLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICdkb21fbHVuX21hcl9tZXJfZ2lvX3Zlbl9zYWInLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnZG9fbHVfbWFfbWVfZ2lfdmVfc2EnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tPZ2dpIGFsbGVdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbRG9tYW5pIGFsbGVdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbYWxsZV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tJZXJpIGFsbGVdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW2xhIHNjb3JzYV0gZGRkZCBbYWxsZV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbbG8gc2NvcnNvXSBkZGRkIFthbGxlXSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiBmdW5jdGlvbiAocykge1xuICAgICAgICAgICAgICAgIHJldHVybiAoL15bMC05XS4rJC8udGVzdChzKSA/ICd0cmEnIDogJ2luJykgKyAnICcgKyBzO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBmYScsXG4gICAgICAgICAgICBzOiAnYWxjdW5pIHNlY29uZGknLFxuICAgICAgICAgICAgc3M6ICclZCBzZWNvbmRpJyxcbiAgICAgICAgICAgIG06ICd1biBtaW51dG8nLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGknLFxuICAgICAgICAgICAgaDogXCJ1bidvcmFcIixcbiAgICAgICAgICAgIGhoOiAnJWQgb3JlJyxcbiAgICAgICAgICAgIGQ6ICd1biBnaW9ybm8nLFxuICAgICAgICAgICAgZGQ6ICclZCBnaW9ybmknLFxuICAgICAgICAgICAgTTogJ3VuIG1lc2UnLFxuICAgICAgICAgICAgTU06ICclZCBtZXNpJyxcbiAgICAgICAgICAgIHk6ICd1biBhbm5vJyxcbiAgICAgICAgICAgIHl5OiAnJWQgYW5uaScsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfcK6LyxcbiAgICAgICAgb3JkaW5hbDogJyVkwronLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIH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YnJhaW9fbWFyem9fYXByaWxlX21hZ2dpb19naXVnbm9fbHVnbGlvX2Fnb3N0b19zZXR0ZW1icmVfb3R0b2JyZV9ub3ZlbWJyZV9kaWNlbWJyZScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6ICdnZW5fZmViX21hcl9hcHJfbWFnX2dpdV9sdWdfYWdvX3NldF9vdHRfbm92X2RpYycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXM6ICdkb21lbmljYV9sdW5lZMOsX21hcnRlZMOsX21lcmNvbGVkw6xfZ2lvdmVkw6xfdmVuZXJkw6xfc2FiYXRvJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnZG9tX2x1bl9tYXJfbWVyX2dpb192ZW5fc2FiJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ2RvX2x1X21hX21lX2dpX3ZlX3NhJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAnW09nZ2kgYScgK1xuICAgICAgICAgICAgICAgICAgICAodGhpcy5ob3VycygpID4gMSA/ICdsbGUgJyA6IHRoaXMuaG91cnMoKSA9PT0gMCA/ICcgJyA6IFwibGwnXCIpICtcbiAgICAgICAgICAgICAgICAgICAgJ11MVCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHREYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAnW0RvbWFuaSBhJyArXG4gICAgICAgICAgICAgICAgICAgICh0aGlzLmhvdXJzKCkgPiAxID8gJ2xsZSAnIDogdGhpcy5ob3VycygpID09PSAwID8gJyAnIDogXCJsbCdcIikgK1xuICAgICAgICAgICAgICAgICAgICAnXUxUJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAnZGRkZCBbYScgK1xuICAgICAgICAgICAgICAgICAgICAodGhpcy5ob3VycygpID4gMSA/ICdsbGUgJyA6IHRoaXMuaG91cnMoKSA9PT0gMCA/ICcgJyA6IFwibGwnXCIpICtcbiAgICAgICAgICAgICAgICAgICAgJ11MVCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAnW0llcmkgYScgK1xuICAgICAgICAgICAgICAgICAgICAodGhpcy5ob3VycygpID4gMSA/ICdsbGUgJyA6IHRoaXMuaG91cnMoKSA9PT0gMCA/ICcgJyA6IFwibGwnXCIpICtcbiAgICAgICAgICAgICAgICAgICAgJ11MVCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1tMYSBzY29yc2FdIGRkZGQgW2EnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAodGhpcy5ob3VycygpID4gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdsbGUgJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHRoaXMuaG91cnMoKSA9PT0gMFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJyAnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBcImxsJ1wiKSArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ11MVCdcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdbTG8gc2NvcnNvXSBkZGRkIFthJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRoaXMuaG91cnMoKSA+IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnbGxlICdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB0aGlzLmhvdXJzKCkgPT09IDBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICcgJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogXCJsbCdcIikgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICddTFQnXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ3RyYSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgZmEnLFxuICAgICAgICAgICAgczogJ2FsY3VuaSBzZWNvbmRpJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vjb25kaScsXG4gICAgICAgICAgICBtOiAndW4gbWludXRvJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRpJyxcbiAgICAgICAgICAgIGg6IFwidW4nb3JhXCIsXG4gICAgICAgICAgICBoaDogJyVkIG9yZScsXG4gICAgICAgICAgICBkOiAndW4gZ2lvcm5vJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZ2lvcm5pJyxcbiAgICAgICAgICAgIHc6ICd1bmEgc2V0dGltYW5hJyxcbiAgICAgICAgICAgIHd3OiAnJWQgc2V0dGltYW5lJyxcbiAgICAgICAgICAgIE06ICd1biBtZXNlJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbWVzaScsXG4gICAgICAgICAgICB5OiAndW4gYW5ubycsXG4gICAgICAgICAgICB5eTogJyVkIGFubmknLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn3Cui8sXG4gICAgICAgIG9yZGluYWw6ICclZMK6JyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGl0O1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IEphcGFuZXNlIFtqYV1cbi8vISBhdXRob3IgOiBMSSBMb25nIDogaHR0cHM6Ly9naXRodWIuY29tL2JhcnlvblxuXG47KGZ1bmN0aW9uIChnbG9iYWwsIGZhY3RvcnkpIHtcbiAgIHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJ1xuICAgICAgICYmIHR5cGVvZiByZXF1aXJlID09PSAnZnVuY3Rpb24nID8gZmFjdG9yeShyZXF1aXJlKCcuLi9tb21lbnQnKSkgOlxuICAgdHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIGphID0gbW9tZW50LmRlZmluZUxvY2FsZSgnamEnLCB7XG4gICAgICAgIGVyYXM6IFtcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaW5jZTogJzIwMTktMDUtMDEnLFxuICAgICAgICAgICAgICAgIG9mZnNldDogMSxcbiAgICAgICAgICAgICAgICBuYW1lOiAn5Luk5ZKMJyxcbiAgICAgICAgICAgICAgICBuYXJyb3c6ICfji78nLFxuICAgICAgICAgICAgICAgIGFiYnI6ICdSJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc2luY2U6ICcxOTg5LTAxLTA4JyxcbiAgICAgICAgICAgICAgICB1bnRpbDogJzIwMTktMDQtMzAnLFxuICAgICAgICAgICAgICAgIG9mZnNldDogMSxcbiAgICAgICAgICAgICAgICBuYW1lOiAn5bmz5oiQJyxcbiAgICAgICAgICAgICAgICBuYXJyb3c6ICfjjbsnLFxuICAgICAgICAgICAgICAgIGFiYnI6ICdIJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc2luY2U6ICcxOTI2LTEyLTI1JyxcbiAgICAgICAgICAgICAgICB1bnRpbDogJzE5ODktMDEtMDcnLFxuICAgICAgICAgICAgICAgIG9mZnNldDogMSxcbiAgICAgICAgICAgICAgICBuYW1lOiAn5pit5ZKMJyxcbiAgICAgICAgICAgICAgICBuYXJyb3c6ICfjjbwnLFxuICAgICAgICAgICAgICAgIGFiYnI6ICdTJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc2luY2U6ICcxOTEyLTA3LTMwJyxcbiAgICAgICAgICAgICAgICB1bnRpbDogJzE5MjYtMTItMjQnLFxuICAgICAgICAgICAgICAgIG9mZnNldDogMSxcbiAgICAgICAgICAgICAgICBuYW1lOiAn5aSn5q2jJyxcbiAgICAgICAgICAgICAgICBuYXJyb3c6ICfjjb0nLFxuICAgICAgICAgICAgICAgIGFiYnI6ICdUJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc2luY2U6ICcxODczLTAxLTAxJyxcbiAgICAgICAgICAgICAgICB1bnRpbDogJzE5MTItMDctMjknLFxuICAgICAgICAgICAgICAgIG9mZnNldDogNixcbiAgICAgICAgICAgICAgICBuYW1lOiAn5piO5rK7JyxcbiAgICAgICAgICAgICAgICBuYXJyb3c6ICfjjb4nLFxuICAgICAgICAgICAgICAgIGFiYnI6ICdNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc2luY2U6ICcwMDAxLTAxLTAxJyxcbiAgICAgICAgICAgICAgICB1bnRpbDogJzE4NzMtMTItMzEnLFxuICAgICAgICAgICAgICAgIG9mZnNldDogMSxcbiAgICAgICAgICAgICAgICBuYW1lOiAn6KW/5pqmJyxcbiAgICAgICAgICAgICAgICBuYXJyb3c6ICdBRCcsXG4gICAgICAgICAgICAgICAgYWJicjogJ0FEJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc2luY2U6ICcwMDAwLTEyLTMxJyxcbiAgICAgICAgICAgICAgICB1bnRpbDogLUluZmluaXR5LFxuICAgICAgICAgICAgICAgIG9mZnNldDogMSxcbiAgICAgICAgICAgICAgICBuYW1lOiAn57SA5YWD5YmNJyxcbiAgICAgICAgICAgICAgICBuYXJyb3c6ICdCQycsXG4gICAgICAgICAgICAgICAgYWJicjogJ0JDJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIF0sXG4gICAgICAgIGVyYVllYXJPcmRpbmFsUmVnZXg6IC8o5YWDfFxcZCsp5bm0LyxcbiAgICAgICAgZXJhWWVhck9yZGluYWxQYXJzZTogZnVuY3Rpb24gKGlucHV0LCBtYXRjaCkge1xuICAgICAgICAgICAgcmV0dXJuIG1hdGNoWzFdID09PSAn5YWDJyA/IDEgOiBwYXJzZUludChtYXRjaFsxXSB8fCBpbnB1dCwgMTApO1xuICAgICAgICB9LFxuICAgICAgICBtb250aHM6ICcx5pyIXzLmnIhfM+aciF805pyIXzXmnIhfNuaciF835pyIXzjmnIhfOeaciF8xMOaciF8xMeaciF8xMuaciCcuc3BsaXQoJ18nKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6ICcx5pyIXzLmnIhfM+aciF805pyIXzXmnIhfNuaciF835pyIXzjmnIhfOeaciF8xMOaciF8xMeaciF8xMuaciCcuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXM6ICfml6Xmm5zml6Vf5pyI5puc5pelX+eBq+abnOaXpV/msLTmm5zml6Vf5pyo5puc5pelX+mHkeabnOaXpV/lnJ/mm5zml6UnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfml6Vf5pyIX+eBq1/msLRf5pyoX+mHkV/lnJ8nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn5pelX+aciF/ngatf5rC0X+acqF/ph5Ff5ZyfJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnWVlZWS9NTS9ERCcsXG4gICAgICAgICAgICBMTDogJ1lZWVnlubRN5pyIROaXpScsXG4gICAgICAgICAgICBMTEw6ICdZWVlZ5bm0TeaciETml6UgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ1lZWVnlubRN5pyIROaXpSBkZGRkIEhIOm1tJyxcbiAgICAgICAgICAgIGw6ICdZWVlZL01NL0REJyxcbiAgICAgICAgICAgIGxsOiAnWVlZWeW5tE3mnIhE5pelJyxcbiAgICAgICAgICAgIGxsbDogJ1lZWVnlubRN5pyIROaXpSBISDptbScsXG4gICAgICAgICAgICBsbGxsOiAnWVlZWeW5tE3mnIhE5pelKGRkZCkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv5Y2I5YmNfOWNiOW+jC9pLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiBpbnB1dCA9PT0gJ+WNiOW+jCc7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfljYjliY0nO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+WNiOW+jCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+S7iuaXpV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vmmI7ml6VdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAobm93KSB7XG4gICAgICAgICAgICAgICAgaWYgKG5vdy53ZWVrKCkgIT09IHRoaXMud2VlaygpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnW+adpemAsV1kZGRkIExUJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2RkZGQgTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiAnW+aYqOaXpV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uIChub3cpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy53ZWVrKCkgIT09IG5vdy53ZWVrKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb5YWI6YCxXWRkZGQgTFQnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZGRkZCBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfeaXpS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICBjYXNlICd5JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciA9PT0gMSA/ICflhYPlubQnIDogbnVtYmVyICsgJ+W5tCc7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfml6UnO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXPlvownLFxuICAgICAgICAgICAgcGFzdDogJyVz5YmNJyxcbiAgICAgICAgICAgIHM6ICfmlbDnp5InLFxuICAgICAgICAgICAgc3M6ICclZOenkicsXG4gICAgICAgICAgICBtOiAnMeWIhicsXG4gICAgICAgICAgICBtbTogJyVk5YiGJyxcbiAgICAgICAgICAgIGg6ICcx5pmC6ZaTJyxcbiAgICAgICAgICAgIGhoOiAnJWTmmYLplpMnLFxuICAgICAgICAgICAgZDogJzHml6UnLFxuICAgICAgICAgICAgZGQ6ICclZOaXpScsXG4gICAgICAgICAgICBNOiAnMeODtuaciCcsXG4gICAgICAgICAgICBNTTogJyVk44O25pyIJyxcbiAgICAgICAgICAgIHk6ICcx5bm0JyxcbiAgICAgICAgICAgIHl5OiAnJWTlubQnLFxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGphO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IEphdmFuZXNlIFtqdl1cbi8vISBhdXRob3IgOiBSb255IExhbnRpcCA6IGh0dHBzOi8vZ2l0aHViLmNvbS9sYW50aXBcbi8vISByZWZlcmVuY2U6IGh0dHA6Ly9qdi53aWtpcGVkaWEub3JnL3dpa2kvQmFzYV9KYXdhXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGU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ogJ0hILm1tLnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgW3B1a3VsXSBISC5tbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgW3B1a3VsXSBISC5tbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC9lbmppbmd8c2l5YW5nfHNvbnRlbnxuZGFsdS8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ2VuamluZycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICdzaXlhbmcnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPj0gMTEgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ3NvbnRlbicgfHwgbWVyaWRpZW0gPT09ICduZGFsdScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXJzLCBtaW51dGVzLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91cnMgPCAxMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnZW5qaW5nJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91cnMgPCAxNSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnc2l5YW5nJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91cnMgPCAxOSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnc29udGVuJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICduZGFsdSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0RpbnRlbiBwdW5pa28gcHVrdWxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbTWJlbmphbmcgcHVrdWxdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbcHVrdWxdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbS2FsYSB3aW5naSBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFtrZXBlbmdrZXIgcHVrdWxdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnd29udGVuIGluZyAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgaW5na2FuZyBrZXBlbmdrZXInLFxuICAgICAgICAgICAgczogJ3Nhd2V0YXdpcyBkZXRpaycsXG4gICAgICAgICAgICBzczogJyVkIGRldGlrJyxcbiAgICAgICAgICAgIG06ICdzZXR1bmdnYWwgbWVuaXQnLFxuICAgICAgICAgICAgbW06ICclZCBtZW5pdCcsXG4gICAgICAgICAgICBoOiAnc2V0dW5nZ2FsIGphbScsXG4gICAgICAgICAgICBoaDogJyVkIGphbScsXG4gICAgICAgICAgICBkOiAnc2VkaW50ZW4nLFxuICAgICAgICAgICAgZGQ6ICclZCBkaW50ZW4nLFxuICAgICAgICAgICAgTTogJ3Nld3VsYW4nLFxuICAgICAgICAgICAgTU06ICclZCB3dWxhbicsXG4gICAgICAgICA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4gICAgICAgICAgICBuZXh0RGF5OiAnW+GDruGDleGDkOGDml0gTFRbLeGDluGDlF0nLFxuICAgICAgICAgICAgbGFzdERheTogJ1vhg5Lhg6Phg6jhg5jhg5xdIExUWy3hg5bhg5RdJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnW+GDqOGDlOGDm+GDk+GDlOGDkl0gZGRkZCBMVFst4YOW4YOUXScsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vhg6zhg5jhg5zhg5BdIGRkZGQgTFQt4YOW4YOUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiBmdW5jdGlvbiAocykge1xuICAgICAgICAgICAgICAgIHJldHVybiBzLnJlcGxhY2UoXG4gICAgICAgICAgICAgICAgICAgIC8o4YOs4YOQ4YObfOGDrOGDo+GDl3zhg6Hhg5Dhg5Dhg5d84YOs4YOU4YOafOGDk+GDpnzhg5fhg5UpKOGDmHzhg5QpLyxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCQwLCAkMSwgJDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkMiA9PT0gJ+GDmCcgPyAkMSArICfhg6jhg5gnIDogJDEgKyAkMiArICfhg6jhg5gnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBwYXN0OiBmdW5jdGlvbiAocykge1xuICAgICAgICAgICAgICAgIGlmICgvKOGDrOGDkOGDm+GDmHzhg6zhg6Phg5fhg5h84YOh4YOQ4YOQ4YOX4YOYfOGDk+GDpuGDlHzhg5fhg5Xhg5QpLy50ZXN0KHMpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzLnJlcGxhY2UoLyjhg5h84YOUKSQvLCAn4YOY4YOhIOGDrOGDmOGDnCcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoL+GDrOGDlOGDmuGDmC8udGVzdChzKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcy5yZXBsYWNlKC/hg6zhg5Thg5rhg5gkLywgJ+GDrOGDmuGDmOGDoSDhg6zhg5jhg5wnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgczogJ+GDoOGDkOGDm+GDk+GDlOGDnOGDmOGDm+GDlCDhg6zhg5Dhg5vhg5gnLFxuICAgICAgICAgICAgc3M6ICclZCDhg6zhg5Dhg5vhg5gnLFxuICAgICAgICAgICAgbTogJ+GDrOGDo+GDl+GDmCcsXG4gICAgICAgICAgICBtbTogJyVkIOGDrOGDo+GDl+GDmCcsXG4gICAgICAgICAgICBoOiAn4YOh4YOQ4YOQ4YOX4YOYJyxcbiAgICAgICAgICAgIGhoOiAnJWQg4YOh4YOQ4YOQ4YOX4YOYJyxcbiAgICAgICAgICAgIGQ6ICfhg5Phg6bhg5QnLFxuICAgICAgICAgICAgZGQ6ICclZCDhg5Phg6bhg5QnLFxuICAgICAgICAgICAgTTogJ+GDl+GDleGDlCcsXG4gICAgICAgICAgICBNTTogJyVkIOGDl+GDleGDlCcsXG4gICAgICAgICAgICB5OiAn4YOs4YOU4YOa4YOYJyxcbiAgICAgICAgICAgIHl5OiAnJWQg4YOs4YOU4YOa4YOYJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogLzB8MS3hg5rhg5h84YOb4YOULVxcZHsxLDJ9fFxcZHsxLDJ9LeGDlC8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLeGDmuGDmCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgbnVtYmVyIDwgMjAgfHxcbiAgICAgICAgICAgICAgICAobnVtYmVyIDw9IDEwMCAmJiBudW1iZXIgJSAyMCA9PT0gMCkgfHxcbiAgICAgICAgICAgICAgICBudW1iZXIgJSAxMDAgPT09IDBcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4YOb4YOULScgKyBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3hg5QnO1xuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsXG4gICAgICAgICAgICBkb3k6IDcsXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4ga2E7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogS2F6YWtoIFtra11cbi8vISBhdXRob3JzIDogTnVybGFuIFJha2hpbXpoYW5vdiA6IGh0dHBzOi8vZ2l0aHViLmNvbS9udXJsYW5cblxuOyhmdW5jdGlvbiAoZ2xvYmFsLCBmYWN0b3J5KSB7XG4gICB0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIG1vZHVsZSAhPT0gJ3VuZGVmaW5lZCdcbiAgICAgICAmJiB0eXBlb2YgcmVxdWlyZSA9PT0gJ2Z1bmN0aW9uJyA/IGZhY3RvcnkocmVxdWlyZSgnLi4vbW9tZW50JykpIDpcbiAgIHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCA/IGRlZmluZShbJy4uL21vbWVudCddLCBmYWN0b3J5KSA6XG4gIC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b25maWd1cmF0aW9uXG5cbiAgICB2YXIgc3ltYm9sTWFwID0ge1xuICAgICAgICAgICAgMTogJ+GfoScsXG4gICAgICAgICAgICAyOiAn4Z+iJyxcbiAgICAgICAgICAgIDM6ICfhn6MnLFxuICAgICAgICAgICAgNDogJ+GfpCcsXG4gICAgICAgICAgICA1OiAn4Z+lJyxcbiAgICAgICAgICAgIDY6ICfhn6YnLFxuICAgICAgICAgICAgNzogJ+GfpycsXG4gICAgICAgICAgICA4OiAn4Z+oJyxcbiAgICAgICAgICAgIDk6ICfhn6knLFxuICAgICAgICAgICAgMDogJ+GfoCcsXG4gICAgICAgIH0sXG4gICAgICAgIG51bWJlck1hcCA9IHtcbiAgICAgICAgICAgICfhn6EnOiAnMScsXG4gICAgICAgICAgICAn4Z+iJzogJzInLFxuICAgICAgICAgICAgJ+Gfoyc6ICczJyxcbiAgICAgICAgICAgICfhn6QnOiAnNCcsXG4gICAgICAgICAgICAn4Z+lJzogJzUnLFxuICAgICAgICAgICAgJ+Gfpic6ICc2JyxcbiAgICAgICAgICAgICfhn6cnOiAnNycsXG4gICAgICAgICAgICAn4Z+oJzogJzgnLFxuICAgICAgICAgICAgJ+GfqSc6ICc5JyxcbiAgICAgICAgICAgICfhn6AnOiAnMCcsXG4gICAgICAgIH07XG5cbiAgICB2YXIga20gPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdrbScsIHtcbiAgICAgICAgbW9udGhzOiAn4Z6Y4Z6A4Z6a4Z62X+GegOGeu+GemOGfkuGel+GfiF/hnpjhnrjhnpPhnrZf4Z6Y4Z+B4Z6f4Z62X+Gep+Gen+Gel+Getl/hnpjhnrfhnpDhnrvhnpPhnrZf4Z6A4Z6A4Z+S4Z6A4Z6K4Z62X+Gen+GeuOGeoOGetl/hnoDhnonhn5LhnonhnrZf4Z6P4Z674Z6b4Z62X+GenOGet+GeheGfkuGehuGet+GegOGetl/hnpLhn5LhnpPhnrwnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICA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XMsIChmdW5jdGlvbiAobW9tZW50KSB7ICd1c2Ugc3RyaWN0JztcblxuICAgIC8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cblxuICAgIHZhciBzeW1ib2xNYXAgPSB7XG4gICAgICAgICAgICAxOiAn4LOnJyxcbiAgICAgICAgICAgIDI6ICfgs6gnLFxuICAgICAgICAgICAgMzogJ+CzqScsXG4gICAgICAgICAgICA0OiAn4LOqJyxcbiAgICAgICAgICAgIDU6ICfgs6snLFxuICAgICAgICAgICAgNjogJ+CzrCcsXG4gICAgICAgICAgICA3OiAn4LOtJyxcbiAgICAgICAgICAgIDg6ICfgs64nLFxuICAgICAgICAgICAgOTogJ+CzrycsXG4gICAgICAgICAgICAwOiAn4LOmJyxcbiAgICAgICAgfSxcbiAgICAgICAgbnVtYmVyTWFwID0ge1xuICAgICAgICAgICAgJ+Czpyc6ICcxJyxcbiAgICAgICAgICAgICfgs6gnOiAnMicsXG4gICAgICAgICAgICAn4LOpJzogJzMnLFxuICAgICAgICAgICAgJ+Czqic6ICc0JyxcbiAgICAgICAgICAgICfgs6snOiAnNScsXG4gICAgICAgICAgICAn4LOsJzogJzYnLFxuICAgICAgICAgICAgJ+CzrSc6ICc3JyxcbiAgICAgICAgICAgICfgs64nOiAnOCcsXG4gICAgICAgICAgICAn4LOvJzogJzknLFxuICAgICAgICAgICAgJ+Czpic6ICcwJyxcbiAgICAgICAgfTtcblxuICAgIHZhciBrbiA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2tuJywge1xuICAgICAgICBtb250aHM6ICfgspzgsqjgsrXgsrDgsr9f4LKr4LOG4LKs4LON4LKw4LK14LKw4LK/X+CyruCyvuCysOCzjeCymuCzjV/gso/gsqrgs43gsrDgsr/gsrLgs41f4LKu4LOG4LOVX+CynOCzguCyqOCzjV/gspzgs4HgsrLgs4bgs5Zf4LKG4LKX4LK44LON4LKf4LONX+CyuOCzhuCyquCzjeCyn+CzhuCyguCyrOCysOCzjV/gs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gV/gsrbgs4Ff4LK2Jy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdBIGg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnQSBoOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVksIEEgaDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVksIEEgaDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+Cyh+CyguCypuCzgV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vgsqjgsr7gsrPgs4ZdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCwgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vgsqjgsr/gsqjgs43gsqjgs4ZdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+CyleCzhuCzguCyqOCzhuCyr10gZGRkZCwgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDgsqjgsoLgsqTgsrAnLFxuICAgICAgICAgICAgcGFzdDogJyVzIOCyueCyv+CyguCypuCzhicsXG4gICAgICAgICAgICBzOiAn4LKV4LOG4LKy4LK14LOBIOCyleCzjeCyt+Cyo+Cyl+Cys+CzgScsXG4gICAgICAgICAgICBzczogJyVkIOCyuOCzhuCyleCzhuCyguCyoeCzgeCyl+Cys+CzgScsXG4gICAgICAgICAgICBtOiAn4LKS4LKC4LKm4LOBIOCyqOCyv+CyruCyv+CytycsXG4gICAgICAgICAgICBtbTogJyVkIOCyqOCyv+CyruCyv+CytycsXG4gICAgICAgICAgICBoOiAn4LKS4LKC4LKm4LOBIOCyl+CyguCyn+CzhicsXG4gICAgICAgICAgICBoaDogJyVkIOCyl+CyguCyn+CzhicsXG4gICAgICAgICAgICBkOiAn4LKS4LKC4LKm4LOBIOCypuCyv+CyqCcsXG4gICAgICAgICAgICBkZDogJyVkIOCypuCyv+CyqCcsXG4gICAgICAgICAgICBNOiAn4LKS4LKC4LKm4LOBIOCypOCyv+CyguCyl+Cys+CzgScsXG4gICAgICAgICAgICBNTTogJyVkIOCypOCyv+CyguCyl+Cys+CzgScsXG4gICAgICAgICAgICB5OiAn4LKS4LKC4LKm4LOBIOCyteCysOCzjeCytycsXG4gICAgICAgICAgICB5eTogJyVkIOCyteCysOCzjeCytycsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1vgs6fgs6jgs6ngs6rgs6vgs6zgs63gs67gs6/gs6ZdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gsrDgsr7gsqTgs43gsrDgsr984LKs4LOG4LKz4LK/4LKX4LON4LKX4LOGfOCyruCyp+CzjeCyr+CyvuCyueCzjeCyqHzgsrjgsoLgspzgs4YvLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWVyaWRpZW0gPT09ICfgsrDgsr7gsqTgs43gsrDgsr8nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPCA0ID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgsqzgs4bgsrPgsr/gspfgs43gspfgs4YnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4LKu4LKn4LON4LKv4LK+4LK54LON4LKoJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDEwID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgsrjgsoLgspzgs4YnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgNCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4LKw4LK+4LKk4LON4LKw4LK/JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgsqzgs4bgsrPgsr/gspfgs43gspfgs4YnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CyruCyp+CzjeCyr+CyvuCyueCzjeCyqCc7XG4gICAgICAgICAg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G4gICAgICAgICAgICBMTDogJ1lZWVnrhYQgTU1NTSBE7J28JyxcbiAgICAgICAgICAgIExMTDogJ1lZWVnrhYQgTU1NTSBE7J28IEEgaDptbScsXG4gICAgICAgICAgICBMTExMOiAnWVlZWeuFhCBNTU1NIETsnbwgZGRkZCBBIGg6bW0nLFxuICAgICAgICAgICAgbDogJ1lZWVkuTU0uREQuJyxcbiAgICAgICAgICAgIGxsOiAnWVlZWeuFhCBNTU1NIETsnbwnLFxuICAgICAgICAgICAgbGxsOiAnWVlZWeuFhCBNTU1NIETsnbwgQSBoOm1tJyxcbiAgICAgICAgICAgIGxsbGw6ICdZWVlZ64WEIE1NTU0gROydvCBkZGRkIEEgaDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAn7Jik64qYIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICfrgrTsnbwgTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICfslrTsoJwgTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICfsp4Drgpzso7wgZGRkZCBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVzIO2bhCcsXG4gICAgICAgICAgICBwYXN0OiAnJXMg7KCEJyxcbiAgICAgICAgICAgIHM6ICfrqocg7LSIJyxcbiAgICAgICAgICAgIHNzOiAnJWTstIgnLFxuICAgICAgICAgICAgbTogJzHrtoQnLFxuICAgICAgICAgICAgbW06ICclZOu2hCcsXG4gICAgICAgICAgICBoOiAn7ZWcIOyLnOqwhCcsXG4gICAgICAgICAgICBoaDogJyVk7Iuc6rCEJyxcbiAgICAgICAgICAgIGQ6ICftlZjro6gnLFxuICAgICAgICAgICAgZGQ6ICclZOydvCcsXG4gICAgICAgICAgICBNOiAn7ZWcIOuLrCcsXG4gICAgICAgICAgICBNTTogJyVk64usJyxcbiAgICAgICAgICAgIHk6ICfsnbwg64WEJyxcbiAgICAgICAgICAgIHl5OiAnJWTrhYQnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0o7J28fOyblHzso7wpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RERCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn7J28JztcbiAgICAgICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfsm5QnO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3cnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ1cnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+yjvCc7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+yYpOyghHzsmKTtm4QvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgICAgICAgIHJldHVybiB0b2tlbiA9PT0gJ+yYpO2bhCc7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc1VwcGVyKSB7XG4gICAgICAgICAgICByZXR1cm4gaG91ciA8IDEyID8gJ+yYpOyghCcgOiAn7Jik7ZuE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gbW06IFtudW0gKyAnIGRlccOucWUnLCBudW0gKyAnIGRlccOucWV5YW4nXSxcbiAgICAgICAgICAgIGg6IFsnc2FldGVrJywgJ3NhZXRla8OqJ10sXG4gICAgICAgICAgICBoaDogW251bSArICcgc2FldCcsIG51bSArICcgc2FldGFuJ10sXG4gICAgICAgICAgICBkOiBbJ3JvamVrJywgJ3JvamVrw6onXSxcbiAgICAgICAgICAgIGRkOiBbbnVtICsgJyByb2onLCBudW0gKyAnIHJvamFuJ10sXG4gICAgICAgICAgICB3OiBbJ2hlZnRleWVrJywgJ2hlZnRleWVrw6onXSxcbiAgICAgICAgICAgIHd3OiBbbnVtICsgJyBoZWZ0ZScsIG51bSArICcgaGVmdGV5YW4nXSxcbiAgICAgICAgICAgIE06IFsnbWVoZWsnLCAnbWVoZWvDqiddLFxuICAgICAgICAgICAgTU06IFtudW0gKyAnIG1laCcsIG51bSArICcgbWVoYW4nXSxcbiAgICAgICAgICAgIHk6IFsnc2FsZWsnLCAnc2FsZWvDqiddLFxuICAgICAgICAgICAgeXk6IFtudW0gKyAnIHNhbCcsIG51bSArICcgc2FsYW4nXSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyBmb3JtYXRba2V5XVswXSA6IGZvcm1hdFtrZXldWzFdO1xuICAgIH1cbiAgICAvLyBmdW5jdGlvbiBvYmxpcXVlTnVtU3VmZml4KG51bSkge1xuICAgIC8vICAgICBpZihudW0uaW5jbHVkZXMoJzonKSlcbiAgICAvLyAgICAgICAgIG51bSA9IHBhcnNlSW50KG51bS5zcGxpdCgnOicpWzBdKTtcbiAgICAvLyAgICAgZWxzZVxuICAgIC8vICAgICAgICAgbnVtID0gcGFyc2VJbnQobnVtKTtcbiAgICAvLyAgICAgcmV0dXJuIG51bSA9PSAwIHx8IG51bSAlIDEwID09IDEgPyAnw6onXG4gICAgLy8gICAgICAgICAgICAgICAgICAgICAgICAgOiAobnVtID4gMTAgJiYgbnVtICUgMTA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ScsXG4gICAgICAgICAgICAn2aInOiAnMicsXG4gICAgICAgICAgICAn2aMnOiAnMycsXG4gICAgICAgICAgICAn2aQnOiAnNCcsXG4gICAgICAgICAgICAn2aUnOiAnNScsXG4gICAgICAgICAgICAn2aYnOiAnNicsXG4gICAgICAgICAgICAn2acnOiAnNycsXG4gICAgICAgICAgICAn2agnOiAnOCcsXG4gICAgICAgICAgICAn2aknOiAnOScsXG4gICAgICAgICAgICAn2aAnOiAnMCcsXG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRocyA9IFtcbiAgICAgICAgICAgICfaqdin2YbZiNmG24wg2K/ZiNmI25XZhScsXG4gICAgICAgICAgICAn2LTZiNio2KfYqicsXG4gICAgICAgICAgICAn2KbYp9iy2KfYsScsXG4gICAgICAgICAgICAn2YbbjNiz2KfZhicsXG4gICAgICAgICAgICAn2KbYp9uM2KfYsScsXG4gICAgICAgICAgICAn2K3ZiNiy25XbjNix2KfZhicsXG4gICAgICAgICAgICAn2KrbldmF2YXZiNiyJyxcbiAgICAgICAgICAgICfYptin2KgnLFxuICAgICAgICAgICAgJ9im25XbjNmE2YjZiNmEJyxcbiAgICAgICAgICAgICfYqti02LHbjNmG24wg24zbldmD25XZhScsXG4gICAgICAgICAgICAn2KrYtNix24zZhtuMINiv2YjZiNuV2YUnLFxuICAgICAgICAgICAgJ9mD2KfZhtmI2YbbjCDbjNuV2qnbldmFJyxcbiAgICAgICAgXTtcblxuICAgIHZhciBrdSA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2t1Jywge1xuICAgICAgICBtb250aHM6IG1vbnRocyxcbiAgICAgICAgbW9udGhzU2hvcnQ6IG1vbnRocyxcbiAgICAgICAgd2Vla2RheXM6XG4gICAgICAgICAgICAn24zZh+KAjNmD2LTZh+KAjNmF2YXZh+KAjF/Yr9mI2YjYtNmH4oCM2YXZhdmH4oCMX9iz247YtNmH4oCM2YXZhdmH4oCMX9qG2YjYp9ix2LTZh+KAjNmF2YXZh+KAjF/ZvtuO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AgICAgICAgICAgcmV0dXJuICfYqNmH4oCM24zYp9mG24wnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9im247ZiNin2LHZh+KAjCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9im2YfigIzZhdix24Yg2YPYp9iq2pjZhduO2LFdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb2KjZh+KAjNuM2KfZhtuMINmD2KfYqtqY2YXbjtixXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW9mD2KfYqtqY2YXbjtixXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9iv2YjbjtmG244g2YPYp9iq2pjZhduO2LFdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBb2YPYp9iq2pjZhduO2LFdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn2YTZh+KAjCAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMnLFxuICAgICAgICAgICAgczogJ9qG2YfigIzZhtivINqG2LHZg9mH4oCM24zZh+KAjNmDJyxcbiAgICAgICAgICAgIHNzOiAn2obYsdmD2YfigIwgJWQnLFxuICAgICAgICAgICAgbTogJ9uM2YfigIzZgyDYrtmI2YTZh+KAjNmDJyxcbiAgICAgICAgICAgIG1tOiAnJWQg2K7ZiNmE2YfigIzZgycsXG4gICAgICAgICAgICBoOiAn24zZh+KAjNmDINmD2KfYqtqY2YXbjtixJyxcbiAgICAgICAgICAgIGhoOiAnJWQg2YPYp9iq2pjZhduO2LEnLFxuICAgICAgICAgICAgZDogJ9uM2YfigIzZgyDalduG2pgnLFxuICAgICAgICAgICAgZGQ6ICclZCDalduG2pgnLFxuICAgICAgICAgICAgTTogJ9uM2YfigIzZgyDZhdin2YbarycsXG4gICAgICAgICAgICBNTTogJyVkINmF2KfZhtqvJyxcbiAgICAgICAgICAgIHk6ICfbjNmH4oCM2YMg2LPYp9q1JyxcbiAgICAgICAgICAgIHl5OiAnJWQg2LPYp9q1JyxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmdcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvW9mh2aLZo9mk2aXZptmn2ajZqdmgXS9nLCBmdW5jdGlvbiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgv2IwvZywgJywnKTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZ1xuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXGQvZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoLywvZywgJ9iMJyk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogNiwgLy8gU2F0dXJkYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogMTIsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDEydGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4ga3U7XG5cbn0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ICAgICAgICAgIG1tOiAnJWQg0LzSr9C906nRgicsXG4gICAgICAgICAgICBoOiAn0LHQuNGAINGB0LDQsNGCJyxcbiAgICAgICAgICAgIGhoOiAnJWQg0YHQsNCw0YInLFxuICAgICAgICAgICAgZDogJ9Cx0LjRgCDQutKv0L0nLFxuICAgICAgICAgICAgZGQ6ICclZCDQutKv0L0nLFxuICAgICAgICAgICAgTTogJ9Cx0LjRgCDQsNC5JyxcbiAgICAgICAgICAgIE1NOiAnJWQg0LDQuScsXG4gICAgICAgICAgICB5OiAn0LHQuNGAINC20YvQuycsXG4gICAgICAgICAgICB5eTogJyVkINC20YvQuycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfS0o0YfQuHzRh9GLfNGH0q980YfRgykvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYSA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIGIgPSBudW1iZXIgPj0gMTAwID8gMTAwIDogbnVsbDtcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAoc3VmZml4ZXNbbnVtYmVyXSB8fCBzdWZmaXhlc1thXSB8fCBzdWZmaXhlc1tiXSk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDcsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDd0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBreTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBMdXhlbWJvdXJn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mVyID0gcGFyc2VJbnQobnVtYmVyLCAxMCk7XG4gICAgICAgIGlmIChpc05hTihudW1iZXIpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG51bWJlciA8IDApIHtcbiAgICAgICAgICAgIC8vIE5lZ2F0aXZlIE51bWJlciAtLT4gYWx3YXlzIHRydWVcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA8IDEwKSB7XG4gICAgICAgICAgICAvLyBPbmx5IDEgZGlnaXRcbiAgICAgICAgICAgIGlmICg0IDw9IG51bWJlciAmJiBudW1iZXIgPD0gNykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA8IDEwMCkge1xuICAgICAgICAgICAgLy8gMiBkaWdpdHNcbiAgICAgICAgICAgIHZhciBsYXN0RGlnaXQgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBmaXJzdERpZ2l0ID0gbnVtYmVyIC8gMTA7XG4gICAgICAgICAgICBpZiAobGFzdERpZ2l0ID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVpZmVsZXJSZWdlbEFwcGxpZXNUb051bWJlcihmaXJzdERpZ2l0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBlaWZlbGVyUmVnZWxBcHBsaWVzVG9OdW1iZXIobGFzdERpZ2l0KTtcbiAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPCAxMDAwMCkge1xuICAgICAgICAgICAgLy8gMyBvciA0IGRpZ2l0cyAtLT4gcmVjdXJzaXZlbHkgY2hlY2sgZmlyc3QgZGlnaXRcbiAgICAgICAgICAgIHdoaWxlIChudW1iZXIgPj0gMTApIHtcbiAgICAgICAgICAgICAgICBudW1iZXIg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ICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbTGVzY2h0ZW5dIGRkZGQgW3VtXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tMZXNjaHRlXSBkZGRkIFt1bV0gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiBwcm9jZXNzRnV0dXJlVGltZSxcbiAgICAgICAgICAgIHBhc3Q6IHByb2Nlc3NQYXN0VGltZSxcbiAgICAgICAgICAgIHM6ICdlIHB1ZXIgU2Vrb25uZW4nLFxuICAgICAgICAgICAgc3M6ICclZCBTZWtvbm5lbicsXG4gICAgICAgICAgICBtOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgbW06ICclZCBNaW51dHRlbicsXG4gICAgICAgICAgICBoOiBwcm9jZXNzUmVsYXRpdmVUaW1lLFxuICAgICAgICAgICAgaGg6ICclZCBTdG9ubmVuJyxcbiAgICAgICAgICAgIGQ6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBkZDogJyVkIERlZWcnLFxuICAgICAgICAgICAgTTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIE1NOiAnJWQgTcOpaW50JyxcbiAgICAgICAgICAgIHk6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICB5eTogJyVkIEpvZXInLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn1cXC4vLFxuICAgICAgICBvcmRpbmFsOiAnJWQuJyxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdG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6peC6sOC6geC6u+C6lF/guqrgurTguofguqvgurJf4LqB4Lqx4LqZ4LqN4LqyX+C6leC6uOC6peC6sl/gup7gurDguojgurTguoFf4LqX4Lqx4LqZ4Lqn4LqyJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICfguqHgurHguofguoHguq3guplf4LqB4Lq44Lqh4Lqe4LqyX+C6oeC6teC6meC6sl/gu4DguqHguqrgurJf4Lqe4Lq24LqU4Lqq4Lqw4Lqe4LqyX+C6oeC6tOC6luC6uOC6meC6sl/guoHgu43guqXgurDguoHgurvgupRf4Lqq4Lq04LqH4Lqr4LqyX+C6geC6seC6meC6jeC6sl/gupXgurjguqXgurJf4Lqe4Lqw4LqI4Lq04LqBX+C6l+C6seC6meC6p+C6sicuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5czogJ+C6reC6suC6l+C6tOC6lF/guojgurHguplf4Lqt4Lqx4LqH4LqE4Lqy4LqZX+C6nuC6uOC6lF/gup7gurDguqvgurHgupRf4Lqq4Lq44LqBX+C7gOC6quC6u+C6sicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ+C6l+C6tOC6lF/guojgurHguplf4Lqt4Lqx4LqH4LqE4Lqy4LqZX+C6nuC6uOC6lF/gup7gurDguqvgurHgupRf4Lqq4Lq44LqBX+C7gOC6quC6u+C6sicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfgupdf4LqIX+C6reC6hF/gup5f4Lqe4LqrX+C6quC6gV/guqonLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAn4Lqn4Lqx4LqZZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gupXguq3gupngu4Dguorgurvgu4ngurJ84LqV4Lqt4LqZ4LuB4Lql4LqHLyxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gaW5wdXQgPT09ICfgupXguq3gupngu4HguqXguocnO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4LqV4Lqt4LqZ4LuA4LqK4Lq74LuJ4LqyJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgupXguq3gupngu4HguqXguocnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vguqHgurfgu4ngupngurXgu4ngu4DguqfguqXgurJdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb4Lqh4Lq34LuJ4Lqt4Lq34LuI4LqZ4LuA4Lqn4Lql4LqyXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1vguqfgurHgupldZGRkZFvgu5zgu4ngurLgu4DguqfguqXgurJdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb4Lqh4Lq34LuJ4Lqn4Lqy4LqZ4LqZ4Lq14LuJ4LuA4Lqn4Lql4LqyXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vguqfgurHgupldZGRkZFvgu4HguqXgu4nguqfgupngurXgu4ngu4DguqfguqXgurJdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn4Lqt4Lq14LqBICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclc+C6nOC7iOC6suC6meC6oeC6sicsXG4gICAgICAgICAgICBzOiAn4Lqa4LuN4LuI4LuA4LqX4Lq74LuI4Lqy4LuD4LqU4Lqn4Lq04LqZ4Lqy4LqX4Lq1JyxcbiAgICAgICAgICAgIHNzOiAnJWQg4Lqn4Lq04LqZ4Lqy4LqX4Lq1JyxcbiAgICAgICAgICAgIG06ICcxIOC6meC6suC6l+C6tScsXG4gICAgICAgICAgICBtbTogJyVkIOC6meC6suC6l+C6tScsXG4gICAgICAgICAgICBoOiAnMSDguorgurvgu4jguqfgu4LguqHguocnLFxuICAgICAgICAgICAgaGg6ICclZCDguorgurvgu4jguqfgu4LguqHguocnLFxuICAgICAgICAgICAgZDogJzEg4Lqh4Lq34LuJJyxcbiAgICAgICAgICAgIGRkOiAnJWQg4Lqh4Lq34LuJJyxcbiAgICAgICAgICAgIE06ICcxIOC7gOC6lOC6t+C6reC6mScsXG4gICAgICAgICAgICBNTTogJyVkIOC7gOC6lOC6t+C6reC6mScsXG4gICAgICAgICAgICB5OiAnMSDgupvgurUnLFxuICAgICAgICAgICAgeXk6ICclZCDgupvgurUnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvKOC6l+C6teC7iClcXGR7MSwyfS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHJldHVybiAn4LqX4Lq14LuIJyArIG51bWJlcjtcbiAgICAgICAgfSxcbiAgICB9KTtcblxuICA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mFzJyxcbiAgICAgICAgTTogJ23El251b19txJduZXNpb19txJduZXPErycsXG4gICAgICAgIE1NOiAnbcSXbmVzaWFpX23El25lc2nFs19txJduZXNpdXMnLFxuICAgICAgICB5OiAnbWV0YWlfbWV0xbNfbWV0dXMnLFxuICAgICAgICB5eTogJ21ldGFpX21ldMWzX21ldHVzJyxcbiAgICB9O1xuICAgIGZ1bmN0aW9uIHRyYW5zbGF0ZVNlY29uZHMobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXksIGlzRnV0dXJlKSB7XG4gICAgICAgIGlmICh3aXRob3V0U3VmZml4KSB7XG4gICAgICAgICAgICByZXR1cm4gJ2tlbGlvcyBzZWt1bmTEl3MnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGlzRnV0dXJlID8gJ2tlbGnFsyBzZWt1bmTFvmnFsycgOiAna2VsaWFzIHNla3VuZGVzJztcbiAgICAgICAgfVxuICAgIH1cbiAgICBmdW5jdGlvbiB0cmFuc2xhdGVTaW5ndWxhcihudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSwgaXNGdXR1cmUpIHtcbiAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXhcbiAgICAgICAgICAgID8gZm9ybXMoa2V5KVswXVxuICAgICAgICAgICAgOiBpc0Z1dHVyZVxuICAgICAgICAgICAgICA/IGZvcm1zKGtleSlbMV1cbiAgICAgICAgICAgICAgOiBmb3JtcyhrZXkpWzJdO1xuICAgIH1cbiAgICBmdW5jdGlvbiBzcGVjaWFsKG51bWJlcikge1xuICAgICAgICByZXR1cm4gbnVtYmVyICUgMTAgPT09IDAgfHwgKG51bWJlciA+IDEwICYmIG51bWJlciA8IDIwKTtcbiAgICB9XG4gICAgZnVuY3Rpb24gZm9ybXMoa2V5KSB7XG4gICAgICAgIHJldHVybiB1bml0c1trZXldLnNwbGl0KCdfJyk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIHRyYW5zbGF0ZShudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSwgaXNGdXR1cmUpIHtcbiAgICAgICAgdmFyIHJlc3VsdCA9IG51bWJlciArICcgJztcbiAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICByZXN1bHQgKyB0cmFuc2xhdGVTaW5ndWxhcihudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleVswXSwgaXNGdXR1cmUpXG4gICAgICAgICAgICApO1xuICAgICAgICB9IGVsc2UgaWYgKHdpdGhvdXRTdWZmaXgpIHtcbiAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAoc3BlY2lhbChudW1iZXIpID8gZm9ybXMoa2V5KVsxXSA6IGZvcm1zKGtleSlbMF0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIGZvcm1zKGtleSlbMV07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAoc3BlY2lhbChudW1iZXIpID8gZm9ybXMoa2V5KVsxXSA6IGZvcm1zKGtleSlbMl0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIHZhciBsdCA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ2x0Jywge1xuICAgICAgICBtb250aHM6IHtcbiAgICAgICAgICAgIGZvcm1hdDogJ3NhdXNpb192YXNhcmlvX2tvdm9fYmFsYW5kxb5pb19nZWd1xb7El3NfYmlyxb5lbGlvX2xpZXBvc19ydWdwasWrxI1pb19ydWdzxJdqb19zcGFsaW9fbGFwa3JpxI1pb19ncnVvZMW+aW8nLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgICAgIHN0YW5kYWxvbmU6XG4gICAgICAgICAgICAgICAgJ3NhdXNpc192YX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mdXR1cmU6ICdwbyAlcycsXG4gICAgICAgICAgICBwYXN0OiAncHJpZcWhICVzJyxcbiAgICAgICAgICAgIHM6IHRyYW5zbGF0ZVNlY29uZHMsXG4gICAgICAgICAgICBzczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbTogdHJhbnNsYXRlU2luZ3VsYXIsXG4gICAgICAgICAgICBtbTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgaDogdHJhbnNsYXRlU2luZ3VsYXIsXG4gICAgICAgICAgICBoaDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZDogdHJhbnNsYXRlU2luZ3VsYXIsXG4gICAgICAgICAgICBkZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgTTogdHJhbnNsYXRlU2luZ3VsYXIsXG4gICAgICAgICAgICBNTTogdHJhbnNsYXRlLFxuICAgICAgICAgICAgeTogdHJhbnNsYXRlU2luZ3VsYXIsXG4gICAgICAgICAgICB5eTogdHJhbnNsYXRlLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0tb2ppLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICctb2ppJztcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIGx0O1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IExhdHZpYW4gW2x2XVxuLy8hI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IFsnamVkYW4gc2F0JywgJ2plZG5vZyBzYXRhJ10sXG4gICAgICAgICAgICBoaDogWydzYXQnLCAnc2F0YScsICdzYXRpJ10sXG4gICAgICAgICAgICBkZDogWydkYW4nLCAnZGFuYScsICdkYW5hJ10sXG4gICAgICAgICAgICBNTTogWydtamVzZWMnLCAnbWplc2VjYScsICdtamVzZWNpJ10sXG4gICAgICAgICAgICB5eTogWydnb2RpbmEnLCAnZ29kaW5lJywgJ2dvZGluYSddLFxuICAgICAgICB9LFxuICAgICAgICBjb3JyZWN0R3JhbW1hdGljYWxDYXNlOiBmdW5jdGlvbiAobnVtYmVyLCB3b3JkS2V5KSB7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyID09PSAxXG4gICAgICAgICAgICAgICAgPyB3b3JkS2V5WzBdXG4gICAgICAgICAgICAgICAgOiBudW1iZXIgPj0gMiAmJiBudW1iZXIgPD0gNFxuICAgICAgICAgICAgICAgICAgPyB3b3JkS2V5WzFdXG4gICAgICAgICAgICAgICAgICA6IHdvcmRLZXlbMl07XG4gICAgICAgIH0sXG4gICAgICAgIHRyYW5zbGF0ZTogZnVuY3Rpb24gKG51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5KSB7XG4gICAgICAgICAgICB2YXIgd29yZEtleSA9IHRyYW5zbGF0b3Iud29yZHNba2V5XTtcbiAgICAgICAgICAgIGlmIChrZXkubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyB3b3JkS2V5WzBdIDogd29yZEtleVsxXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgbnVtYmVyICtcbiAgICAgICAgICAgICAgICAgICAgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRvci5jb3JyZWN0R3JhbW1hdGljYWxDYXNlKG51bWJlciwgd29yZEtleSlcbiAgICAgICAgICAgIC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w6ICdkZGRkLCBELiBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2RhbmFzIHVdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbc2p1dHJhIHVdIExUJyxcblxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdV0gW25lZGplbGp1XSBbdV0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t1XSBbc3JpamVkdV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdV0gW3N1Ym90dV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdV0gZGRkZCBbdV0gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2p1xI1lIHVdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGxhc3RXZWVrRGF5cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxlXSBbbmVkamVsamVdIFt1XSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdbcHJvxaFsb2ddIFtwb25lZGplbGprYV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxvZ10gW3V0b3JrYV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxlXSBbc3JpamVkZV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxvZ10gW8SNZXR2cnRrYV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxvZ10gW3BldGthXSBbdV0gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbGVdIFtzdWJvdGVdIFt1XSBMVCcsXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICByZXR1cm4gbGFzdFdlZWtEYXlzW3RoaXMuZGF5KCldO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnemEgJXMnLFxuICAgICAgICAgICAgcGFzdDogJ3ByaWplICVzJyxcbiAgICAgICAgICAgIHM6ICduZWtvbGlrbyBzZWt1bmRpJyxcbiAgICAgICAgICAgIHNzOiB0cmFuc2xhdG9yLnRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG06IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICAgbW06IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICAgaDogdHJhbnNsYXRvci50cmFuc2xhdGUsXG4gICAgICAgICAgICBoaDogdHJhbnNsYXRvci50cmFuc2xhdGUsXG4gICAgICAgICAgICBkOiAnZGFuJyxcbiAgICAgICAgICAgIGRkOiB0cmFuc2xhdG9yLnRyYW5zbGF0ZSxcbiAgICAgICAgICAgIE06ICdtamVzZWMnLFxuICAgICAgICAgICAgTU06IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICAgeTogJ2dvZGludScsXG4g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hX1TFq19XZV9UxIFpX1BhX0jEgScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdUYV9NYV9UxatfV2VfVMSBaV9QYV9IxIEnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgW2ldIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBbaV0gSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tpIHRlaWUgbWFoYW5hLCBpXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2Fwb3BvIGldIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbaV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tpbmFuYWhpIGldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbd2hha2FtdXR1bmdhIGldIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnaSByb3RvIGkgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGkgbXVhJyxcbiAgICAgICAgICAgIHM6ICd0ZSBoxJNrb25hIHJ1YXJ1YScsXG4gICAgICAgICAgICBzczogJyVkIGjEk2tvbmEnLFxuICAgICAgICAgICAgbTogJ2hlIG1lbmV0aScsXG4gICAgICAgICAgICBtbTogJyVkIG1lbmV0aScsXG4gICAgICAgICAgICBoO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gl/Qv9C10YJf0YHQsNCxJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ9C9ZV/Qv29f0LLRgl/RgdGAX9GH0LVf0L/QtV/RgWEnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnRC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9CU0LXQvdC10YEg0LLQvl0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vQo9GC0YDQtSDQstC+XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1vQktC+XSBkZGRkIFvQstC+XSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9CS0YfQtdGA0LAg0LLQvl0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9CY0LfQvNC40L3QsNGC0LDRgtCwXSBkZGRkIFvQstC+XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9CY0LfQvNC40L3QsNGC0LjQvtGCXSBkZGRkIFvQstC+XSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn0LfQsCAlcycsXG4gICAgICAgICAgICBwYXN0OiAn0L/RgNC10LQgJXMnLFxuICAgICAgICAgICAgczogJ9C90LXQutC+0LvQutGDINGB0LXQutGD0L3QtNC4JyxcbiAgICAgICAgICAgIHNzOiAnJWQg0YHQtdC60YPQvdC00LgnLFxuICAgICAgICAgICAgbTogJ9C10LTQvdCwINC80LjQvdGD0YLQsCcsXG4gICAgICAgICAgICBtbTogJyVkINC80LjQvdGD0YLQuCcsXG4gICAgICAgICAgICBoOiAn0LXQtNC10L0g0YfQsNGBJyxcbiAgICAgICAgICAgIGhoOiAnJWQg0YfQsNGB0LAnLFxuICAgICAgICAgICAgZDogJ9C10LTQtdC9INC00LXQvScsXG4gICAgICAgICAgICBkZDogJyVkINC00LXQvdCwJyxcbiAgICAgICAgICAgIE06ICfQtdC00LXQvSDQvNC10YHQtdGGJyxcbiAgICAgICAgICAgIE1NOiAnJWQg0LzQtdGB0LXRhtC4JyxcbiAgICAgICAgICAgIHk6ICfQtdC00L3QsCDQs9C+0LTQuNC90LAnLFxuICAgICAgICAgICAgeXk6ICclZCDQs9C+0LTQuNC90LgnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0tKNC10LJ80LXQvXzRgtC4fNCy0Lh80YDQuHzQvNC4KS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBsYXN0RGlnaXQgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBsYXN0MkRpZ2l0cyA9IG51bWJlciAlIDEwMDtcbiAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3QtdCyJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdDJEaWdpdHMgPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3QtdC9JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdDJEaWdpdHMgPiAxMCAmJiBsYXN0MkRpZ2l0cyA8IDIwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct0YLQuCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGxhc3REaWdpdCA9PT0gMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdCy0LgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChsYXN0RGlnaXQgPT09IDIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3RgNC4JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdERpZ2l0ID09PSA3IHx8IGxhc3REaWdpdCA9PT0gOCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdC80LgnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3RgtC4JztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN3RoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLl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C1gV/gtLXgtY3gtK/gtL5f4LS14LWGX+C0ticuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnQSBoOm1tIC3gtKjgtYEnLFxuICAgICAgICAgICAgTFRTOiAnQSBoOm1tOnNzIC3gtKjgtYEnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSwgQSBoOm1tIC3gtKjgtYEnLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZLCBBIGg6bW0gLeC0qOC1gScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+C0h+C0qOC1jeC0qOC1jV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vgtKjgtL7gtLPgtYZdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCwgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vgtIfgtKjgtY3gtKjgtLLgtYZdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+C0leC0tOC0v+C0nuC1jeC0nl0gZGRkZCwgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDgtJXgtLTgtL/gtJ7gtY3gtJ7gtY0nLFxuICAgICAgICAgICAgcGFzdDogJyVzIOC0ruC1geC1u+C0quC1jScsXG4gICAgICAgICAgICBzOiAn4LSF4LW94LSqIOC0qOC0v+C0ruC0v+C0t+C0meC1jeC0meC1vicsXG4gICAgICAgICAgICBzczogJyVkIOC0uOC1huC0leC1jeC0leC1u+C0oeC1jScsXG4gICAgICAgICAgICBtOiAn4LSS4LSw4LWBIOC0ruC0v+C0qOC0v+C0seC1jeC0seC1jScsXG4gICAgICAgICAgICBtbTogJyVkIOC0ruC0v+C0qOC0v+C0seC1jeC0seC1jScsXG4gICAgICAgICAgICBoOiAn4LSS4LSw4LWBIOC0ruC0o+C0v+C0leC1jeC0leC1guC1vCcsXG4gICAgICAgICAgICBoaDogJyVkIOC0ruC0o+C0v+C0leC1jeC0leC1guC1vCcsXG4gICAgICAgICAgICBkOiAn4LSS4LSw4LWBIOC0puC0v+C0teC0uOC0gicsXG4gICAgICAgICAgICBkZDogJyVkIOC0puC0v+C0teC0uOC0gicsXG4gICAgICAgICAgICBNOiAn4LSS4LSw4LWBIOC0ruC0vuC0uOC0gicsXG4gICAgICAgICAgICBNTTogJyVkIOC0ruC0vuC0uOC0gicsXG4gICAgICAgICAgICB5OiAn4LSS4LSw4LWBIOC0teC1vOC0t+C0gicsXG4gICAgICAgICAgICB5eTogJyVkIOC0teC1vOC0t+C0gicsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/gtLDgtL7gtKTgtY3gtLDgtL984LSw4LS+4LS14LS/4LSy4LWGfOC0ieC0muC1jeC0miDgtJXgtLTgtL/gtJ7gtY3gtJ7gtY184LS14LWI4LSV4LWB4LSo4LWN4LSo4LWH4LSw4LSCfOC0sOC0vuC0pOC1jeC0sOC0vy9pLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgKG1lcmlkaWVtID09PSAn4LSw4LS+4LSk4LWN4LSw4LS/JyAmJiBob3VyID49IDQpIHx8XG4gICAgICAgICAgICAgICAgbWVyaWRpZW0gPT09ICfgtIngtJrgtY3gtJog4LSV4LS04LS/4LSe4LWN4LSe4LWNJyB8fFxuICAgICAgICAgICAgICAgIG1lcmlkaWVtID09PSAn4LS14LWI4LSV4LWB4LSo4LWN4LSo4LWH4LSw4LSCJ1xuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+C0sOC0vuC0pOC1jeC0sOC0vyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4LSw4LS+4LS14LS/4LSy4LWGJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE3KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgtIngtJrgtY3gtJog4LSV4LS04LS/4LSe4LWN4LSe4LWNJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDIwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgtLXgtYjgtJXgtYHgtKjgtY3gtKjgtYfgtLDgtIInO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+C0sOC0vuC0pOC1jeC0sOC0vyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gbWw7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogTW9uZ29saWFuIFttbl1cbi8vISBhdXRob3IgOiBKYXZraGxhbnR1Z3MgTnlhbWRvcmogO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gICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdZWVlZLU1NLUREJyxcbiAgICAgICAgICAgIExMOiAnWVlZWSDQvtC90YsgTU1NTdGL0L0gRCcsXG4gICAgICAgICAgICBMTEw6ICdZWVlZINC+0L3RiyBNTU1N0YvQvSBEIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBZWVlZINC+0L3RiyBNTU1N0YvQvSBEIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL9Ku06h80q7QpS9pLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiBpbnB1dCA9PT0gJ9Ku0KUnO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0q7TqCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0q7QpSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9Oo0L3TqdOp0LTTqdGAXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9Cc0LDRgNCz0LDQsNGIXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ1vQmNGA0Y3RhV0gZGRkZCBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9Oo0YfQuNCz0LTTqdGAXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vTqNC90LPTqdGA0YHTqdC9XSBkZGRkIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg0LTQsNGA0LDQsCcsXG4gICAgICAgICAgICBwYXN0OiAnJXMg06nQvNC906knLFxuICAgICAgICAgICAgczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgc3M6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG1tOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoaDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZDogdHJhbnNsYXRlLFxuICAgICAgICAgICAgZGQ6IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIE06IHRyYW5zbGF0ZSxcbiAgICAgICAgICAgIE1NOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICB5OiB0cmFuc2xhdGUsXG4gICAgICAgICAgICB5eTogdHJhbnNsYXRlLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0g06nQtNOp0YAvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcg06nQtNOp0YAnO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gbW47XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogTWFyYXRoaSBbbXJdXG4vLyEgYXV0aG9yIDogSGFyc2hhZCBLYWxlIDogaHR0cHM6Ly9naXRodWIuY29tL2thbGVodlxuLy8hIGF1dGhvciA6IFZpdmVrIEF0aGFseWUgOiBodHRwczovL2dpdGh1Yi5jb20vdm5hdGhhbHllXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnXG4gICAgICAgJiYgdHlwZW9mIHJlcXVpcmUgPT09ICdmdW5jdGlvbicgPyBmYWN0b3J5KHJlcXVpcmUoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgc3ltYm9sTWFwID0ge1xuICAgICAgICAgICAgMTogJ+ClpycsXG4gICAgICAgICAgICAyOiAn4KWoJyxcbiAgICAgICAgICAgIDM6ICfgpaknLFxuICAgICAgICAgICAgNDogJ+ClqicsXG4gICAgICAgICAgICA1OiAn4KWrJyxcbiAgICAgICAgICAgIDY6ICfgpawnLFxuICAgICAgICAgICAgNzogJ+ClrScsXG4gICAgICAgICAgICA4OiAn4KWuJyxcbiAgICAgICAgICAgIDk6ICfgpa8nLFxuICAgICAgICAgICAgMDogJ+ClpicsXG4gICAgICAgIH0sXG4gICAgICAgIG51bWJlck1hcCA9IHtcbiAgICAgICAgICAgICfgpacnOiAnMScsXG4gICAgICAgICAgICAn4KWoJzogJzInLFxuICAgICAgICAgICAgJ+ClqSc6ICczJyxcbiAgICAgICAgICAgICfgpaonOiAnNCcsXG4gICAgICAgICAgICAn4KWrJzogJzUnLFxuICAgICAgICAgICAgJ+ClrCc6ICc2JyxcbiAgICAgICAgICAgICfgpa0nOiAnNycsXG4gICAgICAgICAgICAn4KWuJzogJzgnLFxuICAgICAgICAgICAgJ+Clryc6ICc5JyxcbiAgICAgICAgICAgICfgpaYnOiAnMCcsXG4gICAgICAgIH07XG5cbiAgICBmdW5jdGlvbiByZWxhdGl2ZVRpbWVNcihudW1iZXIsIHdpdGhvdXRTdWZmaXgsIHN0cmluZywgaXNGdXR1cmUpIHtcbiAgICAgICAgdmFyIG91dHB1dCA9ICcnO1xuICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCkge1xuICAgICAgICAgICAgc3dpdGNoIChzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+CkleCkvuCkueClgCDgpLjgpYfgpJXgpILgpKYnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdzcyc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpLjgpYfgpJXgpILgpKYnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdtJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CklSDgpK7gpL/gpKjgpL/gpJ8nO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpK7gpL/gpKjgpL/gpJ/gpYcnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdoJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CklSDgpKTgpL7gpLgnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdoaCc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpKTgpL7gpLgnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CklSDgpKbgpL/gpLXgpLgnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdkZCc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpKbgpL/gpLXgpLgnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CklSDgpK7gpLngpL/gpKjgpL4nO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdNTSc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpK7gpLngpL/gpKjgpYcnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICd5JzpcbiAgICAgICAgICAgICAgICAgICAgb3V0cHV0ID0gJ+Ckj+CklSDgpLXgpLDgpY3gpLcnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICd5eSc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICclZCDgpLXgpLDgpY3gpLfgpYcnO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN3aXRjaCAoc3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAncyc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICfgpJXgpL7gpLngpYAg4KS44KWH4KSV4KSC4KSm4KS+4KSCJztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnc3MnOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAnJWQg4KS44KWH4KSV4KSC4KSm4KS+4KSCJztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnbSc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICfgpI/gpJXgpL4g4KSu4KS/4KSo4KS/4KSf4KS+JztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnbW0nOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAnJWQg4KSu4KS/4KSo4KS/4KSf4KS+4KSCJztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnaCc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICfgpI/gpJXgpL4g4KSk4KS+4KS44KS+JztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnaGgnOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAnJWQg4KSk4KS+4KS44KS+4KSCJztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICfgpI/gpJXgpL4g4KSm4KS/4KS14KS44KS+JztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnZGQnOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAnJWQg4KSm4KS/4KS14KS44KS+4KSCJztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnTSc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICfgpI/gpJXgpL4g4KSu4KS54KS/4KSo4KWN4KSv4KS+JztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAnJWQg4KSu4KS54KS/4KSo4KWN4KSv4KS+4KSCJztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAneSc6XG4gICAgICAgICAgICAgICAgICAgIG91dHB1dCA9ICfgpI/gpJXgpL4g4KS14KSw4KWN4KS34KS+JztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAneXknOlxuICAgICAgICAgICAgICAgICAgICBvdXRwdXQgPSAnJWQg4KS14KSw4KWN4KS34KS+4KSCJztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG91dHB1dC5yZXBsYWNlKC8lZC9pLCBudW1iZXIpO1xuICAgIH1cblxuICAgIHZhciBtciA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ21yJywge1xuICAgICAgICBtb250aHM6ICfgpJzgpL7gpKjgpYfgpLXgpL7gpLDgpYBf4KSr4KWH4KSs4KWN4KSw4KWB4KS14KS+4KSw4KWAX+CkruCkvuCksOCljeCkml/gpI/gpKrgpY3gpLDgpL/gpLJf4KSu4KWHX+CknOClguCkqF/gpJzgpYHgpLLgpYhf4KSR4KSX4KS44KWN4KSfX+CkuOCkquCljeCkn+Clh+CkguCkrOCksF/gpJHgpJXgpY3gpJ/gpYvgpKzgpLBf4KSo4KWL4KS14KWN4KS54KWH4KSC4KSs4KSwX+CkoeCkv+CkuOClh+CkguCkrOCksCcuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4g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lZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSwgQSBoOm1tIOCkteCkvuCknOCkpOCkvicsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVksIEEgaDptbSDgpLXgpL7gpJzgpKTgpL4nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vgpIbgpJxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb4KSJ4KSm4KWN4KSv4KS+XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQsIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb4KSV4KS+4KSyXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vgpK7gpL7gpJfgpYDgpLJdIGRkZGQsIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXPgpK7gpKfgpY3gpK/gpYcnLFxuICAgICAgICAgICAgcGFzdDogJyVz4KSq4KWC4KSw4KWN4KS14KWAJyxcbiAgICAgICAgICAgIHM6IHJlbGF0aXZlVGltZU1yLFxuICAgICAgICAgICAgc3M6IHJlbGF0aXZlVGltZU1yLFxuICAgICAgICAgICAgbTogcmVsYXRpdmVUaW1lTXIsXG4gICAgICAgICAgICBtbTogcmVsYXRpdmVUaW1lTXIsXG4gICAgICAgICAgICBoOiByZWxhdGl2ZVRpbWVNcixcbiAgICAgICAgICAgIGhoOiByZWxhdGl2ZVRpbWVNcixcbiAgICAgICAgICAgIGQ6IHJlbGF0aXZlVGltZU1yLFxuICAgICAgICAgICAgZGQ6IHJlbGF0aXZlVGltZU1yLFxuICAgICAgICAgICAgTTogcmVsYXRpdmVUaW1lTXIsXG4gICAgICAgICAgICBNTTogcmVsYXRpdmVUaW1lTXIsXG4gICAgICAgICAgICB5OiByZWxhdGl2ZVRpbWVNcixcbiAgICAgICAgICAgIHl5OiByZWxhdGl2ZVRpbWVNcixcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvW+Clp+ClqOClqeClquClq+ClrOClreClruClr+Clpl0vZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlck1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC9cXGQvZywgZnVuY3Rpb24gKG1hdGNoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbE1hcFttYXRjaF07XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+CkquCkueCkvuCkn+Clh3zgpLjgpJXgpL7gpLPgpYB84KSm4KWB4KSq4KS+4KSw4KWAfOCkuOCkvuCkr+CkguCkleCkvuCks+ClgHzgpLDgpL7gpKTgpY3gpLDgpYAvLFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWVyaWRpZW0gPT09ICfgpKrgpLngpL7gpJ/gpYcnIHx8IG1lcmlkaWVtID09PSAn4KS44KSV4KS+4KSz4KWAJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChcbiAgICAgICAgICAgICAgICBtZXJpZGllbSA9PT0gJ+CkpuClgeCkquCkvuCksOClgCcgfHxcbiAgICAgICAgICAgICAgICBtZXJpZGllbSA9PT0gJ+CkuOCkvuCkr+CkguCkleCkvuCks+ClgCcgfHxcbiAgICAgICAgICAgICAgICBtZXJpZGllbSA9PT0gJ+CksOCkvuCkpOCljeCksOClgCdcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDEyID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyID49IDAgJiYgaG91ciA8IDYpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CkquCkueCkvuCkn+Clhyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4KS44KSV4KS+4KSz4KWAJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE3KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgpKbgpYHgpKrgpL7gpLDgpYAnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMjApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CkuOCkvuCkr+CkguCkleCkvuCks+ClgCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4KSw4KS+4KSk4KWN4KSw4KWAJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAwLCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNiwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNnRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mI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49IDExID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICdwZXRhbmcnIHx8IG1lcmlkaWVtID09PSAnbWFsYW0nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VycywgbWludXRlcywgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXJzIDwgMTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3BhZ2knO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VycyA8IDE1KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICd0ZW5nYWhhcmknO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VycyA8IDE5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdwZXRhbmcnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ21hbGFtJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSGFyaSBpbmkgcHVrdWxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbRXNvayBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tLZWxtYXJpbiBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFtsZXBhcyBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdkYWxhbSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgeWFuZyBsZXBhcycsXG4gICAgICAgICAgICBzOiAnYmViZXJhcGEgc2FhdCcsXG4gICAgICAgICAgICBzczogJyVkIHNhYXQnLFxuICAgICAgICAgICAgbTogJ3NlbWluaXQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW5pdCcsXG4gICAgICAgICAgICBoOiAnc2VqYW0nLFxuICAgICAgICAgICAgaGg6ICclZCBqYW0nLFxuICAgICAgICAgICAgZDogJ3NlaGFyaScsXG4gICAgICAgICAgICBkZDogJyVkIGhhcmknLFxuICAgICAgICAgICAgTTogJ3NlYnVsYW4nLFxuICAgICAgICAgICAgTU06ICclZCBidWxhbicsXG4gICAgICAgICAgICB5OiAnc2V0YWh1bicsXG4gICAgICAgICAgICB5eTogJyVkIHRhaHVuJyxcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN3RoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIG1zTXk7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogTWFsYXkgW21zXVxuLy8hIGF1dGhvciA6IFdlbGRhbiBKYW1pbGkgOiBodHRwczovL2dpdGh1Yi5jb20vd2VsZGFuXG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnXG4gICAgICAgJiYgdHlwZW9mIHJlcXVpcmUgPT09ICdmdW5jdGlvbicgPyBmYWN0b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gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBbcHVrdWxdIEhILm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBbcHVrdWxdIEhILm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL3BhZ2l8dGVuZ2FoYXJpfHBldGFuZ3xtYWxhbS8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ3BhZ2knKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAndGVuZ2FoYXJpJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDExID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICdwZXRhbmcnIHx8IG1lcmlkaWVtID09PSAnbWFsYW0nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VycywgbWludXRlcywgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXJzIDwgMTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3BhZ2knO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VycyA8IDE1KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICd0ZW5nYWhhcmknO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VycyA8IDE5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdwZXRhbmcnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ21hbGFtJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSGFyaSBpbmkgcHVrdWxdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbRXNvayBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tLZWxtYXJpbiBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFtsZXBhcyBwdWt1bF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdkYWxhbSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgeWFuZyBsZXBhcycsXG4gICAgICAgICAgICBzOiAnYmViZXJhcGEgc2FhdCcsXG4gICAgICAgICAgICBzczogJyVkIHNhYXQnLFxuICAgICAgICAgICAgbTogJ3NlbWluaXQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW5pdCcsXG4gICAgICAgICAgICBoOiAnc2VqYW0nLFxuICAgICAgICAgICAgaGg6ICclZCBqYW0nLFxuICAgICAgICAgICAgZDogJ3NlaGFyaScsXG4gICAgICAgICAgICBkZDogJyVkIGhhcmknLFxuICAgICAgICAgICAgTTogJ3NlYnVsYW4nLFxuICAgICAgICAgICAgTU06ICclZCBidWxhbicsXG4gICAgICAgICAgICB5OiAnc2V0YWh1bicsXG4gICAgICAgICAgICB5eTogJyVkIHRhaHVuJyxcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkg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ydV9EacSLZW1icnUnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OiAnSmFuX0ZyYV9NYXJfQXByX01lal/EoHVuX0x1bF9Bd3dfU2V0X090dF9Ob3ZfRGnEiycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXM6XG4gICAgICAgICAgICAnSWwtxKZhZGRfSXQtVG5lam5fSXQtVGxpZXRhX0wtRXJiZ8SnYV9JbC3EpmFtaXNfSWwtxKBpbWfEp2FfSXMtU2lidCcuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnxKZhZF9UbmVfVGxpX0VyYl/EpmFtX8SgaW1fU2liJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ8SmYV9Ubl9UbF9Fcl/EpmFfxKBpX1NpJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0lsbHVtIGZpbC1dTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tHxKdhZGEgZmlsLV1MVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2ZpbC1dTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tJbC1iaWVyYcSnIGZpbC1dTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFtsaSBnxKdhZGRhXSBbZmlsLV1MVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ2bigJkgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGlsdScsXG4gICAgICAgICAgICBzOiAnZnRpdCBzZWtvbmRpJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vrb25kaScsXG4gICAgICAgICAgICBtOiAnbWludXRhJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRpJyxcbiAgICAgICAgICAgIGg6ICdzaWVnxKdhJyxcbiAgICAgICAgICAgIGhoOiAnJWQgc2llZ8SnYXQnLFxuICAgICAgICAgICAgZDogJ8ShdXJuYXRhJyxcbiAgICAgICAgICAgIGRkOiAnJWQgxKFyYW5ldCcsXG4gICAgICAgICAgICBNOiAneGFoYXInLFxuICAgICAgICAgICAgTU06ICclZCB4aHVyJyxcbiAgICAgICAgICAgIHk6ICdzZW5hJyxcbiAgICAgICAgICAgIHl5OiAnJWQgc25pJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9wrovLFxuICAgICAgICBvcmRpbmFsOiAnJWTCuicsXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBtdDtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRp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gICAgICAgbGFzdFdlZWs6ICdb4YCV4YC84YCu4YC44YCB4YCy4YC34YCe4YCx4YCsXSBkZGRkIExUIFvhgJnhgL7hgKxdJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn4YCc4YCs4YCZ4YCK4YC64YC3ICVzIOGAmeGAvuGArCcsXG4gICAgICAgICAgICBwYXN0OiAn4YCc4YC94YCU4YC64YCB4YCy4YC34YCe4YCx4YCsICVzIOGAgCcsXG4gICAgICAgICAgICBzOiAn4YCF4YCA4YC54YCA4YCU4YC6LuGAoeGAlOGAiuGAuuGAuOGAhOGAmuGAuicsXG4gICAgICAgICAgICBzczogJyVkIOGAheGAgOGAueGAgOGAlOGAt+GAuicsXG4gICAgICAgICAgICBtOiAn4YCQ4YCF4YC64YCZ4YCt4YCU4YCF4YC6JyxcbiAgICAgICAgICAgIG1tOiAnJWQg4YCZ4YCt4YCU4YCF4YC6JyxcbiAgICAgICAgICAgIGg6ICfhgJDhgIXhgLrhgJThgKzhgJvhgK4nLFxuICAgICAgICAgICAgaGg6ICclZCDhgJThgKzhgJvhgK4nLFxuICAgICAgICAgICAgZDogJ+GAkOGAheGAuuGAm+GAgOGAuicsXG4gICAgICAgICAgICBkZDogJyVkIOGAm+GAgOGAuicsXG4gICAgICAgICAgICBNOiAn4YCQ4YCF4YC64YCcJyxcbiAgICAgICAgICAgIE1NOiAnJWQg4YCcJyxcbiAgICAgICAgICAgIHk6ICfhgJDhgIXhgLrhgJThgL7hgIXhgLonLFxuICAgICAgICAgICAgeXk6ICclZCDhgJThgL7hgIXhgLonLFxuICAgICAgICB9LFxuICAgICAgICBwcmVwYXJzZTogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cmluZy5yZXBsYWNlKC9b4YGB4YGC4YGD4YGE4YGF4YGG4YGH4YGI4YGJ4YG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pLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRC4gTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QuIE1NTU0gWVlZWSBba2wuXSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBELiBNTU1NIFlZWVkgW2tsLl0gSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tpIGRhZyBrbC5dIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbaSBtb3JnZW4ga2wuXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2tsLl0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tpIGfDpXIga2wuXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tmb3JyaWdlXSBkZGRkIFtrbC5dIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnb20gJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIHNpZGVuJyxcbiAgICAgICAgICAgIHM6ICdub2VuIHNla3VuZGVyJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VrdW5kZXInLFxuICAgICAgICAgICAgbTogJ2V0dCBtaW51dHQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dHRlcicsXG4gICAgICAgICAgICBoOiAnw6luIHRpbWUnLFxuICAgICAgICAgICAgaGg6ICclZCB0aW1lcicsXG4gICAgICAgICAgICBkOiAnw6luIGRhZycs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mUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHN5bWJvbE1hcCA9IHtcbiAgICAgICAgICAgIDE6ICfgpacnLFxuICAgICAgICAgICAgMjogJ+ClqCcsXG4gICAgICAgICAgICAzOiAn4KWpJyxcbiAgICAgICAgICAgIDQ6ICfgpaonLFxuICAgICAgICAgICAgNTogJ+ClqycsXG4gICAgICAgICAgICA2OiAn4KWsJyxcbiAgICAgICAgICAgIDc6ICfgpa0nLFxuICAgICAgICAgICAgODogJ+ClricsXG4gICAgICAgICAgICA5OiAn4KWvJyxcbiAgICAgICAgICAgIDA6ICfgpaYnLFxuICAgICAgICB9LFxuICAgICAgICBudW1iZXJNYXAgPSB7XG4gICAgICAgICAgICAn4KWnJzogJzEnLFxuICAgICAgICAgICAgJ+ClqCc6ICcyJyxcbiAgICAgICAgICAgICfgpaknOiAnMycsXG4gICAgICAgICAgICAn4KWqJzogJzQnLFxuICAgICAgICAgICAgJ+Clqyc6ICc1JyxcbiAgICAgICAgICAgICfgpawnOiAnNicsXG4gICAgICAgICAgICAn4KWtJzogJzcnLFxuICAgICAgICAgICAgJ+Clric6ICc4JyxcbiAgICAgICAgICAgICfgpa8nOiAnOScsXG4gICAgICAgICAgICAn4KWmJzogJzAnLFxuICAgICAgICB9O1xuXG4gICAgdmFyIG5lID0gbW9tZW50LmRlZmluZUxvY2FsZSgnbmUnLCB7XG4gICAgICAgIG1vbnRoczogJ+CknOCkqOCkteCksOClgF/gpKvgpYfgpKzgpY3gpLDgpYHgpLXgpLDgpYBf4KSu4KS+4KSw4KWN4KSaX+CkheCkquCljeCksOCkv+Cksl/gpK7gpIhf4KSc4KWB4KS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SB4KSdLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn4KSw4KS+4KSk4KS/Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyIDwgNCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4KSs4KS/4KS54KS+4KSoJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CkpuCkv+CkieCkgeCkuOCliycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4KS44KS+4KSB4KSdJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CksOCkvuCkpOCkvyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4KSs4KS/4KS54KS+4KSoJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE2KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfgpKbgpL/gpIngpIHgpLjgpYsnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMjApIH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mFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgbW9udGhzU2hvcnRXaXRoRG90cyA9XG4gICAgICAgICAgICAnamFuLl9mZWIuX21ydC5fYXByLl9tZWlfanVuLl9qdWwuX2F1Zy5fc2VwLl9va3QuX25vdi5fZGVjLicuc3BsaXQoJ18nKSxcbiAgICAgICAgbW9udGhzU2hvcnRXaXRob3V0RG90cyA9XG4gICAgICAgICAgICAnamFuX2ZlYl9tcnRfYXByX21laV9qdW5fanVsX2F1Z19zZXBfb2t0X25vdl9kZWMnLnNwbGl0KCdfJyksXG4gICAgICAgIG1vbnRoc1BhcnNlID0gW1xuICAgICAgICAgICAgL15qYW4vaSxcbiAgICAgICAgICAgIC9eZmViL2ksXG4gICAgICAgICAgICAvXihtYWFydHxtcnRcXC4/KSQvaSxcbiAgICAgICAgICAgIC9eYXByL2ksXG4gICAgICAgICAgICAvXm1laSQvaSxcbiAgICAgICAgICAgIC9eanVuW2kuXT8kL2ksXG4gICAgICAgICAgICAvXmp1bFtpLl0/JC9pLFxuICAgICAgICAgICAgL15hdWcvaSxcbiAgICAgICAgICAgIC9ec2VwL2ksXG4gICAgICAgICAgICAvXm9rdC9pLFxuICAgICAgICAgICAgL15ub3YvaSxcbiAgICAgICAgICAgIC9eZGVjL2ksXG4gICAgICAgIF0sXG4gICAgICAgIG1vbnRoc1JlZ2V4ID1cbiAgICAgICAgICAgIC9eKGphbnVhcml8ZmVicnVhcml8bWFhcnR8YXByaWx8bWVpfGp1W25sXWl8YXVndXN0dXN8c2VwdGVtYmVyfG9rdG9iZXJ8bm92ZW1iZXJ8ZGVjZW1iZXJ8amFuXFwuP3xmZWJcXC4/fG1ydFxcLj98YXByXFwuP3xqdVtubF1cXC4/fGF1Z1xcLj98c2VwXFwuP3xva3RcXC4/fG5vdlxcLj98ZGVjXFwuPykvaTtcblxuICAgIHZhciBubEJlID0gbW9tZW50LmRlZmluZUxvY2FsZSgnbmwtYmUnLCB7XG4gICAgICAgIG1vbnRoczogJ2phbnVhcmlfZmVicnVhcmlfbWFhcnRfYXByaWxfbWVpX2p1bmlfanVsaV9hdWd1c3R1c19zZXB0ZW1iZXJfb2t0b2Jlcl9ub3ZlbWJlcl9kZWNlbWJlcicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6IGZ1bmN0aW9uIChtLCBmb3JtYXQpIHtcbiAgICAgICAgICAgIGlmICghbSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydFdpdGhEb3RzO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvLU1NTS0vLnRlc3QoZm9ybWF0KSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydFdpdGhvdXREb3RzW20ubW9udGgoKV07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNTaG9ydFdpdGhEb3RzW20ubW9udGgoKV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgbW9udGhzUmVnZXg6IG1vbnRoc1JlZ2V4LFxuICAgICAgICBtb250aHNTaG9ydFJlZ2V4OiBtb250aHNSZWdleCxcbiAgICAgICAgbW9udGhzU3RyaWN0UmVnZXg6XG4gICAgICAgICAgICAvXihqYW51YXJpfGZlYnJ1YXJpfG1hYXJ0fGFwcmlsfG1laXxqdVtubF1pfGF1Z3VzdHVzfHNlcHRlbWJlcnxva3RvYmVyfG5vdmVtYmVyfGRlY2VtYmVyKS9pLFxuICAgICAgICBtb250aHNTaG9ydFN0cmljdFJlZ2V4OlxuICAgICAgICAgICAgL14oamFuXFwuP3xmZWJcXC4/fG1ydFxcLj98YXByXFwuP3x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ogJ1tnaXN0ZXJlbiBvbV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbYWZnZWxvcGVuXSBkZGRkIFtvbV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdvdmVyICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBnZWxlZGVuJyxcbiAgICAgICAgICAgIHM6ICdlZW4gcGFhciBzZWNvbmRlbicsXG4gICAgICAgICAgICBzczogJyVkIHNlY29uZGVuJyxcbiAgICAgICAgICAgIG06ICfDqcOpbiBtaW51dXQnLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGVuJyxcbiAgICAgICAgICAgIGg6ICfDqcOpbiB1dXInLFxuICAgICAgICAgICAgaGg6ICclZCB1dXInLFxuICAgICAgICAgICAgZDogJ8Opw6luIGRhZycsXG4gICAgICAgICAgICBkZDogJyVkIGRhZ2VuJyxcbiAgICAgICAgICAgIE06ICfDqcOpbiBtYWFuZCcsXG4gICAgICAgICAgICBNTTogJyVkIG1hYW5kZW4nLFxuICAgICAgICAgICAgeTogJ8Opw6luIGphYXInLFxuICAgICAgICAgICAgeXk6ICclZCBqYWFyJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0ZXxkZSkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIG51bWJlciArXG4gICAgICAgICAgICAgICAgKG51bWJlciA9PT0gMSB8fCBudW1iZXIgPT09IDggfHwgbnVtYmVyID49IDIwID8gJ3N0ZScgOiAnZGUnKVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLy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fb2t0Ll9ub3YuX2RlYy4nLnNwbGl0KCdfJyksXG4gICAgICAgIG1vbnRoc1Nob3J0V2l0aG91dERvdHMgPVxuICAgICAgICAgICAgJ2phbl9mZWJfbXJ0X2Fwcl9tZWlfanVuX2p1bF9hdWdfc2VwX29rdF9ub3ZfZGVjJy5zcGxpdCgnXycpLFxuICAgICAgICBtb250aHNQYXJzZSA9IFtcbiAgICAgICAgICAgIC9eamFuL2ksXG4gICAgICAgICAgICAvXmZlYi9pLFxuICAgICAgICAgICAgL14obWFhcnR8bXJ0XFwuPykkL2ksXG4gICAgICAgICAgICAvXmFwci9pLFxuICAgICAgICAgICAgL15tZWkkL2ksXG4gICAgICAgICAgICAvXmp1bltpLl0/JC9pLFxuICAgICAgICAgICAgL15qdWxbaS5dPyQvaSxcbiAgICAgICAgICAgIC9eYXVnL2ksXG4gICAgICAgICAgICAvXnNlcC9pLFxuICAgICAgICAgICAgL15va3QvaSxcbiAgICAgICAgICAgIC9ebm92L2ksXG4gICAgICAgICAgICAvXmRlYy9pLFxuICAgICAgICBdLFxuICAgICAgICBtb250aHNSZWdleCA9XG4gICAgICAgICAgICAvXihqYW51YXJpfGZlYnJ1YXJpfG1hYXJ0fGFwcmlsfG1laXxqdVtubF1pfGF1Z3VzdHVzfHNlcHRlbWJlcnxva3RvYmVyfG5vdmVtYmVyfGRlY2VtYmVyfGphblxcLj98ZmViXFwuP3xtcnRcXC4/fGFwclxcLj98anVbbmxdXFwuP3xhdWdcXC4/fHNlcFxcLj98b2t0XFwuP3xub3ZcXC4/fGRlY1xcLj8pL2k7XG5cbiAgICB2YXIgbmwgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdubCcsIHtcbiAgICAgICAgbW9udGhzOiAnamFudWFyaV9mZWJydWFyaV9tYWFydF9hcHJpbF9tZWlfanVuaV9qdWxpX2F1Z3VzdHVzX3NlcHRlbWJlcl9va3RvYmVyX25vdmVtYmVyX2RlY2VtYmVyJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDogZnVuY3Rpb24gKG0sIGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFtKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0V2l0aERvdHM7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKC8tTU1NLS8udGVzdChmb3JtYXQpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0V2l0aG91dERvdHNbbS5tb250aCgpXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc1Nob3J0V2l0aERvdHNbbS5tb250aCgpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBtb250aHNSZWdleDogbW9udGhzUmVnZXgsXG4gICAgICAgIG1vbnRoc1Nob3J0UmVnZXg6IG1vbnRoc1JlZ2V4LFxuICAgICAgICBtb250aHNTdHJpY3RSZWdleDpcbiAgICAgICAgICAgIC9eKGphbnVhcml8ZmVicnVhcml8bWFhcnR8YXByaWx8bWVpfGp1W25sXWl8YXVndXN0dXN8c2VwdGVtYmVyfG9rdG9iZXJ8bm92ZW1iZXJ8ZGVjZW1iZXIpL2ksXG4gICAgICAgIG1vbnRoc1Nob3J0U3RyaWN0UmVnZXg6XG4gICAgICAgICAgICAvXihqYW5cXC4/fGZlYlxcLj98bXJ0XFwuP3xhcHJcXC4/fG1laXxqdVtubF1cXC4/fGF1Z1xcLj98c2VwXFwuP3xva3RcXC4/fG5vdlxcLj98ZGVjXFwuPykvaSxcblxuICAgICAgICBtb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG4gICAgICAgIGxvbmdNb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG4gICAgICAgIHNob3J0TW9udGhzUGFyc2U6IG1vbnRoc1BhcnNlLFxuXG4gICAgICAgIHdlZWtkYXlzOlxuICAgICAgICAgICAgJ3pvbmRhZ19tYWFuZGFnX2RpbnNkYWdfd29lbnNkYWdfZG9uZGVyZGFnX3ZyaWpkYWdfemF0ZXJkYWcnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICd6by5fbWEuX2RpLl93by5fZG8uX3ZyLl96YS4nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAnem9fbWFfZGlfd29fZG9fdnJfemEnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzUGFyc2VFeGFjdDogdHJ1ZSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELU1NLVlZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW3ZhbmRhYWcgb21dIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbbW9yZ2VuIG9tXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW29tXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2dpc3RlcmVuIG9tXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1thZmdlbG9wZW5dIGRkZGQgW29tXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ292ZXIgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGdlbGVkZW4nLFxuICAgICAgICAgICAgczogJ2VlbiBwYWFyIHNlY29uZGVuJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2Vjb25kZW4nLFxuICAgICAgICAgICAgbTogJ8Opw6luIG1pbnV1dCcsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0ZW4nLFxuICAgICAgICAgICAgaDogJ8Opw6luIHV1cicsXG4gICAgICAgICAgICBoaDogJyVkIHV1cicsXG4gICAgICAgICAgICBkOiAnw6nDqW4gZGFnJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGFnZW4nLFxuICAgICAgICAgICAgdzogJ8Opw6luIHdlZWsnLFxuICAgICAgICAgICAgd3c6ICclZCB3ZWtlbicsXG4gICAgICAgICAgICBNOiAnw6nDqW4gbWFhbmQnLFxuICAgICAgICAgICAgTU06ICclZCBtYWFuZGVuJyxcbiAgICAgICAgICAgIHk6ICfDqcOpbiBqYWFyJyxcbiAgICAgICAgICAgIHl5OiAnJWQgamFhcicsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShzdGV8ZGUpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICBudW1iZXIgK1xuICAgICAgICAgICAgICAgIChudW1iZXIgPT09IDEgfHwgbnVtYmVyID09PSA4IHx8IG51bWJlciA+PSAyMCA/ICdzdGUnIDogJ2RlJylcbiAgICAgICAgICAgICk7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuIC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dC5fbm92Ll9kZXMuJy5zcGxpdCgnXycpLFxuICAgICAgICBtb250aHNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICB3ZWVrZGF5czogJ3N1bmRhZ19tw6VuZGFnX3R5c2RhZ19vbnNkYWdfdG9yc2RhZ19mcmVkYWdfbGF1cmRhZycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ3N1Ll9tw6UuX3R5Ll9vbi5fdG8uX2ZyLl9sYXUuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ3N1X23DpV90eV9vbl90b19mcl9sYScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QuIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdELiBNTU1NIFlZWVkgW2tsLl0gSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBELiBNTU1NIFlZWVkgW2tsLl0gSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tJIGRhZyBrbG9ra2FdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbSSBtb3Jnb24ga2xva2thXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2tsb2trYV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tJIGfDpXIga2xva2thXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tGw7hyZWfDpWFuZGVdIGRkZGQgW2tsb2trYV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdvbSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgc2lkYW4nLFxuICAgICAgICAgICAgczogJ25va3JlIHNla3VuZCcsXG4gICAgICAgICAgICBzczogJyVkIHNla3VuZCcsXG4gICAgICAgICAgICBtOiAnZWl0IG1pbnV0dCcsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0dCcsXG4gICAgICAgICAgICBoOiAnZWluIHRpbWUnLFxuICAgICAgICAgICAgaGg6ICclZCB0aW1hcicsXG4gICAgICAgICAgICBkOiAnZWluIGRhZycsXG4gICAgICAgICAgICBkZDogJyVkIGRhZ2FyJyxcbiAgICAgICAgICAgIHc6ICdlaSB2ZWtlJyxcbiAgICAgICAgICAgIHd3OiAnJWQgdmVrZXInLFxuICAgICAgICAgICAgTTogJ2VpbiBtw6VuYWQnLFxuICAgICAgICAgICAgTU06ICclZCBtw6VuYWRlcicsXG4gICAgICAgICAgICB5OiAnZWl0IMOlcicsXG4gICAgICAgICAgICB5eTogJyVkIMOlcicsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfVxcLi8sXG4gICAgICAgIG9yZGluYWw6ICclZC4nLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gbm47XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogT2NjaXRhbiwgbG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WSwgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gW2RlXSBZWVlZIFthXSBIOm1tJyxcbiAgICAgICAgICAgIGxsbGw6ICdkZGQgRCBNTU0gWVlZWSwgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW3XDqGkgYV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tkZW1hbiBhXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW2FdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbacOociBhXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW3Bhc3NhdCBhXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogXCJkJ2FxdcOtICVzXCIsXG4gICAgICAgICAgICBwYXN0OiAnZmEgJXMnLFxuICAgICAgICAgICAgczogJ3VuYXMgc2Vnb25kYXMnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWdvbmRhcycsXG4gICAgICAgICAgICBtOiAndW5hIG1pbnV0YScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0YXMnLFxuICAgICAgICAgICAgaDogJ3VuYSBvcmEnLFxuICAgICAgICAgICAgaGg6ICclZCBvcmFzJyxcbiAgICAgICAgICAgIGQ6ICd1biBqb3JuJyxcbiAgICAgICAgICAgIGRkOiAnJWQgam9ybnMnLFxuICAgICAgICAgICAgTTogJ3VuIG1lcycsXG4gICAgICAgICAgICBNTTogJyVkIG1lc2VzJyxcbiAgICAgICAgICAgIHk6ICd1biBhbicsXG4gICAgICAgICAgICB5eTogJyVkIGFucycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShyfG58dHzDqHxhKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgdmFyIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgbnVtYmVyID09PSAxXG4gICAgICAgICAgICAgICAgICAgID8gJ3InXG4gICAgICAgICAgICAgICAgICAgIDogbnVtYmVyID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgPyAnbidcbiAgICAgICAgICAgICAgICAgICAgICA6IG51bWJlciA9PT0gM1xuICAgICAgICAgICAgICAgICAgICAgICAgPyAncidcbiAgICAgICAgICAgICAgICAgICAgICAgIDogbnVtYmVyID09PSA0XG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3QnXG4gICAgICAgICAgICAgICAgICAgICAgICAgIDogJ8OoJztcbiAgICAgICAgICAgIGlmIChwZXJpb2QgPT09ICd3JyB8fCBwZXJpb2QgPT09ICdXJykge1xuICAgICAgICAgICAgICAgIG91dHB1dCA9ICdhJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gb2NMbmM7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogUHVuamFiaSAoSW5kaWEpIFtwYS1pbl1cbi8vISBhdXRob3IgOiBIYXJwcmVldCBTaW5naCA6IGh0dHBzOi8vZ2l0aHViLmNvbS9oYXJwcmVldGtoYWxzYWd0Yml0XG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnXG4gICAgICAgJiYgdHlwZW9mIHJlcXVpcmUgPT09ICdmdW5jdGlvbicgPyBmYWN0b3J5KHJlcXVpcmUoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgc3ltYm9sTWFwID0ge1xuICAgICAgICAgICAgMTogJ+CppycsXG4gICAgICAgICAgICAyOiAn4KmoJyxcbiAgICAgICAgICAgIDM6ICfgqaknLFxuICAgICAgICAgICAgNDogJ+CpqicsXG4gICAgICAgICAgICA1OiAn4KmrJyxcbiAgICAgICAgICAgIDY6ICfgqawnLFxuICAgICAgICAgICAgNzogJ+CprScsXG4gICAgICAgICAgICA4OiAn4KmuJyxcbiAgICAgICAgICAgIDk6ICfgqa8nLFxuICAgICAgICAgICAgMDogJ+CppicsXG4gICAgICAgIH0sXG4gICAgICAgIG51bWJlck1hcCA9IHtcbiAgICAgICAgICAgICfgqacnOiAnMScsXG4gICAgICAgICAgICAn4KmoJzogJzInLFxuICAgICAgICAgICAgJ+CpqSc6ICczJyxcbiAgICAgICAgICAgICfgqaonOiAnNCcsXG4gICAgICAgICAgICAn4KmrJzogJzUnLFxuICAgICAgICAgICAgJ+CprCc6ICc2JyxcbiAgICAgICAgICAgICfgqa0nOiAnNycsXG4gICAgICAgICAgICAn4KmuJzogJzgnLFxuICAgICAgICAgICAgJ+Cpryc6ICc5JyxcbiAgICAgICAgICAgICfgqaYnOiAnMCcsXG4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gOComuCosOCoteCovuCosCcuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ+CokOCopF/gqLjgqYvgqK5f4Kiu4Kmw4KiX4KiyX+CorOCpgeCop1/gqLXgqYDgqLBf4Ki44Ki84KmB4KiV4KiwX+CouOCovOCoqOCpgCcuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfgqJDgqKRf4Ki44KmL4KiuX+CoruCpsOCol+Cosl/gqKzgqYHgqKdf4Ki14KmA4KiwX+CouOCovOCpgeColeCosF/gqLjgqLzgqKjgqYAnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0EgaDptbSDgqLXgqJzgqYcnLFxuICAgICAgICAgICAgTFRTOiAnQSBoOm1tOnNzIOCoteConOCphycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZLCBBIGg6bW0g4Ki14Kic4KmHJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSwgQSBoOm1tIOCoteConOCphycsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+CoheConF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vgqJXgqLJdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnW+CoheCol+CosuCovl0gZGRkZCwgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vgqJXgqLJdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+CoquCov+Com+CosuCph10gZGRkZCwgTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyDgqLXgqL/gqbHgqJonLFxuICAgICAgICAgICAgcGFzdDogJyVzIOCoquCov+Com+CosuCphycsXG4gICAgICAgICAgICBzOiAn4KiV4KmB4KidIOCouOColeCov+CpsOConycsXG4gICAgICAgICAgICBzczogJyVkIOCouOColeCov+CpsOConycsXG4gICAgICAgICAgICBtOiAn4KiH4KiVIOCoruCov+CpsOConycsXG4gICAgICAgICAgICBtbTogJyVkIOCoruCov+CpsOConycsXG4gICAgICAgICAgICBoOiAn4KiH4Kmx4KiVIOComOCpsOCon+CovicsXG4gICAgICAgICAgICBoaDogJyVkIOComOCpsOCon+CphycsXG4gICAgICAgICAgICBkOiAn4KiH4Kmx4KiVIOCopuCov+CoqCcsXG4gICAgICAgICAgICBkZDogJyVkIOCopuCov+CoqCcsXG4gICAgICAgICAgICBNOiAn4KiH4Kmx4KiVIOCoruCoueCpgOCoqOCovicsXG4gICAgICAgICAgICBNTTogJyVkIOCoruCoueCpgOCoqOCphycsXG4gICAgICAgICAgICB5OiAn4KiH4Kmx4KiVIOCouOCovuCosicsXG4gICAgICAgICAgICB5eTogJyVkIOCouOCovuCosicsXG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1vgqafgqajgqangqargqavgqazgqa3gqa7gqa/gqaZdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIC8vIFB1bmphYmkgbm90YXRpb24gZm9yIG1lcmlkaWVtcyBhcmUgcXVpdGUgZnV6enkgaW4gcHJhY3RpY2UuIFdoaWxlIHRoZXJlIGV4aXN0c1xuICAgICAgICAvLyBhIHJpZ2lkIG5vdGlvbiBvZiBhICdQYWhhcicgaXQgaXMgbm90IHVzZWQgYXMgcmlnaWRseSBpbiBtb2Rlcm4gUHVuamFiaS5cbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+CosOCovuCopHzgqLjgqLXgqYfgqLB84Kim4KmB4Kiq4Ki54Ki/4KiwfOCouOCovOCovuCori8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+CosOCovuCopCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA8IDQgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CouOCoteCph+CosCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICfgqKbgqYHgqKrgqLngqL/gqLAnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgPj0gMTAgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CouOCovOCovuCoricpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB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dWxlICE9PSAndW5kZWZpbmVkJ1xuICAgICAgICYmIHR5cGVvZiByZXF1aXJlID09PSAnZnVuY3Rpb24nID8gZmFjdG9yeShyZXF1aXJlKCcuLi9tb21lbnQnKSkgOlxuICAgdHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIG1vbnRoc05vbWluYXRpdmUgPVxuICAgICAgICAgICAgJ3N0eWN6ZcWEX2x1dHlfbWFyemVjX2t3aWVjaWXFhF9tYWpfY3plcndpZWNfbGlwaWVjX3NpZXJwaWXFhF93cnplc2llxYRfcGHFumR6aWVybmlrX2xpc3RvcGFkX2dydWR6aWXFhCcuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICBtb250aHNTdWJqZWN0aXZlID1cbiAgICAgICAgICAgICdzdHljem5pYV9sdXRlZ29fbWFyY2Ffa3dpZXRuaWFfbWFqYV9jemVyd2NhX2xpcGNhX3NpZXJwbmlhX3dyemXFm25pYV9wYcW6ZHppZXJuaWthX2xpc3RvcGFkYV9ncnVkbmlhJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIG1vbnRoc1BhcnNlID0gW1xuICAgICAgICAgICAgL15zdHkvaSxcbiAgICAgICAgICAgIC9ebHV0L2ksXG4gICAgICAgICAgICAvXm1hci9pLFxuICAgICAgICAgICAgL15rd2kvaSxcbiAgICAgICAgICAgIC9ebWFqL2ksXG4gICAgICAgICAgICAvXmN6ZS9pLFxuICAgICAgICAgICAgL15saXAvaSxcbiAgICAgICAgICAgIC9ec2llL2ksXG4gICAgICAgICAgICAvXndyei9pLFxuICAgICAgICAgICAgL15wYcW6L2ksXG4gICAgICAgICAgICAvXmxpcy9pLFxuICAgICAgICAgICAgL15ncnUvaSxcbiAgICAgICAgXTtcbiAgICBmdW5jdGlvbiBwbHVyYWwobikge1xuICAgICAgICByZXR1cm4gbiAlIDEwIDwgNSAmJiBuICUgMTAgPiAxICYmIH5+KG4gLyAxMCkgJSAxMCAhPT0gMTtcbiAgICB9XG4gICAgZnVuY3Rpb24gdHJhbnNsYXRlKG51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5KSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBudW1iZXIgKyAnICc7XG4gICAgICAgIHN3aXRjaCAoa2V5KSB7XG4gICAgICAgICAgICBjYXNlICdzcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdzZWt1bmR5JyA6ICdzZWt1bmQnKTtcbiAgICAgICAgICAgIGNhc2UgJ20nOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4ID8gJ21pbnV0YScgOiAnbWludXTEmSc7XG4gICAgICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdtaW51dHknIDogJ21pbnV0Jyk7XG4gICAgICAgICAgICBjYXNlICdoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdnb2R6aW5hJyA6ICdnb2R6aW7EmSc7XG4gICAgICAgICAgICBjYXNlICdoaCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdnb2R6aW55JyA6ICdnb2R6aW4nKTtcbiAgICAgICAgICAgIGNhc2UgJ3d3JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ3R5Z29kbmllJyA6ICd0eWdvZG5pJyk7XG4gICAgICAgICAgICBjYXNlICdNTSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdtaWVzacSFY2UnIDogJ21pZXNpxJljeScpO1xuICAgICAgICAgICAgY2FzZSAneXknOlxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAnbGF0YScgOiAnbGF0Jyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIgcGwgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdwbCcsIHtcbiAgICAgICAgbW9udGhzOiBmdW5jdGlvbiAobW9tZW50VG9Gb3JtYXQsIGZvcm1hdCkge1xuICAgICAgICAgICAgaWYgKCFtb21lbnRUb0Zvcm1hdCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBtb250aHNOb21pbmF0aXZlO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvRCBNTU1NLy50ZXN0KGZvcm1hdCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzU3ViamVjdGl2ZVttb21lbnRUb0Zvcm1hdC5tb250aCgpXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1vbnRoc05vbWluYXRpdmVbbW9tZW50VG9Gb3JtYXQubW9udGgoKV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1vbnRoc1Nob3J0OiAnc3R5X2x1dF9tYXJfa3dpX21hal9jemVfbGlwX3NpZV93cnpfcGHFul9saXNfZ3J1Jy5zcGxpdCgnXycpLFxuICAgICAgICBtb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG4gICAgICAgIGxvbmdNb250aHNQYXJzZTogbW9udGhzUGFyc2UsXG4gICAgICAgIHNob3J0TW9udGhzUGFyc2U6IG1vbnRoc1BhcnNlLFxuICAgICAgICB3ZWVrZGF5czpcbiAgICAgICAgICAgICduaWVkemllbGFfcG9uaWVkemlhxYJla193dG9yZWtfxZtyb2RhX2N6d2FydGVrX3BpxIV0ZWtfc29ib3RhJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnbmR6X3Bvbl93dF/Fm3JfY3p3X3B0X3NvYicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdOZF9Qbl9XdF/FmnJfQ3pfUHRfU28nLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbRHppxZsgb10gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tKdXRybyBvXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tXIG5pZWR6aWVsxJkgb10gTFQnO1xuXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW1dlIHd0b3JlayBvXSBMVCc7XG5cbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbVyDFm3JvZMSZIG9dIExUJztcblxuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tXIHNvYm90xJkgb10gTFQnO1xuXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tXXSBkZGRkIFtvXSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbV2N6b3JhaiBvXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tXIHplc3rFgsSFIG5pZWR6aWVsxJkgb10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tXIHplc3rFgsSFIMWbcm9kxJkgb10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1tXIHplc3rFgsSFIHNvYm90xJkgb10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbVyB6ZXN6xYJ5XSBkZGRkIFtvXSBMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnemEgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIHRlbXUnLFxuICAgICAgICAgICAgczogJ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l9xdWFfcXVpX3NleF9zw6FiJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ2RvXzLCql8zwqpfNMKqXzXCql82wqpfc8OhJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBbZGVdIE1NTU0gW2RlXSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgW2RlXSBNTU1NIFtkZV0gWVlZWSBbw6BzXSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBbZGVdIE1NTU0gW2RlXSBZWVlZIFvDoHNdIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSG9qZSDDoHNdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbQW1hbmjDoyDDoHNdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbw6BzXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW09udGVtIMOgc10gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5kYXkoKSA9PT0gMCB8fCB0aGlzLmRheSgpID09PSA2XG4gICAgICAgICAgICAgICAgICAgID8gJ1vDmmx0aW1vXSBkZGRkIFvDoHNdIExUJyAvLyBTYXR1cmRheSArIFN1bmRheVxuICAgICAgICAgICAgICAgICAgICA6ICdbw5psdGltYV0gZGRkZCBbw6BzXSBMVCc7IC8vIE1vbmRheSAtIEZyaWRheVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnZW0gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ2jDoSAlcycsXG4gICAgICAgICAgICBzOiAncG91Y29zIHNlZ3VuZG9zJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VndW5kb3MnLFxuICAgICAgICAgICAgbTogJ3VtIG1pbnV0bycsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnV0b3MnLFxuICAgICAgICAgICAgaDogJ3VtYSBob3JhJyxcbiAgICAgICAgICAgIGhoOiAnJWQgaG9yYXMnLFxuICAgICAgICAgICAgZDogJ3VtIGRpYScsXG4gICAgICAgICAgICBkZDogJyVkIGRpYXMnLFxuICAgICAgICAgICAgTTogJ3VtIG3DqnMnLFxuICAgICAgICAgICAgTU06ICclZCBtZXNlcycsXG4gICAgICAgICAgICB5OiAndW0gYW5vJyxcbiAgICAgICAgICAgIHl5OiAnJWQgYW5vcycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfcK6LyxcbiAgICAgICAgb3JkaW5hbDogJyVkwronLFxuICAgICAgICBpbnZhbGlkRGF0ZTogJ0RhdGEgaW52w6FsaWRhJyxcbiAgICB9KTtcblxuICAgIHJldHVybiBwdEJyO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IFBvcnR1Z3Vlc2UgW3B0XVxuLy8hIGF1dGhvciA6IEplZmZlcnNvbiA6IGh0dHBzOi8vZ2l0aHViLmNvbS9qYWxleDc5XG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd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xpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBbZGVdIE1NTU0gW2RlXSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgW2RlXSBNTU1NIFtkZV0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBbZGVdIE1NTU0gW2RlXSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbSG9qZSDDoHNdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbQW1hbmjDoyDDoHNdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbw6BzXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW09udGVtIMOgc10gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5kYXkoKSA9PT0gMCB8fCB0aGlzLmRheSgpID09PSA2XG4gICAgICAgICAgICAgICAgICAgID8gJ1vDmmx0aW1vXSBkZGRkIFvDoHNdIExUJyAvLyBTYXR1cmRheSArIFN1bmRheVxuICAgICAgICAgICAgICAgICAgICA6ICdbw5psdGltYV0gZGRkZCBbw6BzXSBMVCc7IC8vIE1vbmRheSAtIEZyaWRheVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnZW0gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ2jDoSAlcycsXG4gICAgICAgICAgICBzOiAnc2VndW5kb3MnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWd1bmRvcycsXG4gICAgICAgICAgICBtOiAndW0gbWludXRvJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRvcycsXG4gICAgICAgICAgICBoOiAndW1hIGhvcmEnLFxuICAgICAgICAgICAgaGg6ICclZCBob3JhcycsXG4gICAgICAgICAgICBkOiAndW0gZGlhJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZGlhcycsXG4gICAgICAgICAgICB3OiAndW1hIHNlbWFuYScsXG4gICAgICAgICAgICB3dzogJyVkIHNlbWFuYXMnLFxuICAgICAgICAgICAgTTogJ3VtIG3DqnMnLFxuICAgICAgICAgICAgTU06ICclZCBtZXNlcycsXG4gICAgICAgICAgICB5OiAndW0gYW5vJyxcbiAgICAgICAgICAgIHl5OiAnJWQgYW5vcycsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfcK6LyxcbiAgICAgICAgb3JkaW5hbDogJyVkwronLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA0LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA0dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gcHQ7XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogUm9tYW5pYW4gW3JvXVxuLy8hIGF1dGhvciA6IFZsYWQgR3VyZGlnYSA6IGh0dHBzOi8vZ2l0aHViLmNvbS9ndXJkaWdhXG4vLyEgYXV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ICAgTDogJ0RELk1NLllZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbYXppIGxhXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW23DomluZSBsYV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtsYV0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tpZXJpIGxhXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tmb3N0YV0gZGRkZCBbbGFdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAncGVzdGUgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIMOubiB1cm3EgycsXG4gICAgICAgICAgICBzOiAnY8OidGV2YSBzZWN1bmRlJyxcbiAgICAgICAgICAgIHNzOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgbTogJ3VuIG1pbnV0JyxcbiAgICAgICAgICAgIG1tOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgaDogJ28gb3LEgycsXG4gICAgICAgICAgICBoaDogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIGQ6ICdvIHppJyxcbiAgICAgICAgICAgIGRkOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgdzogJ28gc8SDcHTEg23Dom7EgycsXG4gICAgICAgICAgICB3dzogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbC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RgdC+0LInLFxuICAgICAgICAgICAgZGQ6ICfQtNC10L3RjF/QtNC90Y9f0LTQvdC10LknLFxuICAgICAgICAgICAgd3c6ICfQvdC10LTQtdC70Y9f0L3QtdC00LXQu9C4X9C90LXQtNC10LvRjCcsXG4gICAgICAgICAgICBNTTogJ9C80LXRgdGP0YZf0LzQtdGB0Y/RhtCwX9C80LXRgdGP0YbQtdCyJyxcbiAgICAgICAgICAgIHl5OiAn0LPQvtC0X9Cz0L7QtNCwX9C70LXRgicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChrZXkgPT09ICdtJykge1xuICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyAn0LzQuNC90YPRgtCwJyA6ICfQvNC40L3Rg9GC0YMnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcgJyArIHBsdXJhbChmb3JtYXRba2V5XSwgK251bWJlcik7XG4gICAgICAgIH1cbiAgICB9XG4gICAgdmFyIG1vbnRoc1BhcnNlID0gW1xuICAgICAgICAvXtGP0L3Qsi9pLFxuICAgICAgICAvXtGE0LXQsi9pLFxuICAgICAgICAvXtC80LDRgC9pLFxuICAgICAgICAvXtCw0L/RgC9pLFxuICAgICAgICAvXtC80LBb0LnRj10vaSxcbiAgICAgICAgL17QuNGO0L0vaSxcbiAgICAgICAgL17QuNGO0LsvaSxcbiAgICAgICAgL17QsNCy0LMvaSxcbiAgICAgICAgL17RgdC10L0vaSxcbiAgICAgICAgL17QvtC60YIvaSxcbiAgICAgICAgL17QvdC+0Y8vaSxcbiAgICAgICAgL17QtNC10LovaSxcbiAgICBdO1xuXG4gICAgLy8gaHR0cDovL25ldy5ncmFtb3RhLnJ1L3NwcmF2a2EvcnVsZXMvMTM5LXByb3AgOiDCpyAxMDNcbiAgICAvLyDQodC+0LrRgNCw0YnQtdC90LjRjyDQvNC10YHRj9GG0LXQsjogaHR0cDovL25ldy5ncmFtb3RhLnJ1L3NwcmF2a2E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sINC60L7RgtC+0YDQvtC1INGB0L7QvtGC0LLQtdGC0YHRgtCy0YPQtdGCINGC0L7Qu9GM0LrQviDRgdC+0LrRgNCw0YnRkdC90L3Ri9C8INGE0L7RgNC80LDQvFxuICAgICAgICBtb250aHNTaG9ydFN0cmljdFJlZ2V4OlxuICAgICAgICAgICAgL14o0Y/QvdCyXFwufNGE0LXQstGAP1xcLnzQvNCw0YBb0YIuXXzQsNC/0YBcXC580LzQsFvRj9C5XXzQuNGO0L1b0YzRjy5dfNC40Y7Qu1vRjNGPLl180LDQstCzXFwufNGB0LXQvdGCP1xcLnzQvtC60YJcXC580L3QvtGP0LE/XFwufNC00LXQulxcLikvaSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSDptbScsXG4gICAgICAgICAgICBMVFM6ICdIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC5NTS5ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVkg0LMuJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZINCzLiwgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkg0LMuLCBIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb0KHQtdCz0L7QtNC90Y8sINCyXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9CX0LDQstGC0YDQsCwg0LJdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb0JLRh9C10YDQsCwg0LJdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBmdW5jdGlvbiAobm93KSB7XG4gICAgICAgICAgICAgICAgaWYgKG5vdy53ZWVrKCkgIT09IHRoaXMud2VlaygpKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9CSINGB0LvQtdC00YPRjtGJ0LXQtV0gZGRkZCwgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JIg0YHQu9C10LTRg9GO0YnQuNC5XSBkZGRkLCBb0LJdIExUJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vQkiDRgdC70LXQtNGD0Y7RidGD0Y5dIGRkZGQsIFvQsl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuZGF5KCkgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9CS0L5dIGRkZGQsIFvQsl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JJdIGRkZGQsIFvQsl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAobm93KSB7XG4gICAgICAgICAgICAgICAgaWYgKG5vdy53ZWVrKCkgIT09IHRoaXMud2VlaygpKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9CSINC/0YDQvtGI0LvQvtC1XSBkZGRkLCBb0LJdIExUJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vQkiDQv9GA0L7RiNC70YvQuV0gZGRkZCwgW9CyXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JIg0L/RgNC+0YjQu9GD0Y5dIGRkZGQsIFvQsl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuZGF5KCkgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9CS0L5dIGRkZGQsIFvQsl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0JJdIGRkZGQsIFvQsl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn0YfQtdGA0LXQtyAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMg0L3QsNC30LDQtCcsXG4gICAgICAgICAgICBzOiAn0L3QtdGB0LrQvtC70YzQutC+INGB0LXQutGD0L3QtCcsXG4gICAgICAgICAgICBzczogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIG06IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBtbTogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIGg6ICfRh9Cw0YEnLFxuICAgICAgICAgICAgaGg6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBkOiAn0LTQtdC90YwnLFxuICAgICAgICAgICAgZGQ6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICB3OiAn0L3QtdC00LXQu9GPJyxcbiAgICAgICAgICAgIHd3OiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgTTogJ9C80LXRgdGP0YYnLFxuICAgICAgICAgICAgTU06IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICB5OiAn0LPQvtC0JyxcbiAgICAgICAgICAgIHl5OiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv0L3QvtGH0Lh80YPRgtGA0LB80LTQvdGPfNCy0LXRh9C10YDQsC9pLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAvXijQtNC90Y980LLQtdGH0LXRgNCwKSQvLnRlc3QoaW5wdXQpO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfQvdC+0YfQuCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0YPRgtGA0LAnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9C00L3Rjyc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0LLQtdGH0LXRgNCwJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9LSjQuXzQs9C+fNGPKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdNJzpcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEREQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3QuSc7XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdCz0L4nO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3cnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ1cnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJy3Rjyc7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LF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dio2LEnLFxuICAgICAgICAgICAgJ9qK2LPZhdio2LEnLFxuICAgICAgICBdLFxuICAgICAgICBkYXlzID0gWyfYotqG2LEnLCAn2LPZiNmF2LEnLCAn2Kfasdin2LHZiCcsICfYp9ix2KjYuScsICfYrtmF2YrYsycsICfYrNmF2LknLCAn2ofZhtqH2LEnXTtcblxuICAgIHZhciBzZCA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ3NkJywge1xuICAgICAgICBtb250aHM6IG1vbnRocyxcbiAgICAgICAgbW9udGhzU2hvcnQ6IG1vbnRocyxcbiAgICAgICAgd2Vla2RheXM6IGRheXMsXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6IGRheXMsXG4gICAgICAgIHdlZWtkYXlzTWluOiBkYXlzLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRk2IwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv2LXYqNitfNi02KfZhS8sXG4gICAgICAgIGlzUE06IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICAgICAgcmV0dXJuICfYtNin2YUnID09PSBpbnB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VyLCBtaW51dGUsIGlzTG93ZXIpIHtcbiAgICAgICAgICAgIGlmIChob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9i12KjYrSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gJ9i02KfZhSc7XG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9in2oRdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb2LPagNin2rvZil0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFvYp9qz2YrZhiDZh9mB2KrZiiDYqtmKXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9qq2KfZhNmH2YddIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW9qv2LLYsdmK2YQg2YfZgdiq2YpdIGRkZGQgW9iq2YpdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg2b7ZiNihJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDYp9qzJyxcbiAgICAgICAgICAgIHM6ICfahtmG2K8g2LPZitqq2YbaiicsXG4gICAgICAgICAgICBzczogJyVkINiz2YraqtmG2oonLFxuICAgICAgICAgICAgbTogJ9mH2qog2YXZhtm9JyxcbiAgICAgICAgICAgIG1tOiAnJWQg2YXZhtm9JyxcbiAgICAgICAgICAgIGg6ICfZh9qqINqq2YTYp9qqJyxcbiAgICAgICAgICAgIGhoOiAnJWQg2qrZhNin2qonLFxuICAgICAgICAgICAgZDogJ9mH2qog2o/ZitmG2YfZhicsXG4gICAgICAgICAgICBkZDogJyVkINqP2YrZhtmH2YYnLFxuICAgICAgICAgICAgTTogJ9mH2qog2YXZh9mK2YbZiCcsXG4gICAgICAgICAgICBNTTogJyVkINmF2YfZitmG2KcnLFxuICAgICAgICAgICAgeTogJ9mH2qog2LPYp9mEJyxcbiAgICAgICAgICAgIHl5OiAnJWQg2LPYp9mEJyxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICA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OiAnTU1NTSBELiBbYi5dIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnTU1NTSBELiBbYi5dIFlZWVkgW3RpLl0gSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIE1NTU0gRC4gW2IuXSBZWVlZIFt0aS5dIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdbb3RuZSB0aV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tpaHR0aW4gdGldIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbdGldIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbaWt0ZSB0aV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbb3ZkZGl0XSBkZGRkIFt0aV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyBnZWHFvmVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdtYcWLaXQgJXMnLFxuICAgICAgICAgICAgczogJ21vYWRkZSBzZWt1bmRkYXQnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWt1bmRkYXQnLFxuICAgICAgICAgICAgbTogJ29rdGEgbWludWh0YScsXG4gICAgICAgICAgICBtbTogJyVkIG1pbnVodGF0JyxcbiAgICAgICAgICAgIGg6ICdva3RhIGRpaW1tdScsXG4gICAgICAgICAgICBoaDogJyVkIGRpaW1tdXQnLFxuICAgICAgICAgICAgZDogJ29rdGEgYmVhaXZpJyxcbiAgICAgICAgICAgIGRkOiAnJWQgYmVhaXZ2aXQnLFxuICAgICAgICAgICAgTTogJ29rdGEgbcOhbm51JyxcbiAgICAgICAgICAgIE1NOiAnJWQgbcOhbnV0JyxcbiAgICAgICAgICAgIHk6ICdva3RhIGphaGtpJyxcbiA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xuICAgICAgICAgICAgZnV0dXJlOiAnJXPgtprgt5LgtrHgt4onLFxuICAgICAgICAgICAgcGFzdDogJyVz4Laa4LanIOC2tOC3meC2uycsXG4gICAgICAgICAgICBzOiAn4Lat4Lat4LeK4La04La7IOC2muC3kuC3hOC3kuC2tOC2uicsXG4gICAgICAgICAgICBzczogJ+C2reC2reC3iuC2tOC2uyAlZCcsXG4gICAgICAgICAgICBtOiAn4La44LeS4Lax4LeS4Lat4LeK4Lat4LeU4LeAJyxcbiAgICAgICAgICAgIG1tOiAn4La44LeS4Lax4LeS4Lat4LeK4Lat4LeUICVkJyxcbiAgICAgICAgICAgIGg6ICfgtrTgt5DgtronLFxuICAgICAgICAgICAgaGg6ICfgtrTgt5DgtrogJWQnLFxuICAgICAgICAgICAgZDogJ+C2r+C3kuC2seC2uicsXG4gICAgICAgICAgICBkZDogJ+C2r+C3kuC2sSAlZCcsXG4gICAgICAgICAgICBNOiAn4La44LeP4LeD4La6JyxcbiAgICAgICAgICAgIE1NOiAn4La44LeP4LeDICVkJyxcbiAgICAgICAgICAgIHk6ICfgt4Dgt4PgtrsnLFxuICAgICAgICAgICAgeXk6ICfgt4Dgt4PgtrsgJWQnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0g4LeA4LeQ4Lax4LeSLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcg4LeA4LeQ4Lax4LeSJztcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL+C2tOC3meC2uyDgt4Dgtrvgt5R84La04LeD4LeKIOC3gOC2u+C3lHzgtrTgt5ku4LeAfOC2tC7gt4AuLyxcbiAgICAgICAgaXNQTTogZnVuY3Rpb24gKGlucHV0KSB7XG4gICAgICAgICAgICByZXR1cm4gaW5wdXQgPT09ICfgtrQu4LeALicgfHwgaW5wdX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FsKG51bWJlcikgPyAnc2VrdW5keScgOiAnc2Vrw7puZCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnc2VrdW5kYW1pJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlICdtJzogLy8gYSBtaW51dGUgLyBpbiBhIG1pbnV0ZSAvIGEgbWludXRlIGFnb1xuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4ID8gJ21pbsO6dGEnIDogaXNGdXR1cmUgPyAnbWluw7p0dScgOiAnbWluw7p0b3UnO1xuICAgICAgICAgICAgY2FzZSAnbW0nOiAvLyA5IG1pbnV0ZXMgLyBpbiA5IG1pbnV0ZXMgLyA5IG1pbnV0ZXMgYWdvXG4gICAgICAgICAgICAgICAgaWYgKHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArIChwbHVyYWwobnVtYmVyKSA/ICdtaW7DunR5JyA6ICdtaW7DunQnKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ21pbsO6dGFtaSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSAnaCc6IC8vIGFuIGhvdXIgLyBpbiBhbiBob3VyIC8gYW4gaG91ciBhZ29cbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdob2RpbmEnIDogaXNGdXR1cmUgPyAnaG9kaW51JyA6ICdob2Rpbm91JztcbiAgICAgICAgICAgIGNhc2UgJ2hoJzogLy8gOSBob3VycyAvIGluIDkgaG91cnMgLyA5IGhvdXJzIGFnb1xuICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAnaG9kaW55JyA6ICdob2TDrW4nKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ2hvZGluYW1pJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXNlICdkJzogLy8gYSBkYXkgLyBpbiBhIGRheSAvIGEgZGF5IGFnb1xuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ2RlxYgnIDogJ2TFiG9tJztcbiAgICAgICAgICAgIGNhc2UgJ2RkJzogLy8gOSBkYXlzIC8gaW4gOSBkYXlzIC8gOSBkYXlzIGFnb1xuICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAnZG5pJyA6ICdkbsOtJyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICdkxYhhbWknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgJ00nOiAvLyBhIG1vbnRoIC8gaW4gYSBtb250aCAvIGEgbW9udGggYWdvXG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbWVzaWFjJyA6ICdtZXNpYWNvbSc7XG4gICAgICAgICAgICBjYXNlICdNTSc6IC8vIDkgbW9udGhzIC8gaW4gOSBtb250aHMgLyA5IG1vbnRocyBhZ29cbiAgICAgICAgICAgICAgICBpZiAod2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgKHBsdXJhbChudW1iZXIpID8gJ21lc2lhY2UnIDogJ21lc2lhY292Jyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCArICdtZXNpYWNtaSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSAneSc6IC8vIGEgeWVhciAvIGluIGEgeWVhciAvIGEgeWVhciBhZ29cbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdyb2snIDogJ3Jva29tJztcbiAgICAgICAgICAgIGNhc2UgJ3l5JzogLy8gOSB5ZWFycyAvIGluIDkgeWVhcnMgLyA5IHllYXJzIGFnb1xuICAgICAgICAgICAgICAgIGlmICh3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAocGx1cmFsKG51bWJlcikgPyAncm9reScgOiAncm9rb3YnKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ3Jva21pJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIgc2sgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdzaycsIHtcbiAgICAgICAgbW9udGhzOiBtb250aHMsXG4gICAgICAgIG1vbnRoc1Nob3J0OiBtb250aHNTaG9ydCxcbiAgICAgICAgd2Vla2RheXM6ICduZWRlxL5hX3BvbmRlbG9rX3V0b3Jva19zdHJlZGFfxaF0dnJ0b2tfcGlhdG9rX3NvYm90YScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ25lX3BvX3V0X3N0X8WhdF9waV9zbycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICduZV9wb191dF9zdF/FoXRfcGlfc28nLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0g6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QuIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdELiBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBELiBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2RuZXMgb10gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1t6YWp0cmEgb10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdiBuZWRlxL51IG9dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2XSBkZGRkIFtvXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3Ygc3RyZWR1IG9dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdm8gxaF0dnJ0b2sgb10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2IHBpYXRvayBvXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3Ygc29ib3R1IG9dIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGFzdERheTogJ1t2xI1lcmEgb10gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbbWludWzDuiBuZWRlxL51IG9dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1ttaW51bMO9XSBkZGRkIFtvXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW21pbnVsw7ogc3RyZWR1IG9dIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1ttaW51bMO9XSBkZGRkIFtvXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW21pbnVsw7ogc29ib3R1IG9dIExUJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICd6YSAlcycsXG4gICAgICAgICAgICBwYXN0OiAncHJlZCAlcycsXG4gICAgICAgICAgICBzOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBzczogdHJhbnNsYXRlLFxuICAgICAgICAgICAgbTogdHJhbnNsYXRlLFxu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UoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICBmdW5jdGlvbiBwcm9jZXNzUmVsYXRpdmVUaW1lKG51bWJlciwgd2l0aG91dFN1ZmZpeCwga2V5LCBpc0Z1dHVyZSkge1xuICAgICAgICB2YXIgcmVzdWx0ID0gbnVtYmVyICsgJyAnO1xuICAgICAgICBzd2l0Y2ggKGtleSkge1xuICAgICAgICAgICAgY2FzZSAncyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmVcbiAgICAgICAgICAgICAgICAgICAgPyAnbmVrYWogc2VrdW5kJ1xuICAgICAgICAgICAgICAgICAgICA6ICduZWthaiBzZWt1bmRhbWknO1xuICAgICAgICAgICAgY2FzZSAnc3MnOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggPyAnc2VrdW5kbycgOiAnc2VrdW5kaSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnc2VrdW5kaScgOiAnc2VrdW5kYWgnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyIDwgNSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdzZWt1bmRlJyA6ICdzZWt1bmRhaCc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9ICdzZWt1bmQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICAgICAgY2FzZSAnbSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyAnZW5hIG1pbnV0YScgOiAnZW5vIG1pbnV0byc7XG4gICAgICAgICAgICBjYXNlICdtbSc6XG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCA/ICdtaW51dGEnIDogJ21pbnV0byc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbWludXRpJyA6ICdtaW51dGFtYSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPCA1KSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ21pbnV0ZScgOiAnbWludXRhbWknO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ21pbnV0JyA6ICdtaW51dGFtaSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICBjYXNlICdoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gd2l0aG91dFN1ZmZpeCA/ICdlbmEgdXJhJyA6ICdlbm8gdXJvJztcbiAgICAgICAgICAgIGNhc2UgJ2hoJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4ID8gJ3VyYScgOiAndXJvJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICd1cmknIDogJ3VyYW1hJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA8IDUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAndXJlJyA6ICd1cmFtaSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAndXInIDogJ3VyYW1pJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ2VuIGRhbicgOiAnZW5pbSBkbmVtJztcbiAgICAgICAgICAgIGNhc2UgJ2RkJzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ2RhbicgOiAnZG5lbSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChudW1iZXIgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnZG5pJyA6ICdkbmV2b21hJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdkbmknIDogJ2RuZXZpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ2VuIG1lc2VjJyA6ICdlbmltIG1lc2VjZW0nO1xuICAgICAgICAgICAgY2FzZSAnTU0nOlxuICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbWVzZWMnIDogJ21lc2VjZW0nO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ21lc2VjYScgOiAnbWVzZWNlbWEnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyIDwgNSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdtZXNlY2UnIDogJ21lc2VjaSc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IHdpdGhvdXRTdWZmaXggfHwgaXNGdXR1cmUgPyAnbWVzZWNldicgOiAnbWVzZWNpJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIGNhc2UgJ3knOlxuICAgICAgICAgICAgICAgIHJldHVybiB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ2VubyBsZXRvJyA6ICdlbmltIGxldG9tJztcbiAgICAgICAgICAgIGNhc2UgJ3l5JzpcbiAgICAgICAgICAgICAgICBpZiAobnVtYmVyID09PSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSB3aXRob3V0U3VmZml4IHx8IGlzRnV0dXJlID8gJ2xldG8nIDogJ2xldG9tJztcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG51bWJlciA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdsZXRpJyA6ICdsZXRvbWEnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtYmVyIDwgNSkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdsZXRhJyA6ICdsZXRpJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gd2l0aG91dFN1ZmZpeCB8fCBpc0Z1dHVyZSA/ICdsZXQnIDogJ2xldGknO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmFyIHNsID0gbW9tZW50LmRlZmluZUxvY2FsZSgnc2wnLCB7XG4gICAgICAgIG1vbnRoczogJ2phbnVhcl9mZWJydWFyX21hcmVjX2FwcmlsX21hal9qdW5pal9qdWxpal9hdmd1c3Rfc2VwdGVtYmVyX29rdG9iZXJfbm92ZW1iZXJfZGVjZW1iZXInLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ2phbi5fZmViLl9tYXIuX2Fwci5fbWFqLl9qdW4uX2p1bC5fYXZnLl9zZXAuX29rdC5fbm92Ll9kZWMuJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIG1vbnRoc1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIHdlZWtkYXlzOiAnbmVkZWxqYV9wb25lZGVsamVrX3RvcmVrX3NyZWRhX8SNZXRydGVrX3BldGVrX3NvYm90YScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ25lZC5fcG9uLl90b3IuX3NyZS5fxI1ldC5fcGV0Ll9zb2IuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ25lX3BvX3RvX3NyX8SNZV9wZV9zbycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0RELiBNTS4gWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QuIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdELiBNTU1NIFlZWVkgSDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRC4gTU1NTSBZWVlZIEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tkYW5lcyBvYl0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tqdXRyaSBvYl0gTFQnLFxuXG4gICAgICAgICAgICBuZXh0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodGhpcy5kYXkoKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2XSBbbmVkZWxqb10gW29iXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ZdIFtzcmVkb10gW29iXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ZdIFtzb2JvdG9dIFtvYl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1t2XSBkZGRkIFtvYl0gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiAnW3bEjWVyYWogb2JdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ByZWrFoW5qb10gW25lZGVsam9dIFtvYl0gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1twcmVqxaFuam9dIFtzcmVkb10gW29iXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3ByZWrFoW5qb10gW3NvYm90b10gW29iXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICA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ICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tTb3QgbsOrXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW05lc8OrciBuw6tdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbbsOrXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0RqZSBuw6tdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnZGRkZCBbZSBrYWx1YXIgbsOrXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ27DqyAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMgbcOrIHBhcsOrJyxcbiAgICAgICAgICAgIHM6ICdkaXNhIHNla29uZGEnLFxuICAgICAgICAgICAgc3M6ICclZCBzZWtvbmRhJyxcbiAgICAgICAgICAgIG06ICduasOrIG1pbnV0w6snLFxuICAgICAgICAgICAgbW06ICclZCBtaW51dGEnLFxuICAgICAgICAgICAgaDogJ25qw6sgb3LDqycsXG4gICAgICAgICAgICBoaDogJyVkIG9yw6snLFxuICAgICAgICAgICAgZDogJ25qw6sgZGl0w6snLFxuICAgICAgICAgICAgZGQ6ICclZCBkaXTDqycsXG4gICAgICAgICAgICBNOiAnbmrDqyBtdWFqJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbXVhaicsXG4gICAgICAgICAgICB5OiAnbmrDqyB2aXQnLFxuICAgICAgICAgICAgeXk6ICclZCB2aXRlJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9XFwuLyxcbiAgICAgICA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G1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHRyYW5zbGF0b3IgPSB7XG4gICAgICAgIHdvcmRzOiB7XG4gICAgICAgICAgICAvL0RpZmZlcmVudCBncmFtbWF0aWNhbCBjYXNlc1xuICAgICAgICAgICAgc3M6IFsn0YHQtdC60YPQvdC00LAnLCAn0YHQtdC60YPQvdC00LUnLCAn0YHQtdC60YPQvdC00LgnXSxcbiAgICAgICAgICAgIG06IFsn0ZjQtdC00LDQvSDQvNC40L3Rg9GCJywgJ9GY0LXQtNC90L7QsyDQvNC40L3Rg9GC0LAnXSxcbiAgICAgICAgICAgIG1tOiBbJ9C80LjQvdGD0YInLCAn0LzQuNC90YPRgtCwJywgJ9C80LjQvdGD0YLQsCddLFxuICAgICAgICAgICAgaDogWyfRmNC10LTQsNC9INGB0LDRgicsICfRmNC10LTQvdC+0LMg0YHQsNGC0LAnXSxcbiAgICAgICAgICAgIGhoOiBbJ9GB0LDRgicsICfRgdCw0YLQsCcsICfRgdCw0YLQuCddLFxuICAgICAgICAgICAgZDogWyfRmNC10LTQsNC9INC00LDQvScsICfRmNC10LTQvdC+0LMg0LTQsNC90LAnXSxcbiAgICAgICAgICAgIGRkOiBbJ9C00LDQvScsICfQtNCw0L3QsCcsICfQtNCw0L3QsCddLFxuICAgICAgICAgICAgTTogWyfRmNC10LTQsNC9INC80LXRgdC10YYnLCAn0ZjQtdC00L3QvtCzINC80LXRgdC10YbQsCddLFxuICAgICAgICAgICAgTU06IFsn0LzQtdGB0LXRhicsICfQvNC10YHQtdGG0LAnLCAn0LzQtdGB0LXRhtC4J10sXG4gICAgICAgICAgICB5OiBbJ9GY0LXQtNC90YMg0LPQvtC00LjQvdGDJywgJ9GY0LXQtNC90LUg0LPQvtC00LjQvdC1J10sXG4gICAgICAgICAgICB5eTogWyfQs9C+0LTQuNC90YMnLCAn0LPQvtC00LjQvdC1JywgJ9Cz0L7QtNC40L3QsCddLFxuICAgICAgICB9LFxuICAgICAgICBjb3JyZWN0R3JhbW1hdGljYWxDYXNlOiBmdW5jdGlvbiAobnVtYmVyLCB3b3JkS2V5KSB7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgbnVtYmVyICUgMTAgPj0gMSAmJlxuICAgICAgICAgICAgICAgIG51bWJlciAlIDEwIDw9IDQgJiZcbiAgICAgICAgICAgICAgICAobnVtYmVyICUgMTAwIDwgMTAgfHwgbnVtYmVyICUgMTAwID49IDIwKVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciAlIDEwID09PSAxID8gd29yZEtleVswXSA6IHdvcmRLZXlbMV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gd29yZEtleVsyXTtcbiAgICAgICAgfSxcbiAgICAgICAgdHJhbnNsYXRlOiBmdW5jdGlvbiAobnVtYmVyLCB3aXRob3V0U3VmZml4LCBrZXksIGlzRnV0dXJlKSB7XG4gICAgICAgICAgICB2YXIgd29yZEtleSA9IHRyYW5zbGF0b3Iud29yZHNba2V5XSxcbiAgICAgICAgICAgICAgICB3b3JkO1xuXG4gICAgICAgICAgICBpZiAoa2V5Lmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgICAgIC8vIE5vbWluYXRpdlxuICAgICAgICAgICAgICAgIGlmIChrZXkgPT09ICd5JyAmJiB3aXRob3V0U3VmZml4KSByZXR1cm4gJ9GY0LXQtNC90LAg0LPQvtC00LjQvdCwJztcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgfHwgd2l0aG91dFN1ZmZpeCA/IHdvcmRLZXlbMF0gOiB3b3JkS2V5WzFdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB3b3JkID0gdHJhbnNsYXRvci5jb3JyZWN0R3JhbW1hdGljYWxDYXNlKG51bWJlciwgd29yZEtleSk7XG4gICAgICAgICAgICAvLyBOb21pbmF0aXZcbiAgICAgICAgICAgIGlmIChrZXkgPT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PQsS4nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn0L3QtV/Qv9C+X9GD0YJf0YHRgF/Rh9C1X9C/0LVf0YHRgycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0QuIE0uIFlZWVkuJyxcbiAgICAgICAgICAgIExMOiAnRC4gTU1NTSBZWVlZLicsXG4gICAgICAgICAgICBMTEw6ICdELiBNTU1NIFlZWVkuIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQuIE1NTU0gWVlZWS4gSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW9C00LDQvdCw0YEg0YNdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb0YHRg9GC0YDQsCDRg10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb0YNdIFvQvdC10LTQtdGZ0YNdIFvRg10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vRg10gW9GB0YDQtdC00YNdIFvRg10gTFQnO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vRg10gW9GB0YPQsdC+0YLRg10gW9GDXSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW9GDXSBkZGRkIFvRg10gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiAnW9GY0YPRh9C1INGDXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBsYXN0V2Vla0RheXMgPSBbXG4gICAgICAgICAgICAgICAgICAgICdb0L/RgNC+0YjQu9C1XSBb0L3QtdC00LXRmdC1XSBb0YNdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1vQv9GA0L7RiNC70L7Qs10gW9C/0L7QvdC10LTQtdGZ0LrQsF0gW9GDXSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdb0L/RgNC+0YjQu9C+0LNdIFvRg9GC0L7RgNC60LBdIFvRg10gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW9C/0YDQvtGI0LvQtV0gW9GB0YDQtdC00LVdIFvRg10gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW9C/0YDQvtGI0LvQvtCzXSBb0YfQtdGC0LLRgNGC0LrQsF0gW9GDXSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdb0L/RgNC+0YjQu9C+0LNdIFvQv9C10YLQutCwXSBb0YNdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1vQv9GA0L7RiNC70LVdIFvRgdGD0LHQvtGC0LVdIFvRg10gTFQnLFxuICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgcmV0dXJuIGxhc3RXZWVrRGF5c1t0aGlzLmRheSgpXTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgIC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AgICAgICAgICAgIG1tOiBbJ21pbnV0JywgJ21pbnV0YScsICdtaW51dGEnXSxcbiAgICAgICAgICAgIGg6IFsnamVkYW4gc2F0JywgJ2plZG5vZyBzYXRhJ10sXG4gICAgICAgICAgICBoaDogWydzYXQnLCAnc2F0YScsICdzYXRpJ10sXG4gICAgICAgICAgICBkOiBbJ2plZGFuIGRhbicsICdqZWRub2cgZGFuYSddLFxuICAgICAgICAgICAgZGQ6IFsnZGFuJywgJ2RhbmEnLCAnZGFuYSddLFxuICAgICAgICAgICAgTTogWydqZWRhbiBtZXNlYycsICdqZWRub2cgbWVzZWNhJ10sXG4gICAgICAgICAgICBNTTogWydtZXNlYycsICdtZXNlY2EnLCAnbWVzZWNpJ10sXG4gICAgICAgICAgICB5OiBbJ2plZG51IGdvZGludScsICdqZWRuZSBnb2RpbmUnXSxcbiAgICAgICAgICAgIHl5OiBbJ2dvZGludScsICdnb2RpbmUnLCAnZ29kaW5hJ10sXG4gICAgICAgIH0sXG4gICAgICAgIGNvcnJlY3RHcmFtbWF0aWNhbENhc2U6IGZ1bmN0aW9uIChudW1iZXIsIHdvcmRLZXkpIHtcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICBudW1iZXIgJSAxMCA+PSAxICYmXG4gICAgICAgICAgICAgICAgbnVtYmVyICUgMTAgPD0gNCAmJlxuICAgICAgICAgICAgICAgIChudW1iZXIgJSAxMDAgPCAxMCB8fCBudW1iZXIgJSAxMDAgPj0gMjApXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICUgMTAgPT09IDEgPyB3b3JkS2V5WzBdIDogd29yZEtleVsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB3b3JkS2V5WzJdO1xuICAgICAgICB9LFxuICAgICAgICB0cmFuc2xhdGU6IGZ1bmN0aW9uIChudW1iZXIsIHdpdGhvdXRTdWZmaXgsIGtleSwgaXNGdXR1cmUpIHtcbiAgICAgICAgICAgIHZhciB3b3JkS2V5ID0gdHJhbnNsYXRvci53b3Jkc1trZXldLFxuICAgICAgICAgICAgICAgIHdvcmQ7XG5cbiAgICAgICAgICAgIGlmIChrZXkubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICAgICAgLy8gTm9taW5hdGl2XG4gICAgICAgICAgICAgICAgaWYgKGtleSA9PT0gJ3knICYmIHdpdGhvdXRTdWZmaXgpIHJldHVybiAnamVkbmEgZ29kaW5hJztcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNGdXR1cmUgfHwgd2l0aG91dFN1ZmZpeCA/IHdvcmRLZXlbMF0gOiB3b3JkS2V5WzFdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB3b3JkID0gdHJhbnNsYXRvci5jb3JyZWN0R3JhbW1hdGljYWxDYXNlKG51bWJlciwgd29yZEtleSk7XG4gICAgICAgICAgICAvLyBOb21pbmF0aXZcbiAgICAgICAgICAgIGlmIChrZXkgPT09ICd5eScgJiYgd2l0aG91dFN1ZmZpeCAmJiB3b3JkID09PSAnZ29kaW51Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnIGdvZGluYSc7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnICcgKyB3b3JkO1xuICAgICAgICB9LFxuICAgIH07XG5cbiAgICB2YXIgc3IgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCdzcicsIHtcbiAgICAgICAgbW9udGhzOiAnamFudWFyX2ZlYnJ1YXJfbWFydF9hcHJpbF9tYWpfanVuX2p1bF9hdmd1c3Rfc2VwdGVtYmFyX29rdG9iYXJfbm92ZW1iYXJfZGVjZW1iYXInLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ2phbi5fZmViLl9tYXIuX2Fwci5fbWFqX2p1bl9qdWxfYXZnLl9zZXAuX29rdC5fbm92Ll9kZWMuJy5zcGxpdCgnXycpLFxuICAgICAgICBtb250aHNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICB3ZWVrZGF5czogJ25lZGVsamFfcG9uZWRlbGpha191dG9yYWtfc3JlZGFfxI1ldHZydGFrX3BldGFrX3N1Ym90YScuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ25lZC5fcG9uLl91dG8uX3NyZS5fxI1ldC5fcGV0Ll9zdWIuJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ25lX3BvX3V0X3NyX8SNZV9wZV9zdScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNQYXJzZUV4YWN0OiB0cnVlLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0g6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0QuIE0uIFlZWVkuJyxcbiAgICAgICAgICAgIExMOiAnRC4gTU1NTSBZWVlZLicsXG4gICAgICAgICAgICBMTEw6ICdELiBNTU1NIFlZWVkuIEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQuIE1NTU0gWVlZWS4gSDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2RhbmFzIHVdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbc3V0cmEgdV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMuZGF5KCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdV0gW25lZGVsanVdIFt1XSBMVCc7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnW3VdIFtzcmVkdV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA2OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdV0gW3N1Ym90dV0gW3VdIExUJztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdbdV0gZGRkZCBbdV0gTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2p1xI1lIHVdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGxhc3RXZWVrRGF5cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxlXSBbbmVkZWxqZV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICAgICAgJ1twcm/FoWxvZ10gW3BvbmVkZWxqa2FdIFt1XSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdbcHJvxaFsb2ddIFt1dG9ya2FdIFt1XSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdbcHJvxaFsZV0gW3NyZWRlXSBbdV0gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbG9nXSBbxI1ldHZydGthXSBbdV0gTFQnLFxuICAgICAgICAgICAgICAgICAgICAnW3Byb8WhbG9nXSBbcGV0a2FdIFt1XSBMVCcsXG4gICAgICAgICAgICAgICAgICAgICdbcHJvxaFsZV0gW3N1Ym90ZV0gW3VdIExUJyxcbiAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgIHJldHVybiBsYXN0V2Vla0RheXNbdGhpcy5kYXkoKV07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICd6YSAlcycsXG4gICAgICAgICAgICBwYXN0OiAncHJlICVzJyxcbiAgICAgICAgICAgIHM6ICduZWtvbGlrbyBzZWt1bmRpJyxcbiAgICAgICAgICAgIHNzOiB0cmFuc2xhdG9yLnRyYW5zbGF0ZSxcbiAgICAgICAgICAgIG06IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICAgbW06IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICAgaDogdHJhbnNsYXRvci50cmFuc2xhdGUsXG4gICAgICAgICAgICBoaDogdHJhbnNsYXRvci50cmFuc2xhdGUsXG4gICAgICAgICAgICBkOiB0cmFuc2xhdG9yLnRyYW5zbGF0ZSxcbiAgICAgICAgICAgIGRkOiB0cmFuc2xhdG9yLnRyYW5zbGF0ZSxcbiAgICAgICAgICAgIE06IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICAgTU06IHRyYW5zbGF0b3IudHJhbnNsYXRlLFxuICAgICAgICAgICAgeTogdHJhbnNsYXRvci50cmFuc2xhdGUsXG4gICAgICAgICAgICB5eTogdHJhbnNsYXRvci50cmFuc2xhdGUsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfVxcLi8sXG4gICAgICAgIG9yZGluYWw6ICclZC4nLFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA3LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA3dGggaXMgdGhlIGZpcnN0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lXSBbbmdhXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ25nYSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnd2VudGVrYSBuZ2EgJXMnLFxuICAgICAgICAgICAgczogJ2VtaXp1endhbmEgbG9tY2FuZScsXG4gICAgICAgICAgICBzczogJyVkIG16dXp3YW5hJyxcbiAgICAgICAgICAgIG06ICd1bXp1enUnLFxuICAgICAgICAgICAgbW06ICclZCBlbWl6dXp1JyxcbiAgICAgICAgICAgIGg6ICdsaWhvcmEnLFxuICAgICAgICAgICAgaGg6ICclZCBlbWFob3JhJyxcbiAgICAgICAgICAgIGQ6ICdsaWxhbmdhJyxcbiAgICAgICAgICAgIGRkOiAnJWQgZW1hbGFuZ2EnLFxuICAgICAgICAgICAgTTogJ2lueWFuZ2EnLFxuICAgICAgICAgICAgTU06ICclZCB0aW55YW5nYScsXG4gICAgICAgICAgICB5OiAndW1ueWFrYScsXG4gICAgICAgICAgICB5eTogJyVkIGltaW55YWthJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL2VrdXNlbml8ZW1pbml8ZW50c2FtYmFtYXxlYnVzdWt1LyxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VycywgbWludXRlcywgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXJzIDwgMTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2VrdXNlbmknO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VycyA8IDE1KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICdlbWluaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXJzIDwgMTkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2VudHNhbWJhbWEnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2VidXN1a3UnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbUhvdXI6IGZ1bmN0aW9uIChob3VyLCBtZXJpZGllbSkge1xuICAgICAgICAgICAgaWYgKGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAobWVyaWRpZW0gPT09ICdla3VzZW5pJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ2VtaW5pJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDExID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWVyaWRpZW0gPT09ICdlbnRzYW1iYW1hJyB8fCBtZXJpZGllbSA9PT0gJ2VidXN1a3UnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGhvdXIgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfS8sXG4gICAgICAgIG9yZGluYWw6ICclZCcsXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDQsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiBzcztcblxufSkpKTtcbiIsIi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fbMO2cmRhZycuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNTaG9ydDogJ3PDtm5fbcOlbl90aXNfb25zX3Rvcl9mcmVfbMO2cicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICdzw7ZfbcOlX3RpX29uX3RvX2ZyX2zDticuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ1lZWVktTU0tREQnLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBba2wuXSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCBEIE1NTU0gWVlZWSBba2wuXSBISDptbScsXG4gICAgICAgICAgICBsbGw6ICdEIE1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIGxsbGw6ICdkZGQgRCBNTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0lkYWddIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbSW1vcmdvbl0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tJZ8Olcl0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdbUMOlXSBkZGRkIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW0ldIGRkZGRbc10gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdvbSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnZsO2ciAlcyBzZWRhbicsXG4gICAgICAgICAgICBzOiAnbsOlZ3JhIHNla3VuZGVyJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VrdW5kZXInLFxuICAgICAgICAgICAgbTogJ2VuIG1pbnV0JyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRlcicsXG4gICAgICAgICAgICBoOiAnZW4gdGltbWUnLFxuICAgICAgICAgICAgaGg6ICclZCB0aW1tYXInLFxuICAgICAgICAgICAgZDogJ2VuIGRhZycsXG4gICAgICAgICAgICBkZDogJyVkIGRhZ2FyJyxcbiAgICAgICAgICAgIE06ICdlbiBtw6VuYWQnLFxuICAgICAgICAgICAgTU06ICclZCBtw6VuYWRlcicsXG4gICAgICAgICAgICB5OiAnZXR0IMOlcicsXG4gICAgICAgICAgICB5eTogJyVkIMOlcicsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfShcXDplfFxcOmEpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIGIgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBvdXRwdXQgPVxuICAgICAgICAgICAgICAgICAgICB+figobnVtYmVyICUgMTAwKSAvIDEwKSA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgPyAnOmUnXG4gICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnOmEnXG4gICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJzphJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gM1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnOmUnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICc6ZSc7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgb3V0cHV0O1xuICAgICAgICB9LFxuICAgICAgICB3ZWV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ExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbamFuYV0gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdbd2lraSBpbGl5b3BpdGFdIGRkZGQgW3NhYXRdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMgYmFhZGF5ZScsXG4gICAgICAgICAgICBwYXN0OiAndG9rZWEgJXMnLFxuICAgICAgICAgICAgczogJ2hpdmkgcHVuZGUnLFxuICAgICAgICAgICAgc3M6ICdzZWt1bmRlICVkJyxcbiAgICAgICAgICAgIG06ICdkYWtpa2EgbW9qYScsXG4gICAgICAgICAgICBtbTogJ2Rha2lrYSAlZCcsXG4gICAgICAgICAgICBoOiAnc2FhIGxpbW9qYScsXG4gICAgICAgICAgICBoaDogJ21hc2FhICVkJyxcbiAgICAgICAgICAgIGQ6ICdzaWt1IG1vamEnLFxuICAgICAgICAgICAgZGQ6ICdzaWt1ICVkJyxcbiAgICAgICAgICAgIE06ICdtd2V6aSBtbW9qYScsXG4gICAgICAgICAgICBNTTogJ21pZXppICVkJyxcbiAgICAgICAgICAgIHk6ICdtd2FrYSBtbW9qYScsXG4gICAgICAgICAgICB5eTogJ21pYWthICVkJyxcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN3RoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIHN3O1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IFRhbWlsIFt0YV1cbi8vISBhdXRob3IgOiBBcmp1bmt1bWFyIEtyaXNobmFtb29ydGh5IDogaHR0cHM6Ly9naXRodWIuY29tL3RrMTIwNDA0XG5cbjsoZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkge1xuICAgdHlwZW9mIGV4cG9ydHMgPT09ICdvYmplY3QnICYmIHR5cGVvZiBtb2R1bGUgIT09ICd1bmRlZmluZWQnXG4gICAgICAgJiYgdHlwZW9mIHJlcXVpcmUgPT09ICdmdW5jdGlvbicgPyBmYWN0b3J5KHJlcXVpcmUoJy4uL21vbWVudCcpKSA6XG4gICB0eXBlb2YgZGVmaW5lID09PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQgPyBkZWZpbmUoWycuLi9tb21lbnQnXSwgZmFjdG9yeSkgOlxuICAgZmFjdG9yeShnbG9iYWwubW9tZW50KVxufSh0aGlzLCAoZnVuY3Rpb24gKG1vbWVudCkgeyAndXNlIHN0cmljdCc7XG5cbiAgICAvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgc3ltYm9sTWFwID0ge1xuICAgICAgICAgICAgMTogJ+CvpycsXG4gICAgICAgICAgICAyOiAn4K+oJyxcbiAgICAgICAgICAgIDM6ICfgr6knLFxuICAgICAgICAgICAgNDogJ+CvqicsXG4gICAgICAgICAgICA1OiAn4K+rJyxcbiAgICAgICAgICAgIDY6ICfgr6wnLFxuICAgICAgICAgICAgNzogJ+CvrScsXG4gICAgICAgICAgICA4OiAn4K+uJyxcbiAgICAgICAgICAgIDk6ICfgr68nLFxuICAgICAgICAgICAgMDogJ+CvpicsXG4gICAgICAgIH0sXG4gICAgICAgIG51bWJlck1hcCA9IHtcbiAgICAgICAgICAgICfgr6cnOiAnMScsXG4gICAgICAgICAgICAn4K+oJzogJzInLFxuICAgICAgICAgICAgJ+CvqSc6ICczJyxcbiAgICAgICAgICAgICfgr6onOiAnNCcsXG4gICAgICAgICAgICAn4K+rJzogJzUnLFxuICAgICAgICAgICAgJ+CvrCc6ICc2JyxcbiAgICAgICAgICAgICfgr60nOiAnNycsXG4gICAgICAgICAgICAn4K+uJzogJzgnLFxuICAgICAgICAgICAgJ+Cvryc6ICc5JyxcbiAgICAgICAgICAgICfgr6YnOiAnMCcsXG4gICAgICAgIH07XG5cbiAgICB2YXIgdGEgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCd0YScsIHtcbiAgICAgICAgbW9udGhzOiAn4K6c4K6p4K614K6w4K6/X+CuquCuv+CuquCvjeCusOCuteCusOCuv1/grq7grr7grrDgr43grprgr41f4K6P4K6q4K+N4K6w4K6y4K+NX+CuruCvh1/grpzgr4Lgrqngr41f4K6c4K+C4K6y4K+IX+CuhuCuleCuuOCvjeCun+CvjV/grprgr4bgrqrgr43grp/gr4bgrq7gr43grqrgrrDgr41f4K6F4K6V4K+N4K6f4K+H4K6+4K6q4K6w4K+NX+CuqOCuteCuruCvjeCuquCusOCvjV/grp/grr/grprgrq7gr43grqrgrrDgr40nLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ+CunOCuqeCuteCusOCuv1/grqrgrr/grqrgr43grrDgrrXgrrDgrr9f4K6u4K6+4K6w4K+N4K6a4K+NX+Cuj+CuquCvjeCusOCusuCvjV/grq7gr4df4K6c4K+C4K6p4K+NX+CunOCvguCusuCviF/grobgrpXgrrjgr43grp/gr41f4K6a4K+G4K6q4K+N4K6f4K+G4K6u4K+N4K6q4K6w4K+NX+CuheCuleCvjeCun+Cvh+CuvuCuquCusOCvjV/grqjgrrXgrq7gr43grqrgrrDgr41f4K6f4K6/4K6a4K6u4K+N4K6q4K6w4K+NJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzOlxuICAgICAgICAgICAgJ+CunuCuvuCur+Cuv+CuseCvjeCuseCvgeCuleCvjeCuleCuv+CutOCuruCviF/grqTgrr/grpngr43grpXgrp/gr43grpXgrr/grrTgrq7gr4hf4K6a4K+G4K614K+N4K614K6+4K6v4K+N4K6V4K6/4K604K6u4K+IX+CuquCvgeCupOCuqeCvjeCuleCuv+CutOCuruCviF/grrXgrr/grq/grr7grrTgrpXgr43grpXgrr/grrTgrq7gr4hf4K614K+G4K6z4K+N4K6z4K6/4K6V4K+N4K6V4K6/4K604K6u4K+IX+CumuCuqeCuv+CuleCvjeCuleCuv+CutOCuruCviCcuc3BsaXQoXG4gICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAn4K6e4K6+4K6v4K6/4K6x4K+BX+CupOCuv+CumeCvjeCuleCus+CvjV/grprgr4bgrrXgr43grrXgrr7grq/gr41f4K6q4K+B4K6k4K6p4K+NX+CuteCuv+Cur+CuvuCutOCuqeCvjV/grrXgr4bgrrPgr43grrPgrr9f4K6a4K6p4K6/Jy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ+CunuCuvl/grqTgrr9f4K6a4K+GX+CuquCvgV/grrXgrr9f4K614K+GX+Cumicuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSwgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIEQgTU1NTSBZWVlZLCBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW+Cuh+CuqeCvjeCuseCvgV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vgrqjgrr7grrPgr4hdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCwgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vgrqjgr4fgrrHgr43grrHgr4FdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+CuleCun+CuqOCvjeCupCDgrrXgrr7grrDgrq7gr41dIGRkZGQsIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg4K6H4K6y4K+NJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDgrq7gr4Hgrqngr40nLFxuICAgICAgICAgICAgczogJ+CukuCusOCvgSDgrprgrr/grrIg4K614K6/4K6o4K6+4K6f4K6/4K6V4K6z4K+NJyxcbiAgICAgICAgICAgIHNzOiAnJWQg4K614K6/4K6o4K6+4K6f4K6/4K6V4K6z4K+NJyxcbiAgICAgICAgICAgIG06ICfgrpLgrrDgr4Eg4K6o4K6/4K6u4K6/4K6f4K6u4K+NJyxcbiAgICAgICAgICAgIG1tOiAnJWQg4K6o4K6/4K6u4K6/4K6f4K6Z4K+N4K6V4K6z4K+NJyxcbiAgICAgICAgICAgIGg6ICfgrpLgrrDgr4Eg4K6u4K6j4K6/IOCuqOCvh+CusOCuruCvjScsXG4gICAgICAgICAgICBoaDogJyVkIOCuruCuo+CuvyDgrqjgr4fgrrDgrq7gr40nLFxuICAgICAgICAgICAgZDogJ+CukuCusOCvgSDgrqjgrr7grrPgr40nLFxuICAgICAgICAgICAgZGQ6ICclZCDgrqjgrr7grp/gr43grpXgrrPgr40nLFxuICAgICAgICAgICAgTTogJ+CukuCusOCvgSDgrq7grr7grqTgrq7gr40nLFxuICAgICAgICAgICAgTU06ICclZCDgrq7grr7grqTgrpngr43grpXgrrPgr40nLFxuICAgICAgICAgICAgeTogJ+CukuCusOCvgSDgrrXgrrDgr4Hgrp/grq7gr40nLFxuICAgICAgICAgICAgeXk6ICclZCDgrobgrqPgr43grp/gr4HgrpXgrrPgr40nLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn3grrXgrqTgr4EvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+CuteCupOCvgSc7XG4gICAgICAgIH0sXG4gICAgICAgIHByZXBhcnNlOiBmdW5jdGlvbiAoc3RyaW5nKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RyaW5nLnJlcGxhY2UoL1vgr6fgr6jgr6ngr6rgr6vgr6zgr63gr67gr6/gr6ZdL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXJNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHBvc3Rmb3JtYXQ6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgvXFxkL2csIGZ1bmN0aW9uIChtYXRjaCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzeW1ib2xNYXBbbWF0Y2hdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIC8vIHJlZmVyIGh0dHA6Ly90YS53aWtpcGVkaWEub3JnL3MvMWVyMVxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv4K6v4K6+4K6u4K6u4K+NfOCuteCviOCuleCuseCviHzgrpXgrr7grrLgr4h84K6o4K6j4K+N4K6q4K6V4K6y4K+NfOCujuCuseCvjeCuquCuvuCun+CvgXzgrq7grr7grrLgr4gvLFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCAyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcg4K6v4K6+4K6u4K6u4K+NJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDYpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJyDgrrXgr4jgrpXgrrHgr4gnOyAvLyDgrrXgr4jgrpXgrrHgr4hcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDEwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcg4K6V4K6+4K6y4K+IJzsgLy8g4K6V4K6+4K6y4K+IXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAnIOCuqOCuo+CvjeCuquCuleCusuCvjSc7IC8vIOCuqOCuo+CvjeCuquCuleCusuCvjVxuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJyDgro7grrHgr43grqrgrr7grp/gr4EnOyAvLyDgro7grrHgr43grqrgrr7grp/gr4FcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDIyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcg4K6u4K6+4K6y4K+IJzsgLy8g4K6u4K6+4K6y4K+IXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAnIOCur+CuvuCuruCuruCvjSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+Cur+CuvuCuruCuruCvjScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA8IDIgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CuteCviOCuleCuseCviCcgfHwgbWVyaWRpZW0gPT09ICfgrpXgrr7grrLgr4gnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4K6o4K6j4K+N4K6q4K6V4K6y4K+NJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyID49IDEwID8gaG91ciA6IGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAwLCAvLyBTdW5kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNiwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNnRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIHRhO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IFRlbHVndSBbdGVdXG4vLyEgYXV0aG9yIDogS3Jpc2huYSBDaGFpdGFueWEgVGhvdGEgOiBodHRwczovL2dpdGh1Yi5jb20va2N0aG90YVxuXG47KGZ1bmN0aW9uIChnbG9iYWwsIGZhY3RvcnkpIHtcbiAgIHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJ1xuICAgICAgICYmIHR5cGVvZiByZXF1aX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kaW5hbFBhcnNlOiAvXFxkezEsMn3gsLUvLFxuICAgICAgICBvcmRpbmFsOiAnJWTgsLUnLFxuICAgICAgICBtZXJpZGllbVBhcnNlOiAv4LCw4LC+4LCk4LGN4LCw4LC/fOCwieCwpuCwr+CwgnzgsK7gsKfgsY3gsK/gsL7gsLngsY3gsKjgsIJ84LC44LC+4LCv4LCC4LCk4LGN4LCw4LCCLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG1lcmlkaWVtID09PSAn4LCw4LC+4LCk4LGN4LCw4LC/Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyIDwgNCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4LCJ4LCm4LCv4LCCJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+CwruCwp+CxjeCwr+CwvuCwueCxjeCwqOCwgicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMCA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn4LC44LC+4LCv4LCC4LCk4LGN4LCw4LCCJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+CwsOCwvuCwpOCxje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AnRG9fU2VnX1RlX0t1X0tpX1Nlc19TYScuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tPaGluIGloYV0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tBYmFuIGloYV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtpaGFdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbSG9yaXNlaWsgaWhhXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW3NlbWFuYSBrb3R1a10gW2loYV0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdpaGEgJXMnLFxuICAgICAgICAgICAgcGFzdDogJyVzIGxpdWJhJyxcbiAgICAgICAgICAgIHM6ICdzZWd1bmR1IGJhbHVuJyxcbiAgICAgICAgICAgIHNzOiAnc2VndW5kdSAlZCcsXG4gICAgICAgICAgICBtOiAnbWludXR1IGlkYScsXG4gICAgICAgICAgICBtbTogJ21pbnV0dSAlZCcsXG4gICAgICAgICAgICBoOiAnb3JhcyBpZGEnLFxuICAgICAgICAgICAgaGg6ICdvcmFzICVkJyxcbiAgICAgICAgICAgIGQ6ICdsb3JvbiBpZGEnLFxuICAgICAgICAgICAgZGQ6ICdsb3JvbiAlZCcsXG4gICAgICAgICAgICBNOiAnZnVsYW4gaWRhJyxcbiAgICAgICAgICAgIE1NOiAnZnVsYW4gJWQnLFxuICAgICAgICAgICAgeTogJ3RpbmFuIGlkYScsXG4gICAgICAgICAgICB5eTogJ3RpbmFuICVkJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9KHN0fG5kfHJkfHRoKS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBiID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICAgb3V0cHV0ID1cbiAgICAgICAgICAgICAgICAgICAgfn4oKG51bWJlciAlIDEwMCkgLyAxMCkgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgID8gJ3RoJ1xuICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3N0J1xuICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICduZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ3JkJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAndGgnO1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIG91dHB1dDtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1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BsYXN0V2VlazogJ2RkZGRb0LhdIFvSs9Cw0YTRgtCw0Lgg0LPRg9C30LDRiNGC0LAg0YHQvtCw0YLQuF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfQsdCw0YrQtNC4ICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDQv9C10YgnLFxuICAgICAgICAgICAgczogJ9GP0LrRh9Cw0L3QtCDRgdC+0L3QuNGPJyxcbiAgICAgICAgICAgIG06ICfRj9C6INC00LDSm9C40pvQsCcsXG4gICAgICAgICAgICBtbTogJyVkINC00LDSm9C40pvQsCcsXG4gICAgICAgICAgICBoOiAn0Y/QuiDRgdC+0LDRgicsXG4gICAgICAgICAgICBoaDogJyVkINGB0L7QsNGCJyxcbiAgICAgICAgICAgIGQ6ICfRj9C6INGA06/QtycsXG4gICAgICAgICAgICBkZDogJyVkINGA06/QtycsXG4gICAgICAgICAgICBNOiAn0Y/QuiDQvNC+0rMnLFxuICAgICAgICAgICAgTU06ICclZCDQvNC+0rMnLFxuICAgICAgICAgICAgeTogJ9GP0Log0YHQvtC7JyxcbiAgICAgICAgICAgIHl5OiAnJWQg0YHQvtC7JyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL9GI0LDQsXzRgdGD0LHSs3zRgNOv0Ld80LHQtdCz0L7Ssy8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ9GI0LDQsScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA8IDQgPyBob3VyIDogaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ9GB0YPQsdKzJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ9GA06/QtycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMSA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn0LHQtdCz0L7SsycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfRiNCw0LEnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9GB0YPQsdKzJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG91ciA8IDE2KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfRgNOv0LcnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChob3VyIDwgMTkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9Cx0LXQs9C+0rMnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9GI0LDQsSc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfS0o0YPQvHzRjtC8KS8sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIpIHtcbiAgICAgICAgICAgIHZhciBhID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICAgICA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cmF0aW9uXG5cbiAgICB2YXIgdGggPSBtb21lbnQuZGVmaW5lTG9jYWxlKCd0aCcsIHtcbiAgICAgICAgbW9udGhzOiAn4Lih4LiB4Lij4Liy4LiE4LihX+C4geC4uOC4oeC4oOC4suC4nuC4seC4meC4mOC5jF/guKHguLXguJnguLLguITguKFf4LmA4Lih4Lip4Liy4Lii4LiZX+C4nuC4pOC4qeC4oOC4suC4hOC4oV/guKHguLTguJbguLjguJnguLLguKLguJlf4LiB4Lij4LiB4LiO4Liy4LiE4LihX+C4quC4tOC4h+C4q+C4suC4hOC4oV/guIHguLHguJnguKLguLLguKLguJlf4LiV4Li44Lil4Liy4LiE4LihX+C4nuC4pOC4qOC4iOC4tOC4geC4suC4ouC4mV/guJjguLHguJnguKfguLLguITguKEnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OlxuICAgICAgICAgICAgJ+C4oS7guIQuX+C4gS7guJ4uX+C4oeC4tS7guIQuX+C5gOC4oS7guKIuX+C4ni7guIQuX+C4oeC4tC7guKIuX+C4gS7guIQuX+C4qi7guIQuX+C4gS7guKIuX+C4lS7guIQuX+C4ni7guKIuX+C4mC7guIQuJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIG1vbnRoc1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIHdlZWtkYXlzOiAn4Lit4Liy4LiX4Li04LiV4Lii4LmMX+C4iOC4seC4meC4l+C4o+C5jF/guK3guLHguIfguITguLLguKNf4Lie4Li44LiYX+C4nuC4pOC4q+C4seC4quC4muC4lOC4tV/guKjguLjguIHguKPguYxf4LmA4Liq4Liy4Lij4LmMJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAn4Lit4Liy4LiX4Li04LiV4Lii4LmMX+C4iOC4seC4meC4l+C4o+C5jF/guK3guLHguIfguITguLLguKNf4Lie4Li44L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gICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn4Lir4Lil4Lix4LiH4LmA4LiX4Li14LmI4Lii4LiHJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb4Lin4Lix4LiZ4LiZ4Li14LmJIOC5gOC4p+C4peC4sl0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vguJ7guKPguLjguYjguIfguJnguLXguYkg4LmA4Lin4Lil4LiyXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGRb4Lir4LiZ4LmJ4LiyIOC5gOC4p+C4peC4sl0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vguYDguKHguLfguYjguK3guKfguLLguJnguJnguLXguYkg4LmA4Lin4Lil4LiyXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vguKfguLHguJldZGRkZFvguJfguLXguYjguYHguKXguYnguKcg4LmA4Lin4Lil4LiyXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJ+C4reC4teC4gSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXPguJfguLXguYjguYHguKXguYnguKcnLFxuICAgICAgICAgICAgczogJ+C5hOC4oeC5iOC4geC4teC5iOC4p+C4tOC4meC4suC4l+C4tScsXG4gICAgICAgICAgICBzczogJyVkIOC4p+C4tOC4meC4suC4l+C4tScsXG4gICAgICAgICAgICBtOiAnMSDguJnguLLguJfguLUnLFxuICAgICAgICAgICAgbW06ICclZCDguJnguLLguJfguLUnLFxuICAgICAgICAgICAgaDogJzEg4LiK4Lix4LmI4Lin4LmC4Lih4LiHJyxcbiAgICAgICAgICAgIGhoOiAnJWQg4LiK4Lix4LmI4Lin4LmC4Lih4LiHJyxcb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G4gICAgdmFyIHN1ZmZpeGVzID0ge1xuICAgICAgICAxOiBcIidpbmppXCIsXG4gICAgICAgIDU6IFwiJ2luamlcIixcbiAgICAgICAgODogXCInaW5qaVwiLFxuICAgICAgICA3MDogXCInaW5qaVwiLFxuICAgICAgICA4MDogXCInaW5qaVwiLFxuICAgICAgICAyOiBcIiduamlcIixcbiAgICAgICAgNzogXCInbmppXCIsXG4gICAgICAgIDIwOiBcIiduamlcIixcbiAgICAgICAgNTA6IFwiJ25qaVwiLFxuICAgICAgICAzOiBcIifDvG5qaVwiLFxuICAgICAgICA0OiBcIifDvG5qaVwiLFxuICAgICAgICAxMDA6IFwiJ8O8bmppXCIsXG4gICAgICAgIDY6IFwiJ25qeVwiLFxuICAgICAgICA5OiBcIid1bmp5XCIsXG4gICAgICAgIDEwOiBcIid1bmp5XCIsXG4gICAgICAgIDMwOiBcIid1bmp5XCIsXG4gICAgICAgIDYwOiBcIid5bmp5XCIsXG4gICAgICAgIDkwOiBcIid5bmp5XCIsXG4gICAgfTtcblxuICAgIHZhciB0ayA9IG1vbWVudC5kZWZpbmVMb2NhbGUoJ3RrJywge1xuICAgICAgICBtb250aHM6ICfDnWFud2FyX0Zld3JhbF9NYXJ0X0FwcmVsX01hw71fScO9dW5fScO9dWxfQXdndXN0X1NlbnTDvWFicl9Pa3TDvWFicl9Ob8O9YWJyX0Rla2Ficicuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6ICfDnWFuX0Zld19NYXJfQXByX01hw71fScO9bl9Jw71sX0F3Z19TZW5fT2t0X05vw71fRGVrJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5czogJ8OdZWvFn2VuYmVfRHXFn2VuYmVfU2nFn2VuYmVfw4dhcsWfZW5iZV9QZW7Fn2VuYmVfQW5uYV/FnmVuYmUnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfDnWVrX0R1xZ9fU2nFn1/Dh2FyX1Blbl9Bbm5fxZ5lbicuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfDnWtfRMWfX1PFn1/Dh3JfUG5fQW5fxZ5uJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW2J1Z8O8biBzYWdhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1tlcnRpciBzYWdhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdbaW5kaWtpXSBkZGRkIFtzYWdhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tkw7zDvW5dIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW2dlw6dlbl0gZGRkZCBbc2FnYXRdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMgc2/FiCcsXG4gICAgICAgICAgICBwYXN0OiAnJXMgw7bFiCcsXG4gICAgICAgICAgICBzOiAnYmlybsOkw6dlIHNla3VudCcsXG4gICAgICAgICAgICBtOiAnYmlyIG1pbnV0JyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXQnLFxuICAgICAgICAgICAgaDogJ2JpciBzYWdhdCcsXG4gICAgICAgICAgICBoaDogJyVkIHNhZ2F0JyxcbiAgICAgICAgICAgIGQ6ICdiaXIgZ8O8bicsXG4gICAgICAgICAgICBkZDogJyVkIGfDvG4nLFxuICAgICAgICAgICAgTTogJ2JpciBhw70nLFxuICAgICAgICAgICAgTU06ICclZCBhw70nLFxuICAgICAgICAgICAgeTogJ2JpciDDvXlsJyxcbiAgICAgICAgICAgIHl5OiAnJWQgw715bCcsXG4gICAgICAgIH0sXG4gICAgICAgIG9yZGluYWw6IGZ1bmN0aW9uIChudW1iZXIsIHBlcmlvZCkge1xuICAgICAgICAgICAgc3dpdGNoIChwZXJpb2QpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdkJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICBjYXNlICdEbyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIGlmIChudW1iZXIgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNwZWNpYWwgY2FzZSBmb3IgemVyb1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIFwiJ3VuanlcIjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgICAgICAgICAgYiA9IChudW1iZXIgJSAxMDApIC0gYSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGMgPSBudW1iZXIgPj0gMTAwID8gMTAwIDogbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArIChzdWZmaXhlc1thXSB8fCBzdWZmaXhlc1tiXSB8fCBzdWZmaXhlc1tjXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gIC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Wdvc3RvX1NldHllbWJyZV9Pa3R1YnJlX05vYnllbWJyZV9EaXN5ZW1icmUnLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIG1vbnRoc1Nob3J0OiAnRW5lX1BlYl9NYXJfQWJyX01heV9IdW5fSHVsX0Fnb19TZXRfT2t0X05vYl9EaXMnLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzOiAnTGluZ2dvX0x1bmVzX01hcnRlc19NaXllcmt1bGVzX0h1d2ViZXNfQml5ZXJuZXNfU2FiYWRvJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAnTGluX0x1bl9NYXJfTWl5X0h1d19CaXlfU2FiJy5zcGxpdCgnXycpLFxuICAgICAgICB3ZWVrZGF5c01pbjogJ0xpX0x1X01hX01pX0h1X0JpX1NhYicuc3BsaXQoJ18nKSxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ01NL0QvWVlZWScsXG4gICAgICAgICAgICBMTDogJ01NTU0gRCwgWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdNTU1NIEQsIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQsIE1NTU0gREQsIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ0xUIFtuZ2F5b25nIGFyYXddJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbQnVrYXMgbmddIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnTFQgW3NhIHN1c3Vub2QgbmFdIGRkZGQnLFxuICAgICAgICAgICAgbGFzdERheTogJ0xUIFtrYWhhcG9uXScsXG4gICAgICAgICAgICBsYXN0V2VlazogJ0xUIFtub29uZyBuYWthcmFhbmddIGRkZGQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICdzYSBsb29iIG5nICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyBhbmcgbmFrYWxpcGFzJyxcbiAgICAgICAgICAgIHM6ICdpbGFuZyBzZWd1bmRvJyxcbiAgICAgICAgICAgIHNzOiAnJWQgc2VndW5kbycsXG4gICAgICAgICAgICBtOiAnaXNhbmcgbWludXRvJyxcbiAgICAgICAgICAgIG1tOiAnJWQgbWludXRvJyxcbiAgICAgICAgICAgIGg6ICdpc2FuZyBvcmFzJyxcbiAgICAgICAgICAgIGhoOiAnJWQgb3JhcycsXG4gICAgICAgICAgICBkOiAnaXNhbmcgYXJhdycsXG4gICAgICAgICAgICBkZDogJyVkIGFyYXcnLFxuICAgICAgICAgICAgTTogJ2lzYW5nIGJ1d2FuJyxcbiAgICAgICAgICAgIE1NOiAnJWQgYnV3YW4nLFxuICAgICAgICAgICAgeTogJ2lzYW5nIHRhb24nLFxuICAgICAgICAgICAgeXk6ICclZCB0YW9uJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE9yZGluYWxQYXJzZTogL1xcZHsxLDJ9LyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNCwgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gNHRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9L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kZXhPZignamFyJykgIT09IC0xXG4gICAgICAgICAgICAgICAgICA/IHRpbWUuc2xpY2UoMCwgLTMpICsgJ3dhUSdcbiAgICAgICAgICAgICAgICAgIDogb3V0cHV0LmluZGV4T2YoJ0RJUycpICE9PSAtMVxuICAgICAgICAgICAgICAgICAgICA/IHRpbWUuc2xpY2UoMCwgLTMpICsgJ25lbSdcbiAgICAgICAgICAgICAgICAgICAgOiB0aW1lICsgJyBwSXEnO1xuICAgICAgICByZXR1cm4gdGltZTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiB0cmFuc2xhdGVQYXN0KG91dHB1dCkge1xuICAgICAgICB2YXIgdGltZSA9IG91dHB1dDtcbiAgICAgICAgdGltZSA9XG4gICAgICAgICAgICBvdXRwdXQuaW5kZXhPZignamFqJykgIT09IC0xXG4gICAgICAgICAgICAgICAgPyB0aW1lLnNsaWNlKDAsIC0zKSArICdIdeKAmSdcbiAgICAgICAgICAgICAgICA6IG91dHB1dC5pbmRleE9mKCdqYXInKSAhPT0gLTFcbiAgICAgICAgICAgICAgICAgID8gdGltZS5zbGljZSgwLCAtMykgKyAnd2VuJ1xuICAgICAgICAgICAgICAgICAgOiBvdXRwdXQuaW5kZXhPZignRElTJykgIT09IC0xXG4gICAgICAgICAgICAgICAgICAgID8gdGltZS5zbGljZSgwLCAtMykgKyAnYmVuJ1xuICAgICAgICAgICAgICAgICAgICA6IHRpbWUgKyAnIHJldCc7XG4gICAgICAgIHJldHVybiB0aW1lO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHRyYW5zbGF0ZShudW1iZXIsIHdpdGhvdXRTdWZmaXgsIHN0cmluZywgaXNGdXR1cmUpIHtcbiAgICAgICAgdmFyIG51bWJlck5vdW4gPSBudW1iZXJBc05vdW4obnVtYmVyKTtcbiAgICAgICAgc3dpdGNoIChzdHJpbmcpIHtcbiAgICAgICAgICAgIGNhc2UgJ3NzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTm91biArICcgbHVwJztcbiAgICAgICAgICAgIGNhc2UgJ21tJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTm91biArICcgdHVwJztcbiAgICAgICAgICAgIGNhc2UgJ2hoJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTm91biArICcgcmVwJztcbiAgICAgICAgICAgIGNhc2UgJ2RkJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTm91biArICcgamFqJztcbiAgICAgICAgICAgIGNhc2UgJ01NJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTm91biArICcgamFyJztcbiAgICAgICAgICAgIGNhc2UgJ3l5JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyTm91biArICcgRElTJztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIG51bWJlckFzTm91bihudW1iZXIpIHtcbiAgICAgICAgdmFyIGh1bmRyZWQgPSBNYXRoLmZsb29yKChudW1iZXIgJSAxMDAwKSAvIDEwMCksXG4gICAgICAgICAgICB0ZW4gPSBNYXRoLmZsb29yKChudW1iZXIgJSAxMDApIC8gMTApLFxuICAgICAgICAgICAgb25lID0gbnVtYmVyICUgMTAsXG4gICAgICAgICAgICB3b3JkID0gJyc7XG4gICAgICAgIGlmIChodW5kcmVkID4gMCkge1xuICAgICAgICAgICAgd29yZCArPSBudW1iZXJzTm91bnNbaHVuZHJlZF0gKyAndmF0bGgnO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0ZW4gPiAwKSB7XG4gICAgICAgICAgICB3b3JkICs9ICh3b3JkICE9PSAnJyA/ICcgJyA6ICcnKSArIG51bWJlcnNOb3Vuc1t0ZW5dICsgJ21hSCc7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9uZSA+IDApIHtcbiAgICAgICAgICAgIHdvcmQgKz0gKHdvcmQgIT09ICcnID8gJyAnIDogJycpICsgbnVtYmVyc05vdW5zW29uZV07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHdvcmQgPT09ICcnID8gJ3BhZ2gnIDogd29yZDtcbiAgICB9XG5cbiAgICB2YXIgdGxoID0gbW9tZW50LmRlZmluZUxvY2FsZSgndGxoJywge1xuICAgICAgICBtb250aHM6ICd0ZXJh4oCZIGphciB3YeKAmV90ZXJh4oCZIGphciBjaGHigJlfdGVyYeKAmSBqYXIgd2VqX3RlcmHigJkgamFyIGxvU190ZXJh4oCZIGphciB2YWdoX3RlcmHigJkgamFyIGphdl90ZXJh4oCZIGphciBTb2NoX3RlcmHigJkgamFyIGNob3JnaF90ZXJh4oCZIGphciBIdXRfdGVyYeKAmSBqYXIgd2HigJltYUhfdGVyYeKAmSBqYXIgd2HigJltYUggd2HigJlfdGVyYeKAmSBqYXIgd2HigJltYUggY2hh4oCZJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDpcbiAgICAgICAgICAgICdqYXIgd2HigJlfamFyIGNoYeKAmV9qYXIgd2VqX2phciBsb1NfamFyIHZhZ2hfamFyIGphdl9qYXIgU29jaF9qYXIgY2hvcmdoX2phciBIdXRfamFyIHdh4oCZbWFIX2phciB3YeKAmW1hSCB3YeKAmV9qYXIgd2HigJltYUggY2hh4oCZJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIG1vbnRoc1BhcnNlRXhhY3Q6IHRydWUsXG4gICAgICAgIHdlZWtkYXlzOiAnbG9qbUl0amFqX0RhU2phal9wb3ZqYWpfZ2hJdGxoamFqX2xvZ2hqYWpfYnVxamFqX2doSW5qYWonLnNwbGl0KFxuICAgICAgICAgICAgJ18nXG4gICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6XG4gICAgICAgICAgICAnbG9qbUl0amFqX0RhU2phal9wb3ZqYWpfZ2hJdGxoamFqX2xvZ2hqYWpfYnVxamFqX2doSW5qYWonLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOlxuICAgICAgICAgICAgJ2xvam1JdGphal9EYVNqYWpfcG92amFqX2doSXRsaGphal9sb2doamFqX2J1cWphal9naEluamFqJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQuTU0uWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkLCBEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0RhSGphal0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1t3YeKAmWxlU10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdMTEwnLFxuICAgICAgICAgICAgbGFzdERheTogJ1t3YeKAmUh14oCZXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ0xMTCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogdHJhbnNsYXRlRnV0dXJlLFxuICAgICAgICAgICAgcGFzdDogdHJhbnNsYXRlUGFzdCxcbiAgICAgICAgICAgIHM6ICdwdVMgbHVwJyxcbiAgICAgICAgICAgIHNzOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBtOiAnd2HigJkgdHVwJyxcbiAgICAgICAgICAgIG1tOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBoOiAnd2HigJkgcmVwJyxcbiAgICAgICAgICAgIGhoOiB0cmFuc2xhdGUsXG4gICAgICAgICAgICBkOiAnd2HigJkgam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0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lKFsnLi4vbW9tZW50J10sIGZhY3RvcnkpIDpcbiAgIGZhY3RvcnkoZ2xvYmFsLm1vbWVudClcbn0odGhpcywgKGZ1bmN0aW9uIChtb21lbnQpIHsgJ3VzZSBzdHJpY3QnO1xuXG4gICAgLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuXG4gICAgdmFyIHN1ZmZpeGVzID0ge1xuICAgICAgICAxOiBcIidpbmNpXCIsXG4gICAgICAgIDU6IFwiJ2luY2lcIixcbiAgICAgICAgODogXCInaW5jaVwiLFxuICAgICAgICA3MDogXCInaW5jaVwiLFxuICAgICAgICA4MDogXCInaW5jaVwiLFxuICAgICAgICAyOiBcIiduY2lcIixcbiAgICAgICAgNzogXCInbmNpXCIsXG4gICAgICAgIDIwOiBcIiduY2lcIixcbiAgICAgICAgNTA6IFwiJ25jaVwiLFxuICAgICAgICAzOiBcIifDvG5jw7xcIixcbiAgICAgICAgNDogXCInw7xuY8O8XCIsXG4gICAgICAgIDEwMDogXCInw7xuY8O8XCIsXG4gICAgICAgIDY6IFwiJ25jxLFcIixcbiAgICAgICAgOTogXCIndW5jdVwiLFxuICAgICAgICAxMDogXCIndW5jdVwiLFxuICAgICAgICAzMDogXCIndW5jdVwiLFxuICAgICAgICA2MDogXCInxLFuY8SxXCIsXG4gICAgICAgIDkwOiBcIifEsW5jxLFcIixcbiAgICB9O1xuXG4gICAgdmFyIHRyID0gbW9tZW50LmRlZmluZUxvY2FsZSgndHInLCB7XG4gICAgICAgIG1vbnRoczogJ09jYWtfxZ51YmF0X01hcnRfTmlzYW5fTWF5xLFzX0hhemlyYW5fVGVtbXV6X0HEn3VzdG9zX0V5bMO8bF9Fa2ltX0thc8SxbV9BcmFsxLFrJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICBtb250aHNTaG9ydDogJ09jYV/FnnViX01hcl9Oa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w6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tidWfDvG4gc2FhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1t5YXLEsW4gc2FhdF0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdbZ2VsZWNla10gZGRkZCBbc2FhdF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1tkw7xuXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tnZcOnZW5dIGRkZGQgW3NhYXRdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMgc29ucmEnLFxuICAgICAgICAgICAgcGFzdDogJyVzIMO2bmNlJyxcbiAgICAgICAgICAgIHM6ICdiaXJrYcOnIHNhbml5ZScsXG4gICAgICAgICAgICBzczogJyVkIHNhbml5ZScsXG4gICAgICAgICAgICBtOiAnYmlyIGRha2lrYScsXG4gICAgICAgICAgICBtbTogJyVkIGRha2lrYScsXG4gICAgICAgICAgICBoOiAnYmlyIHNhYXQnLFxuICAgICAgICAgICAgaGg6ICclZCBzYWF0JyxcbiAgICAgICAgICAgIGQ6ICdiaXIgZ8O8bicsXG4gICAgICAgICAgICBkZDogJyVkIGfDvG4nLFxuICAgICAgICAgICAgdzogJ2JpciBoYWZ0YScsXG4gICAgICAgICAgICB3dzogJyVkIGhhZnRhJyxcbiAgICAgICAgICAgIE06ICdiaXIgYXknLFxuICAgICAgICAgICAgTU06ICclZCBheScsXG4gICAgICAgICAgICB5OiAnYmlyIHnEsWwnLFxuICAgICAgICAgICAgeXk6ICclZCB5xLFsJyxcbiAgICAgICAgfSxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RvJzpcbiAgICAgICAgICAgICAgICBjYXNlICdERCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXI7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3BlY2lhbCBjYXNlIGZvciB6ZXJvXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgXCInxLFuY8SxXCI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdmFyIGEgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGIgPSAobnVtYmVyICUgMTAwKSAtIGEsXG4gICAgICAgICAgICAgICAgICAgICAgICBjID0gbnVtYmVyID49IDEwMCA/IDEwMCA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAoc3VmZml4ZXNbYV0gfHwgc3VmZml4ZXNbYl0gfHwgc3VmZml4ZXNbY10pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDEsIC8vIE1vbmRheSBpcyB0aGUgZmlyc3QgZGF5IG9mIHRoZSB3ZWVrLlxuICAgICAgICAgICAgZG95OiA3LCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiA3dGggaXMgdGhlIGZpcnN0IHdlZWsgb2YgdGhlIHllYXIuXG4gICAgICAgIH0sXG4gICAgfSk7XG5cbiAgICByZXR1cm4gdHI7XG5cbn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ICAgfSxcbiAgICAgICAgbWVyaWRpZW06IGZ1bmN0aW9uIChob3VycywgbWludXRlcywgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXJzID4gMTEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/IFwiZCdvXCIgOiBcIkQnT1wiO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaXNMb3dlciA/IFwiZCdhXCIgOiBcIkQnQVwiO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tveGhpIMOgXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2RlbcOgIMOgXSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW8OgXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2llaXJpIMOgXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1tzw7xyIGVsXSBkZGRkIFtsYXN0ZXUgw6BdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnb3NwcmVpICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICdqYSVzJyxcbiAgICAgICAgICAgIHM6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBzczogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIG06IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBtbTogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIGg6IHByb2Nlc3NSZWxhdGl2ZVRpbWUsXG4gICAgICAgICAgICBoaDogcHJvY2Vzc1JlbGF0aXZlVGltZSxcbiAgICAgICAgICAgIGQ6IHByb2Nlc3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YVwiLCBcIidpZW5zYSDDvm9yYVwiXSxcbiAgICAgICAgICAgIGhoOiBbbnVtYmVyICsgJyDDvm9yYXMnLCAnJyArIG51bWJlciArICcgw75vcmFzJ10sXG4gICAgICAgICAgICBkOiBbXCInbiB6aXVhXCIsIFwiJ2llbnNhIHppdWFcIl0sXG4gICAgICAgICAgICBkZDogW251bWJlciArICcgeml1YXMnLCAnJyArIG51bWJlciArICcgeml1YXMnXSxcbiAgICAgICAgICAgIE06IFtcIiduIG1lc1wiLCBcIidpZW5zIG1lc1wiXSxcbiAgICAgICAgICAgIE1NOiBbbnVtYmVyICsgJyBtZXNlbicsICcnICsgbnVtYmVyICsgJyBtZXNlbiddLFxuICAgICAgICAgICAgeTogW1wiJ24gYXJcIiwgXCInaWVucyBhclwiXSxcbiAgICAgICAgICAgIHl5OiBbbnVtYmVyICsgJyBhcnMnLCAnJyArIG51bWJlciArICcgYXJzJ10sXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBpc0Z1dHVyZVxuICAgICAgICAgICAgPyBmb3JtYXRba2V5XVswXVxuICAgICAgICAgICAgOiB3aXRob3V0U3VmZml4XG4gICAgICAgICAgICAgID8gZm9ybWF0W2tleV1bMF1cbiAgICAgICAgICAgICAgOiBmb3JtYXRba2V5XVsxXTtcbiAgICB9XG5cbiAgICByZXR1cm4gdHpsO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IENlbnRyYWwgQXRsYXMgVGFtYXppZ2h0IExhdGluIFt0em0tbGF0bl1cbi8vISBhdXRob3IgOiBBYmRlbCBTYWlkIDogaHR0cHM6Ly9naXRodWIuY29tL2FiZGVsc2FpZFxuXG47KGZ1bmN0aW9uIChnbG9iYWwsIGZhY3RvcnkpIHtcbiAgIHR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJ1xuICAgICA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ZWVrZGF5c01pbjogJ2FzYW1hc19heW5hc19hc2luYXNfYWtyYXNfYWt3YXNfYXNpbXdhc19hc2nhuI15YXMnLnNwbGl0KCdfJyksXG4gICAgICAgIGxvbmdEYXRlRm9ybWF0OiB7XG4gICAgICAgICAgICBMVDogJ0hIOm1tJyxcbiAgICAgICAgICAgIExUUzogJ0hIOm1tOnNzJyxcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFlZWVknLFxuICAgICAgICAgICAgTExMOiAnRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ2RkZGQgRCBNTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1thc2RraCBnXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW2Fza2EgZ10gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdkZGRkIFtnXSBMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW2Fzc2FudCBnXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW2ddIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnZGFka2ggcyB5YW4gJXMnLFxuICAgICAgICAgICAgcGFzdDogJ3lhbiAlcycsXG4gICAgICAgICAgICBzOiAnaW1paycsXG4gICAgICAgICAgICBzczogJyVkIGltaWsnLFxuICAgICAgICAgICAgbTogJ21pbnXhuI0nLFxuICAgICAgICAgICAgbW06ICclZCBtaW514biNJyxcbiAgICAgICAgICAgIGg6ICdzYcmbYScsXG4gICAgICAgICAgICBoaDogJyVkIHRhc3NhyZtpbicsXG4gICAgICAgICAgICBkOiAnYXNzJyxcbiAgICAgICAgICAgIGRkO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vLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG5cbiAgICB2YXIgdHptID0gbW9tZW50LmRlZmluZUxvY2FsZSgndHptJywge1xuICAgICAgICBtb250aHM6ICfitYnitY/itY/itLDitaLitZRf4rSx4rWV4rSw4rWi4rWVX+K1juK0sOK1leK1ml/itYnitLHitZTitYnitZRf4rWO4rSw4rWi4rWi4rWTX+K1ouK1k+K1j+K1ouK1k1/itaLitZPitY3itaLitZPitaNf4rWW4rWT4rWb4rWcX+K1m+K1k+K1nOK0sOK1j+K0seK1ieK1lF/itL3itZ/itZPitLHitZVf4rWP4rWT4rWh4rSw4rWP4rSx4rWJ4rWUX+K0t+K1k+K1iuK1j+K0seK1ieK1lCcuc3BsaXQoXG4gICAgICAgICAgICAnXydcbiAgICAgICAgKSxcbiAgICAgICAgbW9udGhzU2hvcnQ6XG4gICAgICAgICAgICAn4rWJ4rWP4rWP4rSw4rWi4rWUX+K0seK1leK0sOK1ouK1lV/itY7itLDitZXitZpf4rWJ4rSx4rWU4rWJ4rWUX+K1juK0sOK1ouK1ouK1k1/itaLitZPitY/itaLitZNf4rWi4rWT4rWN4rWi4rWT4rWjX+K1luK1k+K1m+K1nF/itZvitZPitZzitLDitY/itLHitYnitZRf4rS94rWf4rWT4rSx4rWVX+K1j+K1k+K1oeK0sOK1j+K0seK1ieK1lF/itLfitZPitYritY/itLHitYnitZQnLnNwbGl0KFxuICAgICAgICAgICAgICAgICdfJ1xuICAgICAgICAgICAgKSxcbiAgICAgICAgd2Vla2RheXM6ICfitLDitZnitLDitY7itLDitZlf4rSw4rWi4rWP4rSw4rWZX+K0sOK1meK1ieK1j+K0sOK1mV/itLDitL3itZTitLDitZlf4rSw4rS94rWh4rSw4rWZX+K0sOK1meK1ieK1juK1oeK0sOK1mV/itLDitZnitYnitLnitaLitLDitZknLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfitLDitZnitLDitY7itLDitZlf4rSw4rWi4rWP4rSw4rWZX+K0sOK1meK1ieK1j+K0sOK1mV/itLDitL3itZTitLDitZlf4rSw4rS94rWh4rSw4rWZX+K0sOK1meK1ieK1juK1oeK0sOK1mV/itLDitZnitYnitLnitaLitLDitZknLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn4rSw4rWZ4rSw4rWO4rSw4rWZX+K0sOK1ouK1j+K0sOK1mV/itLDitZnitYnitY/itLDitZlf4rSw4rS94rWU4rSw4rWZX+K0sOK0veK1oeK0sOK1mV/itLDitZnitYnitY7itaHitLDitZlf4rSw4rWZ4rWJ4rS54rWi4rSw4rWZJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnREQvTU0vWVlZWScsXG4gICAgICAgICAgICBMTDogJ0QgTU1NTSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRkIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb4rSw4rWZ4rS34rWFIOK0tF0gTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vitLDitZnitL3itLAg4rS0XSBMVCcsXG4gICAgICAgICAgICBuZXh0V2VlazogJ2RkZGQgW+K0tF0gTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vitLDitZritLDitY/itZwg4rS0XSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW+K0tF0gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfitLfitLDitLfitYUg4rWZIOK1ouK0sOK1jyAlcycsXG4gICAgICAgICAgICBwYXN0OiAn4rWi4rSw4rWPICVzJyxcbiAgICAgICAgICAgIHM6ICfitYnitY7itYnitL0nLFxuICAgICAgICAgICAgc3M6ICclZCDitYnitY7itYnitL0nLFxuICAgICAgICAgICAgbTogJ+K1juK1ieK1j+K1k+K0uicsXG4gICAgICAgICAgICBtbTogJyVkIOK1juK1ieK1j+K1k+K0uicsXG4gICAgICAgICAgICBoOiAn4rWZ4rSw4rWE4rSwJyxcbiAgICAgICAgICAgIGhoOiAnJWQg4rWc4rSw4rWZ4rWZ4rSw4rWE4rWJ4rWPJyxcbiAgICAgICAgICAgIGQ6ICfitLDitZnitZknLFxuICAgICAgICAgICAgZGQ6ICclZCBv4rWZ4rWZ4rSw4rWPJyxcbiAgICAgICAgICAgIE06ICfitLDitaJv4rWT4rWUJyxcbiAgICAgICAgICAgIE1NOiAnJWQg4rWJ4rWi4rWi4rWJ4rWU4rWPJyxcbiAgICAgICAgICAgIHk6ICfitLDitZnitLPitLDitZknLFxuICAgICAgICAgICAgeXk6ICclZCDitYnitZnitLPitLDitZnitY8nLFxuICAgICAgICB9LFxuICAgICAgICB3ZWVrOiB7XG4gICAgICAgICAgICBkb3c6IDYsIC8vIFNhdHVyZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDEyLCAvLyBUaGUgd2VlayB0aGF0IGNvbnRhaW5zIEphbiAxMnRoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIHR6bTtcblxufSkpKTtcbiIsIi8vISBtb21lbnQuanMgbG9jYWxlIGNvbmZpZ3VyYXRpb25cbi8vISBsb2NhbGUgOiBVeWdodXIgKENoaW5hKSBbdWctY25dXG4vLyEgYXV0aG9yOiBib3lhcSA6IGh0dHBzOi8vZ2l0aHViLmN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25DZg9in2KjZidixJy5zcGxpdChcbiAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICksXG4gICAgICAgIHdlZWtkYXlzOiAn2YrbldmD2LTbldmG2KjblV/Yr9uI2LTbldmG2KjblV/Ys9uV2YrYtNuV2YbYqNuVX9qG2KfYsdi025XZhtio25Vf2b7bldmK2LTbldmG2KjblV/YrNuI2YXblV/YtNuV2YbYqNuVJy5zcGxpdChcbiAgICAgICAgICAgICdfJ1xuICAgICAgICApLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiAn2YrblV/Yr9uIX9iz25Vf2obYp1/ZvtuVX9is24hf2LTblScuc3BsaXQoJ18nKSxcbiAgICAgICAgd2Vla2RheXNNaW46ICfZituVX9iv24hf2LPblV/ahtinX9m+25Vf2KzbiF/YtNuVJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnWVlZWS1NTS1ERCcsXG4gICAgICAgICAgICBMTDogJ1lZWVkt2YrZidmE2YlNLdim2KfZitmG2YnarUQt2YPbiNmG2YknLFxuICAgICAgICAgICAgTExMOiAnWVlZWS3ZitmJ2YTZiU0t2KbYp9mK2YbZidqtRC3Zg9uI2YbZidiMIEhIOm1tJyxcbiAgICAgICAgICAgIExMTEw6ICdkZGRk2IwgWVlZWS3ZitmJ2YTZiU0t2KbYp9mK2YbZidqtRC3Zg9uI2YbZidiMIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL9mK25DYsdmJ2YUg2YPbkNqG25V82LPbldq+25XYsXzahtuI2LTYqtmJ2YYg2Kjbh9ix24fZhnzahtuI2LR82obbiNi02KrZidmGINmD25DZitmJ2YZ82YPbldqGLyxcbiAgICAgICAgbWVyaWRpZW1Ib3VyOiBmdW5jdGlvbiAoaG91ciwgbWVyaWRpZW0pIHtcbiAgICAgICAgICAgIGlmIChob3VyID09PSAxMikge1xuICAgICAgICAgICAgICAgIGhvdXIgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIG1lcmlkaWVtID09PSAn2YrbkNix2YnZhSDZg9uQ2obblScgfHxcbiAgICAgICAgICAgICAgICBtZXJpZGllbSA9PT0gJ9iz25XavtuV2LEnIHx8XG4gICAgICAgICAgICAgICAgbWVyaWRpZW0gPT09ICfahtuI2LTYqtmJ2YYg2Kjbh9ix24fZhidcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ9qG24jYtNiq2YnZhiDZg9uQ2YrZidmGJyB8fCBtZXJpZGllbSA9PT0gJ9mD25XahicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMSA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICB2YXIgaG0gPSBob3VyICogMTAwICsgbWludXRlO1xuICAgICAgICAgICAgaWYgKGhtIDwgNjAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfZituQ2LHZidmFINmD25DahtuVJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCA5MDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9iz25XavtuV2LEnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDExMzApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9qG24jYtNiq2YnZhiDYqNuH2LHbh9mGJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCAxMjMwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfahtuI2LQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDE4MDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ9qG24jYtNiq2YnZhiDZg9uQ2YrZidmGJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfZg9uV2oYnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vYqNuI2q/biNmGINiz2KfYptuV2KpdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdb2Kbbldiq25Ug2LPYp9im25XYql0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdb2YPbkNmE25XYsdmD2YldIGRkZGQgW9iz2KfYptuV2KpdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2KrbhtmG24jar9uI2YZdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW9im2KfZhNiv2YnZhtmC2YldIGRkZGQgW9iz2KfYptuV2KpdIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnJXMg2YPbkNmK2YnZhicsXG4gICAgICAgICAgICBwYXN0OiAnJXMg2Kjbh9ix24fZhicsXG4gICAgICAgICAgICBzOiAn2YbbldqG2obblSDYs9uQ2YPZiNmG2KonLFxuICAgICAgICAgICAgc3M6ICclZCDYs9uQ2YPZiNmG2KonLFxuICAgICAgICAgICAgbTogJ9io2YnYsSDZhdmJ2Ybbh9iqJyxcbiAgICAgICAgICAgIG1tOiAnJWQg2YXZidmG24fYqicsXG4gICAgICAgICAgICBoOiAn2KjZidixINiz2KfYptuV2KonLFxuICAgICAgICAgICAgaGg6ICclZCDYs9in2KbbldiqJyxcbiAgICAgICAgICAgIGQ6ICfYqNmJ2LEg2YPbiNmGJyxcbiAgICAgICAgICAgIGRkOiAnJWQg2YPbiNmGJyxcbiAgICAgICAgICAgIE06ICfYqNmJ2LEg2KbYp9mKJyxcbiAgICAgICAgICAgIE1NOiAnJWQg2KbYp9mKJyxcbiAgICAgICAgICAgIHk6ICfYqNmJ2LEg2YrZidmEJyxcbiAgICAgICAgICAgIHl5OiAnJWQg2YrZidmEJyxcbiAgICAgICAgfSxcblxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0oLdmD24jZhtmJfC3Yptin2Yp8Ldq+25XZvtiq25UpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RERCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdmD24jZhtmJJztcbiAgICAgICAgICAgICAgICBjYXNlICd3JzpcbiAgICAgICAgICAgICAgICBjYXNlICdXJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct2r7bldm+2KrblSc7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgv2IwvZywgJywnKTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAgICAgICAgcmV0dXJuIHN0cm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Lhf0LPQvtC00LjQvScsXG4gICAgICAgICAgICBkZDogJ9C00LXQvdGMX9C00L3Rll/QtNC90ZbQsicsXG4gICAgICAgICAgICBNTTogJ9C80ZbRgdGP0YbRjF/QvNGW0YHRj9GG0ZZf0LzRltGB0Y/RhtGW0LInLFxuICAgICAgICAgICAgeXk6ICfRgNGW0Lpf0YDQvtC60Lhf0YDQvtC60ZbQsicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChrZXkgPT09ICdtJykge1xuICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyAn0YXQstC40LvQuNC90LAnIDogJ9GF0LLQuNC70LjQvdGDJztcbiAgICAgICAgfSBlbHNlIGlmIChrZXkgPT09ICdoJykge1xuICAgICAgICAgICAgcmV0dXJuIHdpdGhvdXRTdWZmaXggPyAn0LPQvtC00LjQvdCwJyA6ICfQs9C+0LTQuNC90YMnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICcgJyArIHBsdXJhbChmb3JtYXRba2V5XSwgK251bWJlcik7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gd2Vla2RheXNDYXNlUmVwbGFjZShtLCBmb3JtYXQpIHtcbiAgICAgICAgdmFyIHdlZWtkYXlzID0ge1xuICAgICAgICAgICAgICAgIG5vbWluYXRpdmU6XG4gICAgICAgICAgICAgICAgICAgICfQvdC10LTRltC70Y9f0L/QvtC90LXQtNGW0LvQvtC6X9Cy0ZbQstGC0L7RgNC+0Lpf0YHQtdGA0LXQtNCwX9GH0LXRgtCy0LXRgF/Qv+KAmdGP0YLQvdC40YbRj1/RgdGD0LHQvtGC0LAnLnNwbGl0KFxuICAgICAgICAgICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgYWNjdXNhdGl2ZTpcbiAgICAgICAgICAgICAgICAgICAgJ9C90LXQtNGW0LvRjl/Qv9C+0L3QtdC00ZbQu9C+0Lpf0LLRltCy0YLQvtGA0L7Qul/RgdC10YDQtdC00YNf0YfQtdGC0LLQtdGAX9C/4oCZ0Y/RgtC90LjRhtGOX9GB0YPQsdC+0YLRgycuc3BsaXQoXG4gICAgICAgICAgICAgICAgICAgICAgICAnXydcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICBnZW5pdGl2ZTpcbiAgICAgICAgICAgICAgICAgICAgJ9C90LXQtNGW0LvRll/Qv9C+0L3QtdC00ZbQu9C60LBf0LLRltCy0YLQvtGA0LrQsF/RgdC10YDQtdC00Lhf0YfQtdGC0LLQtdGA0LPQsF/Qv+KAmdGP0YLQvdC40YbRll/RgdGD0LHQvtGC0LgnLnNwbGl0KFxuICAgICAgICAgICAgICAgICAgICAgICAgJ18nXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbm91bkNhc2U7XG5cbiAgICAgICAgaWYgKG0gPT09IHRydWUpIHtcbiAgICAgICAgICAgIHJldHVybiB3ZWVrZGF5c1snbm9taW5hdGl2ZSddXG4gICAgICAgICAgICAgICAgLnNsaWNlKDEsIDcpXG4gICAgICAgICAgICAgICAgLmNvbmNhdCh3ZWVrZGF5c1snbm9taW5hdGl2ZSddLnNsaWNlKDAsIDEpKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIW0pIHtcbiAgICAgICAgICAgIHJldHVybiB3ZWVrZGF5c1snbm9taW5hdGl2ZSddO1xuICAgICAgICB9XG5cbiAgICAgICAgbm91bkNhc2UgPSAvKFxcW1vQktCy0KPRg11cXF0pID9kZGRkLy50ZXN0KGZvcm1hdClcbiAgICAgICAgICAgID8gJ2FjY3VzYXRpdmUnXG4gICAgICAgICAgICA6IC9cXFs/KD860LzQuNC90YPQu9C+0Zd80L3QsNGB0YLRg9C/0L3QvtGXKT8gP1xcXSA/ZGRkZC8udGVzdChmb3JtYXQpXG4gICAgICAgICAgICAgID8gJ2dlbml0aXZlJ1x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XNzSG91cnNGdW5jdGlvbignW9CjXSBkZGRkIFsnKSxcbiAgICAgICAgICAgIGxhc3RXZWVrOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0aGlzLmRheSgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwcm9jZXNzSG91cnNGdW5jdGlvbignW9Cc0LjQvdGD0LvQvtGXXSBkZGRkIFsnKS5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByb2Nlc3NIb3Vyc0Z1bmN0aW9uKCdb0JzQuNC90YPQu9C+0LPQvl0gZGRkZCBbJykuY2FsbCh0aGlzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICfQt9CwICVzJyxcbiAgICAgICAgICAgIHBhc3Q6ICclcyDRgtC+0LzRgycsXG4gICAgICAgICAgICBzOiAn0LTQtdC60ZbQu9GM0LrQsCDRgdC10LrRg9C90LQnLFxuICAgICAgICAgICAgc3M6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBtOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgbW06IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgICAgICBoOiAn0LPQvtC00LjQvdGDJyxcbiAgICAgICAgICAgIGhoOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgZDogJ9C00LXQvdGMJyxcbiAgICAgICAgICAgIGRkOiByZWxhdGl2ZVRpbWVXaXRoUGx1cmFsLFxuICAgICAgICAgICAgTTogJ9C80ZbRgdGP0YbRjCcsXG4gICAgICAgICAgICBNTTogcmVsYXRpdmVUaW1lV2l0aFBsdXJhbCxcbiAgICAgICAgICAgIHk6ICfRgNGW0LonLFxuICAgICAgICAgICAgeXk6IHJlbGF0aXZlVGltZVdpdGhQbHVyYWwsXG4gICAgICAgIH0sXG4gICAgICAgIC8vIE0uIEUuOiB0aG9zZSB0d28gYXJlIHZpcnR1YWxseSB1bnVzZWQgYnV0IGEgdXNlciBtaWdodCB3YW50IHRvIGltcGxlbWVudCB0aGVtIGZvciBoaXMvaGVyIHdlYnNpdGUgZm9yIHNvbWUgcmVhc29uXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/QvdC+0YfRlnzRgNCw0L3QutGDfNC00L3Rj3zQstC10YfQvtGA0LAvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAvXijQtNC90Y980LLQtdGH0L7RgNCwKSQvLnRlc3QoaW5wdXQpO1xuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgaWYgKGhvdXIgPCA0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfQvdC+0YfRlic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMikge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0YDQsNC90LrRgyc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxNykge1xuICAgICAgICAgICAgICAgIHJldHVybiAn0LTQvdGPJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfQstC10YfQvtGA0LAnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0tKNC5fNCz0L4pLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlciwgcGVyaW9kKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBlcmlvZCkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgIGNhc2UgJ2QnOlxuICAgICAgICAgICAgICAgIGNhc2UgJ0RERCc6XG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAnLdC5JztcbiAgICAgICAgICAgICAgICBjYXNlICdEJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICct0LPQvic7XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgd2Vlazoge1xuICAgICAgICAgICAgZG93OiAxLCAvLyBNb25kYXkgaXMgdGhlIGZpcnN0IGRheSBvZiB0aGUgd2Vlay5cbiAgICAgICAgICAgIGRveTogNywgLy8gVGhlIHdlZWsgdGhhdCBjb250YWlucyBKYW4gN3RoIGlzIHRoZSBmaXJzdCB3ZWVrIG9mIHRoZSB5ZWFyLlxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIHVrO1xuXG59KSkpO1xuIiwiLy8hIG1vbWVudC5qcyBsb2NhbGUgY29uZmlndXJhdGlvblxuLy8hIGxvY2FsZSA6IFVyZHUgW3VyXVxuLy8hIGF1dGhvciA6IFNhd29vZCBBbGFtIDogaHR0cHM6Ly9naXRodWIuY29tL2libm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An2KzZhdi52LHYp9iqJywgJ9is2YXYuduBJywgJ9uB2YHYqtuBJ107XG5cbiAgICB2YXIgdXIgPSBtb21lbnQuZGVmaW5lTG9jYWxlKCd1cicsIHtcbiAgICAgICAgbW9udGhzOiBtb250aHMsXG4gICAgICAgIG1vbnRoc1Nob3J0OiBtb250aHMsXG4gICAgICAgIHdlZWtkYXlzOiBkYXlzLFxuICAgICAgICB3ZWVrZGF5c1Nob3J0OiBkYXlzLFxuICAgICAgICB3ZWVrZGF5c01pbjogZGF5cyxcbiAgICAgICAgbG9uZ0RhdGVGb3JtYXQ6IHtcbiAgICAgICAgICAgIExUOiAnSEg6bW0nLFxuICAgICAgICAgICAgTFRTOiAnSEg6bW06c3MnLFxuICAgICAgICAgICAgTDogJ0REL01NL1lZWVknLFxuICAgICAgICAgICAgTEw6ICdEIE1NTU0gWVlZWScsXG4gICAgICAgICAgICBMTEw6ICdEIE1NTU0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZNiMIEQgTU1NTSBZWVlZIEhIOm1tJyxcbiAgICAgICAgfSxcbiAgICAgICAgbWVyaWRpZW1QYXJzZTogL9i12KjYrXzYtNin2YUvLFxuICAgICAgICBpc1BNOiBmdW5jdGlvbiAoaW5wdXQpIHtcbiAgICAgICAgICAgIHJldHVybiAn2LTYp9mFJyA9PT0gaW5wdXQ7XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA8IDEyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfYtdio2K0nO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuICfYtNin2YUnO1xuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vYotisINio2YjZgtiqXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW9qp2YQg2KjZiNmC2KpdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBb2KjZiNmC2KpdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdb2q/YsNi02KrbgSDYsdmI2LIg2KjZiNmC2KpdIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW9qv2LDYtNiq24FdIGRkZGQgW9io2YjZgtiqXSBMVCcsXG4gICAgICAgICAgICBzYW1lRWxzZTogJ0wnLFxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVzINio2LnYrycsXG4gICAgICAgICAgICBwYXN0OiAnJXMg2YLYqNmEJyxcbiAgICAgICAgICAgIHM6ICfahtmG2K8g2LPbjNqp2YbaiCcsXG4gICAgICAgICAgICBzczogJyVkINiz24zaqdmG2ognLFxuICAgICAgICAgICAgbTogJ9in24zaqSDZhdmG2bknLFxuICAgICAgICAgICAgbW06ICclZCDZhdmG2bknLFxuICAgICAgICAgICAgaDogJ9in24zaqSDar9q+2YbZuduBJyxcbiAgICAgICAgICAgIGhoOiAnJWQg2q/avtmG2bnbkicsXG4gICAgICAgICAgICBkOiAn2KfbjNqpINiv2YYnLFxuICAgICAgICAgICAgZGQ6ICclZCDYr9mGJyxcbiAgICAgICAgICAgIE06ICfYp9uM2qkg2YXYp9uBJyxcbiAgICAgICAgICAgIE1NOiAnJWQg2YXYp9uBJyxcbiAgICAgICAgICAgIHk6ICfYp9uM2qkg2LPYp9mEJyxcbiAgICAgICAgICAgIHl5OiAnJWQg2LPYp9mEJyxcbiAgICAgICAgfSxcbiAgICAgICAgcHJlcGFyc2U6IGZ1bmN0aW9uIChzdHJpbmcpIHtcbiAgICAgICAgICAgIHJldHVybiBzdHJpbmcucmVwbGFjZSgv2IwvZywgJywnKTtcbiAgICAgICAgfSxcbiAgICAgICAgcG9zdGZvcm1hdDogZnVuY3Rpb24gKHN0cmluZykge1xuICAgICAg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iAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBba3VuaSBzb2F0XSBMVCBbZGFdJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbS2VjaGEgc29hdF0gTFQgW2RhXScsXG4gICAgICAgICAgICBsYXN0V2VlazogXCJbTyd0Z2FuXSBkZGRkIFtrdW5pIHNvYXRdIExUIFtkYV1cIixcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnWWFxaW4gJXMgaWNoaWRhJyxcbiAgICAgICAgICAgIHBhc3Q6ICdCaXIgbmVjaGEgJXMgb2xkaW4nLFxuICAgICAgICAgICAgczogJ3Nvbml5YScsXG4gICAgICAgICAgICBzczogJyVkIHNvbml5YScsXG4gICAgICAgICAgICBtOiAnYmlyIGRhcWlxYScsXG4gICAgICAgICAgICBtbTogJyVkIGRhcWlxYScsXG4gICAgICAgICAgICBoOiAnYmlyIHNvYXQnLFxuICAgICAgICAgICAgaGg6ICclZCBzb2F0JyxcbiAgICAgICAgICAgIGQ6ICdiaXIga3VuJyxcbiAgICAgICAgICAgIGRkOiAnJWQga3VuJyxcbiAgICAgICAgICAgIE06ICdiaXIgb3knLFxuICAgICAgICAgICAgTU06ICclZCBveScsXG4gICAgICAgICAgICB5OiAnYmlyIHlpbCcsXG4gICAgICAgICAgICB5eTogJyVkIHlpbCcsXG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDcsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDd0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiB1ekxhdG47XG5c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AgICAgICAgICBsYXN0V2VlazogJ1vQo9GC0LPQsNC9XSBkZGRkIFvQutGD0L3QuCDRgdC+0LDRgl0gTFQgW9C00LBdJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAn0K/QutC40L0gJXMg0LjRh9C40LTQsCcsXG4gICAgICAgICAgICBwYXN0OiAn0JHQuNGAINC90LXRh9CwICVzINC+0LvQtNC40L0nLFxuICAgICAgICAgICAgczogJ9GE0YPRgNGB0LDRgicsXG4gICAgICAgICAgICBzczogJyVkINGE0YPRgNGB0LDRgicsXG4gICAgICAgICAgICBtOiAn0LHQuNGAINC00LDQutC40LrQsCcsXG4gICAgICAgICAgICBtbTogJyVkINC00LDQutC40LrQsCcsXG4gICAgICAgICAgICBoOiAn0LHQuNGAINGB0L7QsNGCJyxcbiAgICAgICAgICAgIGhoOiAnJWQg0YHQvtCw0YInLFxuICAgICAgICAgICAgZDogJ9Cx0LjRgCDQutGD0L0nLFxuICAgICAgICAgICAgZGQ6ICclZCDQutGD0L0nLFxuICAgICAgICAgICAgTTogJ9Cx0LjRgCDQvtC5JyxcbiAgICAgICAgICAgIE1NOiAnJWQg0L7QuScsXG4gICAgICAgICAgICB5OiAn0LHQuNGAINC50LjQuycsXG4gICAgICAgICAgICB5eTogJyVkINC50LjQuycsXG4gICAgICAgIH0sXG4gICAgICAgIHdlZWs6IHtcbiAgICAgICAgICAgIGRvdzogMSwgLy8gTW9uZGF5IGlzIHRoZSBmaXJzdCBkYXkgb2YgdGhlIHdlZWsuXG4gICAgICAgICAgICBkb3k6IDcsIC8vIFRoZSB3ZWVrIHRoYXQgY29udGFpbnMgSmFuIDR0aCBpcyB0aGUgZmlyc3Qgd2VlayBvZiB0aGUgeWVhci5cbiAgICAgICAgfSxcbiAgICB9KTtcblxuICAgIHJldHVybiB1ejtcblxufSkpKTtcbiIsIi8vISBtb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xcbiAgICAgICAgICAgIEw6ICdERC9NTS9ZWVlZJyxcbiAgICAgICAgICAgIExMOiAnRCBNTU1NIFtuxINtXSBZWVlZJyxcbiAgICAgICAgICAgIExMTDogJ0QgTU1NTSBbbsSDbV0gWVlZWSBISDptbScsXG4gICAgICAgICAgICBMTExMOiAnZGRkZCwgRCBNTU1NIFtuxINtXSBZWVlZIEhIOm1tJyxcbiAgICAgICAgICAgIGw6ICdERC9NL1lZWVknLFxuICAgICAgICAgICAgbGw6ICdEIE1NTSBZWVlZJyxcbiAgICAgICAgICAgIGxsbDogJ0QgTU1NIFlZWVkgSEg6bW0nLFxuICAgICAgICAgICAgbGxsbDogJ2RkZCwgRCBNTU0gWVlZWSBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIGNhbGVuZGFyOiB7XG4gICAgICAgICAgICBzYW1lRGF5OiAnW0jDtG0gbmF5IGzDumNdIExUJyxcbiAgICAgICAgICAgIG5leHREYXk6ICdbTmfDoHkgbWFpIGzDumNdIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiAnZGRkZCBbdHXhuqduIHThu5tpIGzDumNdIExUJyxcbiAgICAgICAgICAgIGxhc3REYXk6ICdbSMO0bSBxdWEgbMO6Y10gTFQnLFxuICAgICAgICAgICAgbGFzdFdlZWs6ICdkZGRkIFt0deG6p24gdHLGsOG7m2MgbMO6Y10gTFQnLFxuICAgICAgICAgICAgc2FtZUVsc2U6ICdMJyxcbiAgICAgICAgfSxcbiAgICAgICAgcmVsYXRpdmVUaW1lOiB7XG4gICAgICAgICAgICBmdXR1cmU6ICclcyB04bubaScsXG4gICAgICAgICAgICBwYXN0OiAnJXMgdHLGsOG7m2MnLFxuICAgICAgICAgICAgczogJ3bDoGkgZ2nDonknLFxuICAgICAgICAgICAgc3M6ICclZCBnacOieScsXG4gICAgICAgICAgICBtOiAnbeG7mXQgcGjDunQnLFxuICAgICAgICAgICAgbW06ICclZCBwaMO6dCcsXG4gICAgICAgICAgICBoOiAnbeG7mX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gICBwYXN0OiAnJXMgw6F+Z8OzJyxcbiAgICAgICAgICAgIHM6ICfDoSB+ZsOpdyB+c8OpY8OzfsOxZHMnLFxuICAgICAgICAgICAgc3M6ICclZCBzfsOpY8Ozw7F+ZHMnLFxuICAgICAgICAgICAgbTogJ8OhIH5tw63DsX7DunTDqScsXG4gICAgICAgICAgICBtbTogJyVkIG1+w63DscO6fnTDqXMnLFxuICAgICAgICAgICAgaDogJ8OhfsOxIGjDs37DunInLFxuICAgICAgICAgICAgaGg6ICclZCBofsOzw7pycycsXG4gICAgICAgICAgICBkOiAnw6EgfmTDocO9JyxcbiAgICAgICAgICAgIGRkOiAnJWQgZH7DocO9cycsXG4gICAgICAgICAgICBNOiAnw6Egfm3Ds8OxfnRoJyxcbiAgICAgICAgICAgIE1NOiAnJWQgbX7Ds8OxdH5ocycsXG4gICAgICAgICAgICB5OiAnw6EgfsO9w6nDoXInLFxuICAgICAgICAgICAgeXk6ICclZCDDvX7DqcOhcnMnLFxuICAgICAgICB9LFxuICAgICAgICBkYXlPZk1vbnRoT3JkaW5hbFBhcnNlOiAvXFxkezEsMn0odGh8c3R8bmR8cmQpLyxcbiAgICAgICAgb3JkaW5hbDogZnVuY3Rpb24gKG51bWJlcikge1xuICAgICAgICAgICAgdmFyIGIgPSBudW1iZXIgJSAxMCxcbiAgICAgICAgICAgICAgICBvdXRwdXQgPVxuICAgICAgICAgICAgICAgICAgICB+figobnVtYmVyICUgMTAwKSAvIDEwKSA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgPyAndGgnXG4gICAgICAgICAgICAgICAgICAgICAgICA6IGIgPT09IDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnc3QnXG4gICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ25kJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gM1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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6ICdkZGRkLCBEIE1NTU0gWVlZWSBoOm1tIEEnLFxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1tPzIBuacyAIG5pXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+G7jMyAbGEgbmldIExUJyxcbiAgICAgICAgICAgIG5leHRXZWVrOiBcImRkZGQgW+G7jHPhurnMgCB0b8yBbidi4buNXSBbbmldIExUXCIsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW0HMgG5hIG5pXSBMVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ2RkZGQgW+G7jHPhurnMgCB0b8yBbOG7jcyBXSBbbmldIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIHJlbGF0aXZlVGltZToge1xuICAgICAgICAgICAgZnV0dXJlOiAnbmnMgSAlcycsXG4gICAgICAgICAgICBwYXN0OiAnJXMga+G7jWphzIEnLFxuICAgICAgICAgICAgczogJ2nMgHPhurlqdcyBIGFheWHMgSBkaWUnLFxuICAgICAgICAgICAgc3M6ICdhYXlhzIEgJWQnLFxuICAgICAgICAgICAgbTogJ2nMgHPhurlqdcyBIGthbicsXG4gICAgICAgICAgICBtbTogJ2nMgHPhurlqdcyBICVkJyxcbiAgICAgICAgICAgIGg6ICd3YcyBa2F0aSBrYW4nLFxuICAgICAgICAgICAgaGg6ICd3YcyBa2F0aSAlZCcsXG4gICAgICAgICAgICBkOiAn4buNauG7jcyBIGthbicsXG4gICAgICAgICAgICBkZDogJ+G7jWrhu43MgSAlZCcsXG4gICAgICAgICAgICBNOiAnb3N1zIAga2FuJyxcbiAgICAgICAgICAgIE1NOiAnb3N1zIAgJWQnLFxuICAgICAgICAgICAgeTogJ+G7jWR1zIFuIGthbicsXG4gICAgICAgICAgICB5eTogJ+G7jWR1zIFuICVkJyxcbiAgICAgICAgfSxcbiAgICAgICAgZGF5T2ZNb250aE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gICAgICAgICBMTExMOiAnWVlZWeW5tE3mnIhE5pelZGRkZEFo54K5bW3liIYnLFxuICAgICAgICAgICAgbDogJ1lZWVkvTS9EJyxcbiAgICAgICAgICAgIGxsOiAnWVlZWeW5tE3mnIhE5pelJyxcbiAgICAgICAgICAgIGxsbDogJ1lZWVnlubRN5pyIROaXpSBISDptbScsXG4gICAgICAgICAgICBsbGxsOiAnWVlZWeW5tE3mnIhE5pelZGRkZCBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/lh4zmmah85pep5LiKfOS4iuWNiHzkuK3ljYh85LiL5Y2IfOaZmuS4ii8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+WHjOaZqCcgfHwgbWVyaWRpZW0gPT09ICfml6nkuIonIHx8IG1lcmlkaWVtID09PSAn5LiK5Y2IJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+S4i+WNiCcgfHwgbWVyaWRpZW0gPT09ICfmmZrkuIonKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvdXIgKyAxMjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gJ+S4reWNiCdcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMSA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtOiBmdW5jdGlvbiAoaG91ciwgbWludXRlLCBpc0xvd2VyKSB7XG4gICAgICAgICAgICB2YXIgaG0gPSBob3VyICogMTAwICsgbWludXRlO1xuICAgICAgICAgICAgaWYgKGhtIDwgNjAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICflh4zmmagnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDkwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5pep5LiKJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCAxMTMwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfkuIrljYgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDEyMzApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+S4reWNiCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTgwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5LiL5Y2IJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfmmZrkuIonO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vku4rlpKldTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vmmI7lpKldTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6IGZ1bmN0aW9uIChub3cpIHtcbiAgICAgICAgICAgICAgICBpZiAobm93LndlZWsoKSAhPT0gdGhpcy53ZWVrKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdb5LiLXWRkZExUJztcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vmnKxdZGRkTFQnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsYXN0RGF5OiAnW+aYqOWkqV1MVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogZnVuY3Rpb24gKG5vdykge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLndlZWsoKSAhPT0gbm93LndlZWsoKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ1vkuIpdZGRkTFQnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnW+acrF1kZGRMVCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSjml6V85pyIfOWRqCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfml6UnO1xuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+aciCc7XG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn5ZGoJztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVz5ZCOJyxcbiAgICAgICAgICAgIHBhc3Q6ICclc+WJjScsXG4gICAgICAgICAgICBzOiAn5Yeg56eSJyxcbiAgICAgICAgICAgIHNzOiAnJWQg56eSJyxcbiAgICAgICAgICAgIG06ICcxIOWIhumSnycsXG4gICAgICAgICAgICBtb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pif5pyf5ZubX+aYn+acn+S6lF/mmJ/mnJ/lha0nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfpgLHml6Vf6YCx5LiAX+mAseS6jF/pgLHkuIlf6YCx5ZubX+mAseS6lF/pgLHlha0nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn5pelX+S4gF/kuoxf5LiJX+Wbm1/kupRf5YWtJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnWVlZWS9NTS9ERCcsXG4gICAgICAgICAgICBMTDogJ1lZWVnlubRN5pyIROaXpScsXG4gICAgICAgICAgICBMTEw6ICdZWVlZ5bm0TeaciETml6UgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ1lZWVnlubRN5pyIROaXpWRkZGQgSEg6bW0nLFxuICAgICAgICAgICAgbDogJ1lZWVkvTS9EJyxcbiAgICAgICAgICAgIGxsOiAnWVlZWeW5tE3mnIhE5pelJyxcbiAgICAgICAgICAgIGxsbDogJ1lZWVnlubRN5pyIROaXpSBISDptbScsXG4gICAgICAgICAgICBsbGxsOiAnWVlZWeW5tE3mnIhE5pelZGRkZCBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/lh4zmmah85pep5LiKfOS4iuWNiHzkuK3ljYh85LiL5Y2IfOaZmuS4ii8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+WHjOaZqCcgfHwgbWVyaWRpZW0gPT09ICfml6nkuIonIHx8IG1lcmlkaWVtID09PSAn5LiK5Y2IJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+S4reWNiCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMSA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn5LiL5Y2IJyB8fCBtZXJpZGllbSA9PT0gJ+aZmuS4iicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgdmFyIGhtID0gaG91ciAqIDEwMCArIG1pbnV0ZTtcbiAgICAgICAgICAgIGlmIChobSA8IDYwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5YeM5pmoJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCA5MDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aXqeS4iic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTIwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5LiK5Y2IJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPT09IDEyMDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+S4reWNiCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTgwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5LiL5Y2IJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfmmZrkuIonO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjYWxlbmRhcjoge1xuICAgICAgICAgICAgc2FtZURheTogJ1vku4rlpKldTFQnLFxuICAgICAgICAgICAgbmV4dERheTogJ1vmmI7lpKldTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdb5LiLXWRkZGRMVCcsXG4gICAgICAgICAgICBsYXN0RGF5OiAnW+aYqOWkqV1MVCcsXG4gICAgICAgICAgICBsYXN0V2VlazogJ1vkuIpdZGRkZExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSjml6V85pyIfOmAsSkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfml6UnO1xuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+aciCc7XG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn6YCxJztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVz5b6MJyxcbiAgICAgICAgICAgIHBhc3Q6ICclc+WJjScsXG4gICAgICAgICAgICBzOiAn5bm+56eSJyxcbiAgICAgICAgICAgIHNzOiAnJWQg56eSJyxcbiAgICAgICAgICAgIG06ICcxIOWI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ICAgTExMTDogJ1lZWVnlubRN5pyIROaXpWRkZGQgSEg6bW0nLFxuICAgICAgICAgICAgbDogJ0QvTS9ZWVlZJyxcbiAgICAgICAgICAgIGxsOiAnWVlZWeW5tE3mnIhE5pelJyxcbiAgICAgICAgICAgIGxsbDogJ1lZWVnlubRN5pyIROaXpSBISDptbScsXG4gICAgICAgICAgICBsbGxsOiAnWVlZWeW5tE3mnIhE5pelZGRkZCBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/lh4zmmah85pep5LiKfOS4iuWNiHzkuK3ljYh85LiL5Y2IfOaZmuS4ii8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+WHjOaZqCcgfHwgbWVyaWRpZW0gPT09ICfml6nkuIonIHx8IG1lcmlkaWVtID09PSAn5LiK5Y2IJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+S4reWNiCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMSA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn5LiL5Y2IJyB8fCBtZXJpZGllbSA9PT0gJ+aZmuS4iicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgdmFyIGhtID0gaG91ciAqIDEwMCArIG1pbnV0ZTtcbiAgICAgICAgICAgIGlmIChobSA8IDYwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5YeM5pmoJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCA5MDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aXqeS4iic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTEzMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5LiK5Y2IJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCAxMjMwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfkuK3ljYgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDE4MDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+S4i+WNiCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5pma5LiKJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb5LuK5aSpXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+aYjuWkqV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdb5LiLXWRkZGQgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vmmKjlpKldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+S4il1kZGRkIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSjml6V85pyIfOmAsSkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfml6UnO1xuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+aciCc7XG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn6YCxJztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVz5YWnJyxcbiAgICAgICAgICAgIHBhc3Q6ICclc+WJjScsXG4gICAgICAgICAgICBzOiAn5bm+56eSJyxcbiAgICAgICAgICAgIHNzOiAnJWQg56eSJyxcbiAgICAgICAgICAgIG06ICcxIOWIhumQmCcsXG4gICAgICAgICAgICBtbTogJyVkIOWIhumQmCcsXG4gICAgICAgICAgICBoOiAnMSDlsI/mmYInLFxuICAgICAgICAgICAgaGg6ICclZCDlsI/mmYInLFxuICAgICAgICAgICAgZDogJzEg5aSpJyxcbiAgICAgICAgICAgIGRkOiAnJWQg5aSpJyxcbiAgICAgICAgICAgIE06ICcxIOWAi+aciCcsXG4gICAgICAgICAgICBNTTogJyVkIOWAi+aciCcsXG4gICAgICAgICAgICB5OiAnMSDlubQnLFxuICAgICAgICAgICAgeXk6ICclZCDlubQnLFxuICAgICAgICB9LFxuICAgIH0pO1xuXG4gICAgcmV0dXJuIHpoTW87XG5cbn0pKSk7XG4iLCIvLyEgbW9tZW50LmpzIGxvY2FsZSBjb25maWd1cmF0aW9uXG4vLyEgbG9jYWxlIDogQ2hpbmVzZSAoVGFpd2FuKSBbemgtdHddXG4vLyEgYXV0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mJ/mnJ/kuIlf5pif5pyf5ZubX+aYn+acn+S6lF/mmJ/mnJ/lha0nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzU2hvcnQ6ICfpgLHml6Vf6YCx5LiAX+mAseS6jF/pgLHkuIlf6YCx5ZubX+mAseS6lF/pgLHlha0nLnNwbGl0KCdfJyksXG4gICAgICAgIHdlZWtkYXlzTWluOiAn5pelX+S4gF/kuoxf5LiJX+Wbm1/kupRf5YWtJy5zcGxpdCgnXycpLFxuICAgICAgICBsb25nRGF0ZUZvcm1hdDoge1xuICAgICAgICAgICAgTFQ6ICdISDptbScsXG4gICAgICAgICAgICBMVFM6ICdISDptbTpzcycsXG4gICAgICAgICAgICBMOiAnWVlZWS9NTS9ERCcsXG4gICAgICAgICAgICBMTDogJ1lZWVnlubRN5pyIROaXpScsXG4gICAgICAgICAgICBMTEw6ICdZWVlZ5bm0TeaciETml6UgSEg6bW0nLFxuICAgICAgICAgICAgTExMTDogJ1lZWVnlubRN5pyIROaXpWRkZGQgSEg6bW0nLFxuICAgICAgICAgICAgbDogJ1lZWVkvTS9EJyxcbiAgICAgICAgICAgIGxsOiAnWVlZWeW5tE3mnIhE5pelJyxcbiAgICAgICAgICAgIGxsbDogJ1lZWVnlubRN5pyIROaXpSBISDptbScsXG4gICAgICAgICAgICBsbGxsOiAnWVlZWeW5tE3mnIhE5pelZGRkZCBISDptbScsXG4gICAgICAgIH0sXG4gICAgICAgIG1lcmlkaWVtUGFyc2U6IC/lh4zmmah85pep5LiKfOS4iuWNiHzkuK3ljYh85LiL5Y2IfOaZmuS4ii8sXG4gICAgICAgIG1lcmlkaWVtSG91cjogZnVuY3Rpb24gKGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgICAgICBpZiAoaG91ciA9PT0gMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtZXJpZGllbSA9PT0gJ+WHjOaZqCcgfHwgbWVyaWRpZW0gPT09ICfml6nkuIonIHx8IG1lcmlkaWVtID09PSAn5LiK5Y2IJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBob3VyO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChtZXJpZGllbSA9PT0gJ+S4reWNiCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciA+PSAxMSA/IGhvdXIgOiBob3VyICsgMTI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1lcmlkaWVtID09PSAn5LiL5Y2IJyB8fCBtZXJpZGllbSA9PT0gJ+aZmuS4iicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaG91ciArIDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXJpZGllbTogZnVuY3Rpb24gKGhvdXIsIG1pbnV0ZSwgaXNMb3dlcikge1xuICAgICAgICAgICAgdmFyIGhtID0gaG91ciAqIDEwMCArIG1pbnV0ZTtcbiAgICAgICAgICAgIGlmIChobSA8IDYwMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5YeM5pmoJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCA5MDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aXqeS4iic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGhtIDwgMTEzMCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5LiK5Y2IJztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaG0gPCAxMjMwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICfkuK3ljYgnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChobSA8IDE4MDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+S4i+WNiCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAn5pma5LiKJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgY2FsZW5kYXI6IHtcbiAgICAgICAgICAgIHNhbWVEYXk6ICdb5LuK5aSpXSBMVCcsXG4gICAgICAgICAgICBuZXh0RGF5OiAnW+aYjuWkqV0gTFQnLFxuICAgICAgICAgICAgbmV4dFdlZWs6ICdb5LiLXWRkZGQgTFQnLFxuICAgICAgICAgICAgbGFzdERheTogJ1vmmKjlpKldIExUJyxcbiAgICAgICAgICAgIGxhc3RXZWVrOiAnW+S4il1kZGRkIExUJyxcbiAgICAgICAgICAgIHNhbWVFbHNlOiAnTCcsXG4gICAgICAgIH0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSjml6V85pyIfOmAsSkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyLCBwZXJpb2QpIHtcbiAgICAgICAgICAgIHN3aXRjaCAocGVyaW9kKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnZCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnRCc6XG4gICAgICAgICAgICAgICAgY2FzZSAnREREJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bWJlciArICfml6UnO1xuICAgICAgICAgICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyICsgJ+aciCc7XG4gICAgICAgICAgICAgICAgY2FzZSAndyc6XG4gICAgICAgICAgICAgICAgY2FzZSAnVyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyAn6YCxJztcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICByZWxhdGl2ZVRpbWU6IHtcbiAgICAgICAgICAgIGZ1dHVyZTogJyVz5b6MJyxcbiAgICAgICAgICAgIHBhc3Q6ICclc+WJjScsXG4gICAgICAgICAgICBzOiAn5bm+56eSJyxcbiAgICAgICAgICAgIHNzOiAnJWQg56eSJ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yY3VsYXIgZGVwZW5kZW5jaWVzLlxuICAgIGZ1bmN0aW9uIHNldEhvb2tDYWxsYmFjayhjYWxsYmFjaykge1xuICAgICAgICBob29rQ2FsbGJhY2sgPSBjYWxsYmFjaztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBpc0FycmF5KGlucHV0KSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICBpbnB1dCBpbnN0YW5jZW9mIEFycmF5IHx8XG4gICAgICAgICAgICBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoaW5wdXQpID09PSAnW29iamVjdCBBcnJheV0nXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNPYmplY3QoaW5wdXQpIHtcbiAgICAgICAgLy8gSUU4IHdpbGwgdHJlYXQgdW5kZWZpbmVkIGFuZCBudWxsIGFzIG9iamVjdCBpZiBpdCB3YXNuJ3QgZm9yXG4gICAgICAgIC8vIGlucHV0ICE9IG51bGxcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIGlucHV0ICE9IG51bGwgJiZcbiAgICAgICAgICAgIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChpbnB1dCkgPT09ICdbb2JqZWN0IE9iamVjdF0nXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaGFzT3duUHJvcChhLCBiKSB7XG4gICAgICAgIHJldHVybiBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoYSwgYik7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNPYmplY3RFbXB0eShvYmopIHtcbiAgICAgICAgaWYgKE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKSB7XG4gICAgICAgICAgICByZXR1cm4gT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMob2JqKS5sZW5ndGggPT09IDA7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB2YXIgaztcbiAgICAgICAgICAgIGZvciAoayBpbiBvYmopIHtcbiAgICAgICAgICAgICAgICBpZiAoaGFzT3duUHJvcChvYmosIGspKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzVW5kZWZpbmVkKGlucHV0KSB7XG4gICAgICAgIHJldHVybiBpbnB1dCA9PT0gdm9pZCAwO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzTnVtYmVyKGlucHV0KSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICB0eXBlb2YgaW5wdXQgPT09ICdudW1iZXInIHx8XG4gICAgICAgICAgICBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoaW5wdXQpID09PSAnW29iamVjdCBOdW1iZXJdJ1xuICAgICAgICApO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzRGF0ZShpbnB1dCkge1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgaW5wdXQgaW5zdGFuY2VvZiBEYXRlIHx8XG4gICAgICAgICAgICBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoaW5wdXQpID09PSAnW29iamVjdCBEYXRlXSdcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtYXAoYXJyLCBmbikge1xuICAgICAgICB2YXIgcmVzID0gW10sXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgYXJyTGVuID0gYXJyLmxlbmd0aDtcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGFyckxlbjsgKytpKSB7XG4gICAgICAgICAgICByZXMucHVzaChmbihhcnJbaV0sIGkpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGV4dGVuZChhLCBiKSB7XG4gICAgICAgIGZvciAodmFyIGkgaW4gYikge1xuICAgICAgICAgICAgaWYgKGhhc093blByb3AoYiwgaSkpIHtcbiAgICAgICAgICAgICAgICBhW2ldID0gYltpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChoYXNPd25Qcm9wKGIsICd0b1N0cmluZycpKSB7XG4gICAgICAgICAgICBhLnRvU3RyaW5nID0gYi50b1N0cmluZztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChoYXNPd25Qcm9wKGIsICd2YWx1ZU9mJykpIHtcbiAgICAgICAgICAgIGEudmFsdWVPZiA9IGIudmFsdWVPZjtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBhO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNyZWF0ZVVUQyhpbnB1dCwgZm9ybWF0LCBsb2NhbGUsIHN0cmljdCkge1xuICAgICAgICByZXR1cm4gY3JlYXRlTG9jYWxPclVUQyhpbnB1dCwgZm9ybWF0LCBsb2NhbGUsIHN0cmljdCwgdHJ1ZSkudXRjKCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZGVmYXVsdFBhcnNpbmdGbGFncygpIHtcbiAgICAgICAgLy8gV2UgbmVlZCB0byBkZWVwIGNsb25lIHRoaXMgb2JqZWN0LlxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgZW1wdHk6IGZhbHNlLFxuICAgICAgICAgICAgdW51c2VkVG9rZW5zOiBbXSxcbiAgICAgICAgICAgIHVudXNlZElucHV0OiBbXSxcbiAgICAgICAgICAgIG92ZXJmbG93OiAtMixcbiAgICAgICAgICAgIGNoYXJzTGVmdE92ZXI6IDAsXG4gICAgICAgICAgICBudWxsSW5wdXQ6IGZhbHNlLFxuICAgICAgICAgICAgaW52YWxpZEVyYTogbnVsbCxcbiAgICAgICAgICAgIGludmFsaWRNb250aDogbnVsbCxcbiAgICAgICAgICAgIGludmFsaWRGb3JtYXQ6IGZhbHNlLFxuICAgICAgICAgICAgdXNlckludmFsaWRhdGVkOiBmYWxzZSxcbiAgICAgICAgICAgIGlzbzogZmFsc2UsXG4gICAgICAgICAgICBwYXJzZWREYXRlUGFydHM6IFtdLFxuICAgICAgICAgICAgZXJhOiBudWxsLFxuICAgICAgICAgICAgbWVyaWRpZW06IG51bGwsXG4gICAgICAgICAgICByZmMyODIyOiBmYWxzZSxcbiAgICAgICAgICAgIHdlZWtkYXlNaXNtYXRjaDogZmFsc2UsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0UGFyc2luZ0ZsYWdzKG0pIHtcbiAgICAgICAgaWYgKG0uX3BmID09IG51bGwpIHtcbiAgICAgICAgICAgIG0uX3BmID0gZGVmYXVsdFBhcnNpbmdGbGFncygpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtLl9wZjtcbiAgICB9XG5cbiAgICB2YXIgc29tZTtcbiAgICBpZiAoQXJyYXkucHJvdG90eXBlLnNvbWUpIHtcbiAgICAgICAgc29tZSA9IEFycmF5LnByb3RvdHlwZS5zb21lO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHNvbWUgPSBmdW5jdGlvbiAoZnVuKSB7XG4gICAgICAgICAgICB2YXIgdCA9IE9iamVjdCh0aGlzKSxcbiAgICAgICAgICAgICAgICBsZW4gPSB0Lmxlbmd0aCA+Pj4gMCxcbiAgICAgICAgICAgICAgICBpO1xuXG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaSBpbiB0ICYmIGZ1bi5jYWxsKHRoaXMsIHRbaV0sIGksIHQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzVmFsaWQobSkge1xuICAgICAgICB2YXIgZmxhZ3MgPSBudWxsLFxuICAgICAgICAgICAgcGFyc2VkUGFydHMgPSBmYWxzZSxcbiAgICAgICAgICAgIGlzTm93VmFsaWQgPSBtLl9kICYmICFpc05hTihtLl9kLmdldFRpbWUoKSk7XG4gICAgICAgIGlmIChpc05vd1ZhbGlkKSB7XG4gICAgICAgICAgICBmbGFncyA9IGdldFBhcnNpbmdGbGFncyhtKTtcbiAgICAgICAgICAgIHBhcnNlZFBhcnRzID0gc29tZS5jYWxsKGZsYWdzLnBhcnNlZERhdGVQYXJ0cywgZnVuY3Rpb24gKGkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaSAhPSBudWxsO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpc05vd1ZhbGlkID1cbiAgICAgICAgICAgICAgICBmbGFncy5vdmVyZmxvdyA8IDAgJiZcbiAgICAgICAgICAgICAgICAhZmxhZ3MuZW1wdHkgJiZcbiAgICAgICAgICAgICAgICAhZmxhZ3MuaW52YWxpZEVyYSAmJlxuICAgICAgICAgICAgICAgICFmbGFncy5pbnZhbGlkTW9udGggJiZcbiAgICAgICAgICAgICAgICAhZmxhZ3MuaW52YWxpZFdlZWtkYXkgJiZcbiAgICAgICAgICAgICAgICAhZmxhZ3Mud2Vla2RheU1pc21hdGNoICYmXG4gICAgICAgICAgICAgICAgIWZsYWdzLm51bGxJbnB1dCAmJlxuICAgICAgICAgICAgICAgICFmbGFncy5pbnZhbGlkRm9ybWF0ICYmXG4gICAgICAgICAgICAgICAgIWZsYWdzLnVzZXJJbnZhbGlkYXRlZCAmJlxuICAgICAgICAgICAgICAgICghZmxhZ3MubWVyaWRpZW0gfHwgKGZsYWdzLm1lcmlkaWVtICYmIHBhcnNlZFBhcnRzKSk7XG4gICAgICAgICAgICBpZiAobS5fc3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgaXNOb3dWYWxpZCA9XG4gICAgICAgICAgICAgICAgICAgIGlzTm93VmFsaWQgJiZcbiAgICAgICAgICAgICAgICAgICAgZmxhZ3MuY2hhcnNMZWZ0T3ZlciA9PT0gMCAmJlxuICAgICAgICAgICAgICAgICAgICBmbGFncy51bnVzZWRUb2tlbnMubGVuZ3RoID09PSAwICYmXG4gICAgICAgICAgICAgICAgICAgIGZsYWdzLmJpZ0hvdXIgPT09IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoT2JqZWN0LmlzRnJvemVuID09IG51bGwgfHwgIU9iamVjdC5pc0Zyb3plbihtKSkge1xuICAgICAgICAgICAgbS5faXNWYWxpZCA9IGlzTm93VmFsaWQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gaXNOb3dWYWxpZDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbS5faXNWYWxpZDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjcmVhdGVJbnZhbGlkKGZsYWdzKSB7XG4gICAgICAgIHZhciBtID0gY3JlYXRlVVRDKE5hTik7XG4gICAgICAgIGlmIChmbGFncyAhPSBudWxsKSB7XG4gICAgICAgICAgICBleHRlbmQoZ2V0UGFyc2luZ0ZsYWdzKG0pLCBmbGFncyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBnZXRQYXJzaW5nRmxhZ3MobSkudXNlckludmFsaWRhdGVkID0gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBtO1xuICAgIH1cblxuICAgIC8vIFBsdWdpbnMgdGhhdCBhZGQgcHJvcGVydGllcyBzaG91bGQgYWxzbyBhZGQgdGhlIGtleSBoZXJlIChudWxsIHZhbHVlKSxcbiAgICAvLyBzbyB3ZSBjYW4gcHJvcGVybHkgY2xvbmUgb3Vyc2VsdmVzLlxuICAgIHZhciBtb21lbnRQcm9wZXJ0aWVzID0gKGhvb2tzLm1vbWVudFByb3BlcnRpZXMgPSBbXSksXG4gICAgICAgIHVwZGF0ZUluUHJvZ3Jlc3MgPSBmYWxzZTtcblxuICAgIGZ1bmN0aW9uIGNvcHlDb25maWcodG8sIGZyb20pIHtcbiAgICAgICAgdmFyIGksXG4gICAgICAgICAgICBwcm9wLFxuICAgICAgICAgICAgdmFsLFxuICAgICAgICAgICAgbW9tZW50UHJvcGVydGllc0xlbiA9IG1vbWVudFByb3BlcnRpZXMubGVuZ3RoO1xuXG4gICAgICAgIGlmICghaXNVbmRlZmluZWQoZnJvbS5faXNBTW9tZW50T2JqZWN0KSkge1xuICAgICAgICAgICAgdG8uX2lzQU1vbWVudE9iamVjdCA9IGZyb20uX2lzQU1vbWVudE9iamVjdDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX2kpKSB7XG4gICAgICAgICAgICB0by5faSA9IGZyb20uX2k7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFpc1VuZGVmaW5lZChmcm9tLl9mKSkge1xuICAgICAgICAgICAgdG8uX2YgPSBmcm9tLl9mO1xuICAgICAgICB9XG4gICAgICAgIGlmICghaXNVbmRlZmluZWQoZnJvbS5fbCkpIHtcbiAgICAgICAgICAgIHRvLl9sID0gZnJvbS5fbDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX3N0cmljdCkpIHtcbiAgICAgICAgICAgIHRvLl9zdHJpY3QgPSBmcm9tLl9zdHJpY3Q7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFpc1VuZGVmaW5lZChmcm9tLl90em0pKSB7XG4gICAgICAgICAgICB0by5fdHptID0gZnJvbS5fdHptO1xuICAgICAgICB9XG4gICAgICAgIGlmICghaXNVbmRlZmluZWQoZnJvbS5faXNVVEMpKSB7XG4gICAgICAgICAgICB0by5faXNVVEMgPSBmcm9tLl9pc1VUQztcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX29mZnNldCkpIHtcbiAgICAgICAgICAgIHRvLl9vZmZzZXQgPSBmcm9tLl9vZmZzZXQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFpc1VuZGVmaW5lZChmcm9tLl9wZikpIHtcbiAgICAgICAgICAgIHRvLl9wZiA9IGdldFBhcnNpbmdGbGFncyhmcm9tKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIWlzVW5kZWZpbmVkKGZyb20uX2xvY2FsZSkpIHtcbiAgICAgICAgICAgIHRvLl9sb2NhbGUgPSBmcm9tLl9sb2NhbGU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAobW9tZW50UHJvcGVydGllc0xlbiA+IDApIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBtb21lbnRQcm9wZXJ0aWVzTGVuOyBpKyspIHtcbiAgICAgICAgICAgICAgICBwcm9wID0gbW9tZW50UHJvcGVydGllc1tpXTtcbiAgICAgICAgICAgICAgICB2YWwgPSBmcm9tW3Byb3BdO1xuICAgICAgICAgICAgICAgIGlmICghaXNVbmRlZmluZWQodmFsKSkge1xuICAgICAgICAgICAgICAgICAgICB0b1twcm9wXSA9IHZhbDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdG87XG4gICAgfVxuXG4gICAgLy8gTW9tZW50IHByb3RvdHlwZSBvYmplY3RcbiAgICBmdW5jdGlvbiBNb21lbnQoY29uZmlnKSB7XG4gICAgICAgIGNvcHlDb25maWcodGhpcywgY29uZmlnKTtcbiAgICAgICAgdGhpcy5fZCA9IG5ldyBEYXRlKGNvbmZpZy5fZCAhPSBudWxsID8gY29uZmlnLl9kLmdldFRpbWUoKSA6IE5hTik7XG4gICAgICAgIGlmICghdGhpcy5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIHRoaXMuX2QgPSBuZXcgRGF0ZShOYU4pO1xuICAgICAgICB9XG4gICAgICAgIC8vIFByZXZlbnQgaW5maW5pdGUgbG9vcCBpbiBjYXNlIHVwZGF0ZU9mZnNldCBjcmVhdGVzIG5ldyBtb21lbnRcbiAgICAgICAgLy8gb2JqZWN0cy5cbiAgICAgICAgaWYgKHVwZGF0ZUluUHJvZ3Jlc3MgPT09IGZhbHNlKSB7XG4gICAgICAgICAgICB1cGRhdGVJblByb2dyZXNzID0gdHJ1ZTtcbiAgICAgICAgICAgIGhvb2tzLnVwZGF0ZU9mZnNldCh0aGlzKTtcbiAgICAgICAgICAgIHVwZGF0ZUluUHJvZ3Jlc3MgPSBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzTW9tZW50KG9iaikge1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgb2JqIGluc3RhbmNlb2YgTW9tZW50IHx8IChvYmogIT0gbnVsbCAmJiBvYmouX2lzQU1vbWVudE9iamVjdCAhPSBudWxsKVxuICAgICAgICApO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHdhcm4obXNnKSB7XG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGhvb2tzLnN1cHByZXNzRGVwcmVjYXRpb25XYXJuaW5ncyA9PT0gZmFsc2UgJiZcbiAgICAgICAgICAgIHR5cGVvZiBjb25zb2xlICE9PSAndW5kZWZpbmVkJyAmJlxuICAgICAgICAgICAgY29uc29sZS53YXJuXG4gICAgICAgICkge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKCdEZXByZWNhdGlvbiB3YXJuaW5nOiAnICsgbXNnKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRlcHJlY2F0ZShtc2csIGZuKSB7XG4gICAgICAgIHZhciBmaXJzdFRpbWUgPSB0cnVlO1xuXG4gICAgICAgIHJldHVybiBleHRlbmQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgaWYgKGhvb2tzLmRlcHJlY2F0aW9uSGFuZGxlciAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgaG9va3MuZGVwcmVjYXRpb25IYW5kbGVyKG51bGwsIG1zZyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZmlyc3RUaW1lKSB7XG4gICAgICAgICAgICAgICAgdmFyIGFyZ3MgPSBbXSxcbiAgICAgICAgICAgICAgICAgICAgYXJnLFxuICAgICAgICAgICAgICAgICAgICBpLFxuICAgICAgICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgICAgICAgIGFyZ0xlbiA9IGFyZ3VtZW50cy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGFyZ0xlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGFyZyA9ICcnO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGFyZ3VtZW50c1tpXSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyZyArPSAnXFxuWycgKyBpICsgJ10gJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoa2V5IGluIGFyZ3VtZW50c1swXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNPd25Qcm9wKGFyZ3VtZW50c1swXSwga2V5KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmcgKz0ga2V5ICsgJzogJyArIGFyZ3VtZW50c1swXVtrZXldICsgJywgJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSBhcmcuc2xpY2UoMCwgLTIpOyAvLyBSZW1vdmUgdHJhaWxpbmcgY29tbWEgYW5kIHNwYWNlXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhcmcgPSBhcmd1bWVudHNbaV07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYXJncy5wdXNoKGFyZyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHdhcm4oXG4gICAgICAgICAgICAgICAgICAgIG1zZyArXG4gICAgICAgICAgICAgICAgICAgICAgICAnXFxuQXJndW1lbnRzOiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3MpLmpvaW4oJycpICtcbiAgICAgICAgICAgICAgICAgICAgICAgICdcXG4nICtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBFcnJvcigpLnN0YWNrXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBmaXJzdFRpbWUgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBmbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuICAgICAgICB9LCBmbik7XG4gICAgfVxuXG4gICAgdmFyIGRlcHJlY2F0aW9ucyA9IHt9O1xuXG4gICAgZnVuY3Rpb24gZGVwcmVjYXRlU2ltcGxlKG5hbWUsIG1zZykge1xuICAgICAgICBpZiAoaG9va3MuZGVwcmVjYXRpb25IYW5kbGVyICE9IG51bGwpIHtcbiAgICAgICAgICAgIGhvb2tzLmRlcHJlY2F0aW9uSGFuZGxlcihuYW1lLCBtc2cpO1xuICAgICAgICB9XG4gICAgICAgIGlmICghZGVwcmVjYXRpb25zW25hbWVdKSB7XG4gICAgICAgICAgICB3YXJuKG1zZyk7XG4gICAgICAgICAgICBkZXByZWNhdGlvbnNbbmFtZV0gPSB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgaG9va3Muc3VwcHJlc3NEZXByZWNhdGlvbldhcm5pbmdzID0gZmFsc2U7XG4gICAgaG9va3MuZGVwcmVjYXRpb25IYW5kbGVyID0gbnVsbDtcblxuICAgIGZ1bmN0aW9uIGlzRnVuY3Rpb24oaW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICh0eXBlb2YgRnVuY3Rpb24gIT09ICd1bmRlZmluZWQnICYmIGlucHV0IGluc3RhbmNlb2YgRnVuY3Rpb24pIHx8XG4gICAgICAgICAgICBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoaW5wdXQpID09PSAnW29iamVjdCBGdW5jdGlvbl0nXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2V0KGNvbmZpZykge1xuICAgICAgICB2YXIgcHJvcCwgaTtcbiAgICAgICAgZm9yIChpIGluIGNvbmZpZykge1xuICAgICAgICAgICAgaWYgKGhhc093blByb3AoY29uZmlnLCBpKSkge1xuICAgICAgICAgICAgICAgIHByb3AgPSBjb25maWdbaV07XG4gICAgICAgICAgICAgICAgaWYgKGlzRnVuY3Rpb24ocHJvcCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tpXSA9IHByb3A7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpc1snXycgKyBpXSA9IHByb3A7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuX2NvbmZpZyA9IGNvbmZpZztcbiAgICAgICAgLy8gTGVuaWVudCBvcmRpbmFsIHBhcnNpbmcgYWNjZXB0cyBqdXN0IGEgbnVtYmVyIGluIGFkZGl0aW9uIHRvXG4gICAgICAgIC8vIG51bWJlciArIChwb3NzaWJseSkgc3R1ZmYgY29taW5nIGZyb20gX2RheU9mTW9udGhPcmRpbmFsUGFyc2UuXG4gICAgICAgIC8vIFRPRE86IFJlbW92ZSBcIm9yZGluYWxQYXJzZVwiIGZhbGxiYWNrIGluIG5leHQgbWFqb3IgcmVsZWFzZS5cbiAgICAgICAgdGhpcy5fZGF5T2ZNb250aE9yZGluYWxQYXJzZUxlbmllbnQgPSBuZXcgUmVnRXhwKFxuICAgICAgICAgICAgKHRoaXMuX2RheU9mTW9udGhPcmRpbmFsUGFyc2Uuc291cmNlIHx8IHRoaXMuX29yZGluYWxQYXJzZS5zb3VyY2UpICtcbiAgICAgICAgICAgICAgICAnfCcgK1xuICAgICAgICAgICAgICAgIC9cXGR7MSwyfS8uc291cmNlXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbWVyZ2VDb25maWdzKHBhcmVudENvbmZpZywgY2hpbGRDb25maWcpIHtcbiAgICAgICAgdmFyIHJlcyA9IGV4dGVuZCh7fSwgcGFyZW50Q29uZmlnKSxcbiAgICAgICAgICAgIHByb3A7XG4gICAgICAgIGZvciAocHJvcCBpbiBjaGlsZENvbmZpZykge1xuICAgICAgICAgICAgaWYgKGhhc093blByb3AoY2hpbGRDb25maWcsIHByb3ApKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzT2JqZWN0KHBhcmVudENvbmZpZ1twcm9wXSkgJiYgaXNPYmplY3QoY2hpbGRDb25maWdbcHJvcF0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc1twcm9wXSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICBleHRlbmQocmVzW3Byb3BdLCBwYXJlbnRDb25maWdbcHJvcF0pO1xuICAgICAgICAgICAgICAgICAgICBleHRlbmQocmVzW3Byb3BdLCBjaGlsZENvbmZpZ1twcm9wXSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGlsZENvbmZpZ1twcm9wXSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc1twcm9wXSA9IGNoaWxkQ29uZmlnW3Byb3BdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSByZXNbcHJvcF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAocHJvcCBpbiBwYXJlbnRDb25maWcpIHtcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICBoYXNPd25Qcm9wKHBhcmVudENvbmZpZywgcHJvcCkgJiZcbiAgICAgICAgICAgICAgICAhaGFzT3duUHJvcChjaGlsZENvbmZpZywgcHJvcCkgJiZcbiAgICAgICAgICAgICAgICBpc09iamVjdChwYXJlbnRDb25maWdbcHJvcF0pXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgY2hhbmdlcyB0byBwcm9wZXJ0aWVzIGRvbid0IG1vZGlmeSBwYXJlbnQgY29uZmlnXG4gICAgICAgICAgICAgICAgcmVzW3Byb3BdID0gZXh0ZW5kKHt9LCByZXNbcHJvcF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gTG9jYWxlKGNvbmZpZykge1xuICAgICAgICBpZiAoY29uZmlnICE9IG51bGwpIHtcbiAgICAgICAgICAgIHRoaXMuc2V0KGNvbmZpZyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2YXIga2V5cztcblxuICAgIGlmIChPYmplY3Qua2V5cykge1xuICAgICAgICBrZXlzID0gT2JqZWN0LmtleXM7XG4gICAgfSBlbHNlIHtcbiAgICAgICAga2V5cyA9IGZ1bmN0aW9uIChvYmopIHtcbiAgICAgICAgICAgIHZhciBpLFxuICAgICAgICAgICAgICAgIHJlcyA9IFtdO1xuICAgICAgICAgICAgZm9yIChpIGluIG9iaikge1xuICAgICAgICAgICAgICAgIGlmIChoYXNPd25Qcm9wKG9iaiwgaSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzLnB1c2goaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICB2YXIgZGVmYXVsdENhbGVuZGFyID0ge1xuICAgICAgICBzYW1lRGF5OiAnW1RvZGF5IGF0XSBMVCcsXG4gICAgICAgIG5leHREYXk6ICdbVG9tb3Jyb3cgYXRdIExUJyxcbiAgICAgICAgbmV4dFdlZWs6ICdkZ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ChmdW5jLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyksIHBhZGRlZFsxXSwgcGFkZGVkWzJdKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9yZGluYWwpIHtcbiAgICAgICAgICAgIGZvcm1hdFRva2VuRnVuY3Rpb25zW29yZGluYWxdID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmxvY2FsZURhdGEoKS5vcmRpbmFsKFxuICAgICAgICAgICAgICAgICAgICBmdW5jLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyksXG4gICAgICAgICAgICAgICAgICAgIHRva2VuXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZW1vdmVGb3JtYXR0aW5nVG9rZW5zKGlucHV0KSB7XG4gICAgICAgIGlmIChpbnB1dC5tYXRjaCgvXFxbW1xcc1xcU10vKSkge1xuICAgICAgICAgICAgcmV0dXJuIGlucHV0LnJlcGxhY2UoL15cXFt8XFxdJC9nLCAnJyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGlucHV0LnJlcGxhY2UoL1xcXFwvZywgJycpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1ha2VGb3JtYXRGdW5jdGlvbihmb3JtYXQpIHtcbiAgICAgICAgdmFyIGFycmF5ID0gZm9ybWF0Lm1hdGNoKGZvcm1hdHRpbmdUb2tlbnMpLFxuICAgICAgICAgICAgaSxcbiAgICAgICAgICAgIGxlbmd0aDtcblxuICAgICAgICBmb3IgKGkgPSAwLCBsZW5ndGggPSBhcnJheS5sZW5ndGg7IGkgPCBsZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGZvcm1hdFRva2VuRnVuY3Rpb25zW2FycmF5W2ldXSkge1xuICAgICAgICAgICAgICAgIGFycmF5W2ldID0gZm9ybWF0VG9rZW5GdW5jdGlvbn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gICAgICAgIHZhciBmb3JtYXQgPSB0aGlzLl9sb25nRGF0ZUZvcm1hdFtrZXldLFxuICAgICAgICAgICAgZm9ybWF0VXBwZXIgPSB0aGlzLl9sb25nRGF0ZUZvcm1hdFtrZXkudG9VcHBlckNhc2UoKV07XG5cbiAgICAgICAgaWYgKGZvcm1hdCB8fCAhZm9ybWF0VXBwZXIpIHtcbiAgICAgICAgICAgIHJldHVybiBmb3JtYXQ7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLl9sb25nRGF0ZUZvcm1hdFtrZXldID0gZm9ybWF0VXBwZXJcbiAgICAgICAgICAgIC5tYXRjaChmb3JtYXR0aW5nVG9rZW5zKVxuICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAodG9rKSB7XG4gICAgICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgICAgICB0b2sgPT09ICdNTU1NJyB8fFxuICAgICAgICAgICAgICAgICAgICB0b2sgPT09ICdNTScgfHxcbiAgICAgICAgICAgICAgICAgICAgdG9rID09PSAnREQnIHx8XG4gICAgICAgICAgICAgICAgICAgIHRvayA9PT0gJ2RkZGQnXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2suc2xpY2UoMSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB0b2s7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgLmpvaW4oJycpO1xuXG4gICAgICAgIHJldHVybiB0aGlzLl9sb25nRGF0ZUZvcm1hdFtrZXldO1xuICAgIH1cblxuICAgIHZhciBkZWZhdWx0SW52YWxpZERhdGUgPSAnSW52YWxpZCBkYXRlJztcblxuICAgIGZ1bmN0aW9uIGludmFsaWREYXRlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5faW52YWxpZERhdGU7XG4gICAgfVxuXG4gICAgdmFyIGRlZmF1bHRPcmRpbmFsID0gJyVkJyxcbiAgICAgICAgZGVmYXVsdERheU9mTW9udGhPcmRpbmFsUGFyc2UgPSAvXFxkezEsMn0vO1xuXG4gICAgZnVuY3Rpb24gb3JkaW5hbChudW1iZXIpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX29yZGluYWwucmVwbGFjZSgnJWQnLCBudW1iZXIpO1xuICAgIH1cblxuICAgIHZhciBkZWZhdWx0UmVsYXRpdmVUaW1lID0ge1xuICAgICAgICBmdXR1cmU6ICdpbiAlcycsXG4gICAgICAgIHBhc3Q6ICclcyBhZ28nLFxuICAgICAgICBzOiAnYSBmZXcgc2Vjb25kcycsXG4gICAgICAgIHNzOiAnJWQgc2Vjb25kcycsXG4gICAgICAgIG06ICdhIG1pbnV0ZScsXG4gICAgICAgIG1tOiAnJWQgbWludXRlcycsXG4gICAgICAgIGg6ICdhbiBob3VyJyxcbiAgICAgICAgaGg6ICclZCBob3VycycsXG4gICAgICAgIGQ6ICdhIGRheScsXG4gICAgICAgIGRkOiAnJWQgZGF5cycsXG4gICAgICAgIHc6ICdhIHdlZWsnLFxuICAgICAgICB3dzogJyVkIHdlZWtzJyxcbiAgICAgICAgTTogJ2EgbW9udGgnLFxuICAgICAgICBNTTogJyVkIG1vbnRocycsXG4gICAgICAgIHk6ICdhIHllYXInLFxuICAgICAgICB5eTogJyVkIHllYXJzJyxcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gcmVsYXRpdmVUaW1lKG51bWJlciwgd2l0aG91dFN1ZmZpeCwgc3RyaW5nLCBpc0Z1dHVyZSkge1xuICAgICAgICB2YXIgb3V0cHV0ID0gdGhpcy5fcmVsYXRpdmVUaW1lW3N0cmluZ107XG4gICAgICAgIHJldHVybiBpc0Z1bmN0aW9uKG91dHB1dClcbiAgICAgICAgICAgID8gb3V0cHV0KG51bWJlciwgd2l0aG91dFN1ZmZpeCwgc3RyaW5nLCBpc0Z1dHVyZSlcbiAgICAgICAgICAgIDogb3V0cHV0LnJlcGxhY2UoLyVkL2ksIG51bWJlcik7XG4gICAgfVxuXG4gICAgZnVuY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ICdtaW51dGUnLFxuICAgICAgICBtaW51dGU6ICdtaW51dGUnLFxuICAgICAgICBNOiAnbW9udGgnLFxuICAgICAgICBtb250aHM6ICdtb250aCcsXG4gICAgICAgIG1vbnRoOiAnbW9udGgnLFxuICAgICAgICBROiAncXVhcnRlcicsXG4gICAgICAgIHF1YXJ0ZXJzOiAncXVhcnRlcicsXG4gICAgICAgIHF1YXJ0ZXI6ICdxdWFydGVyJyxcbiAgICAgICAgczogJ3NlY29uZCcsXG4gICAgICAgIHNlY29uZHM6ICdzZWNvbmQnLFxuICAgICAgICBzZWNvbmQ6ICdzZWNvbmQnLFxuICAgICAgICBnZzogJ3dlZWtZZWFyJyxcbiAgICAgICAgd2Vla3llYXJzOiAnd2Vla1llYXInLFxuICAgICAgICB3ZWVreWVhcjogJ3dlZWtZZWFyJyxcbiAgICAgICAgR0c6ICdpc29XZWVrWWVhcicsXG4gICAgICAgIGlzb3dlZWt5ZWFyczogJ2lzb1dlZWtZZWFyJyxcbiAgICAgICAgaXNvd2Vla3llYXI6ICdpc29XZWVrWWVhcicsXG4gICAgICAgIHc6ICd3ZWVrJyxcbiAgICAgICAgd2Vla3M6ICd3ZWVrJyxcbiAgICAgICAgd2VlazogJ3dlZWsnLFxuICAgICAgICBXOiAnaXNvV2VlaycsXG4gICAgICAgIGlzb3dlZWtzOiAnaXNvV2VlaycsXG4gICAgICAgIGlzb3dlZWs6ICdpc29XZWVrJyxcbiAgICAgICAgeTogJ3llYXInLFxuICAgICAgICB5ZWFyczogJ3llYXInLFxuICAgICAgICB5ZWFyOiAneWVhcicsXG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIG5vcm1hbGl6ZVVuaXRzKHVuaXRzKSB7XG4gICAgICAgIHJldHVybiB0eXBlb2YgdW5pdHMgPT09ICdzdHJpbmcnXG4gICAgICAgICAgICA/IGFsaWFzZXNbdW5pdHNdIHx8IGFsaWFzZXNbdW5pdHMudG9Mb3dlckNhc2UoKV1cbiAgICAgICAgICAgIDogdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG5vcm1hbGl6ZU9iamVjdFVuaXRzKGlucHV0T2JqZWN0KSB7XG4gICAgICAgIHZhciBub3JtYWxpemVkSW5wdXQgPSB7fSxcbiAgICAgICAgICAgIG5vcm1hbGl6ZWRQcm9wLFxuICAgICAgICAgICAgcHJvcDtcblxuICAgICAgICBmb3IgKHByb3AgaW4gaW5wdXRPYmplY3QpIHtcbiAgICAgICAgICAgIGlmIChoYXNPd25Qcm9wKGlucHV0T2JqZWN0LCBwcm9wKSkge1xuICAgICAgICAgICAgICAgIG5vcm1hbGl6ZWRQcm9wID0gbm9ybWFsaXplVW5pdHMocHJvcCk7XG4gICAgICAgICAgICAgICAgaWYgKG5vcm1hbGl6ZWRQcm9wKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vcm1hbGl6ZWRJbnB1dFtub3JtYWxpemVkUHJvcF0gPSBpbnB1dE9iamVjdFtwcm9wXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbm9ybWFsaXplZElucHV0O1xuICAgIH1cblxuICAgIHZhciBwcmlvcml0aWVzID0ge1xuICAgICAgICBkYXRlOiA5LFxuICAgICAgICBkYXk6IDExLFxuICAgICAgICB3ZWVrZGF5OiAxMSxcbiAgICAgICAgaXNvV2Vla2RheTogMTEsXG4gICAgICAgIGRheU9mWWVhcjogNCxcbiAgICAgICAgaG91cjogMTMsXG4gICAgICAgIG1pbGxpc2Vjb25kOiAxNixcbiAgICAgICAgbWludXRlOiAxNCxcbiAgICAgICAgbW9udGg6IDgsXG4gICAgICAgIHF1YXJ0ZXI6IDcsXG4gICAgICAgIHNlY29uZDogMTUsXG4gICAgICAgIHdlZWtZZWFyOiAxLFxuICAgICAgICBpc29XZWVrWWVhcjogMSxcbiAgICAgICAgd2VlazogNSxcbiAgICAgICAgaXNvV2VlazogNSxcbiAgICAgICAgeWVhcjogMSxcbiA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N0aW9uIHVuZXNjYXBlRm9ybWF0KHMpIHtcbiAgICAgICAgcmV0dXJuIHJlZ2V4RXNjYXBlKFxuICAgICAgICAgICAgc1xuICAgICAgICAgICAgICAgIC5yZXBsYWNlKCdcXFxcJywgJycpXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoXG4gICAgICAgICAgICAgICAgICAgIC9cXFxcKFxcWyl8XFxcXChcXF0pfFxcWyhbXlxcXVxcW10qKVxcXXxcXFxcKC4pL2csXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChtYXRjaGVkLCBwMSwgcDIsIHAzLCBwNCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHAxIHx8IHAyIHx8IHAzIHx8IHA0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgKVxuICAgICAgICApO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlZ2V4RXNjYXBlKHMpIHtcbiAgICAgICAgcmV0dXJuIHMucmVwbGFjZSgvWy1cXC9cXFxcXiQqKz8uKCl8W1xcXXt9XS9nLCAnXFxcXCQmJyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gYWJzRmxvb3IobnVtYmVyKSB7XG4gICAgICAgIGlmIChudW1iZXIgPCAwKSB7XG4gICAgICAgICAgICAvLyAtMCAtPiAwXG4gICAgICAgICAgICByZXR1cm4gTWF0aC5jZWlsKG51bWJlcikgfHwgMDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBNYXRoLmZsb29yKG51bWJlcik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiB0b0ludChhcmd1bWVudEZvckNvZXJjaW9uKSB7XG4gICAgICAgIHZhciBjb2VyY2VkTnVtYmVyID0gK2FyZ3VtZW50Rm9yQ29lcmNpb24sXG4gICAgICAgICAgICB2YWx1ZSA9IDA7XG5cbiAgICAgICAgaWYgKGNvZXJjZWROdW1iZXIgIT09IDAgJiYgaXNGaW5pdGUoY29lcmNlZE51bWJlcikpIHtcbiAgICAgICAgICAgIHZhbHVlID0gYWJzRmxvb3IoY29lcmNlZE51bWJlcik7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgdmFyIHRva2VucyA9IHt9O1xuXG4gICAgZnVuY3Rpb24gYWRkUGFyc2VUb2tlbih0b2tlbiwgY2FsbGJhY2spIHtcbiAgICAgICAgdmFyIGksXG4gICAgICAgICAgICBmdW5jID0gY2FsbGJhY2ssXG4gICAgICAgICAgICB0b2tlbkxlbjtcbiAgICAgICAgaWYgKHR5cGVvZiB0b2tlbiA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIHRva2VuID0gW3Rva2VuXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNOdW1iZXIoY2FsbGJhY2spKSB7XG4gICAgICAgICAgICBmdW5jID0gZnVuY3Rpb24gKGlucHV0LCBhcnJheSkge1xuICAgICAgICAgICAgICAgIGFycmF5W2NhbGxiYWNrXSA9IHRvSW50KGlucHV0KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgdG9rZW5MZW4gPSB0b2tlbi5sZW5ndGg7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0b2tlbkxlbjsgaSsrKSB7XG4gICAgICAgICAgICB0b2tlbnNbdG9rZW5baV1dID0gZnVuYztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFkZFdlZWtQYXJzZVRva2VuKHRva2VuLCBjYWxsYmFjaykge1xuICAgICAgICBhZGRQYXJzZVRva2VuKHRva2VuLCBmdW5jdGlvbiAoaW5wdXQsIGFycmF5LCBjb25maWcsIHRva2VuKSB7XG4gICAgICAgICAgICBjb25maWcuX3cgPSBjb25maWcuX3cgfHwge307XG4gICAgICAgICAgICBjYWxsYmFjayhpbnB1dCwgY29uZmlnLl93LCBjb25maWcsIHRva2VuKTtcbiAgICAgIC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FyKSB7XG4gICAgICAgIHJldHVybiBpc0xlYXBZZWFyKHllYXIpID8gMzY2IDogMzY1O1xuICAgIH1cblxuICAgIC8vIEhPT0tTXG5cbiAgICBob29rcy5wYXJzZVR3b0RpZ2l0WWVhciA9IGZ1bmN0aW9uIChpbnB1dCkge1xuICAgICAgICByZXR1cm4gdG9JbnQoaW5wdXQpICsgKHRvSW50KGlucHV0KSA+IDY4ID8gMTkwMCA6IDIwMDApO1xuICAgIH07XG5cbiAgICAvLyBNT01FTlRTXG5cbiAgICB2YXIgZ2V0U2V0WWVhciA9IG1ha2VHZXRTZXQoJ0Z1bGxZZWFyJywgdHJ1ZSk7XG5cbiAgICBmdW5jdGlvbiBnZXRJc0xlYXBZZWFyKCkge1xuICAgICAgICByZXR1cm4gaXNMZWFwWWVhcih0aGlzLnllYXIoKSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbWFrZUdldFNldCh1bml0LCBrZWVwVGltZSkge1xuICAgICAgICByZXR1cm4gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHNldCQxKHRoaXMsIHVuaXQsIHZhbHVlKTtcbiAgICAgICAgICAgICAgICBob29rcy51cGRhdGVPZmZzZXQodGhpcywga2VlcFRpbWUpO1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0KHRoaXMsIHVuaXQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldChtb20sIHVuaXQpIHtcbiAgICAgICAgaWYgKCFtb20uaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICByZXR1cm4gTmFOO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGQgPSBtb20uX2QsXG4gICAgICAgICAgICBpc1VUQyA9IG1vbS5faXNVVEM7XG5cbiAgICAgICAgc3dpdGNoICh1bml0KSB7XG4gICAgICAgICAgICBjYXNlICdNaWxsaXNlY29uZHMnOlxuICAgICAgICAgICAgICAgIHJldHVybiBpc1VUQyA/IGQuZ2V0VVRDTWlsbGlzZWNvbmRzKCkgOiBkLmdldE1pbGxpc2Vjb25kcygpO1xuICAgICAgICAgICAgY2FzZSAnU2Vjb25kcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVVRDID8gZC5nZXRVVENTZWNvbmRzKCkgOiBkLmdldFNlY29uZHMoKTtcbiAgICAgICAgICAgIGNhc2UgJ01pbnV0ZXMnOlxuICAgICAgICAgICAgICAgIHJldHVybiBpc1VUQyA/IGQuZ2V0VVRDTWludXRlcygpIDogZC5nZXRNaW51dGVzKCk7XG4gICAgICAgICAgICBjYXNlICdIb3Vycyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVVRDID8gZC5nZXRVVENIb3VycygpIDogZC5nZXRIb3VycygpO1xuICAgICAgICAgICAgY2FzZSAnRGF0ZSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVVRDID8gZC5nZXRVVENEYXRlKCkgOiBkLmdldERhdGUoKTtcbiAgICAgICAgICAgIGNhc2UgJ0RheSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVVRDID8gZC5nZXRVVENEYXkoKSA6IGQuZ2V0RGF5KCk7XG4gICAgICAgICAgICBjYXNlICdNb250aCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVVRDID8gZC5nZXRVVENNb250aCgpIDogZC5nZXRNb250aCgpO1xuICAgICAgICAgICAgY2FzZSAnRnVsbFllYXInOlxuICAgICAgICAgICAgICAgIHJldHVybiBpc1VUQyA/IGQuZ2V0VVRDRnVsbFllYXIoKSA6IGQuZ2V0RnVsbFllYXIoKTtcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuIE5hTjsgLy8gSnVzdCBpbiBjYXNlXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzZXQkMShtb20sIHVuaXQsIHZhbHVlKSB7XG4gICAgICAgIHZhciBkLCBpc1VUQywgeWVhciwgbW9udGgsIGRhdGU7XG5cbiAgICAgICAgaWYgKCFtb20uaXNWYWxpZCgpIHx8IGlzTmFOKHZhbHVlKSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgZCA9IG1vbS5fZDtcbiAgICAgICAgaXNVVEMgPSBtb20uX2lzVVRDO1xuXG4gICAgICAgIHN3aXRjaCAodW5pdCkge1xuICAgICAgICAgICAgY2FzZSAnTWlsbGlzZWNvbmRzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gdm9pZCAoaXNVVENcbiAgICAgICAgICAgICAgICAgICAgPyBkLnNldFVUQ01pbGxpc2Vjb25kcyh2YWx1ZSlcbiAgICAgICAgICAgICAgICAgICAgOiBkLnNldE1pbGxpc2Vjb25kcyh2YWx1ZSkpO1xuICAgICAgICAgICAgY2FzZSAnU2Vjb25kcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZvaWQgKGlzVVRDID8gZC5zZXRVVENTZWNvbmRzKHZhbHVlKSA6IGQuc2V0U2Vjb25kcyh2YWx1ZSkpO1xuICAgICAgICAgICAgY2FzZSAnTWludXRlcyc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZvaWQgKGlzVVRDID8gZC5zZXRVVENNaW51dGVzKHZhbHVlKSA6IGQuc2V0TWludXRlcyh2YWx1ZSkpO1xuICAgICAgICAgICAgY2FzZSAnSG91cnMnOlxuICAgICAgICAgICAgICAgIHJldHVybiB2b2lkIChpc1VUQyA/IGQuc2V0VVRDSG91cnModmFsdWUpIDogZC5zZXRIb3Vycyh2YWx1ZSkpO1xuICAgICAgICAgICAgY2FzZSAnRGF0ZSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZvaWQgKGlzVVRDID8gZC5zZXRVVENEYXRlKHZhbHVlKS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ZiAoaXNGdW5jdGlvbih0aGlzW3VuaXRzXSkpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzW3VuaXRzXSgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHN0cmluZ1NldCh1bml0cywgdmFsdWUpIHtcbiAgICAgICAgaWYgKHR5cGVvZiB1bml0cyA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgIHVuaXRzID0gbm9ybWFsaXplT2JqZWN0VW5pdHModW5pdHMpO1xuICAgICAgICAgICAgdmFyIHByaW9yaXRpemVkID0gZ2V0UHJpb3JpdGl6ZWRVbml0cyh1bml0cyksXG4gICAgICAgICAgICAgICAgaSxcbiAgICAgICAgICAgICAgICBwcmlvcml0aXplZExlbiA9IHByaW9yaXRpemVkLmxlbmd0aDtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwcmlvcml0aXplZExlbjsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdGhpc1twcmlvcml0aXplZFtpXS51bml0XSh1bml0c1twcmlvcml0aXplZFtpXS51bml0XSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1bml0cyA9IG5vcm1hbGl6ZVVuaXRzKHVuaXRzKTtcbiAgICAgICAgICAgIGlmIChpc0Z1bmN0aW9uKHRoaXNbdW5pdHNdKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzW3VuaXRzXSh2YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbW9kKG4sIHgpIHtcbiAgICAgICAgcmV0dXJuICgobiAlIHgpICsgeCkgJSB4O1xuICAgIH1cblxuICAgIHZhciBpbmRleE9mO1xuXG4gICAgaWYgKEFycmF5LnByb3RvdHlwZS5pbmRleE9mKSB7XG4gICAgICAgIGluZGV4T2YgPSBBcnJheS5wcm90b3R5cGUuaW5kZXhPZjtcbiAgICB9IGVsc2Uge1xuICAgICAgICBpbmRleE9mID0gZnVuY3Rpb24gKG8pIHtcbiAgICAgICAgICAgIC8vIEkga25vd1xuICAgICAgICAgICAgdmFyIGk7XG4gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGhpcy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzW2ldID09PSBvKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBkYXlzSW5Nb250aCh5ZWFyLCBtb250aCkge1xuICAgICAgICBpZiAoaXNOYU4oeWVhcikgfHwgaXNOYU4obW9udGgpKSB7XG4gICAgICAgICAgICByZXR1cm4gTmFOO1xuICAgICAgICB9XG4gICAgICAgIHZhciBtb2RNb250aCA9IG1vZChtb250aCwgMTIpO1xuICAgICAgICB5ZWFyICs9IChtb250aCAtIG1vZE1vbnRoKSAvIDEyO1xuICAgICAgICByZXR1cm4gbW9kTW9udGggPT09IDFcbiAgICAgICAgICAgID8gaXNMZWFwWWVhcih5ZWFyKVxuICAgICAgICAgICAgICAgID8gMjlcbiAgICAgICAgICAgICAgICA6IDI4XG4gICAgICAgICAgICA6IDMxIC0gKChtb2RNb250aCAlIDcpICUgMik7XG4gICAgfVxuXG4gICAgLy8gRk9STUFUVElOR1xuXG4gICAgYWRkRm9ybWF0VG9rZW4oJ00nLCBbJ01NJywgMl0sICdNbycsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubW9udGgoKSArIDE7XG4gICAgfSk7XG5cbiAgICBhZGRGb3JtYXRUb2tlbignTU1NJywgMCwgMCwgZnVuY3Rpb24gKGZvcm1hdCkge1xuICAgICAgICByZXR1cm4gdGhpcy5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kYWxvbmUnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaXNBcnJheSh0aGlzLl9tb250aHMpXG4gICAgICAgICAgICA/IHRoaXMuX21vbnRoc1ttLm1vbnRoKCldXG4gICAgICAgICAgICA6IHRoaXMuX21vbnRoc1tcbiAgICAgICAgICAgICAgICAgICh0aGlzLl9tb250aHMuaXNGb3JtYXQgfHwgTU9OVEhTX0lOX0ZPUk1BVCkudGVzdChmb3JtYXQpXG4gICAgICAgICAgICAgICAgICAgICAgPyAnZm9ybWF0J1xuICAgICAgICAgICAgICAgICAgICAgIDogJ3N0YW5kYWxvbmUnXG4gICAgICAgICAgICAgIF1bbS5tb250aCgpXTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBsb2NhbGVNb250aHNTaG9ydChtLCBmb3JtYXQpIHtcbiAgICAgICAgaWYgKCFtKSB7XG4gICAgICAgICAgICByZXR1cm4gaXNBcnJheSh0aGlzLl9tb250aHNTaG9ydClcbiAgICAgICAgICAgICAgICA/IHRoaXMuX21vbnRoc1Nob3J0XG4gICAgICAgICAgICAgICAgOiB0aGlzLl9tb250aHNTaG9ydFsnc3RhbmRhbG9uZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBpc0FycmF5KHRoaXMuX21vbnRoc1Nob3J0KVxuICAgICAgICAgICAgPyB0aGlzLl9tb250aHNTaG9ydFttLm1vbnRoKCldXG4gICAgICAgICAgICA6IHRoaXMuX21vbnRoc1Nob3J0W1xuICAgICAgICAgICAgICAgICAgTU9OVEhTX0lOX0ZPUk1BVC50ZXN0KGZvcm1hdCkgPyAnZm9ybWF0JyA6ICdzdGFuZGFsb25lJ1xuICAgICAgICAgICAgICBdW20ubW9udGgoKV07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaGFuZGxlU3RyaWN0UGFyc2UobW9udGhOYW1lLCBmb3JtYXQsIHN0cmljdCkge1xuICAgICAgICB2YXIgaSxcbiAgICAgICAgICAgIGlpLFxuICAgICAgICAgICAgbW9tLFxuICAgICAgICAgICAgbGxjID0gbW9udGhOYW1lLnRvTG9jYWxlTG93ZXJDYXNlKCk7XG4gICAgICAgIGlmICghdGhpcy5fbW9udGhzUGFyc2UpIHtcbiAgICAgICAgICAgIC8vIHRoaXMgaXMgbm90IHVzZWRcbiAgICAgICAgICAgIHRoaXMuX21vbnRoc1BhcnNlID0gW107XG4gICAgICAgICAgICB0aGlzLl9sb25nTW9udGhzUGFyc2UgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuX3Nob3J0TW9udGhzUGFyc2UgPSBbXTtcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAxMjsgKytpKSB7XG4gICAgICAgICAgICAgICAgbW9tID0gY3JlYXRlVVRDKFsyMDAwLCBpXSk7XG4gICAgICAgICAgICAgICAgdGhpcy5fc2hvcnRNb250aHNQYXJzZVtpXSA9IHRoaXMubW9udGhzU2hvcnQoXG4gICAgICAgICAgICAgICAgICAgIG1vbSxcbiAgICAgICAgICAgICAgICAgICAgJydcbiAgICAgICAgICAgICAgICApLnRvTG9jYWxlTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5fbG9uZ01vbnRoc1BhcnNlW2ldID0gdGhpcy5tb250aHMobW9tLCAnJykudG9Mb2NhbGVMb3dlckNhc2UoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdHJpY3QpIHtcbiAgICAgICAgICAgIGlmIChmb3JtYXQgPT09ICdNTU0nKSB7XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fc2hvcnRNb250aHNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9sb25nTW9udGhzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlpICE9PSAtMSA/IGlpIDogbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChmb3JtYXQgPT09ICdNTU0nKSB7XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fc2hvcnRNb250aHNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICBpZiAoaWkgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fbG9uZ01vbnRoc1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBpaSAhPT0gLTEgPyBpaSA6IG51bGw7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX2xvbmdNb250aHNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICBpZiAoaWkgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fc2hvcnRNb250aHNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbG9jYWxlTW9udGhzUGFyc2UobW9udGhOYW1lLCBmb3JtYXQsIHN0cmljdCkge1xuICAgICAgICB2YXIgaSwgbW9tLCByZWdleDtcblxuICAgICAgICBpZiAodGhpcy5fbW9udGhzUGFyc2VFeGFjdCkge1xuICAgICAgICAgICAgcmV0dXJuIGhhbmRsZVN0cmljdFBhcnNlLmNhbGwodGhpcywgbW9udGhOYW1lLCBmb3JtYXQsIHN0cmljdCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRoaXMuX21vbnRoc1BhcnNlKSB7XG4gICAgICAgICAgICB0aGlzLl9tb250aHNQYXJzZSA9IFtdO1xuICAgICAgICAgICAgdGhpcy5fbG9uZ01vbnRoc1BhcnNlID0gW107XG4gICAgICAgICAgICB0aGlzLl9zaG9ydE1vbnRoc1BhcnNlID0gW107XG4gICAgICAgIH1cblxuICAgICAgICAvLyBUT0RPOiBhZGQgc29ydGluZ1xuICAgICAgICAvLyBTb3J0aW5nIG1ha2VzIHN1cmUgaWYgb25lIG1vbnRoIChvciBhYmJyKSBpcyBhIHByZWZpeCBvZiBhbm90aGVyXG4gICAgICAgIC8vIHNlZSBzb3J0aW5nIGluIGNvbXB1dGVNb250aHNQYXJzZVxuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTI7IGkrKykge1xuICAgICAgICAgICAgLy8gbWFrZSB0aGUgcmVnZXggaWYgd2UgZG9uJ3QgaGF2ZSBpdCBhbHJlYWR5XG4gICAgICAgICAgICBtb20gPSBjcmVhdGVVVEMoWzIwMDAsIGldKTtcbiAgICAgICAgICAgIGlmIChzdHJpY3QgJiYgIXRoaXMuX2xvbmdNb250aHNQYXJzZVtpXSkge1xuICAgICAgICAgICAgICAgIHRoaXMuX2xvbmdNb250aHNQYXJzZVtpXSA9IG5ldyBSZWdFeHAoXG4gICAgICAgICAgICAgICAgICAgICdeJyArIHRoaXMubW9udGhzKG1vbSwgJycpLnJlcGxhY2UoJy4nLCAnJykgKyAnJCcsXG4gICAgICAgICAgICAgICAgICAgICdpJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgdGhpcy5fc2hvcnRNb250aHNQYXJzZVtpXSA9IG5ldyBSZWdFeHAoXG4gICAgICAgICAgICAgICAgICAgICdeJyArIHRoaXMubW9udGhzU2hvcnQobW9tLCAnJykucmVwbGFjZSgnLicsICcnKSArICckJyxcbiAgICAgICAgICAgICAgICAgICAgJ2knXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghc3RyaWN0ICYmICF0aGlzLl9tb250aHNQYXJzZVtpXSkge1xuICAgICAgICAgICAgICAgIHJlZ2V4ID1cbiAgICAgICAgICAgICAgICAgICAgJ14nICsgdGhpcy5tb250aHMobW9tLCAnJykgKyAnfF4nICsgdGhpcy5tb250aHNTaG9ydChtb20sICcnKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9tb250aHNQYXJzZVtpXSA9IG5ldyBSZWdFeHAocmVnZXgucmVwbGFjZSgnLicsICcnKSwgJ2knKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIHRlc3QgdGhlIHJlZ2V4XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgc3RyaWN0ICYmXG4gICAgICAgICAgICAgICAgZm9ybWF0ID09PSAnTU1NTScgJiZcbiAgICAgICAgICAgICAgICB0aGlzLl9sb25nTW9udGhzUGFyc2VbaV0udGVzdChtb250aE5hbWUpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoXG4gICAgICAgICAgICAgICAgc3RyaWN0ICYmXG4gICAgICAgICAgICAgICAgZm9ybWF0ID09PSAnTU1NJyAmJlxuICAgICAgICAgICAgICAgIHRoaXMuX3Nob3J0TW9udGhzUGFyc2VbaV0udGVzdChtb250aE5hbWUpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIXN0cmljdCAmJiB0aGlzLl9tb250aHNQYXJzZVtpXS50ZXN0KG1vbnRoTmFtZSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIE1PTUVOVFNcblxuICAgIGZ1bmN0aW9uIHNldE1vbnRoKG1vbSwgdmFsdWUpIHtcbiAgICAgICAgaWYgKCFtb20uaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICAvLyBObyBvcFxuICAgICAgICAgICAgcmV0dXJuIG1vbTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBpZiAoL15cXGQrJC8udGVzdCh2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IHRvSW50KHZhbHVlKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFsdWUgPSBtb20ubG9jYWxlRGF0YSgpLm1vbnRoc1BhcnNlKHZhbHVlKTtcbiAgICAgICAgICAgICAgICAvLyBUT0RPOiBBbm90aGVyIHNpbGVudCBmYWlsdXJlP1xuICAgICAgICAgICAgICAgIGlmICghaXNOdW1iZXIodmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtb207XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdmFyIG1vbnRoID0gdmFsdWUsXG4gICAgICAgICAgICBkYXRlID0gbW9tLmRhdGUoKTtcblxuICAgICAgICBkYXRlID0gZGF0ZSA8IDI5ID8gZGF0ZSA6IE1hdGgubWluKGRhdGUsIGRheXNJbk1vbnRoKG1vbS55ZWFyKCksIG1vbnRoKSk7XG4gICAgICAgIHZvaWQgKG1vbS5faXNVVENcbiAgICAgICAgICAgID8gbW9tLl9kLnNldFVUQ01vbnRoKG1vbnRoLCBkYXRlKVxuICAgICAgICAgICAgOiBtb20uX2Quc2V0TW9udGgobW9udGgsIGRhdGUpKTtcbiAgICAgICAgcmV0dXJuIG1vbTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRTZXRNb250aCh2YWx1ZSkge1xuICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgc2V0TW9udGgodGhpcywgdmFsdWUpO1xuICAgICAgICAgICAgaG9va3MudXBkYXRlT2Zmc2V0KHRoaXMsIHRydWUpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gZ2V0KHRoaXMsICdNb250aCcpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RGF5c0luTW9udGgoKSB7XG4gICAgICAgIHJldHVybiBkYXlzSW5Nb250aCh0aGlzLnllYXIoKSwgdGhpcy5tb250aCgpKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtb250aHNTaG9ydFJlZ2V4KGlzU3RyaWN0KSB7XG4gICAgICAgIGlmICh0aGlzLl9tb250aHNQYXJzZUV4YWN0KSB7XG4gICAgICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ19tb250aHNSZWdleCcpKSB7XG4gICAgICAgICAgICAgICAgY29tcHV0ZU1vbnRoc1BhcnNlLmNhbGwodGhpcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNTdHJpY3QpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fbW9udGhzU2hvcnRTdHJpY3RSZWdleDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX21vbnRoc1Nob3J0UmVnZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ19tb250aHNTaG9ydFJlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9tb250aHNTaG9ydFJlZ2V4ID0gZGVmYXVsdE1vbnRoc1Nob3J0UmVnZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fbW9udGhzU2hvcnRTdHJpY3RSZWdleCAmJiBpc1N0cmljdFxuICAgICAgICAgICAgICAgID8gdGhpcy5fbW9udGhzU2hvcnRTdHJpY3RSZWdleFxuICAgICAgICAgICAgICAgIDogdGhpcy5fbW9udGhzU2hvcnRSZWdleDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1vbnRoc1JlZ2V4KGlzU3RyaWN0KSB7XG4gICAgICAgIGlmICh0aGlzLl9tb250aHNQYXJzZUV4YWN0KSB7XG4gICAgICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ19tb250aHNSZWdleCcpKSB7XG4gICAgICAgICAgICAgICAgY29tcHV0ZU1vbnRoc1BhcnNlLmNhbGwodGhpcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNTdHJpY3QpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fbW9udGhzU3RyaWN0UmVnZXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9tb250aHNSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX21vbnRoc1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl9tb250aHNSZWdleCA9IGRlZmF1bHRNb250aHNSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9tb250aHNTdHJpY3RSZWdleCAmJiBpc1N0cmljdFxuICAgICAgICAgICAgICAgID8gdGhpcy5fbW9udGhzU3RyaWN0UmVnZXhcbiAgICAgICAgICAgICAgICA6IHRoaXMuX21vbnRoc1JlZ2V4O1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY29tcHV0ZU1vbnRoc1BhcnNlKCkge1xuICAgICAgICBmdW5jdGlvbiBjbXBMZW5SZXYoYSwgYikge1xuICAgICAgICAgICAgcmV0dXJuIGIubGVuZ3RoIC0gYS5sZW5ndGg7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgc2hvcnRQaWVjZXMgPSBbXSxcbiAgICAgICAgICAgIGxvbmdQaWVjZXMgPSBbXSxcbiAgICAgICAgICAgIG1peGVkUGllY2VzID0gW10sXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgbW9tLFxuICAgICAgICAgICAgc2hvcnRQLFxuICAgICAgICAgICAgbG9uZ1A7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCAxMjsgaSsrKSB7XG4gICAgICAgICAgICAvLyBtYWtlIHRoZSByZWdleCBpZiB3ZSBkb24ndCBoYXZlIGl0IGFscmVhZHlcbiAgICAgICAgICAgIG1vbSA9IGNyZWF0ZVVUQyhbMjAwMCwgaV0pO1xuICAgICAgICAgICAgc2hvcnRQID0gcmVnZXhFc2NhcGUodGhpcy5tb250aHNTaG9ydChtb20sICcnKSk7XG4gICAgICAgICAgICBsb25nUCA9IHJlZ2V4RXNjYXBlKHRoaXMubW9udGhzKG1vbSwgJycpKTtcbiAgICAgICAgICAgIHNob3J0UGllY2VzLnB1c2goc2hvcnRQKTtcbiAgICAgICAgICAgIGxvbmdQaWVjZXMucHVzaChsb25nUCk7XG4gICAgICAgICAgICBtaXhlZFBpZWNlcy5wdXNoKGxvbmdQKTtcbiAgICAgICAgICAgIG1peGVkUGllY2VzLnB1c2goc2hvcnRQKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBTb3J0aW5nIG1ha2VzIHN1cmUgaWYgb25lIG1vbnRoIChvciBhYmJyKSBpcyBhIHByZWZpeCBvZiBhbm90aGVyIGl0XG4gICAgICAgIC8vIHdpbGwgbWF0Y2ggdGhlIGxvbmdlciBwaWVjZS5cbiAgICAgICAgc2hvcnRQaWVjZXMuc29ydChjbXBMZW5SZXYpO1xuICAgICAgICBsb25nUGllY2VzLnNvcnQoY21wTGVuUmV2KTtcbiAgICAgICAgbWl4ZWRQaWVjZXMuc29ydChjbXBMZW5SZXYpO1xuXG4gICAgIC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4gICAgICAgICAgICByZXNZZWFyID0geWVhciAtIDE7XG4gICAgICAgICAgICByZXNEYXlPZlllYXIgPSBkYXlzSW5ZZWFyKHJlc1llYXIpICsgZGF5T2ZZZWFyO1xuICAgICAgICB9IGVsc2UgaWYgKGRheU9mWWVhciA+IGRheXNJblllYXIoeWVhcikpIHtcbiAgICAgICAgICAgIHJlc1llYXIgPSB5ZWFyICsgMTtcbiAgICAgICAgICAgIHJlc0RheU9mWWVhciA9IGRheU9mWWVhciAtIGRheXNJblllYXIoeWVhcik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXNZZWFyID0geWVhcjtcbiAgICAgICAgICAgIHJlc0RheU9mWWVhciA9IGRheU9mWWVhcjtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB5ZWFyOiByZXNZZWFyLFxuICAgICAgICAgICAgZGF5T2ZZZWFyOiByZXNEYXlPZlllYXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gd2Vla09mWWVhcihtb20sIGRvdywgZG95KSB7XG4gICAgICAgIHZhciB3ZWVrT2Zmc2V0ID0gZmlyc3RXZWVrT2Zmc2V0KG1vbS55ZWFyKCksIGRvdywgZG95KSxcbiAgICAgICAgICAgIHdlZWsgPSBNYXRoLmZsb29yKChtb20uZGF5T2ZZZWFyKCkgLSB3ZWVrT2Zmc2V0IC0gMSkgLyA3KSArIDEsXG4gICAgICAgICAgICByZXNXZWVrLFxuICAgICAgICAgICAgcmVzWWVhcjtcblxuICAgICAgICBpZiAod2VlayA8IDEpIHtcbiAgICAgICAgICAgIHJlc1llYXIgPSBtb20ueWVhcigpIC0gMTtcbiAgICAgICAgICAgIHJlc1dlZWsgPSB3ZWVrICsgd2Vla3NJblllYXIocmVzWWVhciwgZG93LCBkb3kpO1xuICAgICAgICB9IGVsc2UgaWYgKHdlZWsgPiB3ZWVrc0luWWVhcihtb20ueWVhcigpLCBkb3csIGRveSkpIHtc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aW52YWxpZFdlZWtkYXkgPSBpbnB1dDtcbiAgICAgICAgfVxuICAgIH0pO1xuXG4gICAgYWRkV2Vla1BhcnNlVG9rZW4oWydkJywgJ2UnLCAnRSddLCBmdW5jdGlvbiAoaW5wdXQsIHdlZWssIGNvbmZpZywgdG9rZW4pIHtcbiAgICAgICAgd2Vla1t0b2tlbl0gPSB0b0ludChpbnB1dCk7XG4gICAgfSk7XG5cbiAgICAvLyBIRUxQRVJTXG5cbiAgICBmdW5jdGlvbiBwYXJzZVdlZWtkYXkoaW5wdXQsIGxvY2FsZSkge1xuICAgICAgICBpZiAodHlwZW9mIGlucHV0ICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuIGlucHV0O1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFpc05hTihpbnB1dCkpIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJzZUludChpbnB1dCwgMTApO1xuICAgICAgICB9XG5cbiAgICAgICAgaW5wdXQgPSBsb2NhbGUud2Vla2RheXNQYXJzZShpbnB1dCk7XG4gICAgICAgIGlmICh0eXBlb2YgaW5wdXQgPT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICByZXR1cm4gaW5wdXQ7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXJzZUlzb1dlZWtkYXkoaW5wdXQsIGxvY2FsZSkge1xuICAgICAgICBpZiAodHlwZW9mIGlucHV0ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuIGxvY2FsZS53ZWVrZGF5c1BhcnNlKGlucHV0KSAlIDcgfHwgNztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gaXNOYU4oaW5wdXQpID8gbnVsbCA6IGlucHV0O1xuICAgIH1cblxuICAgIC8vIExPQ0FMRVNcbiAgICBmdW5jdGlvbiBzaGlmdFdlZWtkYXlzKHdzLCBuKSB7XG4gICAgICAgIHJldHVybiB3cy5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lZWtkYXlzLCB0aGlzLl93ZWVrLmRvdylcbiAgICAgICAgICAgIDogbVxuICAgICAgICAgICAgICA/IHdlZWtkYXlzW20uZGF5KCldXG4gICAgICAgICAgICAgIDogd2Vla2RheXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbG9jYWxlV2Vla2RheXNTaG9ydChtKSB7XG4gICAgICAgIHJldHVybiBtID09PSB0cnVlXG4gICAgICAgICAgICA/IHNoaWZ0V2Vla2RheXModGhpcy5fd2Vla2RheXNTaG9ydCwgdGhpcy5fd2Vlay5kb3cpXG4gICAgICAgICAgICA6IG1cbiAgICAgICAgICAgICAgPyB0aGlzLl93ZWVrZGF5c1Nob3J0W20uZGF5KCldXG4gICAgICAgICAgICAgIDogdGhpcy5fd2Vla2RheXNTaG9ydDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBsb2NhbGVXZWVrZGF5c01pbihtKSB7XG4gICAgICAgIHJldHVybiBtID09PSB0cnVlXG4gICAgICAgICAgICA/IHNoaWZ0V2Vla2RheXModGhpcy5fd2Vla2RheXNNaW4sIHRoaXMuX3dlZWsuZG93KVxuICAgICAgICAgICAgOiBtXG4gICAgICAgICAgICAgID8gdGhpcy5fd2Vla2RheXNNaW5bbS5kYXkoKV1cbiAgICAgICAgICAgICAgOiB0aGlzLl93ZWVrZGF5c01pbjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBoYW5kbGVTdHJpY3RQYXJzZSQxKHdlZWtkYXlOYW1lLCBmb3JtYXQsIHN0cmljdCkge1xuICAgICAgICB2YXIgaSxcbiAgICAgICAgICAgIGlpLFxuICAgICAgICAgICAgbW9tLFxuICAgICAgICAgICAgbGxjID0gd2Vla2RheU5hbWUudG9Mb2NhbGVMb3dlckNhc2UoKTtcbiAgICAgICAgaWYgKCF0aGlzLl93ZWVrZGF5c1BhcnNlKSB7XG4gICAgICAgICAgICB0aGlzLl93ZWVrZGF5c1BhcnNlID0gW107XG4gICAgICAgICAgICB0aGlzLl9zaG9ydFdlZWtkYXlzUGFyc2UgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuX21pbldlZWtkYXlzUGFyc2UgPSBbXTtcblxuICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDc7ICsraSkge1xuICAgICAgICAgICAgICAgIG1vbSA9IGNyZWF0ZVVUQyhbMjAwMCwgMV0pLmRheShpKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9taW5XZWVrZGF5c1BhcnNlW2ldID0gdGhpcy53ZWVrZGF5c01pbihcbiAgICAgICAgICAgICAgICAgICAgbW9tLFxuICAgICAgICAgICAgICAgICAgICAnJ1xuICAgICAgICAgICAgICAgICkudG9Mb2NhbGVMb3dlckNhc2UoKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9zaG9ydFdlZWtkYXlzUGFyc2VbaV0gPSB0aGlzLndlZWtkYXlzU2hvcnQoXG4gICAgICAgICAgICAgICAgICAgIG1vbSxcbiAgICAgICAgICAgICAgICAgICAgJydcbiAgICAgICAgICAgICAgICApLnRvTG9jYWxlTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5fd2Vla2RheXNQYXJzZVtpXSA9IHRoaXMud2Vla2RheXMobW9tLCAnJykudG9Mb2NhbGVMb3dlckNhc2UoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdHJpY3QpIHtcbiAgICAgICAgICAgIGlmIChmb3JtYXQgPT09ICdkZGRkJykge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3dlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlpICE9PSAtMSA/IGlpIDogbnVsbDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZm9ybWF0ID09PSAnZGRkJykge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3Nob3J0V2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9taW5XZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIHJldHVybiBpaSAhPT0gLTEgPyBpaSA6IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoZm9ybWF0ID09PSAnZGRkZCcpIHtcbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl93ZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIGlmIChpaSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9zaG9ydFdlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgaWYgKGlpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaWk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX21pbldlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlpICE9PSAtMSA/IGlpIDogbnVsbDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZm9ybWF0ID09PSAnZGRkJykge1xuICAgICAgICAgICAgICAgIGlpID0gaW5kZXhPZi5jYWxsKHRoaXMuX3Nob3J0V2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICBpZiAoaWkgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fd2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICBpZiAoaWkgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWkgPSBpbmRleE9mLmNhbGwodGhpcy5fbWluV2Vla2RheXNQYXJzZSwgbGxjKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gaWkgIT09IC0xID8gaWkgOiBudWxsO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9taW5XZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIGlmIChpaSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl93ZWVrZGF5c1BhcnNlLCBsbGMpO1xuICAgICAgICAgICAgICAgIGlmIChpaSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpaSA9IGluZGV4T2YuY2FsbCh0aGlzLl9zaG9ydFdlZWtkYXlzUGFyc2UsIGxsYyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlpICE9PSAtMSA/IGlpIDogbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGxvY2FsZVdlZWtkYXlzUGFyc2Uod2Vla2RheU5hbWUsIGZvcm1hdCwgc3RyaWN0KSB7XG4gICAgICAgIHZhciBpLCBtb20sIHJlZ2V4O1xuXG4gICAgICAgIGlmICh0aGlzLl93ZWVrZGF5c1BhcnNlRXhhY3QpIHtcbiAgICAgICAgICAgIHJldHVybiBoYW5kbGVTdHJpY3RQYXJzZSQxLmNhbGwodGhpcywgd2Vla2RheU5hbWUsIGZvcm1hdCwgc3RyaWN0KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghdGhpcy5fd2Vla2RheXNQYXJzZSkge1xuICAgICAgICAgICAgdGhpcy5fd2Vla2RheXNQYXJzZSA9IFtdO1xuICAgICAgICAgICAgdGhpcy5fbWluV2Vla2RheXNQYXJzZSA9IFtdO1xuICAgICAgICAgICAgdGhpcy5fc2hvcnRXZWVrZGF5c1BhcnNlID0gW107XG4gICAgICAgICAgICB0aGlzLl9mdWxsV2Vla2RheXNQYXJzZSA9IFtdO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IDc7IGkrKykge1xuICAgICAgICAgICAgLy8gbWFrZSB0aGUgcmVnZXggaWYgd2UgZG9uJ3QgaGF2ZSBpdCBhbHJlYWR5XG5cbiAgICAgICAgICAgIG1vbSA9IGNyZWF0ZVVUQyhbMjAwMCwgMV0pLmRheShpKTtcbiAgICAgICAgICAgIGlmIChzdHJpY3QgJiYgIXRoaXMuX2Z1bGxXZWVrZGF5c1BhcnNlW2ldKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fZnVsbFdlZWtkYXlzUGFyc2VbaV0gPSBuZXcgUmVnRXhwKFxuICAgICAgICAgICAgICAgICAgICAnXicgKyB0aGlzLndlZWtkYXlzKG1vbSwgJycpLnJlcGxhY2UoJy4nLCAnXFxcXC4/JykgKyAnJCcsXG4gICAgICAgICAgICAgICAgICAgICdpJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgdGhpcy5fc2hvcnRXZWVrZGF5c1BhcnNlW2ldID0gbmV3IFJlZ0V4cChcbiAgICAgICAgICAgICAgICAgICAgJ14nICsgdGhpcy53ZWVrZGF5c1Nob3J0KG1vbSwgJycpLnJlcGxhY2UoJy4nLCAnXFxcXC4/JykgKyAnJCcsXG4gICAgICAgICAgICAgICAgICAgICdpJ1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgdGhpcy5fbWluV2Vla2RheXNQYXJzZVtpXSA9IG5ldyBSZWdFeHAoXG4gICAgICAgICAgICAgICAgICAgICdeJyArIHRoaXMud2Vla2RheXNNaW4obW9tLCAnJykucmVwbGFjZSgnLicsICdcXFxcLj8nKSArICckJyxcbiAgICAgICAgICAgICAgICAgICAgJ2knXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghdGhpcy5fd2Vla2RheXNQYXJzZVtpXSkge1xuICAgICAgICAgICAgICAgIHJlZ2V4ID1cbiAgICAgICAgICAgICAgICAgICAgJ14nICtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy53ZWVrZGF5cyhtb20sICcnKSArXG4gICAgICAgICAgICAgICAgICAgICd8XicgK1xuICAgICAgICAgICAgICAgICAgICB0aGlzLndlZWtkYXlzU2hvcnQobW9tLCAnJykgK1xuICAgICAgICAgICAgICAgICAgICAnfF4nICtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy53ZWVrZGF5c01pbihtb20sICcnKTtcbiAgICAgICAgICAgICAgICB0aGlzLl93ZWVrZGF5c1BhcnNlW2ldID0gbmV3IFJlZ0V4cChyZWdleC5yZXBsYWNlKCcuJywgJycpLCAnaScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gdGVzdCB0aGUgcmVnZXhcbiAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICBzdHJpY3QgJiZcbiAgICAgICAgICAgICAgICBmb3JtYXQgPT09ICdkZGRkJyAmJlxuICAgICAgICAgICAgICAgIHRoaXMuX2Z1bGxXZWVrZGF5c1BhcnNlW2ldLnRlc3Qod2Vla2RheU5hbWUpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoXG4gICAgICAgICAgICAgICAgc3RyaWN0ICYmXG4gICAgICAgICAgICAgICAgZm9ybWF0ID09PSAnZGRkJyAmJlxuICAgICAgICAgICAgICAgIHRoaXMuX3Nob3J0V2Vla2RheXNQYXJzZVtpXS50ZXN0KHdlZWtkYXlOYW1lKVxuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKFxuICAgICAgICAgICAgICAgIHN0cmljdCAmJlxuICAgICAgICAgICAgICAgIGZvcm1hdCA9PT0gJ2RkJyAmJlxuICAgICAgICAgICAgICAgIHRoaXMuX21pbldlZWtkYXlzUGFyc2VbaV0udGVzdCh3ZWVrZGF5TmFtZSlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyaWN0ICYmIHRoaXMuX3dlZWtkYXlzUGFyc2VbaV0udGVzdCh3ZWVrZGF5TmFtZSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIE1PTUVOVFNcblxuICAgIGZ1bmN0aW9uIGdldFNldERheU9mV2VlayhpbnB1dCkge1xuICAgICAgICBpZiAoIXRoaXMuaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICByZXR1cm4gaW5wdXQgIT0gbnVsbCA/IHRoaXMgOiBOYU47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgZGF5ID0gZ2V0KHRoaXMsICdEYXknKTtcbiAgICAgICAgaWYgKGlucHV0ICE9IG51bGwpIHtcbiAgICAgICAgICAgIGlucHV0ID0gcGFyc2VXZWVrZGF5KGlucHV0LCB0aGlzLmxvY2FsZURhdGEoKSk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5hZGQoaW5wdXQgLSBkYXksICdkJyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gZGF5O1xuICAgICAgICB9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tcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmRheSgpIHx8IDc7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiB3ZWVrZGF5c1JlZ2V4KGlzU3RyaWN0KSB7XG4gICAgICAgIGlmICh0aGlzLl93ZWVrZGF5c1BhcnNlRXhhY3QpIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX3dlZWtkYXlzUmVnZXgnKSkge1xuICAgICAgICAgICAgICAgIGNvbXB1dGVXZWVrZGF5c1BhcnNlLmNhbGwodGhpcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNTdHJpY3QpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fd2Vla2RheXNTdHJpY3RSZWdleDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzUmVnZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ193ZWVrZGF5c1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICB0aGlzLl93ZWVrZGF5c1JlZ2V4ID0gZGVmYXVsdFdlZWtkYXlzUmVnZXg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fd2Vla2RheXNTdHJpY3RSZWdleCAmJiBpc1N0cmljdFxuICAgICAgICAgICAgICAgID8gdGhpcy5fd2Vla2RheXNTdHJpY3RSZWdleFxuICAgICAgICAgICAgICAgIDogdGhpcy5fd2Vla2RheXNSZWdleDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHdlZWtkYXlzU2hvcnRSZWdleChpc1N0cmljdCkge1xuICAgICAgICBpZiAodGhpcy5fd2Vla2RheXNQYXJzZUV4YWN0KSB7XG4gICAgICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ193ZWVrZGF5c1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlV2Vla2RheXNQYXJzZS5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzU2hvcnRTdHJpY3RSZWdleDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzU2hvcnRSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICghaGFzT3duUHJvcCh0aGlzLCAnX3dlZWtkYXlzU2hvcnRSZWdleCcpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fd2Vla2RheXNTaG9ydFJlZ2V4ID0gZGVmYXVsdFdlZWtkYXlzU2hvcnRSZWdleDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLl93ZWVrZGF5c1Nob3J0U3RyaWN0UmVnZXggJiYgaXNTdHJpY3RcbiAgICAgICAgICAgICAgICA/IHRoaXMuX3dlZWtkYXlzU2hvcnRTdHJpY3RSZWdleFxuICAgICAgICAgICAgICAgIDogdGhpcy5fd2Vla2RheXNTaG9ydFJlZ2V4O1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gd2Vla2RheXNNaW5SZWdleChpc1N0cmljdCkge1xuICAgICAgICBpZiAodGhpcy5fd2Vla2RheXNQYXJzZUV4YWN0KSB7XG4gICAgICAgICAgICBpZiAoIWhhc093blByb3AodGhpcywgJ193ZWVrZGF5c1JlZ2V4JykpIHtcbiAgICAgICAgICAgICAgICBjb21wdXRlV2Vla2RheXNQYXJzZS5jYWxsKHRoaXMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzTWluU3RyaWN0UmVnZXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl93ZWVrZGF5c01pblJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfd2Vla2RheXNNaW5SZWdleCcpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fd2Vla2RheXNNaW5SZWdleCA9IGRlZmF1bHRXZWVrZGF5c01pblJlZ2V4O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3dlZWtkYXlzTWluU3RyaWN0UmVnZXggJiYgaXNTdHJpY3RcbiAgICAgICAgICAgICAgICA/IHRoaXMuX3dlZWtkYXlzTWluU3RyaWN0UmVnZXhcbiAgICAgICAgICAgICAgICA6IHRoaXMuX3dlZWtkYXlzTWluUmVnZXg7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjb21wdXRlV2Vla2RheXNQYXJzZSgpIHtcbiAgICAgICAgZnVuY3Rpb24gY21wTGVuUmV2KGEsIGIpIHtcbiAgICAgICAgICAgIHJldHVybiBiLmxlbmd0aCAtIGEubGVuZ3RoO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIG1pblBpZWNlcyA9IFtdLFxuICAgICAgICAgICAgc2hvcnRQaWVjZXMgPSBbXSxcbiAgICAgICAgICAgIGxvbmdQaWVjZXMgPSBbXSxcbiAgICAgICAgICAgIG1peGVkUGllY2VzID0gW10sXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgbW9tLFxuICAgICAgICAgICAgbWlucCxcbiAgICAgICAgICAgIHNob3J0cCxcbiAgICAgICAgICAgIGxvbmdwO1xuICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNzsgaSsrKSB7XG4gICAgICAgICAgICAvLyBtYWtlIHRoZSByZWdleCBpZiB3ZSBkb24ndCBoYXZlIGl0IGFscmVhZHlcbiAgICAgICAgICAgIG1vbSA9IGNyZWF0ZVVUQyhbMjAwMCwgMV0pLmRheShpKTtcbiAgICAgICAgICAgIG1pbnAgPSByZWdleEVzY2FwZSh0aGlzLndlZWtkYXlzTWluKG1vbSwgJycpKTtcbiAgICAgICAgICAgIHNob3J0cCA9IHJlZ2V4RXNjYXBlKHRoaXMud2Vla2RheXNTaG9ydChtb20sICcnKSk7XG4gICAgICAgICAgICBsb25ncCA9IHJlZ2V4RXNjYXBlKHRoaXMud2Vla2RheXMobW9tLCAnJykpO1xuICAgICAgICAgICAgbWluUGllY2VzLnB1c2gobWlucCk7XG4gICAgICAgICAgICBzaG9ydFBpZWNlcy5wdXNoKHNob3J0cCk7XG4gICAgICAgICAgICBsb25nUGllY2VzLnB1c2gobG9uZ3ApO1xuICAgICAgICAgICAgbWl4ZWRQaWVjZXMucHVzaChtaW5wKTtcbiAgICAgICAgICAgIG1peGVkUGllY2VzLnB1c2goc2hvcnRwKTtcbiAgICAgICAgICAgIG1peGVkUGllY2VzLnB1c2gobG9uZ3ApO1xuICAgICAgICB9XG4gICAgICAgIC8vIFNvcnRpbmcgbWFrZXMgc3VyZSBpZiBvbmUgd2Vla2RheSAob3IgYWJicikgaXMgYSBwcmVmaXggb2YgYW5vdGhlciBpdFxuICAgICAgICAvLyB3aWxsIG1hdGNoIHRoZSBsb25nZXIgcGllY2UuXG4gICAgICAgIG1pblBpZWNlcy5zb3J0KGNtcExlblJldik7XG4gICAgICAgIHNob3J0UGllY2VzLnNvcnQoY21wTGVuUmV2KTtcbiAgICAgICAgbG9uZ1BpZWNlcy5zb3J0KGNtcExlblJldik7XG4gICAgICAgIG1peGVkUGllY2VzLnNvcnQoY21wTGVuUmV2KTtcblxuICAgICAgICB0aGlzLl93ZWVrZGF5c1JlZ2V4ID0gbmV3IFJlZ0V4cCgnXignICsgbWl4ZWRQaWVjZXMuam9pbignfCcpICsgJyknLCAnaSc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Zvcm1hdFRva2VuKCdobW0nLCAwLCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiAnJyArIGhGb3JtYXQuYXBwbHkodGhpcykgKyB6ZXJvRmlsbCh0aGlzLm1pbnV0ZXMoKSwgMik7XG4gICAgfSk7XG5cbiAgICBhZGRGb3JtYXRUb2tlbignaG1tc3MnLCAwLCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAnJyArXG4gICAgICAgICAgICBoRm9ybWF0LmFwcGx5KHRoaXMpICtcbiAgICAgICAgICAgIHplcm9GaWxsKHRoaXMubWludXRlcygpLCAyKSArXG4gICAgICAgICAgICB6ZXJvRmlsbCh0aGlzLnNlY29uZHMoKSwgMilcbiAgICAgICAgKTtcbiAgICB9KTtcblxuICAgIGFkZEZvcm1hdFRva2VuKCdIbW0nLCAwLCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiAnJyArIHRoaXMuaG91cnMoKSArIHplcm9GaWxsKHRoaXMubWludXRlcygpLCAyKTtcbiAgICB9KTtcblxuICAgIGFkZEZvcm1hdFRva2VuKCdIbW1zcycsIDAsIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICcnICtcbiAgICAgICAgICAgIHRoaXMuaG91cnMoKSArXG4gICAgICAgICAgICB6ZXJvRmlsbCh0aGlzLm1pbnV0ZXMoKSwgMikgK1xuICAgICAgICAgICAgemVyb0ZpbGwodGhpcy5zZWNvbmRzKCksIDIpXG4gICAgICAgICk7XG4gICAgfSk7XG5cbiAgICBmdW5jdGlvbiBtZXJpZGllbSh0b2tlbiwgbG93ZXJjYXNlKSB7XG4gICAgICAgIGFkZEZvcm1hdFRva2VuKHRva2VuLCAwLCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5sb2NhbGVEYXRhKCkubWVyaWRpZW0oXG4gICAgICAgICAgICA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AgICAgICAgICAgIGogPSBzcGxpdC5sZW5ndGg7XG4gICAgICAgICAgICBuZXh0ID0gbm9ybWFsaXplTG9jYWxlKG5hbWVzW2kgKyAxXSk7XG4gICAgICAgICAgICBuZXh0ID0gbmV4dCA/IG5leHQuc3BsaXQoJy0nKSA6IG51bGw7XG4gICAgICAgICAgICB3aGlsZSAoaiA+IDApIHtcbiAgICAgICAgICAgICAgICBsb2NhbGUgPSBsb2FkTG9jYWxlKHNwbGl0LnNsaWNlKDAsIGopLmpvaW4oJy0nKSk7XG4gICAgICAgICAgICAgICAgaWYgKGxvY2FsZSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbG9jYWxlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgICAgIG5leHQgJiZcbiAgICAgICAgICAgICAgICAgICAgbmV4dC5sZW5ndGggPj0gaiAmJlxuICAgICAgICAgICAgICAgICAgICBjb21tb25QcmVmaXgoc3BsaXQsIG5leHQpID49IGogLSAxXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vdGhlIG5leHQgYXJyYXkgaXRlbSBpcyBiZXR0ZXIgdGhhbiBhIHNoYWxsb3dlciBzdWJzdHJpbmcgb2YgdGhpcyBvbmVcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGotLTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGkrKztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZ2xvYmFsTG9jYWxlO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzTG9jYWxlTmFtZVNhbmUobmFtZSkge1xuICAgICAgICAvLyBQcmV2ZW50IG5hbWVzIHRoYXQgbG9vayBsaWtlIGZpbGVzeXN0ZW0gcGF0aHMsIGkuZSBjb250YWluICcvJyBvciAnXFwnXG4gICAgICAgIC8vIEVuc3VyZSBuYW1lIGlzIGF2YWlsYWJsZSBhbmQgZnVuY3Rpb24gcmV0dXJucyBib29sZWFuXG4gICAgICAgIHJldHVybiAhIShuYW1lICYmIG5hbWUubWF0Y2goJ15bXi9cXFxcXFxcXF0qJCcpKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBsb2FkTG9jYWxlKG5hbWUpIHtcbiAgICAgICAgdmFyIG9sZExvY2FsZSA9IG51bGwsXG4gICAgICAgICAgICBhbGlhc2VkUmVxdWlyZTtcbiAgICAgICAgLy8gVE9ETzogRmluZCBhIGJldHRlciB3YXkgdG8gcmVnaXN0ZXIgYW5kIGxvYWQgYWxsIHRoZSBsb2NhbGVzIGluIE5vZGVcbiAgICAgICAgaWYgKFxuICAgICAgICAgICAgbG9jYWxlc1tuYW1lXSA9PT0gdW5kZWZpbmVkICYmXG4gICAgICAgICAgICB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJyAmJlxuICAgICAgICAgICAgbW9kdWxlICYmXG4gICAgICAgICAgICBtb2R1bGUuZXhwb3J0cyAmJlxuICAgICAgICAgICAgaXNMb2NhbGVOYW1lU2FuZShuYW1lKVxuICAgICAgICApIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgb2xkTG9jYWxlID0gZ2xvYmFsTG9jYWxlLl9hYmJyO1xuICAgICAgICAgICAgICAgIGFsaWFzZWRSZXF1aXJlID0gcmVxdWlyZTtcbiAgICAgICAgICAgICAgICBhbGlhc2VkUmVxdWlyZSgnLi9sb2NhbGUvJyArIG5hbWUpO1xuICAgICAgICAgICAgICAgIGdldFNldEdsb2JhbExvY2FsZShvbGRMb2NhbGUpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIC8vIG1hcmsgYXMgbm90IGZvdW5kIHRvIGF2b2lkIHJlcGVhdGluZyBleHBlbnNpdmUgZmlsZSByZXF1aXJlIGNhbGwgY2F1c2luZyBoaWdoIENQVVxuICAgICAgICA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kJyAmJiBjb25zb2xlLndhcm4pIHtcbiAgICAgICAgICAgICAgICAgICAgLy93YXJuIHVzZXIgaWYgYXJndW1lbnRzIGFyZSBwYXNzZWQgYnV0IHRoZSBsb2NhbGUgY291bGQgbm90IGJlIHNldFxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXG4gICAgICAgICAgICAgICAgICAgICAgICAnTG9jYWxlICcgKyBrZXkgKyAnIG5vdCBmb3VuZC4gRGlkIHlvdSBmb3JnZXQgdG8gbG9hZCBpdD8nXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGdsb2JhbExvY2FsZS5fYWJicjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBkZWZpbmVMb2NhbGUobmFtZSwgY29uZmlnKSB7XG4gICAgICAgIGlmIChjb25maWcgIT09IG51bGwpIHtcbiAgICAgICAgICAgIHZhciBsb2NhbGUsXG4gICAgICAgICAgICAgICAgcGFyZW50Q29uZmlnID0gYmFzZUNvbmZpZztcbiAgICAgICAgICAgIGNvbmZpZy5hYmJyID0gbmFtZTtcbiAgICAgICAgICAgIGlmIChsb2NhbGVzW25hbWVdICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBkZXByZWNhdGVTaW1wbGUoXG4gICAgICAgICAgICAgICAgICAgICdkZWZpbmVMb2NhbGVPdmVycmlkZScsXG4gICAgICAgICAgICAgICAgICAgICd1c2UgbW9tZW50LnVwZGF0ZUxvY2FsZShsb2NhbGVOYW1lLCBjb25maWcpIHRvIGNoYW5nZSAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbiBleGlzdGluZyBsb2NhbGUuIG1vbWVudC5kZWZpbmVMb2NhbGUobG9jYWxlTmFtZSwgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29uZmlnKSBzaG91bGQgb25seSBiZSB1c2VkIGZvciBjcmVhdGluZyBhIG5ldyBsb2NhbGUgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VlIGh0dHA6Ly9tb21lbnRqcy5jb20vZ3VpZGVzLyMvd2FybmluZ3MvZGVmaW5lLWxvY2FsZS8gZm9yIG1vcmUgaW5mby4nXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBwYXJlbnRDb25maWcgPSBsb2NhbGVzW25hbWVdLl9jb25maWc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNvbmZpZy5wYXJlbnRMb2NhbGUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGlmIChsb2NhbGVzW2NvbmZpZy5wYXJlbnRMb2NhbGVdICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50Q29uZmlnID0gbG9jYWxlc1tjb25maWcucGFyZW50TG9jYWxlXS5fY29uZmlnO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGxvY2FsZSA9IGxvYWRMb2NhbGUoY29uZmlnLnBhcmVudExvY2FsZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChsb2NhbGUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q29uZmlnID0gbG9jYWxlLl9jb25maWc7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWxvY2FsZUZhbWlsaWVzW2NvbmZpZy5wYXJlbnRMb2NhbGVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxlRmFtaWxpZXNbY29uZmlnLnBhcmVudExvY2FsZV0gPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsZUZhbWlsaWVzW2NvbmZpZy5wYXJlbnRMb2NhbGVdLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnOiBjb25maWcsXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbG9jYWxlc1tuYW1lXSA9IG5ldyBMb2NhbGUobWVyZ2VDb25maWdzKHBhcmVudENvbmZpZywgY29uZmlnKSk7XG5cbiAgICAgICAgICAgIGlmIChsb2NhbGVGYW1pbGllc1tuYW1lXSkge1xuICAgICAgICAgICAgICAgIGxvY2FsZUZhbWlsaWVzW25hbWVdLmZvckVhY2goZnVuY3Rpb24gKHgpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVmaW5lTG9jYWxlKHgubmFtZSwgeC5jb25maWcpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBiYWNrd2FyZHMgY29tcGF0IGZvciBub3c6IGFsc28gc2V0IHRoZSBsb2NhbGVcbiAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB3ZSBzZXQgdGhlIGxvY2FsZSBBRlRFUiBhbGwgY2hpbGQgbG9jYWxlcyBoYXZlIGJlZW5cbiAgICAgICAgICAgIC8vIGNyZWF0ZWQsIHNvIHdlIHdvbid0IGVuZCB1cCB3aXRoIHRoZSBjaGlsZCBsb2NhbGUgc2V0LlxuICAgICAgICAgICAgZ2V0U2V0R2xvYmFsTG9jYWxlKG5hbWUpO1xuXG4gICAgICAgICAgICByZXR1cm4gbG9jYWxlc1tuYW1lXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHVzZWZ1bCBmb3IgdGVzdGluZ1xuICAgICAgICAgICAgZGVsZXRlIGxvY2FsZXNbbmFtZV07XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHVwZGF0ZUxvY2FsZShuYW1lLCBjb25maWcpIHtcbiAgICAgICAgaWYgKGNvbmZpZyAhPSBudWxsKSB7XG4gICAgICAgICAgICB2YXIgbG9jYWxlLFxuICAgICAgICAgICAgICAgIHRtcExvY2FsZSxcbiAgICAgICAgICAgICAgICBwYXJlbnRDb25maWcgPSBiYXNlQ29uZmlnO1xuXG4gICAgICAgICAgICBpZiAobG9jYWxlc1tuYW1lXSAhPSBudWxsICYmIGxvY2FsZXNbbmFtZV0ucGFyZW50TG9jYWxlICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAvLyBVcGRhdGUgZXhpc3RpbmcgY2hpbGQgbG9jYWxlIGluLXBsYWNlIHRvIGF2b2lkIG1lbW9yeS1sZWFrc1xuICAgICAgICAgICAgICAgIGxvY2FsZXNbbmFtZV0uc2V0KG1lcmdlQ29uZmlncyhsb2NhbGVzW25hbWVdLl9jb25maWcsIGNvbmZpZykpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBNRVJHRVxuICAgICAgICAgICAgICAgIHRtcExvY2FsZSA9IGxvYWRMb2NhbGUobmFtZSk7XG4gICAgICAgICAgICAgICAgaWYgKHRtcExvY2FsZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIHBhcmVudENvbmZpZyA9IHRtcExvY2FsZS5fY29uZmlnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjb25maWcgPSBtZXJnZUNvbmZpZ3MocGFyZW50Q29uZmlnLCBjb25maWcpO1xuICAgICAgICAgICAgICAgIGlmICh0bXBMb2NhbGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAvLyB1cGRhdGVMb2NhbGUgaXMgY2FsbGVkIGZvciBjcmVhdGluZyBhIG5ldyBsb2NhbGVcbiAgICAgICAgICAgICAgICAgICAgLy8gU2V0IGFiYnIgc28gaXQgd2lsbCBoYXZlIGEgbmFtZSAoZ2V0dGVycyByZXR1cm5cbiAgICAgICAgICAgICAgICAgICAgLy8gdW5kZWZpbmVkIG90aGVyd2lzZSkuXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5hYmJyID0gbmFtZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbG9jYWxlID0gbmV3IExvY2FsZShjb25maWcpO1xuICAgICAgICAgICAgICAgIGxvY2FsZS5wYXJlbnRMb2NhbGUgPSBsb2NhbGVzW25hbWVdO1xuICAgICAgICAgICAgICAgIGxvY2FsZXNbbmFtZV0gPSBsb2NhbGU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIGJhY2t3YXJkcyBjb21wYXQgZm9yIG5vdzogYWxzbyBzZXQgdGhlIGxvY2FsZVxuICAgICAgICAgICAgZ2V0U2V0R2xvYmFsTG9jYWxlKG5hbWUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gcGFzcyBudWxsIGZvciBjb25maWcgdG8gdW51cGRhdGUsIHVzZWZ1bCBmb3IgdGVzdHNcbiAgICAgICAgICAgIGlmIChsb2NhbGVzW25hbWVdICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAobG9jYWxlc1tuYW1lXS5wYXJlbnRMb2NhbGUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBsb2NhbGVzW25hbWVdID0gbG9jYWxlc1tuYW1lXS5wYXJlbnRMb2NhbGU7XG4gICAgICAgICAgICAgICAgICAgIGlmIChuYW1lID09PSBnZXRTZXRHbG9iYWxMb2NhbGUoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0U2V0R2xvYmFsTG9jYWxlKG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChsb2NhbGVzW25hbWVdICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGxvY2FsZXNbbmFtZV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBsb2NhbGVzW25hbWVdO1xuICAgIH1cblxuICAgIC8vIHJldHVybnMgbG9jYWxlIGRhdGFcbiAgICBmdW5jdGlvbiBnZXRMb2NhbGUoa2V5KSB7XG4gICAgICAgIHZhciBsb2NhbGU7XG5cbiAgICAgICAgaWYgKGtleSAmJiBrZXkuX2xvY2FsZSAmJiBrZXkuX2xvY2FsZS5fYWJicikge1xuICAgICAgICAgICAga2V5ID0ga2V5Ll9sb2NhbGUuX2FiYnI7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWtleSkge1xuICAgICAgICAgICAgcmV0dXJuIGdsb2JhbExvY2FsZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghaXNBcnJheShrZXkpKSB7XG4gICAgICAgICAgICAvL3Nob3J0LWNpcmN1aXQgZXZlcnl0aGluZyBlbHNlXG4gICAgICAgICAgICBsb2NhbGUgPSBsb2FkTG9jYWxlKGtleSk7XG4gICAgICAgICAgICBpZiAobG9jYWxlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGxvY2FsZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGtleSA9IFtrZXldO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGNob29zZUxvY2FsZShrZXkpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGxpc3RMb2NhbGVzKCkge1xuICAgICAgICByZXR1cm4ga2V5cyhsb2NhbGVzKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjaGVja092ZXJmbG93KG0pIHtcbiAgICAgICAgdmFyIG92ZXJmbG93LFxuICAgICAgICAgICAgYSA9IG0uX2E7XG5cbiAgICAgICAgaWYgKGEgJiYgZ2V0UGFyc2luZ0ZsYWdzKG0pLm92ZXJmbG93ID09PSAtMikge1xuICAgICAgICAgICAgb3ZlcmZsb3cgPVxuICAgICAgICAgICAgICAgIGFbTU9OVEhdIDwgMCB8fCBhW01PTlRIXSA+IDExXG4gICAgICAgICAgICAgICAgICAgID8gTU9OVEhcbiAgICAgICAgICAgICAgICAgICAgOiBhW0RBVEVdIDwgMSB8fCBhW0RBVEVdID4gZGF5c0luTW9udGgoYVtZRUFSXSwgYVtNT05USF0pXG4gICAgICAgICAgICAgICAgICAgICAgPyBEQVRFXG4gICAgICAgICAgICAgICAgICAgICAgOiBhW0hPVVJdIDwgMCB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICBhW0hPVVJdID4gMjQgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgKGFbSE9VUl0gPT09IDI0ICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYVtNSU5VVEVdICE9PSAwIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtTRUNPTkRdICE9PSAwIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYVtNSUxMSVNFQ09ORF0gIT09IDApKVxuICAgICAgICAgICAgICAgICAgICAgICAgPyBIT1VSXG4gICAgICAgICAgICAgICAgICAgICAgICA6IGFbTUlOVVRFXSA8IDAgfHwgYVtNSU5VVEVdID4gNTlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNSU5VVEVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBhW1NFQ09ORF0gPCAwIHx8IGFbU0VDT05EXSA+IDU5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBTRUNPTkRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGFbTUlMTElTRUNPTkRdIDwgMCB8fCBhW01JTExJU0VDT05EXSA+IDk5OVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBNSUxMSVNFQ09ORFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAtMTtcblxuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIGdldFBhcnNpbmdGbGFncyhtKS5fb3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p1bnxKdWx8QXVnfFNlcHxPY3R8Tm92fERlYylcXHMoXFxkezIsNH0pXFxzKFxcZFxcZCk6KFxcZFxcZCkoPzo6KFxcZFxcZCkpP1xccyg/OihVVHxHTVR8W0VDTVBdW1NEXVQpfChbWnpdKXwoWystXVxcZHs0fSkpJC8sXG4gICAgICAgIG9ic09mZnNldHMgPSB7XG4gICAgICAgICAgICBVVDogMCxcbiAgICAgICAgICAgIEdNVDogMCxcbiAgICAgICAgICAgIEVEVDogLTQgKiA2MCxcbiAgICAgICAgICAgIEVTVDogLTUgKiA2MCxcbiAgICAgICAgICAgIENEVDogLTUgKiA2MCxcbiAgICAgICAgICAgIENTVDogLTYgKiA2MCxcbiAgICAgICAgICAgIE1EVDogLTYgKiA2MCxcbiAgICAgICAgICAgIE1TVDogLTcgKiA2MCxcbiAgICAgICAgICAgIFBEVDogLTcgKiA2MCxcbiAgICAgICAgICAgIFBTVDogLTggKiA2MCxcbiAgICAgICAgfTtcblxuICAgIC8vIGRhdGUgZnJvbSBpc28gZm9ybWF0XG4gICAgZnVuY3Rpb24gY29uZmlnRnJvbUlTTyhjb25maWcpIHtcbiAgICAgICAgdmFyIGksXG4gICAgICAgICAgICBsLFxuICAgICAgICAgICAgc3RyaW5nID0gY29uZmlnLl9pLFxuICAgICAgICAgICAgbWF0Y2ggPSBleHRlbmRlZElzb1JlZ2V4LmV4ZWMoc3RyaW5nKSB8fCBiYXNpY0lzb1JlZ2V4LmV4ZWMoc3RyaW5nKSxcbiAgICAgICAgICAgIGFsbG93VGltZSxcbiAgICAgICAgICAgIGRhdGVGb3JtYXQsXG4gICAgICAgICAgICB0aW1lRm9ybWF0LFxuICAgICAgICAgICAgdHpGb3JtYXQsXG4gICAgICAgICAgICBpc29EYXRlc0xlbiA9IGlzb0RhdGVzLmxlbmd0aCxcbiAgICAgICAgICAgIGlzb1RpbWVzTGVuID0gaXNvVGltZXMubGVuZ3RoO1xuXG4gICAgICAgIGlmIChtYXRjaCkge1xuICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykuaXNvID0gdHJ1ZTtcbiAgICAgICAgICAgIGZvciAoaSA9IDAsIGwgPSBpc29EYXRlc0xlbjsgaSA8IGw7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChpc29EYXRlc1tpXVsxXS5leGVjKG1hdGNoWzFdKSkge1xuICAgICAgICAgICAgICAgICAgICBkYXRlRm9ybWF0ID0gaXNvRGF0ZXNbaV1bMF07XG4gICAgICAgICAgICAgICAgICAgIGFsbG93VGltZSA9IGlzb0RhdGVzW2ldWzJdICE9PSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGRhdGVGb3JtYXQgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5faXNWYWxpZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtYXRjaFszXSkge1xuICAgICAgICAgICAgICAgIGZvciAoaSA9IDAsIGwgPSBpc29UaW1lc0xlbjsgaSA8IGw7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNvVGltZXNbaV1bMV0uZXhlYyhtYXRjaFszXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1hdGNoWzJdIHNob3VsZCBiZSAnVCcgb3Igc3BhY2VcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVGb3JtYXQgPSAobWF0Y2hbMl0gfHwgJyAnKSArIGlzb1RpbWVzW2ldWzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHRpbWVGb3JtYXQgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBjb25maWcuX2lzVmFsaWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghYWxsb3dUaW1lICYmIHRpbWVGb3JtYXQgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIGNvbmZpZy5faXNWYWxpZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChtYXRjaFs0XSkge1xuICAgICAgICAgICAgICAgIGlmICh0elJlZ2V4LmV4ZWMobWF0Y2hbNF0pKSB7XG4gICAgICAgICAgICAgICAgICAgIHR6Rm9ybWF0ID0gJ1onO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5faXNWYWxpZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29uZmlnLl9mID0gZGF0ZUZvcm1hdCArICh0aW1lRm9ybWF0IHx8ICcnKSArICh0ekZvcm1hdCB8fCAnJyk7XG4gICAgICAgICAgICBjb25maWdGcm9tU3RyaW5nQW5kRm9ybWF0KGNvbmZpZyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb25maWcuX2lzVmFsaWQgPSBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGV4dHJhY3RGcm9tUkZDMjgyMlN0cmluZ3MoXG4gICAgICAgIHllYXJTdHIsXG4gICAgICAgIG1vbnRoU3RyLFxuICAgICAgICBkYXlTdHIsXG4gICAgICAgIGhvdXJTdHIsXG4gICAgICAgIG1pbnV0ZVN0cixcbiAgICAgICAgc2Vjb25kU3RyXG4gICAgKSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBbXG4gICAgICAgICAgICB1bnRydW5jYXRlWWVhcih5ZWFyU3RyKSxcbiAgICAgICAgICAgIGRlZmF1bHRMb2NhbGVNb250aHNTaG9ydC5pbmRleE9mKG1vbnRoU3RyKSxcbiAgICAgICAgICAgIHBhcnNlSW50KGRheVN0ciwgMTApLFxuICAgICAgICAgICAgcGFyc2VJbnQoaG91clN0ciwgMTApLFxuICAgICAgICAgICAgcGFyc2VJbnQobWludXRlU3RyLCAxMCksXG4gICAgICAgIF07XG5cbiAgICAgICAgaWYgKHNlY29uZFN0cikge1xuICAgICAgICAgICAgcmVzdWx0LnB1c2gocGFyc2VJbnQoc2Vjb25kU3RyLCAxMCkpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiB1bnRydW5jYXRlWWVhcih5ZWFyU3RyKSB7XG4gICAgICAgIHZhciB5ZWFyID0gcGFyc2VJbnQoeWVhclN0ciwgMTApO1xuICAgICAgICBpZiAoeWVhciA8PSA0OSkge1xuICAgICAgICAgICAgcmV0dXJuIDIwMDAgKyB5ZWFyO1xuICAgICAgICB9IGVsc2UgaWYgKHllYXIgPD0gOTk5KSB7XG4gICAgICAgICAgICByZXR1cm4gMTkwMCArIHllYXI7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHllYXI7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcHJlcHJvY2Vzc1JGQzI4MjIocykge1xuICAgICAgICAvLyBSZW1vdmUgY29tbWVudHMgYW5kIGZvbGRpbmcgd2hpdGVzcGFjZSBhbmQgcmVwbGFjZSBtdWx0aXBsZS1zcGFjZXMgd2l0aCBhIHNpbmdsZSBzcGFjZVxuICAgICAgICByZXR1cm4gc1xuICAgICAgICAgICAgLnJlcGxhY2UoL1xcKFteKCldKlxcKXxbXFxuXFx0XS9nLCAnICcpXG4gICAgICAgICAgICAucmVwbGFjZSgvKFxcc1xccyspL2csICcgJylcbiAgICAgICAgICAgIC5yZXBsYWNlKC9eXFxzXFxzKi8sICcnKVxuICAgICAgICAgICAgLnJlcGxhY2UoL1xcc1xccyokLywgJycpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNoZWNrV2Vla2RheSh3ZWVrZGF5U3RyLCBwYXJzZWRJbnB1dCwgY29uZmlnKSB7XG4gICAgICAgIGlmICh3ZWVrZGF5U3RyKSB7XG4gICAgICAgICAgICAvLyBUT0RPOiBSZXBsYWNlIHRoZSB2YW5pbGxhIEpTIERhdGUgb2JqZWN0IHdpdGggYW4gaW5kZXBlbmRlbnQgZGF5LW9mLXdlZWsgY2hlY2suXG4gICAgICAgICAgICB2YXIgd2Vla2RheVByb3ZpZGVkID0gZGVmYXVsdExvY2FsZVdlZWtkYXlzU2hvcnQuaW5kZXhPZih3ZWVrZGF5U3RyKSxcbiAgICAgICAgICAgICAgICB3ZWVrZGF5QWN0dWFsID0gbmV3IERhdGUoXG4gICAgICAgICAgICAgICAgICAgIHBhcnNlZElucHV0WzBdLFxuICAgICAgICAgICAgICAgICAgICBwYXJzZWRJbnB1dFsxXSxcbiAgICAgICAgICAgICAgICAgICAgcGFyc2VkSW5wdXRbMl1cbiAgICAgICAgICAgICAgICApLmdldERheSgpO1xuICAgICAgICAgICAgaWYgKHdlZWtkYXlQcm92aWRlZCAhPT0gd2Vla2RheUFjdHVhbCkge1xuICAgICAgICAgICAgICAgIGdldFBhcnNpbmdGbGFncyhjb25maWcpLndlZWtkYXlNaXNtYXRjaCA9IHRydWU7XG4gICAgICAgICAgICAgICAgY29uZmlnLl9pc1ZhbGlkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNhbGN1bGF0ZU9mZnNldChvYnNPZmZzZXQsIG1pbGl0YXJ5T2Zmc2V0LCBudW1PZmZzZXQpIHtcbiAgICAgICAgaWYgKG9ic09mZnNldCkge1xuICAgICAgICAgICAgcmV0dXJuIG9ic09mZnNldHNbb2JzT2Zmc2V0XTtcbiAgICAgICAgfSBlbHNlIGlmIChtaWxpdGFyeU9mZnNldCkge1xuICAgICAgICAgICAgLy8gdGhlIG9ubHkgYWxsb3dlZCBtaWxpdGFyeSB0eiBpcyBaXG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBobSA9IHBhcnNlSW50KG51bU9mZnNldCwgMTApLFxuICAgICAgICAgICAgICAgIG0gPSBobSAlIDEwMCxcbiAgICAgICAgICAgICAgICBoID0gKGhtIC0gbSkgLyAxMDA7XG4gICAgICAgICAgICByZXR1cm4gaCAqIDYwICsgbTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIGRhdGUgYW5kIHRpbWUgZnJvbSByZWYgMjgyMiBmb3JtYXRcbiAgICBmdW5jdGlvbiBjb25maWdGcm9tUkZDMjgyMihjb25maWcpIHtcbiAgICAgICAgdmFyIG1hdGNoID0gcmZjMjgyMi5leGVjKHByZXByb2Nlc3NSRkMyODIyKGNvbmZpZy5faSkpLFxuICAgICAgICAgICAgcGFyc2VkQXJyYXk7XG4gICAgICAgIGlmIChtYXRjaCkge1xuICAgICAgICAgICAgcGFyc2VkQXJyYXkgPSBleHRyYWN0RnJvbVJGQzI4MjJTdHJpbmdzKFxuICAgICAgICAgICAgICAgIG1hdGNoWzRdLFxuICAgICAgICAgICAgICAgIG1hdGNoWzNdLFxuICAgICAgICAgICAgICAgIG1hdGNoWzJdLFxuICAgICAgICAgICAgICAgIG1hdGNoWzVdLFxuICAgICAgICAgICAgICAgIG1hdGNoWzZdLFxuICAgICAgICAgICAgICAgIG1hdGNoWzddXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgaWYgKCFjaGVja1dlZWtkYXkobWF0Y2hbMV0sIHBhcnNlZEFycmF5LCBjb25maWcpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIC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9kID0gbmV3IERhdGUoY29uZmlnLl9pICsgKGNvbmZpZy5fdXNlVVRDID8gJyBVVEMnIDogJycpKTtcbiAgICAgICAgfVxuICAgICk7XG5cbiAgICAvLyBQaWNrIHRoZSBmaXJzdCBkZWZpbmVkIG9mIHR3byBvciB0aHJlZSBhcmd1bWVudHMuXG4gICAgZnVuY3Rpb24gZGVmYXVsdHMoYSwgYiwgYykge1xuICAgICAgICBpZiAoYSAhPSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gYTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYiAhPSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gYjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjdXJyZW50RGF0ZUFycmF5KGNvbmZpZykge1xuICAgICAgICAvLyBob29rcyBpcyBhY3R1YWxseSB0aGUgZXhwb3J0ZWQgbW9tZW50IG9iamVjdFxuICAgICAgICB2YXIgbm93VmFsdWUgPSBuZXcgRGF0ZShob29rcy5ub3coKSk7XG4gICAgICAgIGlmIChjb25maWcuX3VzZVVUQykge1xuICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICBub3dWYWx1ZS5nZXRVVENGdWxsWWVhcigpLFxuICAgICAgICAgICAgICAgIG5vd1ZhbHVlLmdldFVUQ01vbnRoKCksXG4gICAgICAgICAgICAgICAgbm93VmFsdWUuZ2V0VVRDRGF0ZSgpLFxuICAgICAgICAgICAgXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gW25vd1ZhbHVlLmdldEZ1bGxZZWFyKCksIG5vd1ZhbHVlLmdldE1vbnRoKCksIG5vd1ZhbHVlLmdldERhdGUoKV07XG4gICAgfVxuXG4gICAgLy8gY29udmVydCBhbiBhcnJheSB0byBhIGRhdGUuXG4gICAgLy8gdGhlIGFycmF5IHNob3VsZCBtaXJyb3IgdGhlIHBhcmFtZXRlcnMgYmVsb3dcbiAgICA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BkZWZhdWx0ZWQsIGluY2x1ZGluZyB0aW1lXG4gICAgICAgIGZvciAoOyBpIDwgNzsgaSsrKSB7XG4gICAgICAgICAgICBjb25maWcuX2FbaV0gPSBpbnB1dFtpXSA9XG4gICAgICAgICAgICAgICAgY29uZmlnLl9hW2ldID09IG51bGwgPyAoaSA9PT0gMiA/IDEgOiAwKSA6IGNvbmZpZy5fYVtpXTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENoZWNrIGZvciAyNDowMDowMC4wMDBcbiAgICAgICAgaWYgKFxuICAgICAgICAgICAgY29uZmlnLl9hW0hPVVJdID09PSAyNCAmJlxuICAgICAgICAgICAgY29uZmlnLl9hW01JTlVURV0gPT09IDAgJiZcbiAgICAgICAgICAgIGNvbmZpZy5fYVtTRUNPTkRdID09PSAwICYmXG4gICAgICAgICAgICBjb25maWcuX2FbTUlMTElTRUNPTkRdID09PSAwXG4gICAgICAgICkge1xuICAgICAgICAgICAgY29uZmlnLl9uZXh0RGF5ID0gdHJ1ZTtcbiAgICAgICAgICAgIGNvbmZpZy5fYVtIT1VSXSA9IDA7XG4gICAgICAgIH1cblxuICAgICAgICBjb25maWcuX2QgPSAoY29uZmlnLl91c2VVVEMgPyBjcmVhdGVVVENEYXRlIDogY3JlYXRlRGF0ZSkuYXBwbHkoXG4gICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgaW5wdXRcbiAgICAgICAgKTtcbiAgICAgICAgZXhwZWN0ZWRXZWVrZGF5ID0gY29uZmlnLl91c2VVVENcbiAgICAgICAgICAgID8gY29uZmlnLl9kLmdldFVUQ0RheSgpXG4gICAgICAgICAgICA6IGNvbmZpZy5fZC5nZXREYXkoKTtcblxuICAgICAgICAvLyBBcHBseSB0aW1lem9uZSBvZmZzZXQgZnJvbSBpbnB1dC4gVGhlIGFjdHVhbCB1dGNPZmZzZXQgY2FuIGJlIGNoYW5nZWRcbiAgICAgICAgLy8gd2l0aCBwYXJzZVpvbmUuXG4gICAgICAgIGlmIChjb25maWcuX3R6bSAhPSBudWxsKSB7XG4gICAgICAgICAgICBjb25maWcuX2Quc2V0VVRDTWludXRlcyhjb25maWcuX2QuZ2V0VVRDTWludXRlcygpIC0gY29uZmlnLl90em0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGNvbmZpZy5fbmV4dERheSkge1xuICAgICAgICAgICAgY29uZmlnLl9hW0hPVVJdID0gMjQ7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBjaGVjayBmb3IgbWlzbWF0Y2hpbmcgZGF5IG9mIHdlZWtcbiAgICAgICAgaWYgKFxuICAgICAgICAgICAgY29uZmlnLl93ICYmXG4gICAgICAgICAgICB0eXBlb2YgY29uZmlnLl93LmQgIT09ICd1bmRlZmluZWQnICYmXG4gICAgICAgICAgICBjb25maWcuX3cuZCAhPT0gZXhwZWN0ZWRXZWVrZGF5XG4gICAgICAgICkge1xuICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykud2Vla2RheU1pc21hdGNoID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGRheU9mWWVhckZyb21XZWVrSW5mbyhjb25maWcpIHtcbiAgICAgICAgdmFyIHcsIHdlZWtZZWFyLCB3ZWVrLCB3ZWVrZGF5LCBkb3csIGRveSwgdGVtcCwgd2Vla2RheU92ZXJmbG93LCBjdXJXZWVrO1xuXG4gICAgICAgIHcgPSBjb25maWcuX3c7XG4gICAgICAgIGlmICh3LkdHICE9IG51bGwgfHwgdy5XICE9IG51bGwgfHwgdy5FICE9IG51bGwpIHtcbiAgICAgICAgICAgIGRvdyA9IDE7XG4gICAgICAgICAgICBkb3kgPSA0O1xuXG4gICAgICAgICAgICAvLyBUT0RPOiBXZSBuZWVkIHRvIHRha2UgdGhlIGN1cnJlbnQgaXNvV2Vla1llYXIsIGJ1dCB0aGF0IGRlcGVuZHMgb25cbiAgICAgICAgICAgIC8vIGhvdyB3ZSBpbnRlcnByZXQgbm93IChsb2NhbCwgdXRjLCBmaXhlZCBvZmZzZXQpLiBTbyBjcmVhdGVcbiAgICAgICAgICAgIC8vIGEgbm93IHZlcnNpb24gb2YgY3VycmVudCBjb25maWcgKHRha2UgbG9jYWwvdXRjL29mZnNldCBmbGFncywgYW5kXG4gICAgICAgICAgICAvLyBjcmVhdGUgbm93KS5cbiAgICAgICAgICAgIHdlZWtZZWFyID0gZGVmYXVsdHMoXG4gICAgICAgICAgICAgICAgdy5HRyxcbiAgICAgICAgICAgICAgICBjb25maWcuX2FbWUVBUl0sXG4gICAgICAgICAgICAgICAgd2Vla09mWWVhcihjcmVhdGVMb2NhbCgpLCAxLCA0KS55ZWFyXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgd2VlayA9IGRlZmF1bHRzKHcuVywgMSk7XG4gICAgICAgICAgICB3ZWVrZGF5ID0gZGVmYXVsdHMody5FLCAxKTtcbiAgICAgICAgICAgIGlmICh3ZWVrZGF5IDwgMSB8fCB3ZWVrZGF5ID4gNykge1xuICAgICAgICAgICAgICAgIHdlZWtkYXlPdmVyZmxvdyA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkb3cgPSBjb25maWcuX2xvY2FsZS5fd2Vlay5kb3c7XG4gICAgICAgICAgICBkb3kgPSBjb25maWcuX2xvY2FsZS5fd2Vlay5kb3k7XG5cbiAgICAgICAgICAgIGN1cldlZWsgPSB3ZWVrT2ZZZWFyKGNyZWF0ZUxvY2FsKCksIGRvdywgZG95KTtcblxuICAgICAgICAgICAgd2Vla1llYXIgPSBkZWZhdWx0cyh3LmdnLCBjb25maWcuX2FbWUVBUl0sIGN1cldlZWsueWVhcik7XG5cbiAgICAgICAgICAgIC8vIERlZmF1bHQgdG8gY3VycmVudCB3ZWVrLlxuICAgICAgICAgICAgd2VlayA9IGRlZmF1bHRzKHcudywgY3VyV2Vlay53ZWVrKTtcblxuICAgICAgICAgICAgaWYgKHcuZCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgLy8gd2Vla2RheSAtLSBsb3cgZGF5IG51bWJlcnMgYXJlIGNvbnNpZGVyZWQgbmV4dCB3ZWVrXG4gICAgICAgICAgICAgICAgd2Vla2RheSA9IHcuZDtcbiAgICAgICAgICAgICAgICBpZiAod2Vla2RheSA8IDAgfHwgd2Vla2RheSA+IDYpIHtcbiAgICAgICAgICAgICAgICAgICAgd2Vla2RheU92ZXJmbG93ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHcuZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgLy8gbG9jYWwgd2Vla2RheSAtLSBjb3VudGluZyBzdGFydHMgZnJvbSBiZWdpbm5pbmcgb2Ygd2Vla1xuICAgICAgICAgICAgICAgIHdlZWtkYXkgPSB3LmUgKyBkb3c7XG4gICAgICAgICAgICAgICAgaWYgKHcuZSA8IDAgfHwgdy5lID4gNikge1xuICAgICAgICAgICAgICAgICAgICB3ZWVrZGF5T3ZlcmZsb3cgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gZGVmYXVsdCB0byBiZWdpbm5pbmcgb2Ygd2Vla1xuICAgICAgICAgICAgICAgIHdlZWtkYXkgPSBkb3c7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHdlZWsgPCAxIHx8IHdlZWsgPiB3ZWVrc0luWWVhcih3ZWVrWWVhciwgZG93LCBkb3kpKSB7XG4gICAgICAgICAgICBnZXRQYXJzaW5nRmxhZ3MoY29uZmlnKS5fb3ZlcmZsb3dXZWVrcyA9IHRydWU7XG4gICAgICAgIH0gZWxzZSBpZiAod2Vla2RheU92ZXJmbG93ICE9IG51bGwpIHtcbiAgICAgICAgICAgIGdldFBhcnNpbmdGbGFncyhjb25maWcpLl9vdmVyZmxvd1dlZWtkYXkgPSB0cnVlO1xuICAgIC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jb25maWcpLmVtcHR5ID0gdHJ1ZTtcblxuICAgICAgICAvLyBUaGlzIGFycmF5IGlzIHVzZWQgdG8gbWFrZSBhIERhdGUsIGVpdGhlciB3aXRoIGBuZXcgRGF0ZWAgb3IgYERhdGUuVVRDYFxuICAgICAgICB2YXIgc3RyaW5nID0gJycgKyBjb25maWcuX2ksXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgcGFyc2VkSW5wdXQsXG4gICAgICAgICAgICB0b2tlbnMsXG4gICAgICAgICAgICB0b2tlbixcbiAgICAgICAgICAgIHNraXBwZWQsXG4gICAgICAgICAgICBzdHJpbmdMZW5ndGggPSBzdHJpbmcubGVuZ3RoLFxuICAgICAgICAgICAgdG90YWxQYXJzZWRJbnB1dExlbmd0aCA9IDAsXG4gICAgICAgICAgICBlcmEsXG4gICAgICAgICAgICB0b2tlbkxlbjtcblxuICAgICAgICB0b2tlbnMgPVxuICAgICAgICAgICAgZXhwYW5kRm9ybWF0KGNvbmZpZy5fZiwgY29uZmlnLl9sb2NhbGUpLm1hdGNoKGZvcm1hdHRpbmdUb2tlbnMpIHx8IFtdO1xuICAgICAgICB0b2tlbkxlbiA9IHRva2Vucy5sZW5ndGg7XG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0b2tlbkxlbjsgaSsrKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHRva2Vuc1tpXTtcbiAgICAgICAgICAgIHBhcnNlZElucHV0ID0gKHN0cmluZy5tYXRjaChnZXRQYXJzZVJlZ2V4Rm9yVG9rZW4odG9rZW4sIGNvbmZpZykpIHx8XG4gICAgICAgICAgICAgICAgW10pWzBdO1xuICAgICAgICAgICAgaWYgKHBhcnNlZElucHV0KSB7XG4gICAgICAgICAgICAgICAgc2tpcHBlZCA9IHN0cmluZy5zdWJzdHIoMCwgc3RyaW5nLmluZGV4T2YocGFyc2VkSW5wdXQpKTtcbiAgICAgICAgICAgICAgICBpZiAoc2tpcHBlZC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGdldFBhcnNpbmdGbGFncyhjb25maWcpLnVudXNlZElucHV0LnB1c2goc2tpcHBlZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHN0cmluZyA9IHN0cmluZy5zbGljZShcbiAgICAgICAgICAgICAgICAgICAgc3RyaW5nLmluZGV4T2YocGFyc2VkSW5wdXQpICsgcGFyc2VkSW5wdXQubGVuZ3RoXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB0b3RhbFBhcnNlZElucHV0TGVuZ3RoICs9IHBhcnNlZElucHV0Lmxlbmd0aDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGRvbid0IHBhcnNlIGlmIGl0J3Mgbm90IGEga25vd24gdG9rZW5cbiAgICAgICAgICAgIGlmIChmb3JtYXRUb2tlbkZ1bmN0aW9uc1t0b2tlbl0pIHtcbiAgICAgICAgICAgICAgICBpZiAocGFyc2VkSW5wdXQpIHtcbiAgICAgICAgICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykuZW1wdHkgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBnZXRQYXJzaW5nRmxhZ3MoY29uZmlnKS51bnVzZWRUb2tlbnMucHVzaCh0b2tlbik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGFkZFRpbWVUb0FycmF5RnJvbVRva2VuKHRva2VuLCBwYXJzZWRJbnB1dCwgY29uZmlnKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29uZmlnLl9zdHJpY3QgJiYgIXBhcnNlZElucHV0KSB7XG4gICAgICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykudW51c2VkVG9rZW5zLnB1c2godG9rZW4pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gYWRkIHJlbWFpbmluZyB1bnBhc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yYVxuICAgICAgICBlcmEgPSBnZXRQYXJzaW5nRmxhZ3MoY29uZmlnKS5lcmE7XG4gICAgICAgIGlmIChlcmEgIT09IG51bGwpIHtcbiAgICAgICAgICAgIGNvbmZpZy5fYVtZRUFSXSA9IGNvbmZpZy5fbG9jYWxlLmVyYXNDb252ZXJ0WWVhcihlcmEsIGNvbmZpZy5fYVtZRUFSXSk7XG4gICAgICAgIH1cblxuICAgICAgICBjb25maWdGcm9tQXJyYXkoY29uZmlnKTtcbiAgICAgICAgY2hlY2tPdmVyZmxvdyhjb25maWcpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1lcmlkaWVtRml4V3JhcChsb2NhbGUsIGhvdXIsIG1lcmlkaWVtKSB7XG4gICAgICAgIHZhciBpc1BtO1xuXG4gICAgICAgIGlmIChtZXJpZGllbSA9PSBudWxsKSB7XG4gICAgICAgICAgICAvLyBub3RoaW5nIHRvIGRvXG4gICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgfVxuICAgICAgICBpZiAobG9jYWxlLm1lcmlkaWVtSG91ciAhPSBudWxsKSB7XG4gICAgICAgICAgICByZXR1cm4gbG9jYWxlLm1lcmlkaWVtSG91cihob3VyLCBtZXJpZGllbSk7XG4gICAgICAgIH0gZWxzZSBpZiAobG9jYWxlLmlzUE0gIT0gbnVsbCkge1xuICAgICAgICAgICAgLy8gRmFsbGJhY2tcbiAgICAgICAgICAgIGlzUG0gPSBsb2NhbGUuaXNQTShtZXJpZGllbSk7XG4gICAgICAgICAgICBpZiAoaXNQbSAmJiBob3VyIDwgMTIpIHtcbiAgICAgICAgICAgICAgICBob3VyICs9IDEyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCFpc1BtICYmIGhvdXIgPT09IDEyKSB7XG4gICAgICAgICAgICAgICAgaG91ciA9IDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gaG91cjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHRoaXMgaXMgbm90IHN1cHBvc2VkIHRvIGhhcHBlblxuICAgICAgICAgICAgcmV0dXJuIGhvdXI7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBkYXRlIGZyb20gc3RyaW5nIGFuZCBhcnJheSBvZiBmb3JtYXQgc3RyaW5nc1xuICAgIGZ1bmN0aW9uIGNvbmZpZ0Zyb21TdHJpbmdBbmRBcnJheShjb25maWcpIHtcbiAgICAgICAgdmFyIHRlbXBDb25maWcsXG4gICAgICAgICAgICBiZXN0TW9tZW50LFxuICAgICAgICAgICAgc2NvcmVUb0JlYXQsXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgY3VycmVudFNjb3JlLFxuICAgICAgICAgICAgdmFsaWRGb3JtYXRGb3VuZCxcbiAgICAgICAgICAgIGJlc3RGb3JtYXRJc1ZhbGlkID0gZmFsc2UsXG4gICAgICAgICAgICBjb25maWdmTGVuID0gY29uZmlnLl9mLmxlbmd0aDtcblxuICAgICAgICBpZiAoY29uZmlnZkxlbiA9PT0gMCkge1xuICAgICAgICAgICAgZ2V0UGFyc2luZ0ZsYWdzKGNvbmZpZykuaW52YWxpZEZvcm1hdCA9IHRydWU7XG4gICAgICAgICAgICBjb25maWcuX2QgPSBuZXcgRGF0ZShOYU4pO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGNvbmZpZ2ZMZW47IGkrKykge1xuICAgICAgICAgICAgY3VycmVudFNjb3JlID0gMDtcbiAgICAgICAgICAgIHZhbGlkRm9ybWF0Rm91bmQgPSBmYWxzZTtcbiAgICAgICAgICAgIHRlbXBDb25maWcgPSBjb3B5Q29uZmlnKHt9LCBjb25maWcpO1xuICAgICAgICAgICAgaWYgKGNvbmZpZy5fdXNlVVRDICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICB0ZW1wQ29uZmlnLl91c2VVVEMgPSBjb25maWcuX3VzZVVUQztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRlbXBDb25maWcuX2YgPSBjb25maWcuX2ZbaV07XG4gICAgICAgICAgICBjb25maWdGcm9tU3RyaW5nQW5kRm9ybWF0KHRlbXBDb25maWcpO1xuXG4gICAgICAgICAgICBpZiAoaXNWYWxpZCh0ZW1wQ29uZmlnKSkge1xuICAgICAgICAgICAgICAgIHZhbGlkRm9ybWF0Rm91bmQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBpZiB0aGVyZSBpcyBhbnkgaW5wdXQgdGhhdCB3YXMgbm90IHBhcnNlZCBhZGQgYSBwZW5hbHR5IGZvciB0aGF0IGZvcm1hdFxuICAgICAgICAgICAgY3VycmVudFNjb3JlICs9IGdldFBhcnNpbmdGbGFncyh0ZW1wQ29uZmlnKS5jaGFyc0xlZnRPdmVyO1xuXG4gICAgICAgICAgICAvL29yIHRva2Vuc1xuICAgICAgICAgICAgY3VycmVudFNjb3JlICs9IGdldFBhcnNpbmdGbGFncyh0ZW1wQ29uZmlnKS51bnVzZWRUb2tlbnMubGVuZ3RoICogMTA7XG5cbiAgICAgICAgICAgIGdldFBhcnNpbmdGbGFncyh0ZW1wQ29uZmlnKS5zY29yZSA9IGN1cnJlbnRTY29yZTtcblxuICAgICAgICAgICAgaWYgKCFiZXN0Rm9ybWF0SXNWYWxpZCkge1xuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgc2NvcmVUb0JlYXQgPT0gbnVsbCB8fFxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50U2NvcmUgPCBzY29yZVRvQmVhdCB8fFxuICAgICAgICAgICAgICAgICAgICB2YWxpZEZvcm1hdEZvdW5kXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIHNjb3JlVG9CZWF0ID0gY3VycmVudFNjb3JlO1xuICAgICAgICAgICAgICAgICAgICBiZXN0TW9tZW50ID0gdGVtcENvbmZpZztcbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbGlkRm9ybWF0Rm91bmQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJlc3RGb3JtYXRJc1ZhbGlkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRTY29yZSA8IHNjb3JlVG9CZWF0KSB7XG4gICAgICAgICAgICAgICAgICAgIHNjb3JlVG9CZWF0ID0gY3VycmVudFNjb3JlO1xuICAgICAgICAgICAgICAgICAgICBiZXN0TW9tZW50ID0gdGVtcENvbmZpZztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBleHRlbmQoY29uZmlnLCBiZXN0TW9tZW50IHx8IHRlbXBDb25maWcpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbmZpZ0Zyb21PYmplY3QoY29uZmlnKSB7XG4gICAgICAgIGlmIChjb25maWcuX2QpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBpID0gbm9ybWFsaXplT2JqZWN0VW5pdHMoY29uZmlnLl9pKSxcbiAgICAgICAgICAgIGRheU9yRGF0ZSA9IGkuZGF5ID09PSB1bmRlZmluZWQgPyBpLmRhdGUgOiBpLmRheTtcbiAgICAgICAgY29uZmlnLl9hID0gbWFwKFxuICAgICAgICAgICAgW2kueWVhciwgaS5tb250aCwgZGF5T3JEYXRlLCBpLmhvdXIsIGkubWludXRlLCBpLnNlY29uZCwgaS5taWxsaXNlY29uZF0sXG4gICAgICAgICAgICBmdW5jdGlvbiAob2JqKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG9iaiAmJiBwYXJzZUludChvYmosIDEwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcblxuICAgICAgICBjb25maWdGcm9tQXJyYXkoY29uZmlnKTtc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bHNlIGlmIChpc0RhdGUoaW5wdXQpKSB7XG4gICAgICAgICAgICBjb25maWcuX2QgPSBpbnB1dDtcbiAgICAgICAgfSBlbHNlIGlmIChpc0FycmF5KGZvcm1hdCkpIHtcbiAgICAgICAgICAgIGNvbmZpZ0Zyb21TdHJpbmdBbmRBcnJheShjb25maWcpO1xuICAgICAgICB9IGVsc2UgaWYgKGZvcm1hdCkge1xuICAgICAgICAgICAgY29uZmlnRnJvbVN0cmluZ0FuZEZvcm1hdChjb25maWcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29uZmlnRnJvbUlucHV0KGNvbmZpZyk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWlzVmFsaWQoY29uZmlnKSkge1xuICAgICAgICAgICAgY29uZmlnLl9kID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjb25maWc7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY29uZmlnRnJvbUlucHV0KGNvbmZpZykge1xuICAgICAgICB2YXIgaW5wdXQgPSBjb25maWcuX2k7XG4gICAgICAgIGlmIChpc1VuZGVmaW5lZChpbnB1dCkpIHtcbiAgICAgICAgICAgIGNvbmZpZy5fZCA9IG5ldyBEYXRlKGhvb2tzLm5vdygpKTtcbiAgICAgICAgfSBlbHNlIGlmIChpc0RhdGUoaW5wdXQpKSB7XG4gICAgICAgICAgICBjb25maWcuX2QgPSBuZXcgRGF0ZShpbnB1dC52YWx1ZU9mKCkpO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBpbnB1dCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGNvbmZpZ0Zyb21TdHJpbmcoY29uZmlnKTtcbiAgICAgICAgfSBlbHNlIGlmIChpc0FycmF5KGlucHV0KSkge1xuICAgICAgICAgICAgY29uZmlnLl9hID0gbWFwKGlucHV0LnNsaWNlKDApLCBmdW5jdGlvbiAob2JqKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlSW50KG9iaiwgMTApO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBjb25maWdGcm9tQXJyYXkoY29uZmlnKTtcbiAgICAgICAgfSBlbHNlIGlmIChpc09iamVjdChpbnB1dCkpIHtcbiAgICAgICAgICAgIGNvbmZpZ0Zyb21PYmplY3QoY29uZmlnKTtcbiAgICAgICAgfSBlbHNlIGlmIChpc051bWJlcihpbnB1dCkpIHtcbiAgICAgICAgICAgIC8vIGZyb20gbWlsbGlzZWNvbmRzXG4gICAgICAgICAgICBjb25maWcuX2QgPSBuZXcgRGF0ZShpbnB1dCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBob29rcy5jcmVhdGVGcm9tSW5wdXRGYWxsYmFjayhjb25maWcpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gY3JlYXRlTG9jYWxPclVUQyhpbnB1dCwgZm9ybWF0LCBsb2NhbGUsIHN0cmljdCwgaXNVVEMpIHtcbiAgICAgICAgdmFyIGMgPSB7fTtcblxuICAgICAgICBpZiAoZm9ybWF0ID09PSB0cnVlIHx8IGZvcm1hdCA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgIHN0cmljdCA9IGZvcm1hdDtcbiAgICAgICAgICAgIGZvcm1hdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChsb2NhbGUgPT09IHRydWUgfHwgbG9jYWxlID09PSBmYWxzZSkge1xuICAgICAgICAgICAgc3RyaWN0ID0gbG9jYWxlO1xuICAgICAgICAgICAgbG9jYWxlID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKFxuICAgICAgICAgICAgKGlzT2JqZWN0KGlucHV0KSAmJiBpc09iamVjdEVtcHR5KGlucHV0KSkgfHxcbiAgICAgICAgICAgIChpc0FycmF5KGlucHV0KSAmJiBpbnB1dC5sZW5ndGggPT09IDApXG4gICAgICAgICkge1xuICAgICAgICAgICA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AgIHJldHVybiBvdGhlciA8IHRoaXMgPyB0aGlzIDogb3RoZXI7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNyZWF0ZUludmFsaWQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICksXG4gICAgICAgIHByb3RvdHlwZU1heCA9IGRlcHJlY2F0ZShcbiAgICAgICAgICAgICdtb21lbnQoKS5tYXggaXMgZGVwcmVjYXRlZCwgdXNlIG1vbWVudC5taW4gaW5zdGVhZC4gaHR0cDovL21vbWVudGpzLmNvbS9ndWlkZXMvIy93YXJuaW5ncy9taW4tbWF4LycsXG4gICAgICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIG90aGVyID0gY3JlYXRlTG9jYWwuYXBwbHkobnVsbCwgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5pc1ZhbGlkKCkgJiYgb3RoZXIuaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvdGhlciA+IHRoaXMgPyB0aGlzIDogb3RoZXI7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNyZWF0ZUludmFsaWQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG5cbiAgICAvLyBQaWNrIGEgbW9tZW50IG0gZnJvbSBtb21lbnRzIHNvIHRoYXQgbVtmbl0ob3RoZXIpIGlzIHRydWUgZm9yIGFsbFxuICAgIC8vIG90aGVyLiBUaGlzIHJlbGllcyBvbiB0aGUgZnVuY3Rpb24gZm4gdG8gYmUgdHJhbnNpdGl2ZS5cbiAgICAvL1xuICAgIC8vIG1vbWVudHMgc2hvdWxkIGVpdGhlciBiZSBhbiBhcnJheSBvZiBtb21lbnQgb2JqZWN0cyBvciBhbiBhcnJheSwgd2h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ICAgICByZXR1cm4gRGF0ZS5ub3cgPyBEYXRlLm5vdygpIDogK25ldyBEYXRlKCk7XG4gICAgfTtcblxuICAgIHZhciBvcmRlcmluZyA9IFtcbiAgICAgICAgJ3llYXInLFxuICAgICAgICAncXVhcnRlcicsXG4gICAgICAgICdtb250aCcsXG4gICAgICAgICd3ZWVrJyxcbiAgICAgICAgJ2RheScsXG4gICAgICAgICdob3VyJyxcbiAgICAgICAgJ21pbnV0ZScsXG4gICAgICAgICdzZWNvbmQnLFxuICAgICAgICAnbWlsbGlzZWNvbmQnLFxuICAgIF07XG5cbiAgICBmdW5jdGlvbiBpc0R1cmF0aW9uVmFsaWQobSkge1xuICAgICAgICB2YXIga2V5LFxuICAgICAgICAgICAgdW5pdEhhc0RlY2ltYWwgPSBmYWxzZSxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBvcmRlckxlbiA9IG9yZGVyaW5nLmxlbmd0aDtcbiAgICAgICAgZm9yIChrZXkgaW4gbSkge1xuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIGhhc093blByb3AobSwga2V5KSAmJlxuICAgICAgICAgICAgICAgICEoXG4gICAgICAgICAgICAgICAgICAgIGluZGV4T2YuY2FsbChvcmRlcmluZywga2V5KSAhPT0gLTEgJiZcbiAgICAgICAgICAgICAgICAgICAgKG1ba2V5XSA9PSBudWxsIHx8ICFpc05hTihtW2tleV0pKVxuICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBvcmRlckxlbjsgKytpKSB7XG4gICAgICAgICAgICBpZiAobVtvcmRlcmluZ1tpXV0pIHtcbiAgICAgICAgICAgICAgICBpZiAodW5pdEhhc0RlY2ltYWwpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOyAvLyBvbmx5IGFsbG93IG5vbi1pbnRlZ2VycyBmb3Igc21hbGxlc3QgdW5pdFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAocGFyc2VGbG9hdChtW29yZGVyaW5nW2ldXSkgIT09IHRvSW50KG1bb3JkZXJpbmdbaV1dKSkge1xuICAgICAgICAgICAgICAgICAgICB1bml0SGFzRGVjaW1hbCA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaXNWYWxpZCQxKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5faXNWYWxpZDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjcmVhdGVJbnZhbGlkJDEoKSB7XG4gICAgICAgIHJldHVybiBjcmVhdGVEdXJhdGlvbihOYU4pO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIER1cmF0aW9uKGR1cmF0aW9uKSB7XG4gICAgICAgIHZhciBub3JtYWxpemVkSW5wdXQgPSBub3JtYWxpemVPYmplY3RVbml0cyhkdXJhdGlvbiksXG4gICAgICAgICAgICB5ZWFycyA9IG5vcm1hbGl6ZWRJbnB1dC55ZWFyIHx8IDAsXG4gICAgICAgICAgICBxdWFydGVycyA9IG5vcm1hbGl6ZWRJbnB1dC5xdWFydGVyIHx8IDAsXG4gICAgICAgICAgICBtb250aHMgPSBub3JtYWxpemVkSW5wdXQubW9udGggfHwgMCxcbiAgICAgICAgICAgIHdlZWtzID0gbm9ybWFsaXplZElucHV0LndlZWsgfHwgbm9ybWFsaXplZElucHV0Lmlzb1dlZWsgfHwgMCxcbiAgICAgICAgICAgIGRheXMgPSBub3JtYWxpemVkSW5wdXQuZGF5IHx8IDAsXG4gICAgICAgICAgICBob3VycyA9IG5vcm1hbGl6ZWRJbnB1dC5ob3VyIHx8IDAsXG4gICAgICAgICAgICBtaW51dGVzID0gbm9ybWFsaXplZElucHV0Lm1p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G4gICAgICAgICAgICAgICAgKGRvbnRDb252ZXJ0ICYmIGFycmF5MVtpXSAhPT0gYXJyYXkyW2ldKSB8fFxuICAgICAgICAgICAgICAgICghZG9udENvbnZlcnQgJiYgdG9JbnQoYXJyYXkxW2ldKSAhPT0gdG9JbnQoYXJyYXkyW2ldKSlcbiAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICAgIGRpZmZzKys7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGRpZmZzICsgbGVuZ3RoRGlmZjtcbiAgICB9XG5cbiAgICAvLyBGT1JNQVRUSU5HXG5cbiAgICBmdW5jdGlvbiBvZmZzZXQodG9rZW4sIHNlcGFyYXRvcikge1xuICAgICAgICBhZGRGb3JtYXRUb2tlbih0b2tlbiwgMCwgMCwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIG9mZnNldCA9IHRoaXMudXRjT2Zmc2V0KCksXG4gICAgICAgICAgICAgICAgc2lnbiA9ICcrJztcbiAgICAgICAgICAgIGlmIChvZmZzZXQgPCAwKSB7XG4gICAgICAgICAgICAgICAgb2Zmc2V0ID0gLW9mZnNldDtcbiAgICAgICAgICAgICAgICBzaWduID0gJy0nO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICBzaWduICtcbiAgICAgICAgICAgICAgICB6ZXJvRmlsbCh+fihvZmZzZXQgLyA2MCksIDIpICtcbiAgICAgICAgICAgICAgICBzZXBhcmF0b3IgK1xuICAgICAgICAgICAgICAgIHplcm9GaWxsKH5+b2Zmc2V0ICUgNjAsIDIpXG4gICAgICAgICAgICApO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBvZmZzZXQoJ1onLCAnOicpO1xuICAgIG9mZnNldCgnWlonLCAnJyk7XG5cbiAgICAvLyBQQVJTSU5HXG5cbiAgICBhZGRSZWdleFRva2VuKCdaJywgbWF0Y2hTaG9ydE9mZnNldCk7XG4gICAgYWRkUmVnZXhUb2tlbignWlonLCBtYXRjaFNob3J0T2Zmc2V0KTtcbiAgICBhZGRQYXJzZVRva2VuKFsnWicsICdaWiddLCBmdW5jdGlvbiAoaW5wdXQsIGFycmF5LCBjb25maWcpIHtcbiAgICAgICAgY29uZmlnLl91c2VVVEMgPSB0cnVlO1xuICAgICAgICBjb25maWcuX3R6bSA9IG9mZnNldEZyb21TdHJpbmcobWF0Y2hTaG9ydE9mZnNldCwgaW5wdXQpO1xuICAgIH0pO1xuXG4gICAgLy8gSEVMUEVSU1xuXG4gICAgLy8gdGltZXpvbmUgY2h1bmtlclxuICAgIC8vICcrMTA6MDAnID4gWycxMCcsICAnMDAnXVxuICAgIC8vICctMTUzMCcgID4gWyctMTUnLCAnMzAnXVxuICAgIHZhciBjaHVua09mZnNldCA9IC8oW1xcK1xcLV18XFxkXFxkKS9naTtcblxuICAgIGZ1bmN0aW9uIG9mZnNldEZyb21TdHJpbmcobWF0Y2hlciwgc3RyaW5nKSB7XG4gICAgICAgIHZhciBtYXRjaGVzID0gKHN0cmluZyB8fCAnJykubWF0Y2gobWF0Y2hlciksXG4gICAgICAgICAgICBjaHVuayxcbiAgICAgICAgICAgIHBhcnRzLFxuICAgICAgICAgICAgbWludXRlcztcblxuICAgICAgICBpZiAobWF0Y2hlcyA9PT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICBjaHVuayA9IG1hdGNoZXNbbWF0Y2hlcy5sZW5ndGggLSAxXSB8fCBbXTtcbiAgICAgICAgcGFydHMgPSAoY2h1bmsgKyAnJykubWF0Y2goY2h1bmtPZmZzZXQpIHx8IFsnLScsIDAsIDBdO1xuICAgICAgICBtaW51dGVzID0gKyhwYXJ0c1sxXSAqIDYwKSArIHRvSW50KHBhcnRzWzJdKTtcblxuICAgICAgICByZXR1cm4gbWludXRlcyA9PT0gMCA/IDAgOiBwYXJ0c1swXSA9PT0gJysnID8gbWludXRlcyA6IC1taW51dGVzO1xuICAgIH1cblxuICAgIC8vIFJldHVybiBhIG1vbWVudCBmcm9tIGlucHV0LCB0aGF0IGlzIGxvY2FsL3V0Yy96b25lIGVxdWl2YWxlbnQgdG8gbW9kZWwuXG4gICAgZnVuY3Rpb24gY2xvbmVXaXRoT2Zmc2V0KGlucHV0LCBtb2RlbCkge1xuICAgICAgICB2YXIgcmVzLCBkaWZmO1xuICAgICAgICBpZiAobW9kZWwuX2lzVVRDKSB7XG4gICAgICAgICAgICByZXMgPSBtb2RlbC5jbG9uZSgpO1xuICAgICAgICAgICAgZGlmZiA9XG4gICAgICAgICAgICAgICAgKGlzTW9tZW50KGlucHV0KSB8fCBpc0RhdGUoaW5wdXQpXG4gICAgICAgICAgICAgICAgICAgID8gaW5wdXQudmFsdWVPZigpXG4gICAgICAgICAgICAgICAgICAgIDogY3JlYXRlTG9jYWwoaW5wdXQpLnZhbHVlT2YoKSkgLSByZXMudmFsdWVPZigpO1xuICAgICAgICAgICAgLy8gVXNlIGxvdy1sZXZlbCBhcGksIGJlY2F1c2UgdGhpcyBmbiBpcyBsb3ctbGV2ZWwgYXBpLlxuICAgICAgICAgICAgcmVzLl9kLnNldFRpbWUocmVzLl9kLnZhbHVlT2YoKSArIGRpZmYpO1xuICAgICAgICAgICAgaG9va3MudXBkYXRlT2Zmc2V0KHJlcywgZmFsc2UpO1xuICAgICAgICAgICAgcmV0dXJuIHJlcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBjcmVhdGVMb2NhbChpbnB1dCkubG9jYWwoKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldERhdGVPZmZzZXQobSkge1xuICAgICAgICAvLyBPbiBGaXJlZm94LjI0IERhdGUjZ2V0VGltZXpvbmVPZmZzZXQgcmV0dXJucyBhIGZsb2F0aW5nIHBvaW50LlxuICAgICAgICAvLyBodHRwczovL2dpdGh1Yi5jb20vbW9tZW50L21vbWVudC9wdWxsLzE4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cyA9PSB0cnVlIGNhc2UsIHRoZW4gd2UgaGF2ZSB0byBhZGp1c3QsIGJlY2F1c2VcbiAgICAvLyB0aGVyZSBpcyBubyBzdWNoIHRpbWUgaW4gdGhlIGdpdmVuIHRpbWV6b25lLlxuICAgIGZ1bmN0aW9uIGdldFNldE9mZnNldChpbnB1dCwga2VlcExvY2FsVGltZSwga2VlcE1pbnV0ZXMpIHtcbiAgICAgICAgdmFyIG9mZnNldCA9IHRoaXMuX29mZnNldCB8fCAwLFxuICAgICAgICAgICAgbG9jYWxBZGp1c3Q7XG4gICAgICAgIGlmICghdGhpcy5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIHJldHVybiBpbnB1dCAhPSBudWxsID8gdGhpcyA6IE5hTjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaW5wdXQgIT0gbnVsbCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBpbnB1dCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICBpbnB1dCA9IG9mZnNldEZyb21TdHJpbmcobWF0Y2hTaG9ydE9mZnNldCwgaW5wdXQpO1xuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKE1hdGguYWJzKGlucHV0KSA8IDE2ICYmICFrZWVwTWludXRlcykge1xuICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQgKiA2MDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICghdGhpcy5faXNVVEMgJiYga2VlcExvY2FsVGltZSkge1xuICAgICAgICAgICAgICAgIGxvY2FsQWRqdXN0ID0gZ2V0RGF0ZU9mZnNldCh0aGlzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX29mZnNldCA9IGlucHV0O1xuICAgICAgICAgICAgdGhpcy5faXNVVEMgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKGxvY2FsQWRqdXN0ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmFkZChsb2NhbEFkanVzdCwgJ20nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChvZmZzZXQgIT09IGlucHV0KSB7XG4gICAgICAgICAgICAgICAgaWYgKCFrZWVwTG9jYWxUaW1lIHx8IHRoaXMuX2NoYW5nZUluUHJvZ3Jlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgYWRkU3VidHJhY3QoXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLFxuICAgICAgICAgICAgICAgICAgICAgICAgY3JlYXRlRHVyYXRpb24oaW5wdXQgLSBvZmZzZXQsICdtJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCF0aGlzLl9jaGFuZ2VJblByb2dyZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NoYW5nZUluUHJvZ3Jlc3MgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBob29rcy51cGRhdGVPZmZzZXQodGhpcywgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2NoYW5nZUluUHJvZ3Jlc3MgPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2lzVVRDID8gb2Zmc2V0IDogZ2V0RGF0ZU9mZnNldCh0aGlzKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldFNldFpvbmUoaW5wdXQsIGtlZXBMb2NhbFRpbWUpIHtcbiAgICAgICAgaWYgKGlucHV0ICE9IG51bG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dXQuX21pbGxpc2Vjb25kcyxcbiAgICAgICAgICAgICAgICBkOiBpbnB1dC5fZGF5cyxcbiAgICAgICAgICAgICAgICBNOiBpbnB1dC5fbW9udGhzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSBlbHNlIGlmIChpc051bWJlcihpbnB1dCkgfHwgIWlzTmFOKCtpbnB1dCkpIHtcbiAgICAgICAgICAgIGR1cmF0aW9uID0ge307XG4gICAgICAgICAgICBpZiAoa2V5KSB7XG4gICAgICAgICAgICAgICAgZHVyYXRpb25ba2V5XSA9ICtpbnB1dDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZHVyYXRpb24ubWlsbGlzZWNvbmRzID0gK2lucHV0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKChtYXRjaCA9IGFzcE5ldFJlZ2V4LmV4ZWMoaW5wdXQpKSkge1xuICAgICAgICAgICAgc2lnbiA9IG1hdGNoWzFdID09PSAnLScgPyAtMSA6IDE7XG4gICAgICAgICAgICBkdXJhdGlvbiA9IHtcbiAgICAgICAgICAgICAgICB5OiAwLFxuICAgICAgICAgICAgICAgIGQ6IHRvSW50KG1hdGNoW0RBVEVdKSAqIHNpZ24sXG4gICAgICAgICAgICAgICAgaDogdG9JbnQobWF0Y2hbSE9VUl0pICogc2lnbixcbiAgICAgICAgICAgICAgICBtOiB0b0ludChtYXRjaFtNSU5VVEVdKSAqIHNpZ24sXG4gICAgICAgICAgICAgICAgczogdG9JbnQobWF0Y2hbU0VDT05EXSkgKiBzaWduLFxuICAgICAgICAgICAgICAgIG1zOiB0b0ludChhYnNSb3VuZChtYXRjaFtNSUxMSVNFQ09ORF0gKiAxMDAwKSkgKiBzaWduLCAvLyB0aGUgbWlsbGlzZWNvbmQgZGVjaW1hbCBwb2ludCBpcyBpbmNsdWRlZCBpbiB0aGUgbWF0Y2hcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoKG1hdGNoID0gaXNvUmVnZXguZXhlYyhpbnB1dCkpKSB7XG4gICAgICAgICAgICBzaWduID0gbWF0Y2hbMV0gPT09ICctJyA/IC0xIDogMTtcbiAgICAgICAgICAgIGR1cmF0aW9uID0ge1xuICAgICAgICAgICAgICAgIHk6IHBhcnNlSXNvKG1hdGNoWzJdLCBzaWduKSxcbiAgICAgICAgICAgICAgICBNOiBwYXJzZUlzbyhtYXRjaFszXSwgc2lnbiksXG4gICAgICAgICAgICAgICAgdzogcGFyc2VJc28obWF0Y2hbNF0sIHNpZ24pLFxuICAgICAgICAgICAgICAgIGQ6IHBhcnNlSXNvKG1hdGNoWzVdLCBzaWduKSxcbiAgICAgICAgICAgICAgICBoOiBwYXJzZUlzbyhtYXRjaFs2XSwgc2lnbiksXG4gICAgICAgICAgICAgICAgbTogcGFyc2VJc28obWF0Y2hbN10sIHNpZ24pLFxuICAgICAgICAgICAgICAgIHM6IHBhcnNlSXNvKG1hdGNoWzhdLCBzaWduKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoZHVyYXRpb24gPT0gbnVsbCkge1xuICAgICAgICAgICAgLy8gY2hlY2tzIGZvciBudWxsIG9yIHVuZGVmaW5lZFxuICAgICAgICAgICAgZHVyYXRpb24gPSB7fTtcbiAgICAgICAgfSBlbHNlIGlmIChcbiAgICAgICAgICAgIHR5cGVvZiBkdXJhdGlvbiA9PT0gJ29iamVjdCcgJiZcbiAgICAgICAgICAgICgnZnJvbScgaW4gZHVyYXRpb24gfHwgJ3RvJyBpbiBkdXJhdGlvbilcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBkaWZmUmVzID0gbW9tZW50c0RpZmZlcmVuY2UoXG4gICAgICAgICAgICAgICAgY3JlYXRlTG9jYWwoZHVyYXRpb24uZnJvbSksXG4gICAgICAgICAgICAgICAgY3JlYXRlTG9jYWwoZHVyYXRpb24udG8pXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICBkdXJhdGlvbiA9IHt9O1x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XRcbiAgICAgICAgcmV0dXJuIChpc05hTihyZXMpID8gMCA6IHJlcykgKiBzaWduO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHBvc2l0aXZlTW9tZW50c0RpZmZlcmVuY2UoYmFzZSwgb3RoZXIpIHtcbiAgICAgICAgdmFyIHJlcyA9IHt9O1xuXG4gICAgICAgIHJlcy5tb250aHMgPVxuICAgICAgICAgICAgb3RoZXIubW9udGgoKSAtIGJhc2UubW9udGgoKSArIChvdGhlci55ZWFyKCkgLSBiYXNlLnllYXIoKSkgKiAxMjtcbiAgICAgICAgaWYgKGJhc2UuY2xvbmUoKS5hZGQocmVzLm1vbnRocywgJ00nKS5pc0FmdGVyKG90aGVyKSkge1xuICAgICAgICAgICAgLS1yZXMubW9udGhzO1xuICAgICAgICB9XG5cbiAgICAgICAgcmVzLm1pbGxpc2Vjb25kcyA9ICtvdGhlciAtICtiYXNlLmNsb25lKCkuYWRkKHJlcy5tb250aHMsICdNJyk7XG5cbiAgICAgICAgcmV0dXJuIHJlcztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtb21lbnRzRGlmZmVyZW5jZShiYXNlLCBvdGhlcikge1xuICAgICAgICB2YXIgcmVzO1xuICAgICAgICBpZiAoIShiYXNlLmlzVmFsaWQoKSAmJiBvdGhlci5pc1ZhbGlkKCkpKSB7XG4gICAgICAgICAgICByZXR1cm4geyBtaWxsaXNlY29uZHM6IDAsIG1vbnRoczogMCB9O1xuICAgICAgICB9XG5cbiAgICAgICAgb3RoZXIgPSBjbG9uZVdpdGhPZmZzZXQob3RoZXIsIGJhc2UpO1xuICAgICAgICBpZiAoYmFzZS5pc0JlZm9yZShvdGhlcikpIHtcbiAgICAgICAgICAgIHJlcyA9IHBvc2l0aXZlTW9tZW50c0RpZmZlcmVuY2UoYmFzZSwgb3RoZXIpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzID0gcG9zaXRpdmVNb21lbnRzRGlmZmVyZW5jZShvdGhlciwgYmFzZSk7XG4gICAgICAgICAgICByZXMubWlsbGlzZWNvbmRzID0gLXJlcy5taWxsaXNlY29uZHM7XG4gICAgICAgICAgICByZXMubW9udGhzID0gLXJlcy5tb250aHM7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gcmVzO1xuICAgIH1cblxuICAgIC8vIFRPRE86IHJlbW92ZSAnbmFtZScgYXJnIGFmdGVyIGRlcHJlY2F0aW9uIGlzIHJlbW92ZWRcbiAgICBmdW5jdGlvbiBjcmVhdGVBZGRlcihkaXJlY3Rpb24sIG5hbWUpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICh2YWwsIHBlcmlvZCkge1xuICAgICAgICAgICAgdmFyIGR1ciwgdG1wO1xuICAgICAgICAgICAgLy9pbnZlcnQgdGhlIGFyZ3VtZW50cywgYnV0IGNvbXBsYWluIGFib3V0IGl0XG4gICAgICAgICAgICBpZiAocGVyaW9kICE9PSBudWxsICYmICFpc05hTigrcGVyaW9kKSkge1xuICAgICAgICAgICAgICAgIGRlcHJlY2F0ZVNpbXBsZShcbiAgICAgICAgICAgICAgICAgICAgbmFtZSxcbiAgICAgICAgICAgICAgICAgICAgJ21vbWVudCgpLicgK1xuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAnKHBlcmlvZCwgbnVtYmVyKSBpcyBkZXByZWNhdGVkLiBQbGVhc2UgdXNlIG1vbWVudCgpLicgK1xuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSArXG4gICAgICAgICAgICAgICAgICAgICAgICAnKG51bWJlciwgcGVyaW9kKS4gJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VlIGh0dHA6Ly9tb21lbnRqcy5jb20vZ3VpZGVzLyMvd2FybmluZ3MvYWRkLWludmVydGVkLXBhcmFtLyBmb3IgbW9yZSBpbmZvLidcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHRtcCA9IHZhbDtcbiAgICAgICAgICAgICAgICB2YWwgPSBwZXJpb2Q7XG4gICAgICAgICAgICAgICAgcGVyaW9kID0gdG1wO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBkdXIgPSBjcmVhdGVEdXJhdGlvbih2YWwsIHBlcmlvZCk7XG4gICAgICAgICAgICBhZGRTdWJ0cmFjdCh0aGlzLCBkdXIsIGRpcmVjdGlvbik7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBhZGRTdWJ0cmFjdChtb20sIGR1cmF0aW9uLCBpc0FkZGluZywgdXBkYXRlT2Zmc2V0KSB7XG4gICAgICAgIHZhciBtaWxsaXNlY29uZHMgPSBkdXJhdGlvbi5fbWlsbGlzZWNvbmRzLFxuICAgICAgICAgICAgZGF5cyA9IGFic1JvdW5kKGR1cmF0aW9uLl9kYXlzKSxcbiAgICAgICAgICAgIG1vbnRocyA9IGFic1JvdW5kKGR1cmF0aW9uLl9tb250aHMpO1xuXG4gICAgICAgIGlmICghbW9tLmlzVmFsaWQoKSkge1xuICAgICAgICAgICAgLy8gTm8gb3BcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHVwZGF0ZU9mZnNldCA9IHVwZGF0ZU9mZnNldCA9PSBudWxsID8gdHJ1ZSA6IHVwZGF0ZU9mZnNldDtcblxuICAgICAgICBpZiAobW9udGhzKSB7XG4gICAgICAgICAgICBzZXRNb250aChtb20sIGdldChtb20sICdNb250aCcpICsgbW9udGhzICogaXNBZGRpbmcpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChkYXlzKSB7XG4gICAgICAgICAgICBzZXQkMShtb20sICdEYXRlJywgZ2V0KG1vbSwgJ0RhdGUnKSArIGRheXMgKiBpc0FkZGluZyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1pbGxpc2Vjb25kcykge1xuICAgICAgICAgICAgbW9tLl9kLnNldFRpbWUobW9tLl9kLnZ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IGZ1bmN0aW9uIGlzTW9tZW50SW5wdXRPYmplY3QoaW5wdXQpIHtcbiAgICAgICAgdmFyIG9iamVjdFRlc3QgPSBpc09iamVjdChpbnB1dCkgJiYgIWlzT2JqZWN0RW1wdHkoaW5wdXQpLFxuICAgICAgICAgICAgcHJvcGVydHlUZXN0ID0gZmFsc2UsXG4gICAgICAgICAgICBwcm9wZXJ0aWVzID0gW1xuICAgICAgICAgICAgICAgICd5ZWFycycsXG4gICAgICAgICAgICAgICAgJ3llYXInLFxuICAgICAgICAgICAgICAgICd5JyxcbiAgICAgICAgICAgICAgICAnbW9udGhzJyxcbiAgICAgICAgICAgICAgICAnbW9udGgnLFxuICAgICAgICAgICAgICAgICdNJyxcbiAgICAgICAgICAgICAgICAnZGF5cycsXG4gICAgICAgICAgICAgICAgJ2RheScsXG4gICAgICAgICAgICAgICAgJ2QnLFxuICAgICAgICAgICAgICAgICdkYXRlcycsXG4gICAgICAgICAgICAgICAgJ2RhdGUnLFxuICAgICAgICAgICAgICAgICdEJyxcbiAgICAgICAgICAgICAgICAnaG91cnMnLFxuICAgICAgICAgICAgICAgICdob3VyJyxcbiAgICAgICAgICAgICAgICAnaCcsXG4gICAgICAgICAgICAgICAgJ21pbnV0ZXMnLFxuICAgICAgICAgICAgICAgICdtaW51dGUnLFxuICAgICAgICAgICAgICAgICdtJyxcbiAgICAgICAgICAgICAgICAnc2Vjb25kcycsXG4gICAgICAgICAgICAgICAgJ3NlY29uZCcsXG4gICAgICAgICAgICAgICAgJ3MnLFxuICAgICAgICAgICAgICAgICdtaWxsaXNlY29uZHMnLFxuICAgICAgICAgICAgICAgICdtaWxsaXNlY29uZCcsXG4gICAgICAgICAgICAgICAgJ21zJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgcHJvcGVydHksXG4gICAgICAgICAgICBwcm9wZXJ0eUxlbiA9IHByb3BlcnRpZXMubGVuZ3RoO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBwcm9wZXJ0eUxlbjsgaSArPSAxKSB7XG4gICAgICAgICAgICBwcm9wZXJ0eSA9IHByb3BlcnRpZXNbaV07XG4gICAgICAgICAgICBwcm9wZXJ0eVRlc3QgPSBwcm9wZXJ0eVRlc3QgfHwgaGFzT3duUHJvcChpbnB1dCwgcHJvcGVydHkpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG9iamVjdFRlc3QgJiYgcHJvcGVydHlUZXN0O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzTnVtYmVyT3JTdHJpbmdBcnJheShpbnB1dCkge1xuICAgICAgICB2YXIgYXJyYXlUZXN0ID0gaXNBcnJheShpbnB1dCksXG4gICAgICAgICAgICBkYXRhVHlwZVRlc3QgPSBmYWxzZTtcbiAgICAgICAgaWYgKGFycmF5VGVzdCkge1xuICAgICAgICAgICAgZGF0YVR5cGVUZXN0ID1cbiAgICAgICAgICAgICAgICBpbnB1dC5maWx0ZXIoZnVuY3Rpb24gKGl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICFpc051bWJlcihpdGVtKSAmJiBpc1N0cmluZyhpbnB1dCk7XG4gICAgICAgICAgICAgICAgfSkubGVuZ3RoID09PSAwO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBhcnJheVRlc3QgJiYgZGF0YVR5cGVUZXN0O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGlzQ2FsZW5kYXJTcGVjKGlucHV0KSB7XG4gICAgICAgIHZhciBvYmplY3RUZXN0ID0gaXNPYmplY3QoaW5wdXQpICYmICFpc09iamVjdEVtcHR5KGlucHV0KSxcbiAgICAgICAgICAgIHByb3BlcnR5VGVzdCA9IGZhbHNlLFxuICAgICAgICAgICAgcHJvcGVydGllcyA9IFtcbiAgICAgICAgICAgICAgICAnc2FtZURheScsXG4gICAgICAgICAgICAgICAgJ25leHREYXknLFxuICAgICAgICAgICAgICAgICdsYXN0RGF5JyxcbiAgICAgICAgICAgICAgICAnbmV4dFdlZWsnLFxuICAgICAgICAgICAgICAgICdsYXN0V2VlaycsXG4gICAgICAgICAgICAgICAgJ3NhbWVFbHNlJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgcHJvcGVydHk7XG5cbiAgICAgICAgZm9yIChpID0gMDsgaSA8IHByb3BlcnRpZXMubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgICAgIHByb3BlcnR5ID0gcHJvcGVydGllc1tpXTtcbiAgICAgICAgICAgIHByb3BlcnR5VGVzdCA9IHByb3BlcnR5VGVzdCB8fCBoYXNPd25Qcm9wKGlucHV0LCBwcm9wZXJ0eSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gb2JqZWN0VGVzdCAmJiBwcm9wZXJ0eVRlc3Q7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0Q2FsZW5kYXJGb3JtYXQobXlNb21lbnQsIG5vdykge1xuICAgICAgICB2YXIgZGlmZiA9IG15TW9tZW50LmRpZmYobm93LCAnZGF5cycsIHRydWUpO1xuICAgICAgICByZXR1cm4gZGlmZiA8IC02XG4gICAgICAgICAgICA/ICdzYW1lRWxzZSdcbiAgICAgICAgICAgIDogZGlmZiA8IC0xXG4gICAgICAgICAgICAgID8gJ2xhc3RXZWVrJ1xuICAgICAgICAgICAgICA6IGRpZmYgPCAwXG4gICAgICAgICAgICAgICAgPyAnbGFzdERheSdcbiAgICAgICAgICAgICAgICA6IGRpZmYgPCAxXG4gICAgICAgICAgICAgICAgICA/ICdzYW1lRGF5J1xuICAgICAgICAgICAgICAgICAgOiBkaWZmIDwgMlxuICAgICAgICAgICAgICAgICAgICA/ICduZXh0RGF5J1xuICAgICAgICAgICAgICAgICAgICA6IGRpZmYgPCA3XG4gICAgICAgICAgICAgICAgICAgICAgPyAnbmV4dFdlZWsnXG4gICAgICAgICAgICAgICAgICAgICAgOiAnc2FtZUVsc2UnO1xuICAgIH1cblxuICAgIGZ1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GNoICh1bml0cykge1xuICAgICAgICAgICAgY2FzZSAneWVhcic6XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gbW9udGhEaWZmKHRoaXMsIHRoYXQpIC8gMTI7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdtb250aCc6XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gbW9udGhEaWZmKHRoaXMsIHRoYXQpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAncXVhcnRlcic6XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gbW9udGhEaWZmKHRoaXMsIHRoYXQpIC8gMztcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ3NlY29uZCc6XG4gICAgICAgICAgICAgICAgb3V0cHV0ID0gKHRoaXMgLSB0aGF0KSAvIDFlMztcbiAgICAgICAgICAgICAgICBicmVhazsgLy8gMTAwMFxuICAgICAgICAgICAgY2FzZSAnbWludXRlJzpcbiAgICAgICAgICAgICAgICBvdXRwdXQgPSAodGhpcyAtIHRoYXQpIC8gNmU0O1xuICAgICAgICAgICAgICAgIGJyZWFrOyAvLyAxMDAwICogNjBcbiAgICAgICAgICAgIGNhc2UgJ2hvdXInOlxuICAgICAgICAgICAgICAgIG91dHB1dCA9ICh0aGlzIC0gdGhhdCkgLyAzNmU1O1xuICAgICAgICAgICAgICAgIGJyZWFrOyAvLyAxMDAwICogNjAgKiA2MFxuICAgICAgICAgICAgY2FzZSAnZGF5JzpcbiAgICAgICAgICAgICAgICBvdXRwdXQgPSAodGhpcyAtIHRoYXQgLSB6b25lRGVsdGEpIC8gODY0ZTU7XG4gICAgICAgICAgICAgICAgYnJlYWs7IC8vIDEwMDAgKiA2MCAqIDYwICogMjQsIG5lZ2F0ZSBkc3RcbiAgICAgICAgICAgIGNhc2UgJ3dlZWsnOlxuICAgICAgICAgICAgICAgIG91dHB1dCA9ICh0aGlzIC0gdGhhdCAtIHpvbmVEZWx0YSkgLyA2MDQ4ZTU7XG4gICAgICAgICAgICAgICAgYnJlYWs7IC8vIDEwMDAgKiA2MCAqIDYwICogMjQgKiA3LCBuZWdhdGUgZHN0XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIG91dHB1dCA9IHRoaXMgLSB0aGF0O1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGFzRmxvYXQgPyBvdXRwdXQgOiBhYnNGbG9vcihvdXRwdXQpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG1vbnRoRGlmZihhLCBiKSB7XG4gICAgICAgIGlmIChhLmRhdGUoKSA8IGIuZGF0ZSgpKSB7XG4gICAgICAgICAgICAvLyBlbmQtb2YtbW9udGggY2FsY3VsYXRpb25zIHdvcmsgY29ycmVjdCB3aGVuIHRoZSBzdGFydCBtb250aCBoYXMgbW9yZVxuICAgICAgICAgICAgLy8gZGF5cyB0aGFuIHRoZSBlbmQgbW9udGguXG4gICAgICAgICAgICByZXR1cm4gLW1vbnRoRGlmZihiLCBhKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBkaWZmZXJlbmNlIGluIG1vbnRoc1xuICAgICAgICB2YXIgd2hvbGVNb250aERpZmYgPSAoYi55ZWFyKCkgLSBhLnllYXIoKSkgKiAxMiArIChiLm1vbnRoKCkgLSBhLm1vbnRoKCkpLFxuICAgICAgICAgICAgLy8gYiBpcyBpbiAoYW5jaG9yIC0gMSBtb250aCwgYW5jaG9yICsgMSBtb250aClcbiAgICAgICAgICAgIGFuY2hvciA9IGEuY2xvbmUoKS5hZGQod2hvbGVNb250aERpZmYsICdtb250aHMnKSxcbiAgICAgICAgICAgIGFuY2hvcjIsXG4gICAgICAgICAgICBhZGp1c3Q7XG5cbiAgICAgICAgaWYgKGIgLSBhbmNob3IgPCAwKSB7XG4gICAgICAgICAgICBhbmNob3IyID0gYS5jbG9uZSgpLmFkZCh3aG9sZU1vbnRoRGlmZiAtIDEsICdtb250aH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G9uZSgpLnV0YygpIDogdGhpcztcbiAgICAgICAgaWYgKG0ueWVhcigpIDwgMCB8fCBtLnllYXIoKSA+IDk5OTkpIHtcbiAgICAgICAgICAgIHJldHVybiBmb3JtYXRNb21lbnQoXG4gICAgICAgICAgICAgICAgbSxcbiAgICAgICAgICAgICAgICB1dGNcbiAgICAgICAgICAgICAgICAgICAgPyAnWVlZWVlZLU1NLUREW1RdSEg6bW06c3MuU1NTW1pdJ1xuICAgICAgICAgICAgICAgICAgICA6ICdZWVlZWVktTU0tRERbVF1ISDptbTpzcy5TU1NaJ1xuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNGdW5jdGlvbihEYXRlLnByb3RvdHlwZS50b0lTT1N0cmluZykpIHtcbiAgICAgICAgICAgIC8vIG5hdGl2ZSBpbXBsZW1lbnRhdGlvbiBpcyB+NTB4IGZhc3RlciwgdXNlIGl0IHdoZW4gd2UgY2FuXG4gICAgICAgICAgICBpZiAodXRjKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMudG9EYXRlKCkudG9JU09TdHJpbmcoKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBEYXRlKHRoaXMudmFsdWVPZigpICsgdGhpcy51dGNPZmZzZXQoKSAqIDYwICogMTAwMClcbiAgICAgICAgICAgICAgICAgICAgLnRvSVNPU3RyaW5nKClcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoJ1onLCBmb3JtYXRNb21lbnQobSwgJ1onKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZvcm1hdE1vbWVudChcbiAgICAgICAgICAgIG0sXG4gICAgICAgICAgICB1dGMgPyAnWVlZWS1NTS1ERFtUXUhIOm1tOnNzLlNTU1taXScgOiAnWVlZWS1NTS1ERFtUXUhIOm1tOnNzLlNTU1onXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgL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mZml4ID0gem9uZSArICdbXCIpXSc7XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuZm9ybWF0KHByZWZpeCArIHllYXIgKyBkYXRldGltZSArIHN1ZmZpeCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZm9ybWF0KGlucHV0U3RyaW5nKSB7XG4gICAgICAgIGlmICghaW5wdXRTdHJpbmcpIHtcbiAgICAgICAgICAgIGlucHV0U3RyaW5nID0gdGhpcy5pc1V0YygpXG4gICAgICAgICAgICAgICAgPyBob29rcy5kZWZhdWx0Rm9ybWF0VXRjXG4gICAgICAgICAgICAgICAgOiBob29rcy5kZWZhdWx0Rm9ybWF0O1xuICAgICAgICB9XG4gICAgICAgIHZhciBvdXRwdXQgPSBmb3JtYXRNb21lbnQodGhpcywgaW5wdXRTdHJpbmcpO1xuICAgICAgICByZXR1cm4gdGhpcy5sb2NhbGVEYXRhKCkucG9zdGZvcm1hdChvdXRwdXQpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGZyb20odGltZSwgd2l0aG91dFN1ZmZpeCkge1xuICAgICAgICBpZiAoXG4gICAgICAgICAgICB0aGlzLmlzVmFsaWQoKSAmJlxuICAgICAgICAgICAgKChpc01vbWVudCh0aW1lKSAmJiB0aW1lLmlzVmFsaWQoKSkgfHwgY3JlYXRlTG9jYWwodGltZSkuaXNWYWxpZCgpKVxuICAgICAgICApIHtcbiAgICAgICAgICAgIHJldHVybiBjcmVhdGVEdXJhdGlvbih7IHRvOiB0aGlzLCBmcm9tOiB0aW1lIH0pXG4gICAgICAgICAgICAgICAgLmxvY2FsZSh0aGlzLmxvY2FsZSgpKVxuICAgICAgICAgICAgICAgIC5odW1hbml6ZSghd2l0aG91dFN1ZmZpeCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5sb2NhbGVEYXRhKCkuaW52YWxpZERhdGUoKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGZyb21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XG5cbiAgICAgICAgaWYgKGtleSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fbG9jYWxlLl9hYmJyO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbmV3TG9jYWxlRGF0YSA9IGdldExvY2FsZShrZXkpO1xuICAgICAgICAgICAgaWYgKG5ld0xvY2FsZURhdGEgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHRoaXMuX2xvY2FsZSA9IG5ld0xvY2FsZURhdGE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZhciBsYW5nID0gZGVwcmVjYXRlKFxuICAgICAgICAnbW9tZW50KCkubGFuZygpIGlzIGRlcHJlY2F0ZWQuIEluc3RlYWQsIHVzZSBtb21lbnQoKS5sb2NhbGVEYXRhKCkgdG8gZ2V0IHRoZSBsYW5ndWFnZSBjb25maWd1cmF0aW9uLiBVc2UgbW9tZW50KCkubG9jYWxlKCkgdG8gY2hhbmdlIGxhbmd1YWdlcy4nLFxuICAgICAgICBmdW5jdGlvbiAoa2V5KSB7XG4gICAgICAgICAgICBpZiAoa2V5ID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5sb2NhbGVEYXRhKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmxvY2FsZShrZXkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgKTtcblxuICAgIGZ1bmN0aW9uIGxvY2FsZURhdGEoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9sb2NhbGU7XG4gICAgfVxuXG4gICAgdmFyIE1TX1BFUl9TRUNPTkQgPSAxMDAwLFxuICAgICAgICBNU19QRVJfTUlOVVRFID0gNjAgKiBNU19QRVJfU0VDT05ELFxuICAgICAgICBNU19QRVJfSE9VUiA9IDYwICogT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ZWFyIGN5Y2xlLCB0aGVuIHJlc2V0XG4gICAgICAgICAgICByZXR1cm4gRGF0ZS5VVEMoeSArIDQwMCwgbSwgZCkgLSBNU19QRVJfNDAwX1lFQVJTO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIERhdGUuVVRDKHksIG0sIGQpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc3RhcnRPZih1bml0cykge1xuICAgICAgICB2YXIgdGltZSwgc3RhcnRPZkRhdGU7XG4gICAgICAgIHVuaXRzID0gbm9ybWFsaXplVW5pdHModW5pdHMpO1xuICAgICAgICBpZiAodW5pdHMgPT09IHVuZGVmaW5lZCB8fCB1bml0cyA9PT0gJ21pbGxpc2Vjb25kJyB8fCAhdGhpcy5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG5cbiAgICAgICAgc3RhcnRPZkRhdGUgPSB0aGlzLl9pc1VUQyA/IHV0Y1N0YXJ0T2ZEYXRlIDogbG9jYWxTdGFydE9mRGF0ZTtcblxuICAgICAgICBzd2l0Y2ggKHVuaXRzKSB7XG4gICAgICAgICAgICBjYXNlICd5ZWFyJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gc3RhcnRPZkRhdGUodGhpcy55ZWFyKCksIDAsIDEpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAncXVhcnRlcic6XG4gICAgICAgICAgICAgICAgdGltZSA9IHN0YXJ0T2ZEYXRlKFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnllYXIoKSxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tb250aCgpIC0gKHRoaXMubW9udGgoKSAlIDMpLFxuICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ21vbnRoJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gc3RhcnRPZkRhdGUodGhpcy55ZWFyKCksIHRoaXMubW9udGgoKSwgMSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICd3ZWVrJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gc3RhcnRPZkRhdGUoXG4gICAgICAgICAgICAgICAgICAgIHRoaXMueWVhcigpLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLm1vbnRoKCksXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGF0ZSgpIC0gdGhpcy53ZWVrZGF5KClcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnaXNvV2Vlayc6XG4gICAgICAgICAgICAgICAgdGltZSA9IHN0YXJ0T2ZEYXRlKFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnllYXIoKSxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tb250aCgpLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRhdGUoKSAtICh0aGlzLmlzb1dlZWtkYXkoKSAtIDEpXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2RheSc6XG4gICAgICAgICAgICBjYXNlICdkYXRlJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gc3RhcnRPZkRhdGUodGhpcy55ZWFyKCksIHRoaXMubW9udGgoKSwgdGhpcy5kYXRlKCkpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnaG91cic6XG4gICAgICAgICAgICAgICAgdGltZSA9IHRoaXMuX2QudmFsdWVPZigpO1xuICAgICAgICAgICAgICAgIHRpbWUgLT0gbW9kJDEoXG4gICAgICAgICAgICAgICAgICAgIHRpbWUgKyAodGhpcy5faXNVVEMgPyAwIDogdGhpcy51dGNPZmZzZXQoKSAqIE1TX1BFUl9NSU5VVEUpLFxuICAgICAgICAgICAgICAgICAgICBNU19QRVJfSE9VUlxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdtaW51dGUnOlxuICAgICAgICAgICAgICAgIHRpbWUgPSB0aGlzLl9kLnZhbHVlT2YoKTtcbiAgICAgICAgICAgICAgICB0aW1lIC09IG1vZCQxKHRpbWUsIE1TX1BFUl9NSU5VVEUpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnc2Vjb25kJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gdGhpcy5fZC52YWx1ZU9mKCk7XG4gICAgICAgICAgICAgICAgdGltZSAtPSBtb2QkMSh0aW1lLCBNU19QRVJfU0VDT05EKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX2Quc2V0VGltZSh0aW1lKTtcbiAgICAgICAgaG9va3MudXBkYXRlT2Zmc2V0KHRoaXMsIHRydWUpO1xuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBlbmRPZih1bml0cykge1xuICAgICAgICB2YXIgdGltZSwgc3RhcnRPZkRhdGU7XG4gICAgICAgIHVuaXRzID0gbm9ybWFsaXplVW5pdHModW5pdHMpO1xuICAgICAgICBpZiAodW5pdHMgPT09IHVuZGVmaW5lZCB8fCB1bml0cyA9PT0gJ21pbGxpc2Vjb25kJyB8fCAhdGhpcy5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG5cbiAgICAgICAgc3RhcnRPZkRhdGUgPSB0aGlzLl9pc1VUQyA/IHV0Y1N0YXJ0T2ZEYXRlIDogbG9jYWxTdGFydE9mRGF0ZTtcblxuICAgICAgICBzd2l0Y2ggKHVuaXRzKSB7XG4gICAgICAgICAgICBjYXNlICd5ZWFyJzpcbiAgICAgICAgICAgICAgICB0aW1lID0gc3RhcnRPZkRhdGUodGhpcy55ZWFyKCkgKyAxLCAwLCAxKSAtIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdxdWFydGVyJzpcbiAgICAgICAgICAgICAgICB0aW1lID1cbiAgICAgICAgICAgICAgICAgICAgc3RhcnRPZkRhdGUoXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnllYXIoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMubW9udGgoKSAtICh0aGlzLm1vbnRoKCkgJSAzKSArIDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAxXG4gICAgICAgICAgICAgICAgICAgICkgLSAxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnbW9udGgnOlxuICAgICAgICAgICAgICAgIHRpbWUgPSBzdGFydE9mRGF0ZSh0aGlzLnllYXIoKSwgdGhpcy5tb250aCgpICsgMSwgMSkgLSAxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnd2Vlayc6XG4gICAgICAgICAgICAgICAgdGltZSA9XG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0T2ZEYXRlKFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy55ZWFyKCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm1vbnRoKCksXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRhdGUoKSAtIHRoaXMud2Vla2RheSgpICsgN1xuICAgICAgICAgICAgICAgICAgICApIC0gMTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgJ2lzb1dlZWsnOlxuICAgICAgICAgICAgICAgIHRpbWUgPVxuICAgICAgICAgICAgICAgICAgICBzdGFydE9mRGF0ZShcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMueWVhcigpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5tb250aCgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kYXRlKCkgLSAodGhpcy5pc29XZWVrZGF5KCkgLSAxKSArIDdcbiAgICAgICAgICAgICAgICAgICAgKSAtIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdkYXknOlxuICAgICAgICAgICAgY2FzZSAnZGF0ZSc6XG4gICAgICAgICAgICAgICAgdGltZSA9IHN0YXJ0T2ZEYXRlKHRoaXMueWVhcigpLCB0aGlzLm1vbnRoKCksIHRoaXMuZGF0ZSgpICsgMSkgLSAxO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgY2FzZSAnaG91cic6XG4gICAgICAgICAgICAgICAgdGltZSA9IHRoaXMuX2QudmFsdWVPZigpO1xuICAgICAgICAgICAgICAgIHRpbWUgKz1cbiAgICAgICAgICAgICAgICAgICAgTVNfUEVSX0hPVVIgLVxuICAgICAgICAgICAgICAgICAgICBtb2QkMShcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWUgKyAodGhpcy5faXNVVEMgPyAwIDogdGhpcy51dGNPZmZzZXQoKSAqIE1TX1BFUl9NSU5VVEUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgTVNfUEVSX0hPVVJcbiAgICAgICAgICAgICAgICAgICAgKSAtXG4gICAgICAgICAgICAgICAgICAgIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdtaW51dGUnOlxuICAgICAgICAgICAgICAgIHRpbWUgPSB0aGlzLl9kLnZhbHVlT2YoKTtcbiAgICAgICAgICAgICAgICB0aW1lICs9IE1TX1BFUl9NSU5VVEUgLSBtb2QkMSh0aW1lLCBNU19QRVJfTUlOVVRFKSAtIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICBjYXNlICdzZWNvbmQnOlxuICAgICAgICAgICAgICAgIHRpbWUgPSB0aGlzLl9kLnZhbHVlT2YoKTtcbiAgICAgICAgICAgICAgICB0aW1lICs9IE1TX1BFUl9TRUNPTkQgLSBtb2QkMSh0aW1lLCBNU19QRVJfU0VDT05EKSAtIDE7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLl9kLnNldFRpbWUodGltZSk7XG4gICAgICAgIGhvb2tzLnVwZGF0ZU9mZnNldCh0aGlzLCB0cnVlKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdmFsdWVPZigpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2QudmFsdWVPZigpIC0gKHRoaXMuX29mZnNldCB8fCAwKSAqIDYwMDAwO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHVuaXgoKSB7XG4gICAgICAgIHJldHVybiBNYXRoLmZsb29yKHRoaXMudmFsdWVPZigpIC8gMTAwMCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdG9EYXRlKCkge1xuICAgICAgICByZXR1cm4gbmV3IERhdGUodGhpcy52YWx1ZU9mKCkpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHRvQXJyYXkoKSB7XG4gICAgICAgIHZhciBtID0gdGhpcztcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgIG0ueWVhcigpLFxuICAgICAgICAgICAgbS5tb250aCgpLFxuICAgICAgICAgICAgbS5kYXRlKCksXG4gICAgICAgICAgICBtLmhvdXIoKSxcbiAgICAgICAgICAgIG0ubWludXRlKCksXG4gICAgICAgICAgICBtLnNlY29uZCgpLFxuICAgICAgICAgICAgbS5taWxsaXNlY29uZCgpLFxuICAgICAgICBdO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHRvT2JqZWN0KCkge1xuICAgICAgICB2YXIgbSA9IHRoaXM7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB5ZWFyczogbS55ZWFyKCksXG4gICAgICAgICAgICBtb250aHM6IG0ubW9udGgoKSxcbiAgICAgICAgICAgIGR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9IHBhcnNlSW50KGlucHV0LCAxMCk7XG4gICAgICAgIH1cbiAgICB9KTtcblxuICAgIGZ1bmN0aW9uIGxvY2FsZUVyYXMobSwgZm9ybWF0KSB7XG4gICAgICAgIHZhciBpLFxuICAgICAgICAgICAgbCxcbiAgICAgICAgICAgIGRhdGUsXG4gICAgICAgICAgICBlcmFzID0gdGhpcy5fZXJhcyB8fCBnZXRMb2NhbGUoJ2VuJykuX2VyYXM7XG4gICAgICAgIGZvciAoaSA9IDAsIGwgPSBlcmFzLmxlbmd0aDsgaSA8IGw7ICsraSkge1xuICAgICAgICAgICAgc3dpdGNoICh0eXBlb2YgZXJhc1tpXS5zaW5jZSkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ3N0cmluZyc6XG4gICAgICAgICAgICAgICAgICAgIC8vIHRydW5jYXRlIHRpbWVcbiAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IGhvb2tzKGVyYXNbaV0uc2luY2UpLnN0YXJ0T2YoJ2RheScpO1xuICAgICAgICAgICAgICAgICAgICBlcmFzW2ldLnNpbmNlID0gZGF0ZS52YWx1ZU9mKCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzd2l0Y2ggKHR5cGVvZiBlcmFzW2ldLnVudGlsKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAndW5kZWZpbmVkJzpcbiAgICAgICAgICAgICAgICAgICAgZXJhc1tpXS51bnRpbCA9ICtJbmZpbml0eTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnc3RyaW5nJzpcbiAgICAgICAgICAgICAgICAgICAgLy8gdHJ1bmNhdGUgdGltZVxuICAgICAgICAgICAgICAgICAgICBkYXRlID0gaG9va3MoZXJhc1tpXS51bnRpbCkuc3RhcnRPZignZGF5JykudmFsdWVPZigpO1xuICAgICAgICAgICAgICAgICAgICBlcmFzW2ldLnVudGlsID0gZGF0ZS52YWx1ZU9mKCk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBlcmFzO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGxvY2FsZUVyYXNQYXJzZShlcmFOYW1lLCBmb3JtYXQsIHN0cmljdCkge1xuICAgICAgICB2YXIgaSxcbiAgICAgICAgICAgIGwsXG4gICAgICAgICAgICBlcmFzID0gdGhpcy5lcmFzKCksXG4gICAgICAgICAgICBuYW1lLFxuICAgICAgICAgICAgYWJicixcbiAgICAgICAgICAgIG5hcnJvdztcbiAgICAgICAgZXJhTmFtZSA9IGVyYU5hbWUudG9VcHBlckNhc2UoKTtcblxuICAgICAgICBmb3IgKGkgPSAwLCBsID0gZXJhcy5sZW5ndGg7IGkgPCBsOyArK2kpIHtcbiAgICAgICAgICAgIG5hbWUgPSBlcmFzW2ldLm5hbWUudG9VcHBlckNhc2UoKTtcbiAgICAgICAgICAgIGFiYnIgPSBlcmFzW2ldLmFiYnIudG9VcHBlckNhc2UoKTtcbiAgICAgICAgICAgIG5hcnJvdyA9IGVyYXNbaV0ubmFycm93LnRvVXBwZXJDYXNlKCk7XG5cbiAgICAgICAgICAgIGlmIChzdHJpY3QpIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGZvcm1hdCkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdOJzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnTk4nOlxuICAgICAgICAgICAgICAgICAgICBjYXNlICdOTk4nOlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFiYnIgPT09IGVyYU5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJhc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ05OTk4nOlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5hbWUgPT09IGVyYU5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJhc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ05OTk5OJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuYXJyb3cgPT09IGVyYU5hbWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJhc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoW25hbWUsIGFiYnIsIG5hcnJvd10uaW5kZXhPZihlcmFOYW1lKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVyYXNbaV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBsb2NhbGVFcmFzQ29udmVydFllYXIoZXJhLCB5ZWFyKSB7XG4gICAgICAgIHZhciBkaXIgPSBlcmEuc2luY2UgPD0gZXJhLnVudGlsID8gKzEgOiAtMTtcbiAgICAgICAgaWYgKHllYXIgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcmV0dXJuIGhvb2tzKGVyYS5zaW5jZSkueWVhcigpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIGhvb2tzKGVyYS5zaW5jZSkueWVhcigpICsgKHllYXIgLSBlcmEub2Zmc2V0KSAqIGRpcjtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldEVyYU5hbWUoKSB7XG4gICAgICAgIHZhciBpLFxuICAgICAgICAgICAgbCxcbiAgICAgICAgICAgIHZhbCxcbiAgICAgICAgICAgIGVyYXMgPSB0aGlzLmxvY2FsZURhdGEoKS5lcmFzKCk7XG4gICAgICAgIGZvciAoaSA9IDAsIGwgPSBlcmFzLmxlbmd0aDsgaSA8IGw7ICsraSkge1xuICAgICAgICAgICAgLy8gdHJ1bmNhdGUgdGltZVxuICAgICAgICAgICAgdmFsID0gdGhpcy5jbG9uZSgpLnN0YXJ0T2YoJ2RheScpLnZhbHVlT2YoKTtcblxuICAgICAgICAgICAgaWYgKGVyYXNbaV0uc2luY2UgPD0gdmFsICYmIHZhbCA8PSBlcmFzW2ldLnVudGlsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGVyYXNbaV0ubmFtZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChlcmFzW2ldLnVudGlsIDw9IHZhbCAmJiB2YWwgPD0gZXJhc1tpXS5zaW5jZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBlcmFzW2ldLm5hbWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gJyc7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0RXJhTmFycm93KCkge1xuICAgICAgICB2YXIgaSxcbiAgICAgICAgICAgIGwsXG4gICAgICAgICAgICB2YWwsXG4gICAgICAgICAgICBlcmFzID0gdGhpcy5sb2NhbGVEYXRhKCkuZXJhcygpO1xuICAgICAgICBmb3IgKGkgPSAwLCBsID0gZXJhcy5sZW5ndGg7IGkgPCBsOyArK2kpIHtcbiAgICAgICAgICAgIC8vIHRydW5jYXRlIHRpbWVcbiAgICAgICAgICAgIHZhbCA9IHRoaXMuY2xvbmUoKS5zdGFydE9mKCdkYXknKS52YWx1ZU9mKCk7XG5cbiAgICAgICAgICAgIGlmIChlcmFzW2ldLnNpbmNlIDw9IHZhbCAmJiB2YWwgPD0gZXJhc1tpXS51bnRpbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBlcmFzW2ldLm5hcnJvdztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChlcmFzW2ldLnVudGlsIDw9IHZhbCAmJiB2YWwgPD0gZXJhc1tpXS5zaW5jZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBlcmFzW2ldLm5hcnJvdztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAnJztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRFcmFBYmJyKCkge1xuICAgICAgICB2YXIgaSxcbiAgICAgICAgICAgIGwsXG4gICAgICAgICAgICB2YWwsXG4gICAgICAgICAgICBlcmFzID0gdGhpcy5sb2NhbGVEYXRhKCkuZXJhcygpO1xuICAgICAgICBmb3IgKGkgPSAwLCBsID0gZXJhcy5sZW5ndGg7IGkgPCBsOyArK2kpIHtcbiAgICAgICAgICAgIC8vIHRydW5jYXRlIHRpbWVcbiAgICAgICAgICAgIHZhbCA9IHRoaXMuY2xvbmUoKS5zdGFydE9mKCdkYXknKS52YWx1ZU9mKCk7XG5cbiAgICAgICAgICAgIGlmIChlcmFzW2ldLnNpbmNlIDw9IHZhbCAmJiB2YWwgPD0gZXJhc1tpXS51bnRpbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBlcmFzW2ldLmFiYnI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZXJhc1tpXS51bnRpbCA8PSB2YWwgJiYgdmFsIDw9IGVyYXNbaV0uc2luY2UpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZXJhc1tpXS5hYmJyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuICcnO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldEVyYVllYXIoKSB7XG4gICAgICAgIHZhciBpLFxuICAgICAgICAgICAgbCxcbiAgICAgICAgICAgIGRpcixcbiAgICAgICAgICAgIHZhbCxcbiAgICAgICAgICAgIGVyYXMgPSB0aGlzLmxvY2FsZURhdGEoKS5lcmFzKCk7XG4gICAgICAgIGZvciAoaSA9IDAsIGwgPSBlcmFzLmxlbmd0aDsgaSA8IGw7ICsraSkge1xuICAgICAgICAgICAgZGlyID0gZXJhc1tpXS5zaW5jZSA8PSBlcmFzW2ldLnVudGlsID8gKzEgOiAtMTtcblxuICAgICAgICAgICAgLy8gdHJ1bmNhdGUgdGltZVxuICAgICAgICAgICAgdmFsID0gdGhpcy5jbG9uZSgpLnN0YXJ0T2YoJ2RheScpLnZhbHVlT2YoKTtcblxuICAgICAgICAgICAgaWYgKFxuICAgICAgICAgICAgICAgIChlcmFzW2ldLnNpbmNlIDw9IHZhbCAmJiB2YWwgPD0gZXJhc1tpXS51bnRpbCkgfHxcbiAgICAgICAgICAgICAgICAoZXJhc1tpXS51bnRpbCA8PSB2YWwgJiYgdmFsIDw9IGVyYXNbaV0uc2luY2UpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAodGhpcy55ZWFyKCkgLSBob29rcyhlcmFzW2ldLnNpbmNlKS55ZWFyKCkpICogZGlyICtcbiAgICAgICAgICAgICAgICAgICAgZXJhc1tpXS5vZmZzZXRcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMueWVhcigpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGVyYXNOYW1lUmVnZXgoaXNTdHJpY3QpIHtcbiAgICAgICAgaWYgKCFoYXNPd25Qcm9wKHRoaXMsICdfZXJhc05hbWVSZWdleCcpKSB7XG4gICAgICAgICAgICBjb21wdXRlRXJhc1BhcnNlLmNhbGwodGhpcyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGlzU3RyaWN0ID8gdGhpcy5fZXJhc05hbWVSZWdleCA6IHRoaXMuX2VyYXNSZWdleDtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBlcmFzQWJiclJlZ2V4KGlzU3RyaWN0KSB7XG4gICAg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CBtYXRjaFVuc2lnbmVkO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbXB1dGVFcmFzUGFyc2UoKSB7XG4gICAgICAgIHZhciBhYmJyUGllY2VzID0gW10sXG4gICAgICAgICAgICBuYW1lUGllY2VzID0gW10sXG4gICAgICAgICAgICBuYXJyb3dQaWVjZXMgPSBbXSxcbiAgICAgICAgICAgIG1peGVkUGllY2VzID0gW10sXG4gICAgICAgICAgICBpLFxuICAgICAgICAgICAgbCxcbiAgICAgICAgICAgIGVyYXNOYW1lLFxuICAgICAgICAgICAgZXJhc0FiYnIsXG4gICAgICAgICAgICBlcmFzTmFycm93LFxuICAgICAgICAgICAgZXJhcyA9IHRoaXMuZXJhcygpO1xuXG4gICAgICAgIGZvciAoaSA9IDAsIGwgPSBlcmFzLmxlbmd0aDsgaSA8IGw7ICsraSkge1xuICAgICAgICAgICAgZXJhc05hbWUgPSByZWdleEVzY2FwZShlcmFzW2ldLm5hbWUpO1xuICAgICAgICAgICAgZXJhc0FiYnIgPSByZWdleEVzY2FwZShlcmFzW2ldLmFiYnIpO1xuICAgICAgICAgICAgZXJhc05hcnJvdyA9IHJlZ2V4RXNjYXBlKGVyYXNbaV0ubmFycm93KTtcblxuICAgICAgICAgICAgbmFtZVBpZWNlcy5wdXNoKGVyYXNOYW1lKTtcbiAgICAgICAgICAgIGFiYnJQaWVjZXMucHVzaChlcmFzQWJicik7XG4gICAgICAgICAgICBuYXJyb3dQaWVjZXMucHVzaChlcmFzTmFycm93KTtcbiAgICAgICAgICAgIG1peGVkUGllY2VzLnB1c2goZXJhc05hbWUpO1xuICAgICAgICAgICAgbWl4ZWRQaWVjZXMucHVzaChlcmFzQWJicik7XG4gICAgICAgICAgICBtaXhlZFBpZWNlcy5wdXNoKGVyYXNOYXJyb3cpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5fZXJhc1JlZ2V4ID0gbmV3IFJlZ0V4cCgnXignICsgbWl4ZWRQaWVjZXMuam9pbignfCcpIC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V0V2Vla1llYXIoaW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIGdldFNldFdlZWtZZWFySGVscGVyLmNhbGwoXG4gICAgICAgICAgICB0aGlzLFxuICAgICAgICAgICAgaW5wdXQsXG4gICAgICAgICAgICB0aGlzLndlZWsoKSxcbiAgICAgICAgICAgIHRoaXMud2Vla2RheSgpICsgdGhpcy5sb2NhbGVEYXRhKCkuX3dlZWsuZG93LFxuICAgICAgICAgICAgdGhpcy5sb2NhbGVEYXRhKCkuX3dlZWsuZG93LFxuICAgICAgICAgICAgdGhpcy5sb2NhbGVEYXRhKCkuX3dlZWsuZG95XG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0U2V0SVNPV2Vla1llYXIoaW5wdXQpIHtcbiAgICAgICAgcmV0dXJuIGdldFNldFdlZWtZZWFySGVscGVyLmNhbGwoXG4gICAgICAgICAgICB0aGlzLFxuICAgICAgICAgICAgaW5wdXQsXG4gICAgICAgICAgICB0aGlzLmlzb1dlZWsoKSxcbiAgICAgICAgICAgIHRoaXMuaXNvV2Vla2RheSgpLFxuICAgICAgICAgICAgMSxcbiAgICAgICAgICAgIDRcbiAgICAgICAgKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRJU09XZWVrc0luWWVhcigpIHtcbiAgICAgICAgcmV0dXJuIHdlZWtzSW5ZZWFyKHRoaXMueWVhcigpLCAxLCA0KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRJU09XZWVrc0luSVNPV2Vla1llYXIoKSB7XG4gICAgICAgIHJldHVybiB3ZWVrc0luWWVhcih0aGlzLmlzb1dlZWtZZWFyKCksIDEsIDQpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldFdlZWtzSW5ZZWFyKCkge1xuICAgICAgICB2YXIgd2Vla0luZm8gPSB0aGlzLmxvY2FsZURhdGEoKS5fd2VlaztcbiAgICAgICAgcmV0dXJuIHdlZWtzSW5ZZWFyKHRoaXMueWVhc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bicpIHtcbiAgICAgICAgICAgIGlmIChpc051bWJlcihmb3JtYXQpKSB7XG4gICAgICAgICAgICAgICAgaW5kZXggPSBmb3JtYXQ7XG4gICAgICAgICAgICAgICAgZm9ybWF0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmb3JtYXQgPSBmb3JtYXQgfHwgJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmb3JtYXQgPSBsb2NhbGVTb3J0ZWQ7XG4gICAgICAgICAgICBpbmRleCA9IGZvcm1hdDtcbiAgICAgICAgICAgIGxvY2FsZVNvcnRlZCA9IGZhbHNlO1xuXG4gICAgICAgICAgICBpZiAoaXNOdW1iZXIoZm9ybWF0KSkge1xuICAgICAgICAgICAgICAgIGluZGV4ID0gZm9ybWF0O1xuICAgICAgICAgICAgICAgIGZvcm1hdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9ybWF0ID0gZm9ybWF0IHx8ICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIGxvY2FsZSA9IGdldExvY2FsZSgpLFxuICAgICAgICAgICAgc2hpZnQgPSBsb2NhbGVTb3J0ZWQgPyBsb2NhbGUuX3dlZWsuZG93IDogMCxcbiAgICAgICAgICAgIGksXG4gICAgICAgICAgICBvdXQgPSBbXTtcblxuICAgICAgICBpZiAoaW5kZXggIT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuIGdldCQxKGZvcm1hdCwgKGluZGV4ICsgc2hpZnQpICUgNywgZmllbGQsICdkYXknKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCA3OyBpKyspIHtcbiAgICAgICAgICAgIG91dFtpXSA9IGdldCQxKGZvcm1hdCwgKGkgKyBzaGlmdCkgJSA3LCBmaWVsZCwgJ2RheScpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvdXQ7XG4gICAgfVxuXG4gICAgZnV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xcbiAgICAgICAgICAgICAgICBuYW1lOiAnQW5ubyBEb21pbmknLFxuICAgICAgICAgICAgICAgIG5hcnJvdzogJ0FEJyxcbiAgICAgICAgICAgICAgICBhYmJyOiAnQUQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzaW5jZTogJzAwMDAtMTItMzEnLFxuICAgICAgICAgICAgICAgIHVudGlsOiAtSW5maW5pdHksXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAxLFxuICAgICAgICAgICAgICAgIG5hbWU6ICdCZWZvcmUgQ2hyaXN0JyxcbiAgICAgICAgICAgICAgICBuYXJyb3c6ICdCQycsXG4gICAgICAgICAgICAgICAgYWJicjogJ0JDJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIF0sXG4gICAgICAgIGRheU9mTW9udGhPcmRpbmFsUGFyc2U6IC9cXGR7MSwyfSh0aHxzdHxuZHxyZCkvLFxuICAgICAgICBvcmRpbmFsOiBmdW5jdGlvbiAobnVtYmVyKSB7XG4gICAgICAgICAgICB2YXIgYiA9IG51bWJlciAlIDEwLFxuICAgICAgICAgICAgICAgIG91dHB1dCA9XG4gICAgICAgICAgICAgICAgICAgIHRvSW50KChudW1iZXIgJSAxMDApIC8gMTApID09PSAxXG4gICAgICAgICAgICAgICAgICAgICAgICA/ICd0aCdcbiAgICAgICAgICAgICAgICAgICAgICAgIDogYiA9PT0gMVxuICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdzdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAnbmQnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBiID09PSAzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICdyZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogJ3RoJztcbiAgICAgICAgICAgIHJldHVybiBudW1iZXIgKyBvdXRwdXQ7XG4gICAg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gfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBNYXRoLmNlaWwobnVtYmVyKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIGJ1YmJsZSgpIHtcbiAgICAgICAgdmFyIG1pbGxpc2Vjb25kcyA9IHRoaXMuX21pbGxpc2Vjb25kcyxcbiAgICAgICAgICAgIGRheXMgPSB0aGlzLl9kYXlzLFxuICAgICAgICAgICAgbW9udGhzID0gdGhpcy5fbW9udGhzLFxuICAgICAgICAgICAgZGF0YSA9IHRoaXMuX2RhdGEsXG4gICAgICAgICAgICBzZWNvbmRzLFxuICAgICAgICAgICAgbWludXRlcyxcbiAgICAgICAgICAgIGhvdXJzLFxuICAgICAgICAgICAgeWVhcnMsXG4gICAgICAgICAgICBtb250aHNGcm9tRGF5cztcblxuICAgICAgICAvLyBpZiB3ZSBoYXZlIGEgbWl4IG9mIHBvc2l0aXZlIGFuZCBuZWdhdGl2ZSB2YWx1ZXMsIGJ1YmJsZSBkb3duIGZpcnN0XG4gICAgICAgIC8vIGNoZWNrOiBodHRwczovL2dpdGh1Yi5jb20vbW9tZW50L21vbWVudC9pc3N1ZXMvMjE2NlxuICAgICAgICBpZiAoXG4gICAgICAgICAgICAhKFxuICAgICAgICAgICAgICAgIChtaWxsaXNlY29uZHMgPj0gMCAmJiBkYXlzID49IDAgJiYgbW9udGhzID49IDApIHx8XG4gICAgICAgICAgICAgICAgKG1pbGxpc2Vjb25kcyA8PSAwICYmIGRheXMgPD0gMCAmJiBtb250aHMgPD0gMClcbiAgICAgICAgICAgIClcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBtaWxsaXNlY29uZHMgKz0gYWJzQ2VpbChtb250aHNUb0RheXMobW9udGhzKSArIGRheXMpICogODY0ZTU7XG4gICAgICAgICAgICBkYXlzID0gMDtcbiAgICAgICAgICAgIG1vbnRocyA9IDA7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBUaGUgZm9sbG93aW5nIGNvZGUgYnViYmxlcyB1cCB2YWx1ZXMsIHNlZSB0aGUgdGVzdHMgZm9yXG4gICAgICAgIC8vIGV4YW1wbGVzIG9mIHdoYXQgdGhhdCBtZWFucy5cbiAgICAgICAgZGF0YS5taWxsaXNlY29uZHMgPSBtaWxsaXNlY29uZHMgJSAxMDAwO1xuXG4gICAgICAgIHNlY29uZHMgPSBhYnNGbG9vcihtaWxsaXNlY29uZHMgLyAxMDAwKTtcbiAgICAgICAgZGF0YS5zZWNvbmRzID0gc2Vjb25kcyAlIDYwO1xuXG4gICAgICAgIG1pbnV0ZXMgPSBhYnNGbG9vcihzZWNvbmRzIC8gNjApO1xuICAgICAgICBkYXRhLm1pbnV0ZXMgPSBtaW51dGVzICUgNjA7XG5cbiAgICAgICAgaG91cnMgPSBhYnNGbG9vcihtaW51dGVzIC8gNjApO1xuICAgICAgICBkYXRhLmhvdXJzID0gaG91cnMgJSAyNDtcblxuICAgICAgICBkYXlzICs9IGFic0Zsb29yKGhvdXJzIC8gMjQpO1xuXG4gICAgICAgIC8vIGNvbnZlcnQgZGF5cyB0byBtb250aHNcbiAgICAgICAgbW9udGhzRnJvbURheXMgPSBhYnNGbG9vcihkYXlzVG9Nb250aHMoZGF5cykpO1xuICAgICAgICBtb250aHMgKz0gbW9udGhzRnJvbURheXM7XG4gICAgICAgIGRheXMgLT0gYWJzQ2VpbChtb250aHNUb0RheXMobW9udGhzRnJvbURheXMpKTtcblxuICAgICAgICAvLyAxMiBtb250aHMgLT4gMSB5ZWFyXG4gICAgICAgIHllYXJzID0gYWJzRmxvb3IobW9udGhzIC8gMTIpO1xuICAgICAgICBtb250aHMgJT0gMTI7XG5cbiAgICAgICAgZGF0YS5kYXlzID0gZGF5cztcbiAgICAgICAgZGF0YS5tb250aHMgPSBtb250aHM7XG4gICAgICAgIGRhdGEueWVhcnMgPSB5ZWFycztcblxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBkYXlzVG9Nb250aHMoZGF5cykge1xuICAgICAgICAvLyA0MDAgeWVhcnMgaGF2ZSAxNDYwOTcgZGF5cyAodGFraW5nIGludG8gYWNjb3VudCBsZWFwIHllYXIgcnVsZXMpXG4gICAgICAgIC8vIDQwMCB5ZWFycyBoYXZlIDEyIG1vbnRocyA9PT0gNDgwMFxuICAgICAgICByZXR1cm4gKGRheXMgKiA0ODAwKSAvIDE0NjA5NztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBtb250aHNUb0RheXMobW9udGhzKSB7XG4gICAgICAgIC8vIHRoZSByZXZlcnNlIG9mIGRheXNUb01vbnRoc1xuICAgICAgICByZXR1cm4gKG1vbnRocyAqIDE0NjA5NykgLyA0ODAwO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFzKHVuaXRzKSB7XG4gICAgICAgIGlmICghdGhpcy5pc1ZhbGlkKCkpIHtcbiAgICAgICAgICAgIHJldHVybiBOYU47XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGRheXMsXG4gICAgICAgICAgICBtb250aHMsXG4gICAgICAgICAgICBtaWxsaXNlY29uZHMgPSB0aGlzLl9taWxsaXNlY29uZHM7XG5cbiAgICAgICAgdW5pdHMgPSBub3JtYWxpemVVbml0cyh1bml0cyk7XG5cbiAgICAgICAgaWYgKHVuaXRzID09PSAnbW9udGgnIHx8IHVuaXRzID09PSAncXVhcnRlcicgfHwgdW5pdHMgPT09ICd5ZWFyJykge1xuICAgICAgICAgICAgZGF5cyA9IHRoaXMuX2RheXMgKyBtaWxsaXNlY29uZHMgLyA4NjRlNTtcbiAgICAgICAgICAgIG1vbnRocyA9IHRoaXMuX21vbnRocyArIGRheXNUb01vbnRocyhkYXlzKTtcbiAgICAgICAgICAgIHN3aXRjaCAodW5pdHMpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdtb250aCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtb250aHM7XG4gICAgICAgICAgICAgICAgY2FzZSAncXVhcnRlcic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtb250aHMgLyAzO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3llYXInOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbW9udGhzIC8gMTI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBoYW5kbGUgbWlsbGlzZWNvbmRzIHNlcGFyYXRlbHkgYmVjYXVzZSBvZiBmbG9hdGluZyBwb2ludCBtYXRoIGVycm9ycyAoaXNzdWUgIzE4NjcpXG4gICAgICAgICAgICBkYXlzID0gdGhpcy5fZGF5cyArIE1hdGgucm91bmQobW9udGhzVG9EYXlzKHRoaXMuX21vbnRocykpO1xuICAgICAgICAgICAgc3dpdGNoICh1bml0cykge1xuICAgICAgICAgICAgICAgIGNhc2UgJ3dlZWsnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF5cyAvIDcgKyBtaWxsaXNlY29uZHMgLyA2MDQ4ZTU7XG4gICAgICAgICAgICAgICAgY2FzZSAnZGF5JzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRheXMgKyBtaWxsaXNlY29uZHMgLyA4NjRlNTtcbiAgICAgICAgICAgICAgICBjYXNlICdob3VyJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRheXMgKiAyNCArIG1pbGxpc2Vjb25kcyAvIDM2ZTU7XG4gICAgICAgICAgICAgICAgY2FzZSAnbWludXRlJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRheXMgKiAxNDQwICsgbWlsbGlzZWNvbmRzIC8gNmU0O1xuICAgICAgICAgICAgICAgIGNhc2UgJ3NlY29uZCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkYXlzICogODY0MDAgKyBtaWxsaXNlY29uZHMgLyAxMDAwO1xuICAgICAgICAgICAgICAgIC8vIE1hdGguZmxvb3IgcHJldmVudHMgZmxvYXRpbmcgcG9pbnQgbWF0aCBlcnJvcnMgaGVyZVxuICAgICAgICAgICA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AgKHNlY29uZHMgPD0gdGhyZXNob2xkcy5zcyAmJiBbJ3MnLCBzZWNvbmRzXSkgfHxcbiAgICAgICAgICAgICAgICAoc2Vjb25kcyA8IHRocmVzaG9sZHMucyAmJiBbJ3NzJywgc2Vjb25kc10pIHx8XG4gICAgICAgICAgICAgICAgKG1pbnV0ZXMgPD0gMSAmJiBbJ20nXSkgfHxcbiAgICAgICAgICAgICAgICAobWludXRlcyA8IHRocmVzaG9sZHMubSAmJiBbJ21tJywgbWludXRlc10pIHx8XG4gICAgICAgICAgICAgICAgKGhvdXJzIDw9IDEgJiYgWydoJ10pIHx8XG4gICAgICAgICAgICAgICAgKGhvdXJzIDwgdGhyZXNob2xkcy5oICYmIFsnaGgnLCBob3Vyc10pIHx8XG4gICAgICAgICAgICAgICAgKGRheXMgPD0gMSAmJiBbJ2QnXSkgfHxcbiAgICAgICAgICAgICAgICAoZGF5cyA8IHRocmVzaG9sZHMuZCAmJiBbJ2RkJywgZGF5c10pO1xuXG4gICAgICAgIGlmICh0aHJlc2hvbGRzLncgIT0gbnVsbCkge1xuICAgICAgICAgICAgYSA9XG4gICAgICAgICAgICAgICAgYSB8fFxuICAgICAgICAgICAgICAgICh3ZWVrcyA8PSAxICYmIFsndyddKSB8fFxuICAgICAgICAgICAgICAgICh3ZWVrcyA8IHRocmVzaG9sZHMudyAmJiBbJ3d3Jywgd2Vla3NdKTtcbiAgICAgICAgfVxuICAgICAgICBhID0gYSB8fFxuICAgICAgICAgICAgKG1vbnRocyA8PSAxICYmIFsnTSddKSB8fFxuICAgICAgICAgICAgKG1vbnRocyA8IHRocmVzaG9sZHMuTSAmJiBbJ01NJywgbW9udGhzXSkgfHxcbiAgICAgICAgICAgICh5ZWFycyA8PSAxICYmIFsneSddKSB8fCBbJ3l5JywgeWVhcnNdO1xuXG4gICAgICAgIGFbMl0gPSB3aXRob3V0U3VmZml4O1xuICAgICAgICBhWzNdID0gK3Bvc05lZ0R1cmF0aW9uID4gMDtcbiAgICAgICAgY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aHMgKDI4LTMxIGRheXMgcGVyIG1vbnRoKVxuICAgICAgICBpZiAoIXRoaXMuaXNWYWxpZCgpKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5sb2NhbGVEYXRhKCkuaW52YWxpZERhdGUoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBzZWNvbmRzID0gYWJzJDEodGhpcy5fbWlsbGlzZWNvbmRzKSAvIDEwMDAsXG4gICAgICAgICAgICBkYXlzID0gYWJzJDEodGhpcy5fZGF5cyksXG4gICAgICAgICAgICBtb250aHMgPSBhYnMkMSh0aGlzLl9tb250aHMpLFxuICAgICAgICAgICAgbWludXRlcyxcbiAgICAgICAgICAgIGhvdXJzLFxuICAgICAgICAgICAgeWVhcnMsXG4gICAgICAgICAgICBzLFxuICAgICAgICAgICAgdG90YWwgPSB0aGlzLmFzU2Vjb25kcygpLFxuICAgICAgICAgICAgdG90YWxTaWduLFxuICAgICAgICAgICAgeW1TaWduLFxuICAgICAgICAgICAgZGF5c1NpZ24sXG4gICAgICAgICAgICBobXNTaWduO1xuXG4gICAgICAgIGlmICghdG90YWwpIHtcbiAgICAgICAgICAgIC8vIHRoaXMgaXMgdGhlIHNhbWUgYXMgQyMncyAoTm9kYSkgYW5kIHB5dGhvbiAoaXNvZGF0ZSkuLi5cbiAgICAgICAgICAgIC8vIGJ1dCBub3Qgb3RoZXIgSlMgKGdvb2cuZGF0ZSlcbiAgICAgICAgICAgIHJldHVybiAnUDBEJztcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIDM2MDAgc2Vjb25kcyAtPiA2MCBtaW51dGVzIC0+IDEgaG91clxuICAgICAgICBtaW51dGVzID0gYWJzRmxvb3Ioc2Vjb25kcyAvIDYwKTtcbiAgICAgICAgaG91cnMgPSBhYnNGbG9vcihtaW51dGVzIC8gNjApO1xuICAgICAgICBzZWNvbmRzICU9IDYwO1xuICAgICAgICBtaW51dGVzICU9IDYwO1xuXG4gICAgICAgIC8vIDEyIG1vbnRocyAtPiAxIHllYXJcbiAgICAgICAgeWVhcnMgPSBhYnNGbG9vcihtb250aHMgLyAxMik7XG4gICAgICAgIG1vbnRocyAlPSAxMjtcblxuICAgICAgICAvLyBpbnNwaXJlZCBieSBodHRwczovL2dpdGh1Yi5jb20vZG9yZGlsbGUvbW9tZW50LWlzb2R1cmF0aW9uL2Jsb2IvbWFzdGVyL21vbWVudC5pc29kdXJhdGlvbi5qc1xuICAgICAgICBzID0gc2Vjb25kcyA/IHNlY29uZHMudG9GaXhlZCgzKS5yZXBsYWNlKC9cXC4/MCskLywgJycpIDogJyc7XG5cbiAgICAgICAgdG90YWxTaWduID0gdG90YWwgPCAwID8gJy0nIDogJyc7XG4gICAgICAgIHltU2lnbiA9IHNpZ24odGhpcy5fbW9udGhzKSAhPT0gc2lnbih0b3RhbCkgPyAnLScgOiAnJztcbiAgICAgICAgZGF5c1NpZ24gPSBzaWduKHRoaXMuX2RheXMpICE9PSBzaWduKHRvdGFsKSA/ICctJyA6ICcnO1xuICAgICAgICBobXNTaWduID0gc2lnbih0aGlzLl9taWxsaXNlY29uZHMpICE9PSBzaWduKHRvdGFsKSA/ICctJyA6ICcnO1xuXG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICB0b3RhbFNpZ24gK1xuICAgICAgICAgICAgJ1AnICtcbiAgICAgICAgICAgICh5ZWFycyA/IHltU2lnbiArIHllYXJzICsgJ1knIDogJycpICtcbiAgICAgICAgICAgIChtb250aHMgPyB5bVNpZ24gKyBtb250aHMgKyAnTScgOiAnJykgK1xuICAgICAgICAgICAgKGRheXMgPyBkYXlzU2lnbiArIGRheXMgKyAnRCcgOiAnJykgK1xuICAgICAgICAgICAgKGhvdXJzIHx8IG1pbnV0ZXMgfHwgc2Vjb25kcyA/ICdUJyA6ICcnKSArXG4gICAgICAgICAgICAoaG91cnMgPyBobXNTaWduICsgaG91cnMgKyAnSCcgOiAnJykgK1xuICAgICAgICAgICAgKG1pbnV0ZXMgPyBobXNTaWduICsgbWludXRlcy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GdldENhY2hlLmdldChwYXRoKSB8fFxuICAgICAgZ2V0Q2FjaGUuc2V0KHBhdGgsIGZ1bmN0aW9uIGdldHRlcihkYXRhKSB7XG4gICAgICAgIHZhciBpbmRleCA9IDAsXG4gICAgICAgICAgbGVuID0gcGFydHMubGVuZ3RoXG4gICAgICAgIHdoaWxlIChpbmRleCA8IGxlbikge1xuICAgICAgICAgIGlmIChkYXRhICE9IG51bGwgfHwgIXNhZmUpIGRhdGEgPSBkYXRhW3BhcnRzW2luZGV4KytdXVxuICAgICAgICAgIGVsc2UgcmV0dXJuXG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGRhdGFcbiAgICAgIH0pXG4gICAgKVxuICB9LFxuXG4gIGpvaW46IGZ1bmN0aW9uIChzZWdtZW50cykge1xuICAgIHJldHVybiBzZWdtZW50cy5yZWR1Y2UoZnVuY3Rpb24gKHBhdGgsIHBhcnQpIHtcbiAgICAgIHJldHVybiAoXG4gICAgICAgIHBhdGggK1xuICAgICAgICAoaXNRdW90ZWQocGFydCkgfHwgRElHSVRfUkVHRVgudGVzdChwYXJ0KVxuICAgICAgICAgID8gJ1snICsgcGFydCArICddJ1xuICAgICAgICAgIDogKHBhdGggPyAnLicgOiAnJykgKyBwYXJ0KVxuICAgICAgKVxuICAgIH0sICcnKVxuICB9LFxuXG4gIGZvckVhY2g6IGZ1bmN0aW9uIChwYXRoLCBjYiwgdGhpc0FyZykge1xuICAgIGZvckVhY2goQXJyYXkuaXNBcnJheShwYXRoKSA/IHBhdGggOiBzcGxpdChwYXRoKSwgY2IsIHRoaXNBcmcpXG4gIH0sXG59XG5cbmZ1bmN0aW9uIG5vcm1hbGl6ZVBhdGgocGF0aCkge1xuICByZXR1cm4gKFxuICAgIHBhdGhDYWNoZS5nZXQocGF0aCkgfHxcbiAgICBwYXRoQ2FjaGUuc2V0KFxuICAgICAgcGF0aCxcbiAgICAgIHNwbGl0KHBhdGgpLm1hcChmdW5jdGlvbiAocGFydCkge1xuICAgICAgICBy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CQVRDSF9TSVpFIiwiQ1JFQVRFX0JBVENIX1NJWkVfTUFYIiwiVVBEQVRFX0JBVENIX1NJWkUiLCJVUERBVEVfQkFUQ0hfU0laRV9NQVgiLCJERUxFVEVfQkFUQ0hfU0laRSIsIkRFTEVURV9CQVRDSF9TSVpFX01BWCIsIlJFQURfQllfRklMVEVSX0JBVENIX1NJWkUiLCJSRUFEX0JZX0ZJTFRFUl9CQVRDSF9TSVpFX01BWCIsIlBFUkZPUk1fT1BfSU5fQkFUQ0hfQkFUQ0hfU0laRSIsIlBFUkZPUk1fT1BfSU5fQkFUQ0hfTUFYX0JBVENIX1NJWkUiLCJQRVJGT1JNX09QX0lOX0JBVENIX01BWF9QQVJBTExFTCIsImRlZmF1bHRDb25maWciLCJwYXNzZWRDb25maWciLCJMSU1JVF9QUk9QRVJUWSIsIm51bWJlciIsIm51bGxhYmxlIiwibm90UmVxdWlyZWQiLCJzdHJpY3QiLCJtaW4iLCJnZXRCYXRjaFByb3AiLCJkZWZhdWx0U2l6ZSIsIm1heFNpemUiLCJnZXRSZXR1cm5SZXN1bHRQcm9wIiwiZGVmYXVsdFZhbCIsImJvb2xlYW4iLCJQRVJGT1JNX09QX0lOX0JBVENIX09CSiIsIm9iamVjdCIsIlBST0dSRVNTX09CSiIsImluY3JlbWVudCIsInN0cmluZyIsInV1aWRWYWxpZGF0ZSIsImdldFJlYWRhYmxlTmFtZSIsImZxbmFtZSIsImtpbmQiLCJ0aW1lU2VyaWVzRW50cmllcyIsInBhcnNlZFZhbCIsInJlc2V0IiwibXMiLCJzZXRUaW1lb3V0Il0sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/dist/jsWideSky.min.js b/dist/jsWideSky.min.js index 2a728b7..32ba646 100644 --- a/dist/jsWideSky.min.js +++ b/dist/jsWideSky.min.js @@ -1,2 +1,2 @@ /*! For license information please see jsWideSky.min.js.LICENSE.txt */ -!function(e,M){"object"==typeof exports&&"object"==typeof module?module.exports=M(require("fs"),require("os"),function(){try{return require("dtrace-provider")}catch(e){}}(),function(){try{return require("mv")}catch(e){}}(),function(){try{return require("source-map-support")}catch(e){}}()):"function"==typeof define&&define.amd?define("JsWideSky",["fs","os","dtrace-provider","mv","source-map-support"],M):"object"==typeof exports?exports.JsWideSky=M(require("fs"),require("os"),function(){try{return require("dtrace-provider")}catch(e){}}(),function(){try{return require("mv")}catch(e){}}(),function(){try{return require("source-map-support")}catch(e){}}()):e.JsWideSky=M(e.fs,e.os,e["dtrace-provider"],e.mv,e["source-map-support"])}(this,((e,M,b,t,p)=>(()=>{var o={969:e=>{function M(){}e.exports=function(e,b,t){var p=!1;return t=t||M,o.count=e,0===e?b():o;function o(e,M){if(o.count<=0)throw new Error("after called too many times");--o.count,e?(p=!0,b(e),b=t):0!==o.count||p||b(null,M)}}},9880:e=>{"use strict";e.exports=({onlyFirst:e=!1}={})=>{const M=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(M,e?void 0:"g")}},1999:e=>{"use strict";var M={white:37,black:30,blue:34,cyan:36,green:32,magenta:35,red:31,yellow:33,brightBlack:90,brightRed:91,brightGreen:92,brightYellow:93,brightBlue:94,brightMagenta:95,brightCyan:96,brightWhite:97},b={bgBlack:40,bgRed:41,bgGreen:42,bgYellow:43,bgBlue:44,bgMagenta:45,bgCyan:46,bgWhite:47,bgBrightBlack:100,bgBrightRed:101,bgBrightGreen:102,bgBrightYellow:103,bgBrightBlue:104,bgBrightMagenta:105,bgBrightCyan:106,bgBrightWhite:107},t={};Object.keys(M).forEach((function(e){t[e]=function(b){return"\x1b["+M[e]+"m"+b+"\x1b[39m"}})),Object.keys(b).forEach((function(e){t[e]=function(M){return"\x1b["+b[e]+"m"+M+"\x1b[49m"}})),e.exports=t},9703:e=>{"use strict";var M={reset:[0,22],bright:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],blink:[5,25],inverse:[7,27]},b={};Object.keys(M).forEach((function(e){b[e]=function(b){return"\x1b["+M[e][0]+"m"+b+"\x1b["+M[e][1]+"m"}})),e.exports=b},3344:e=>{e.exports=function(e,M,b){var t=e.byteLength;if(M=M||0,b=b||t,e.slice)return e.slice(M,b);if(M<0&&(M+=t),b<0&&(b+=t),b>t&&(b=t),M>=t||M>=b||0===t)return new ArrayBuffer(0);for(var p=new Uint8Array(e),o=new Uint8Array(b-M),z=M,n=0;z{"use strict";const t=b(1106),p=b(1317),o=b(55),z=b(1031),n=b(9816),r=b(6025),c=b(4740),O=b(1721),a={WideSkyClient:t,VER_2:p.VER_2,VER_3:p.VER_3,MARKER:p.MARKER,NA:p.NA,REMOVE:p.REMOVE,Ref:p.Ref,String:p.String,Number:p.Number,Date:p.Date,HSNumber:p.HSNumber,parse:p.parse,dump:p.dump,graphql:{replace:o,exprParser:z,find:n},hsTools:r,HisWritePayload:c,EntityCriteria:O};e.exports=a},1106:(e,M,b)=>{"use strict";var t=b(5606);const p=b(1317),o=b(55),z=b(4743),n=b(1160),r=b(2947),c=b(6224),O=b(616),a=b(1894),i=b(7698),{RequestError:s}=b(1910),A=b(5667),{CLIENT_SCHEMA:u}=b(8458),d=b(2743),{performOpInBatch:q,...l}=b(6631),f=b(7926),{GraphQLError:W}=b(1910);let h;h="undefined"==typeof window?b(6425):b(6425).default;const{isAxiosError:m}=h,_=["id","name","dis"],L="YYYY-MM-DDTHH:mm:ss.SSS\\Z",R=Object.freeze({LOCAL:"local",SCRAM:"scram"});class y{baseUri;#e;#M;#b;#t;#p;logger;_acceptGzipEncoding;_impersonate;constructor(e,M,b,p,o,z,n,r={}){this.baseUri=e,this.#e=M,this.#M=b,this.#b=p,this.#t=o,this.#p=n,this.logger=function(e){let M;return M=void 0===e?A.createLogger({name:"WideSky-Client"}):"Object"===e.constructor.name?A.createLogger({name:e.name||"WideSky-Client",level:e.level||"info",stream:e.raw?t.stdout:f({outputMode:"short",color:!0,levelInString:!0},t.stdout)}):e,M}(z),this.options=r,this.clientOptions=null,this.httpAgent=null,this.httpsAgent=null,this._impersonate=null,this._acceptGzipEncoding=!0,this.initialised=!1,this.initAccessToken(),this.initAxios(),this.initWaitFor=this.initClientOptions(),this.assignSubFunctions()}static makeFromConfig(e={}){const M=["serverURL","username","password","clientId","clientSecret"];for(const b of M)if(void 0===e[b])throw new Error(`Configuration parameter requires properties ${M.join(", ")}`);return new y(e.serverURL,e.username,e.password,e.clientId,e.clientSecret,e.logger,e.accessToken,e.options)}assignSubFunctions(){const e=e=>async(...M)=>(this.initialised||(this.logger.info("Not finished initialising. Waiting..."),await this.initWaitFor),e.call(this,...M)),M=(M,b,t=!1)=>{for(const[p,o]of Object.entries(b))M[p]=t?e.call(this,o):o.bind(this)};this.v2={},M(this.v2,d),this.performOpInBatch=e(q),this.batch={},M(this.batch,l,!0)}initAccessToken(){if(this._ws_token=null,this._ws_token_wait=null,this.#p){for(const e of["refresh_token","expires_in","token_type","access_token"])if(void 0===this.#p[e])throw new Error("Parameter 'accessToken' is not a valid WideSky token.");this._ws_token=this.#p}}initAxios(){this.httpAgent=new c.Agent(this.options?.http||{}),this.httpsAgent=new O.Agent(this.options?.http||{}),this.axios=h.create(Object.assign({baseURL:this.baseUri,httpAgent:this.httpAgent,httpsAgent:this.httpsAgent},this.options.axios||{}))}async initClientOptions(){try{if(await u.validate(this.options.client),this.clientOptions=u.cast(this.options.client),this.setAcceptGzip(this.clientOptions.acceptGzip),null!==this.clientOptions.impersonateAs&&this.impersonateAs(this.clientOptions.impersonateAs),this.isProgressEnabled&&void 0===this.clientOptions.progress.instance){const e=b(7705);this.clientOptions.progress.instance=new e.MultiBar({clearOnComplete:!1,hideCursor:!0},e.Presets.shades_classic)}this.initialised=!0}catch(e){throw new Error(e.message)}}login(){return this.getToken()}impersonateAs(e){if(this.initialised)this._impersonate=e;else{const M=this.initWaitFor;this.initWaitFor=new Promise((async b=>{await M,this._impersonate=e,b()}))}}isImpersonating(){return null!==this._impersonate}unsetImpersonate(){this._impersonate=null}setAcceptGzip(e){this._acceptGzipEncoding=Boolean(e)}isAcceptingGzip(){return this._acceptGzipEncoding}get isProgressEnabled(){return this.clientOptions.progress.enable}progressCreate(e,M=0){return this.clientOptions.progress.instance[this.clientOptions.progress.create](e,M)}async _wsRawSubmit(e,M,b,t){let p;switch(this.initialised||(this.logger.info("Not finished initialising. Waiting..."),await this.initWaitFor),this.logger&&this.logger.trace(t,"Raw request"),e.toUpperCase()){case"GET":p=await this.axios.get(M,t);break;case"POST":p=await this.axios.post(M,b,t);break;case"PATCH":p=await this.axios.patch(M,b,t);break;case"PUT":p=await this.axios.put(M,b,t);break;default:throw new Error(`Not configured for method ${e}.`)}return p.data}async _attachReqConfig(e){const M=await this.getToken();return void 0===(e=Object.assign({},e)).headers&&(e.headers={}),e.headers.Authorization="Bearer "+M.access_token,e.headers.Accept="application/json",this.isAcceptingGzip()&&(e.decompress=!0),this.isImpersonating()&&(e.headers["X-IMPERSONATE"]=this._impersonate),e}async submitRequest(e,M,b={},t={}){t=await this._attachReqConfig(t);try{return this.logger.info("Submitting request [%s] %s",e.toUpperCase(),M),this.logger.debug("With body %j and config %j",b,t),await this._wsRawSubmit(e,M,b,t)}catch(p){let o=p;if(m(p)&&p.response){if(401===p.response.status&&this._ws_token)return this._ws_token=null,t=await this._attachReqConfig(t),this._wsRawSubmit(e,M,b,t);o=s.make(p,this.logger)}throw this.logger.error(o),o instanceof W&&o.errors.length>1&&o.errors.forEach(((e,M)=>this.logger.error("GraphQL error #%d: %s",M+1,e))),o}}_doLogin(){return this.logger&&this.logger.trace("Performing login attempt"),this._wsRawSubmit("POST","/oauth2/token",{username:this.#e,password:this.#M,grant_type:"password"},{auth:{username:this.#b,password:this.#t}})}_doRefresh(){return this.logger&&this.logger.trace("Performing token refresh attempt"),this._wsRawSubmit("POST","/oauth2/token",{refresh_token:this._ws_token.refresh_token,grant_type:"refresh_token"},{auth:{username:this.#b,password:this.#t}})}_getTokenSuccess(e,M){this.logger&&this.logger.info("Logged in to API server"),this._ws_token=e;const b=this._ws_token_wait;this._ws_token_wait=null,M(e),b.forEach((function(M){M.resolve(e)}))}_getTokenFail(e,M){this.logger&&this.logger.warn(e,"Failed to log into API server"),this._ws_token=null;const b=this._ws_token_wait;this._ws_token_wait=null,M(e),b.forEach((function(M){M.reject(e)}))}getToken(){let e,M=!1;if(null!==this._ws_token_wait)return this.logger&&this.logger.trace("Waiting for token acquisition"),new Promise(((e,M)=>{this._ws_token_wait.push({resolve:e,reject:M})}));if(null===this._ws_token)this._ws_token_wait=[],this.logger&&this.logger.trace("Begin token acquisition"),e=this._doLogin();else{if(!(this._ws_token.expires_ine.then((e=>this._getTokenSuccess(e,b))).catch((e=>M?(this.logger&&this.logger.info(e,"Refresh fails, trying log-in instead"),this._doLogin().then((e=>this._getTokenSuccess(e,b))).catch((e=>this._getTokenFail(e,t)))):this._getTokenFail(e,t)))))}_opByIds(e,M){if("string"==typeof e||Array.isArray(e)&&1===e.length){const b=Array.isArray(e)?e[0]:e;return this.submitRequest("GET",M,{},{params:{id:new p.Ref(b).toHSZINC()}})}if(Array.isArray(e)){if(e.length>1){for(const M of e)if("string"!=typeof M){if(!(M instanceof Object))throw new Error(`Parameter 'ids' contains an element that is not a string. Found ${typeof M}.`);try{new p.Ref(M)}catch(e){throw new Error(`Parameter 'ids' contains an element that is of type object but not compatible with class Ref due to: ${e.message}`)}}return this.submitRequest("POST",M,{meta:{ver:"2.0"},cols:[{name:"id"}],rows:e.map((function(e){return{id:new p.Ref(e).toHSJSON()}}))})}throw new Error("An empty array of id's was given.")}throw new Error("Parameter 'ids' is neither a single id or an array of id's.")}_byFilter(e,M,b){if(b<0)throw new Error("Invalid negative limit given.");if("string"!=typeof M)throw new Error(`Invalid filter type ${typeof M} given. Expected string.`);return this.submitRequest("POST",`/api/${e}`,{meta:{ver:"2.0"},cols:[{name:"filter"},{name:"limit"}],rows:[{filter:`s:${M}`,limit:`n:${b}`}]})}read(e){return this._opByIds(e,"/api/read")}query(e){let M={query:e=o.outerBraces(e)};return this.submitRequest("POST","/graphql",M)}find(e,M=0){return this._byFilter("read",e,M)}reloadCache(){return this.submitRequest("GET","/api/reloadAuthCache")}_create_or_update(e,M){Array.isArray(M)||(M=[M]);let b=[],t={},p="2.0";if(M.forEach((function(e){Object.keys(e).forEach((function(M){t[M]||(t[M]=!0),Array.isArray(e[M])&&(p="3.0")}))})),!t.id&&"updateRec"===e)throw this.logger&&this.logger.trace(M,"Entities lacks id column"),new Error("id is missing");return _.forEach((e=>{t[e]&&(b.push(e),delete t[e])})),b=[...b,...Object.keys(t).sort()],this.submitRequest("POST",`/api/${e}`,{meta:{ver:p},cols:b.map((function(e){return{name:e}})),rows:M})}create(e){return this._create_or_update("createRec",e)}update(e){return this._create_or_update("updateRec",e)}createUser(e,M,b,t,p=null,o=R.LOCAL){if(this.logger&&this.logger.trace("Creating a new user: "+e),e.length<1)throw new Error("Email cannot be empty.");if(b.length<1)throw new Error("Description cannot be empty.");if(!1===Array.isArray(t))throw new Error("Roles must be an array.");if(0===t.length)throw new Error("At least one roles must be set.");if(o!==R.LOCAL&&o!==R.SCRAM)throw new Error("Auth method can only be LOCAL or SCRAM.");return this.submitRequest("PUT","/api/admin/user",{email:e,name:M,description:b,roles:t,password:p,method:o})}updatePassword(e){if(this.logger&&this.logger.trace("Updating password"),!e)throw new Error("New password cannot be empty.");return this.submitRequest("POST","/user/updatePassword",{newPassword:e})}deleteById(e){return this._opByIds(e,"/api/deleteRec")}deleteByFilter(e,M=0){return this._byFilter("deleteRec",e,M)}hisRead(e,M,b,t=50){let o;if(void 0!==b){if(!(M instanceof Date))throw new Error("`from` is not a Date");if(!(b instanceof Date))throw new Error("`to` is not a Date");o=M.toHSZINC()+","+b.toHSZINC()}else o=M;if(Array.isArray(e)||(e=[e]),o=o.toHSZINC(),(e=e.map((function(e){return new p.Ref(e).toHSJSON()}))).lengththis._hisRead(e,o).then((M=>{this._mergeHisReadRes(r,c,e,M)}))))).then((()=>{let e=Object.keys(c.rowTs).map((e=>parseInt(e)));return e.sort(),r.rows=e.map((function(e){return c.rowTs[e]})),r}))}_mergeHisReadRes(e,M,b,t){let o=p.parse(t.meta.hisStart),z=p.parse(t.meta.hisEnd);null!=o&&o instanceof Date&&(o=o.valueOf(),(null==M.hisStart||M.hisStart>o)&&(M.hisStart=o,e.meta.hisStart=t.meta.hisStart)),null!=z&&z instanceof Date&&(z=z.valueOf(),(null==M.hisEnd||M.hisEnd{b.params["id"+M]=new p.Ref(e).toHSZINC()})),this.submitRequest("GET","/api/hisRead",{},b)}hisWrite(e){const M={},b=[{name:"ts"}],t=Object.keys(e).map((function(t){const p=e[t],o={ts:t};return Object.keys(p).sort().forEach((e=>{let t=M[e];void 0===t&&(t="v"+(b.length-1),b.push({name:t,id:e}),M[e]=t),o[t]=p[e]})),o})).sort(((e,M)=>e.tsM.ts?1:0));return this.submitRequest("POST","/api/hisWrite",{meta:{ver:"2.0"},cols:b,rows:t})}fileUpload(e,M,b,t,p,o=!0,z=1800,n=!1,c={}){if("string"==typeof b)b=r.createReadStream(b);else if(!Buffer.isBuffer(b))throw new Error("File can only be a buffer or an absolute file path (string).");if("string"!=typeof t)throw new Error("File name must be a string.");if("boolean"!=typeof n)throw new Error("Force must be of type boolean.");if("boolean"!=typeof o)throw new Error("InlineRetrieval must be of type boolean.");if("number"!=typeof z)throw new Error("CacheMaxAge must be of type number.");if(z<0)throw new Error("CacheMaxAge must be more than or equals to 0.");if("object"!=typeof c)throw new Error(`Tags must be an object not ${typeof c}.`);const O=[],i=Object.keys(c);for(let e=0;e({id:`r:${e}`})));return this.submitRequest("POST","/api/watchSub",{meta:{ver:"2.0",watchDis:`s:${b}`,lease:M},cols:[{name:"id"}],rows:p},t)}watchExtend(e,M,b,t={}){Array.isArray(M)||(M=[M]);const p=M.map((e=>({id:`r:${e}`})));return this.submitRequest("POST","/api/watchSub",{meta:{ver:"2.0",watchId:`s:${e}`,lease:b},cols:[{name:"id"}],rows:p},t)}watchUnsub(e,M,b=!0,t={}){Array.isArray(M)||(M=[M]);const p={meta:{ver:"2.0",watchId:"s:"+e},cols:[],rows:[]};if(M.length>0){p.cols.push({name:"id"});for(let e=0;e0))throw new Error("`ids` must contain at least one point UUID.");const b="An invalid hisRead range input was given: ";if(!M.startsWith("s:"))throw new Error(b+"Missing `s:`.");const t=M.replace("s:","");if(""===t)throw new Error(b+"No range was given.");if("last"!==t&&"first"!==t&&"today"!==t&&"yesterday"!==t)if(t.includes(",")){const e=t.split(",");if(2!==e.length)throw new Error(b+"Number of timestamps cannot exceed 2.");for(const M in e)if(e[M].includes(" ")&&(e[M]=e[M].trimStart().split(" ")[0]),!z(e[M].trim(),z.ISO_8601).isValid())throw new Error(b+"Invalid ISO8601 timestamp.")}else if(!z(t,z.ISO_8601).isValid())throw new Error(b+"Invalid ISO8601 timestamp.");e=e.map((function(e){return new p.Ref(e).toHSJSON()}));const o={meta:{ver:"2.0"},cols:[{name:"range"}],rows:[{range:M}]};return 1===e.length?(o.rows[0].id=new p.Ref(e[0]).toHSJSON(),o.cols.push({name:"id"})):e.forEach(((e,M)=>{o.rows[0]["id"+M]=new p.Ref(e).toHSJSON(),o.cols.push({name:"id"+M})})),this.submitRequest("POST","/api/hisDelete",o,{})}async entityCount(e){const M=`\n{\n haystack {\n search(filter: "${e.replaceAll('"','\\"')}", limit: 0) {\n count\n }\n }\n}\n`;return Number((await this.query(M)).data.haystack.search.count)}async findAsId(e,M=0){const b=`\n{\n haystack {\n search(filter: "${e.replaceAll('"','\\"')}", limit: ${M}) {\n entity {\n id\n }\n }\n }\n}\n`;return(await this.query(b)).data.haystack.search.entity.map((e=>e.id))}}e.exports=y},6631:(e,M,b)=>{const{deriveFromDefaults:t,PERFORM_OP_IN_BATCH_SCHEMA:p,BATCH_HIS_WRITE_SCHEMA:o,BATCH_HIS_READ_SCHEMA:z,BATCH_HIS_DELETE_SCHEMA:n,BATCH_CREATE_SCHEMA:r,BATCH_UPDATE_SCHEMA:c,BATCH_DELETE_BY_ID_SCHEMA:O,BATCH_DELETE_BY_FILTER_SCHEMA:a,BATCH_HIS_READ_BY_FILTER_SCHEMA:i,BATCH_UPDATE_BY_FILTER_SCHEMA:s,BATCH_HIS_DELETE_BY_FILTER_SCHEMA:A,BATCH_MIGRATE_HISTORY_SCHEMA:u,BATCH_ADD_CHILDREN_BY_FILTER_SCHEMA:d,BATCH_MULTI_FIND_SCHEMA:q,BATCH_UPDATE_OR_CREATE_SCHEMA:l}=b(8458),f=b(4740),{sleep:W}=b(6312),h=b(6025),m=b(1721),_=["id","fqname"],L=["lastHisTime","lastHisVal","curVal","curStatus","curErr"];function R(e){const M=[];for(let b=0;b{const o=M.splice(0,t);return"hisDelete"===e?{next:p(o),size:o.length}:{next:[p(o),...b],size:o.length}},o=()=>M.length>0,this.isProgressEnabled&&(n=this.progressCreate(M.length));else{if("object"!=typeof M)throw new Error("First element of parameter should be of type Array or Object");{for(const[e,b]of Object.entries(M))if("object"!=typeof M)throw new Error("Object payload structure for batch operation is malformed");const e=Object.keys(M),r=e.map((e=>Object.keys(M[e]).length)),c=[...r];let O=0;z=()=>{const o={};let z=0;for(;zt-z||i!==Object.keys(M[b]).length){void 0===o[b]&&(o[b]={});let e=0;const M=t-z;for(let t=i;t-i{for(;O{try{const p=await this[e](...M);t&&b.success.push(p)}catch(t){b.errors.push({error:t.message,args:[e,...M]})}finally{p()}}))}function B(e,M,b){let t=0,p=0;const o=e=>Date.parse(h.removePrefix(e));for(;e[t]&&o(e[t].ts)b);t++)p++;return p}function N(e,M,b){if(0===e.length||M>=e.length)return null;let t=M;for(;te.length-1&&(t=e.length-1),Date.parse(h.removePrefix(e[t].ts))}function v(e,M,b,t){const p=e.filter((e=>null!==e)).sort(((e,M)=>eM?1:0));let o,z,n;for(let e=0;eB(M,b,p[e]))),o=Math.max(...n),o>t){o=void 0;continue}if(o===t)break;continue}const r=M.map((M=>B(M,b,p[e]))),c=Math.max(...r);if(c===t){n=r,o=c,z=p[e];break}t>=c&&c>o&&(n=r,o=c,z=p[e])}return{endRange:z,deleteRowCounts:n}}function T(e,M){for(let b=0;bM[b])return!1;return!0}function w(e){let M=null;for(const b of e)if(b.length>0){if(null===M){M=Date.parse(h.removePrefix(b[0].ts));continue}const e=Date.parse(h.removePrefix(b[0].ts));eN(e[b],n[b],t))),{endRange:r,deleteRowCounts:c}=v(p,e,z.valueOf(),t),O=new Date(r+1);if(O.getTime()>o.getTime()){b.push([M,`s:${z.toISOString()},${o.toISOString()}`]);break}b.push([M,`s:${z.toISOString()},${O.toISOString()}`]),z=O;for(let e=0;e{const t={id:M.id};for(const[p,o]of Object.entries(M))_.includes(p)||L.includes(p)?b.debug("Ignoring tag %s and value %s for entity %s.",p,o,M.id):void 0===e[p]?t[p]=o:e[p]!==o&&(p.includes("Ref")||["metaOf"].includes(p)?h.getId(e,p)!==h.getId(M,p)&&(t[p]=o):t[p]=o);for(const b in e)_.includes(b)||L.includes(b)||void 0===M[b]&&(t[b]="x:");return t};e.exports={performOpInBatch:async function(e,M,b={}){await p.validate(b);const{batchSize:o,batchDelay:z,returnResult:n,parallel:r,parallelDelay:c}=t(this.clientOptions.performOpInBatch,b);let{transformer:O}=b;if(null==O&&(O=e=>e),!Array.isArray(M)||0===M.length)throw new Error("args parameter must be an array consisting of at least the payload to be batched");const a=M[0],i=M.slice(1),s={errors:[],success:[]},{getNext:A,hasMore:u,p1:d}=g.call(this,e,a,i,o,O);if(!u())return s;let q=0;for(;u();){let M=0;const b=[];for(let t=0;t0&&await W(z)}await Promise.all(b),this.isProgressEnabled&&d[this.clientOptions.progress.update](q+=M),c>0&&await W(c)}return s},hisWrite:async function(e,M={}){if(!["Object","HisWritePayload"].includes(e.constructor.name))throw new Error("parameter hisWriteData must be of type Object");let b,p;if(e instanceof f?(b=e.payload,p=e.size):(b=e,p=f.calculateSize(e)),0===p)throw new Error("Nothing to hisWrite");return await o.validate(M),M=t(this.clientOptions.batch.hisWrite,M),this.performOpInBatch("hisWrite",[b],M)},hisRead:async function(e,M,b,p={}){await z.validate(p),p=t(this.clientOptions.batch.hisRead,p);const{success:o,errors:n}=await this.performOpInBatch("hisRead",[[...e],M,b,p.batchSize],{...p,returnResult:!0}),r=R(e.length);for(let M=0;M{const b=Date.parse(h.removePrefix(e.ts)),t=Date.parse(h.removePrefix(M.ts));return b>t?1:bz){const M=[...e];for(;M.length;)r.push(M.splice(0,z))}else r.push(e);const c=[],O=R(r.length);for(let e=0;ee.length>0)).length&&k(p,t,O[e],o,w(p),b)}if(0===O.filter((e=>e.length>0)).length)return{success:[],errors:c};const a=[];for(const e of O)for(const M of e)a.push(M);const i=await this.performOpInBatch("hisDelete",[a],{...p,batchSize:1,transformer:e=>e[0]});return{success:i.success,errors:[...c,...i.errors]}},create:async function(e,M={}){return await r.validate(M),M=t(this.clientOptions.batch.create,M),this.performOpInBatch("create",[[...e]],M)},update:async function(e,M={}){return await c.validate(M),M=t(this.clientOptions.batch.update,M),this.performOpInBatch("update",[[...e]],M)},deleteById:async function(e,M={}){return await O.validate(M),M=t(this.clientOptions.batch.deleteById,M),this.performOpInBatch("deleteById",[[...e]],M)},deleteByFilter:async function(e,M=0,b={}){await a.validate(b),b=t(this.clientOptions.batch.deleteByFilter,b);try{return this.performOpInBatch("deleteById",[await this.findAsId(e,M)],b)}catch(b){return{success:[],errors:[{error:b.message,args:["findAsId",e,M]}]}}},hisReadByFilter:async function(e,M,b,p={}){await i.validate(p),p=t(this.clientOptions.batch.hisReadByFilter,p);const{limit:o}=p;try{return this.batch.hisRead(await this.findAsId(e,o),M,b,p)}catch(M){return{success:[],errors:[{error:M.message,args:["findAsId",e,o]}]}}},updateByFilter:async function(e,M,b={}){for(const e of M)if(!(e instanceof m))throw new Error("Element of parameter 'criteriaList' is not of class EntityCriteria");await s.validate(b),b=t(this.clientOptions.batch.updateByFilter,b);const{limit:p}=b;let o;try{o=await this.v2.find(e,p)}catch(M){return{success:[],errors:[{error:M.message,args:["v2.find",e,p]}]}}const z=[];for(const e of o){const b={id:e.id};for(const t of M)t.isValid(e)&&t.applyChanges(b,e);Object.keys(b).length>1&&z.push(b)}return this.performOpInBatch("update",[z],b)},hisDeleteByFilter:async function(e,M,b,p={}){await A.validate(p),p=t(this.clientOptions.batch.hisDeleteByFilter,p);const{limit:o}=p;try{return this.batch.hisDelete(await this.findAsId(e,o),M,b,p)}catch(M){return{success:[],errors:[{error:M.message,args:["findAsId",e,o]}]}}},migrateHistory:async function(e,M,b={}){await u.validate(b),b=t(this.clientOptions.batch.migrateHistory,b);const p=new Date(0),o=new Date(Date.now()),z=await this.batch.hisRead([e],p,o);if(z.errors.length)return z;const{success:[n],errors:r}=z,c=new f;return c.add(`r:${M}`,n),this.batch.hisWrite(c,b)},addChildrenByFilter:async function(e,M,b=[],p={}){if(!Array.isArray(M)||M.filter((e=>"object"!=typeof e)).length)throw new Error("parameter children is not an Array of Objects");if(0===M.length)throw new Error("parameter children is an empty Array");if(!Array.isArray(b)||b.filter((e=>!Array.isArray(e)||2!==e.length)).length)throw new Error("parameter refTags is not a 2D Array as specified");await d.validate(p),p=t(this.clientOptions.batch.addChildrenByFilter,p);const{limit:o}=p,z=await this.v2.find(e,o),n=[];for(const e of z)for(const t of JSON.parse(JSON.stringify(M))){let M=!1;for(const[p,o]of b)void 0!==e[p]&&(M=!0,t[o]=e[p]);M&&n.push(t)}if(n.length>0)return this.performOpInBatch("create",[n],p)},multiFind:async function(e,M={}){if(!Array.isArray(e)||e.filter((e=>!Array.isArray(e)||0===e.length)).length)throw new Error("parameter filterAndLimits is not a 2D Array as specified");await q.validate(M),M=t(this.clientOptions.batch.multiFind,M);const{limit:b}=M,p=[];for(let M=0;M`\n{\n haystack {\n ${e.join("\n")}\n }\n}\n `}),n=[];for(const e of o)for(const M of Object.values(e.data.haystack)){const e=[];for(const b of M.entity){const M={};for(const{name:e,value:t,kindValue:p}of b.tags){let b="Zero";null!=p&&(b=p.__typename),M[e]=h.toHaystack(t,b)}e.push(M)}n.push(e)}return{success:n,errors:z}},updateOrCreate:async function(e,M={}){if(!Array.isArray(e))throw new Error("parameter entities is not an Array");if(0===e.length)return this.logger.debug("No entities given."),{success:[],errors:[]};await l.validate(M),M=t(this.clientOptions.batch.updateOrCreate,M);const{returnResult:b}=M,p=[],o=[];let z=[];const n=new Array(e.length),r=[];for(let M=0;M1?o.push(e):b&&z.push(t)}}if(0===p.length&&0===o.length)return this.logger.debug("Nothing to update or create."),{success:e,errors:[]};const a=[];p.length>0?(this.logger.debug("Creating %d entities.",p.length),a.push(this.batch.create(p,M))):this.logger.debug("Nothing to create."),o.length>0?(this.logger.debug("Updating %d entities.",o.length),a.push(this.batch.update(o,M))):this.logger.debug("Nothing to update");const i=[];for(const{success:e,errors:M}of await Promise.all(a)){if(e.length&&b)for(const{rows:M}of e)for(const e of M)z.push(e);for(const e of M)i.push(e)}return{success:z,errors:i}}}},2743:e=>{e.exports={find:async function(e,M=0){return(await this.find(e,M)).rows}}},1317:(e,M,b)=>{"use strict";const t=b(7159),p=b(1937),o=b(8470),z=b(9747),n=b(9442),r=b(5943),c=new p,O=new z,a=new o;function i(e,M){var b={};return M&&(e=Object.assign({},e),b[M]=e[M],delete e[M]),Object.keys(e).forEach((M=>{b[M]=A(e[M])})),b}function s(e,M,b){const t={};return M&&(e=Object.assign({},e),t[M]=e[M],delete e[M]),Object.keys(e).forEach((M=>{t[M]=u(e[M],b)})),t}function A(e){return null===e||"boolean"==typeof e?e:void 0===e?null:"string"==typeof e?function(e){if("m:"===e)return c;if("z:"===e)return a;if("x:"===e||"-:"===e)return O;const M=e.substring(0,2);return"n:"===M?Number.fromHS(e):"r:"===M?new n(e):"s:"===M?String.fromHS(e):"t:"===M?Date.fromHS(e):e}(e):"object"==typeof e?Array.isArray(e)?e.map((e=>A(e))):e.hasOwnProperty("meta")&&e.hasOwnProperty("cols")&&e.hasOwnProperty("rows")?function(e){const M={};return M.meta=i(e.meta,"ver"),M.cols=e.cols.map((e=>i(e,"name"))),M.rows=e.rows.map((e=>i(e))),M}(e):i(e):void 0}function u(e,M){return null===e||"boolean"==typeof e?e:void 0===e?null:"function"==typeof e.toHSJSON?e.toHSJSON(M):"object"==typeof e?Array.isArray(e)?function(e,M){return e.map((e=>u(e,M)))}(e,M):e.hasOwnProperty("meta")&&e.hasOwnProperty("cols")&&e.hasOwnProperty("rows")?function(e,M){const b={};return b.meta=s(e.meta,"ver",e.meta.ver),b.cols=e.cols.map((M=>s(M,"name",e.meta.ver))),b.rows=e.rows.map((M=>s(M,void 0,e.meta.ver))),b}(e):s(e,void 0,M):void 0}String.fromHS=function(e){return e.startsWith("s:")||e.startsWith("u:")?e.substring(2):e.startsWith('"')&&e.endsWith('"')?JSON.parse(e):e},String.prototype.toHSJSON=function(){return"s:"+this},String.prototype.toHSZINC=function(){return t(this,{quotes:"double",wrap:!0})},Date.fromHS=function(e){var M=e.indexOf(" ");return M>=0&&(e=e.substring(0,M)),e.startsWith("t:")&&(e=e.substring(2)),new Date(Date.parse(e))},Date.prototype.toHSJSON=function(){return"t:"+this.toJSON()+" UTC"},Date.prototype.toHSZINC=function(){return this.toJSON()+" UTC"},Number.fromHS=function(e){return new r(e)},Number.prototype.toHSNumber=function(e){return new r(this,e)},Number.prototype.toHSJSON=function(){return this.toHSNumber().toHSJSON()},Number.prototype.toHSZINC=function(){return this.toHSNumber().toHSZINC()},e.exports={VER_2:"2.0",VER_3:"3.0",MARKER:c,NA:a,REMOVE:O,Ref:n,HSNumber:r,String,Number,Date,parse:A,dump:u}},5943:e=>{"use strict";const M=/^(-?\d+|-?\d+\.\d+|-?\d+[eE]\d+|-?\d+\.\d+[eE]\d+|-?\d+[eE]\d+)([^\.]*)$/;e.exports=class{constructor(e,b){if("object"==typeof e){if("number"!=typeof e.value)throw new Error("clonee 'value' property must be a number");if(e.unit&&"string"!=typeof e.unit)throw new Error("clonee 'unit' property must be a string or undefined");this.value=e.value,this.unit=e.unit}else if("number"==typeof e)this.value=e,this.unit=b||void 0;else if(e.startsWith("n:")){const M=e.indexOf(" ");let b,t=null;M>=0?(t=e.substring(2,M),b=e.substring(M+1)):t=e.substring(2),t.indexOf(".")>=0?(this.value=Number.parseFloat(t),this.unit=b):(this.value=Number.parseInt(t),this.unit=b)}else{let b=e.match(M);b[1].indexOf(".")>=0?this.value=Number.parseFloat(b[1]):this.value=Number.parseInt(b[1]),this.unit=b[2]||void 0}}toHSJSON(){let e="n:"+this.value.toString();return void 0!==this.unit&&(e+=" "+this.unit),e}toHSZINC(){let e=this.value.toString();return void 0!==this.unit&&(e+=this.unit),e}}},1937:e=>{"use strict";e.exports=class{HS_JSON_STR="m:";HS_ZINC_STR="M";toHSJSON(){return this.HS_JSON_STR}toHSZINC(){return this.HS_ZINC_STR}}},8470:e=>{"use strict";e.exports=class{HS_JSON_STR="z:";HS_ZINC_STR="NA";toHSJSON(){return this.HS_JSON_STR}toHSZINC(){return this.HS_ZINC_STR}}},9442:e=>{"use strict";e.exports=class{HS_ZINC_PREFIX="@";HS_JSON_PREFIX="r:";constructor(e,M){if("object"==typeof e){if(void 0!==M)throw new Error("clone constructor takes a Ref only");if("string"!=typeof e.id)throw new Error("clonee object 'id' property must be a string");if(e.dis&&"string"!=typeof e.dis)throw new Error("clonee object 'dis' property must be null or a string");this.id=e.id,this.dis=e.dis}else{if("string"!=typeof e)throw new Error("id is not a string");var b=e.indexOf(" ");if(b>=0){if(void 0!==M)throw new Error("id may not contain spaces");M=e.substring(b+1),e=e.substring(0,b)}if(e.startsWith(this.HS_JSON_PREFIX))this.id=e.substring(2);else if(e.startsWith(this.HS_ZINC_PREFIX)){if(this.id=e.substring(1),M){if(!M.startsWith('"')||!M.endsWith('"'))throw new Error("dis must be a valid ZINC string");M=JSON.parse(M)}}else this.id=e;this.dis=M||null}}toHSJSON(){let e=this.HS_JSON_PREFIX+this.id;return this.dis&&(e+=" "+this.dis),e}toHSZINC(){let e=this.HS_ZINC_PREFIX+this.id;return this.dis&&(e+=" "+this.dis.toHSZINC()),e}}},9747:e=>{"use strict";e.exports=class{HS_JSON_V2_STR="x:";HS_JSON_V3_STR="-:";HS_ZINC_STR="R";toHSJSON(e){return"3.0"===e?this.HS_JSON_V3_STR:this.HS_JSON_V2_STR}toHSZINC(){return this.HS_ZINC_STR}}},1910:(e,M,b)=>{const t=b(2543);class p extends Error{constructor(e,M){super(e),this.stack+=M.stack.substring(M.stack.indexOf("\n"))}static make(e,M){if(t.has(e,"response.data")){const{data:b}=e.response;if(t.has(b,"meta.dis"))return new o(b.meta.dis.substring(2),e);if(void 0!==b.errors&&Array.isArray(b.errors)&&b.errors.length>0){let t="More than 1 GraphQLError encountered";return 1===b.errors.length&&(t=b.errors[0].message),M.debug("Raw GraphQL error response: %j",b),new z(t.replace(/\n/g,""),e)}return e}return e}}class o extends p{constructor(e,M){super(e,M)}}class z extends p{constructor(e,M){super(e.replace(/\n/g,""),M),this.errors=[];for(const e of M.response.data.errors){const{message:M,locations:b}=e,t=b.map((e=>`line ${e.line}:${e.column}`));this.errors.push(`${M.replace(/\n/g," ")} @ location/s ${t.join(", ")}`)}}}e.exports={RequestError:p,HaystackError:o,GraphQLError:z}},1031:(e,M,b)=>{"use strict";b(2543);const t=b(4743);class p{static parseDt(e,M){let b;t.suppressDeprecationWarnings=!0;let o=t(e);return b=o.isValid()?o.tz(M).toISOString():p.asWideskyDT(e,M),b}static asWideskyDT(e,M){let b=e.split(""),o={current:0};if(p.isKeywordNow(b,o)){p.consumeChar(o),p.consumeChar(o),p.consumeChar(o),p.consumeWhitespaces(b,o);let z=t().tz(M);for(;p.hasChar(b,o);)if(p.isKeywordAdd(b,o)){p.consumeChar(o),p.consumeWhitespaces(b,o);let M=p.consumeNumbers(b,o);if(!M)throw new Error(`Invalid datetime expression ${e}.\nExpecting numbers followed by the + sign.`);p.consumeWhitespaces(b,o);let t=p.consumeDatetimeUnit(b,o);if(!t)throw new Error(`Invalid datetime expression ${e}.\nMissing unit after '+${M}'`);let n=p.toMomentUnit(t);if(z.add(Number.parseInt(M),n),p.hasChar(b,o)){if(!p.isKeywordSuffixInd(b,o))throw new Error(`Invalid datetime expression ${e}.\nExpecting a datetime unit after the '/' char.`);{p.consumeChar(o),p.consumeWhitespaces(b,o);let M=p.consumeDatetimeUnit(b,o);if(p.hasChar(b,o))throw new Error(`Invalid datetime expression ${e}.\nUnexpected value found after /${M}.`);let t=p.toMomentUnit(M);z.startOf(t)}}}else if(p.isKeywordSub(b,o)){p.consumeChar(o),p.consumeWhitespaces(b,o);let M=p.consumeNumbers(b,o);if(!M)throw new Error(`Invalid datetime expression ${e}.\nExpecting numbers followed by the - sign.`);p.consumeWhitespaces(b,o);let t=p.consumeDatetimeUnit(b,o);if(!t)throw new Error(`Invalid datetime expression ${e}.\nMissing unit after '-${M}'`);let n=p.toMomentUnit(t);if(z.subtract(Number.parseInt(M),n),p.hasChar(b,o)){if(!p.isKeywordSuffixInd(b,o))throw new Error(`Invalid datetime expression ${e}.\nExpecting a datetime unit after the '/' char.`);{p.consumeChar(o),p.consumeWhitespaces(b,o);let M=p.consumeDatetimeUnit(b,o);if(p.hasChar(b,o))throw new Error(`Invalid datetime expression ${e}.\nUnexpected value found after /${M}.`);let t=p.toMomentUnit(M);z.startOf(t)}}}else{if(!p.isKeywordSuffixInd(b,o))throw new Error(`Invalid datetime expression ${e}.\nExpecting '+','-' or '/' sign after now.`);{p.consumeChar(o),p.consumeWhitespaces(b,o);let e=p.consumeDatetimeUnit(b,o);p.consumeWhitespaces(b,o);let M=p.toMomentUnit(e);z.startOf(M)}}return z.toISOString()}throw new Error(`Invalid date time expression(${e}), it must start with keyword 'now'`)}static hasChar(e,M){let b=!0;return void 0===e[M.current]&&(b=!1),b}static toMomentUnit(e){let M;return"m"===e?M="minutes":"s"===e?M="seconds":"d"===e?M="days":"h"===e?M="hours":"M"===e&&(M="months"),M}static consumeDatetimeUnit(e,M){let b=null,t=e[M.current];if(p.isKeywordSec(t))b="s";else if(p.isKeywordMin(t))b="m";else if(p.isKeywordHour(t))b="h";else if(p.isKeywordDay(t))b="d";else{if(!p.isKeywordMonth(t))return b;b="M"}return p.consumeChar(M),b}static consumeNumbers(e,M){let b="",t=0;for(let p=M.current;p{"use strict";const t=b(2543),p=function(e,M,b,t,p){b.forEach(((b,z)=>{o(e,M,b,`${t}[${z}]`,p)}))},o=function(e,M,b,z,n){for(let r in b){if(!t.has(b,r))continue;if(r===M&&(n.target={},n.target[r]=b[r],n.path=`${z.slice(1)}.${r}`,!e))return;const c=b[r];t.isArray(c)?p(e,M,c,`${z}.${r}`,n):t.isObject(c)&&o(e,M,c,`${z}.${r}`,n)}};e.exports=class{static node(e,M,b){const p={target:null,path:""};if(t.isString(M))try{M=JSON.parse(M)}catch(M){e=null}return e&&o(b,e,M,"",p),p}static timeseriesNode(e,M){const b={target:null,path:""};if(t.isString(M))try{M=JSON.parse(M)}catch(M){e=null}if(e){const t={target:null,path:""};o(!1,e,M,"",t),t.target&&(o(!0,"timeSeries",t.target,"",b),b.target&&(b.path=t.path.replace(e,"")+b.path))}return b}}},55:(e,M,b)=>{"use strict";const t=b(2543),p=/history(.*){/g;e.exports=class{static outerBraces(e){let M=t.trimStart(e);return t.startsWith(M,"{")||(e=`{ ${e} }`),e}static filterVar(e,M,b){M=t.trimStart(M),t.startsWith(M,"$")||(M=`$${M}`),M="\\"+M;const p=new RegExp(M,"g");return e.replace(p,b)}static timeVars(e,M,b){return t.replace(e,p,(e=>(M&&(e=t.replace(e,"$from",M)),b&&(e=t.replace(e,"$to",b)),e)))}}},1721:e=>{e.exports=class{constructor(e,M,b){this.name=e,this.conditionalFunc=M,this.resultFunc=b}isValid(e){return this.conditionalFunc(e)}applyChanges(e,M){this.resultFunc(e,M)}}},8458:(e,M,b)=>{const t=b(2664),p=2e3,o=1e4,z=2e3,n=1e4;const r={limit:t.number().nullable().notRequired().default(0).strict().min(0)},c=(e,M=e,b="batchSize")=>({[b]:t.number().notRequired().nullable().strict().min(1).max(M).default(e)}),O=e=>({returnResult:t.boolean().strict().default(e)}),a={...c(100,10**9),batchDelay:t.number().notRequired().nullable().strict().min(0).default(0),parallel:t.number().strict().min(1).max(100).default(1),parallelDelay:t.number().notRequired().nullable().strict().min(0).default(0)},i=t.object({...a}),s=t.object({...a,...c(1e4,2e4),...O(!1)}),A=t.object({...a,...c(1500,3e3),...c(100,1e3,"batchSizeEntity"),...O(!1)}),u=t.object({...a,...c(p,o),...O(!1)}),d=t.object({...a,...c(z,n),...O(!1)}),q=t.object({...a,...c(30,100),...O(!1)}),l=t.object({...a,...c(30,100),...O(!1)}),f=t.object({...a,...c(100,1e3),...r}),W=t.object({...a,...c(p,o),...O(!1),...r}),h=t.object({...a,...c(z,n),...O(!1),...r}),m=t.object({...a,...c(1500,3e3),...c(100,1e3,"batchSizeEntity"),...O(!1),...r}),_=t.object({...a,...c(1e4,2e4),...O(!1)}),L=t.object({...a,...c(Math.min(p,z),Math.min(o,n)),...O(!0)}),R=t.object({...a,...c(10,200),...r}),y=t.object({...a,...O(!1)}),g={enable:t.boolean().nullable().notRequired().strict().default(!1),increment:t.string().nullable().notRequired().strict().default("increment"),create:t.string().nullable().notRequired().strict().default("create"),update:t.string().nullable().notRequired().strict().default("update")},D=t.object({impersonateAs:t.string().nullable().notRequired().strict().default(null),acceptGzip:t.boolean().nullable().notRequired().strict().default(!0),progress:t.object(g),batch:t.object({hisRead:i,hisWrite:s,hisDelete:A,create:u,update:d,deleteById:q,deleteByFilter:l,hisReadByFilter:f,addChildrenByFilter:W,updateByFilter:h,migrateHistory:_,hisDeleteByFilter:m,updateOrCreate:L,multiFind:R}),performOpInBatch:y});e.exports={CLIENT_SCHEMA:D,PERFORM_OP_IN_BATCH_SCHEMA:y,BATCH_HIS_WRITE_SCHEMA:s,BATCH_HIS_READ_SCHEMA:i,BATCH_HIS_DELETE_SCHEMA:A,BATCH_CREATE_SCHEMA:u,BATCH_UPDATE_SCHEMA:d,BATCH_DELETE_BY_ID_SCHEMA:q,BATCH_DELETE_BY_FILTER_SCHEMA:l,BATCH_HIS_READ_BY_FILTER_SCHEMA:f,BATCH_UPDATE_BY_FILTER_SCHEMA:h,BATCH_HIS_DELETE_BY_FILTER_SCHEMA:m,BATCH_MIGRATE_HISTORY_SCHEMA:_,BATCH_ADD_CHILDREN_BY_FILTER_SCHEMA:W,BATCH_MULTI_FIND_SCHEMA:R,BATCH_UPDATE_OR_CREATE_SCHEMA:L,deriveFromDefaults:function(e,M){for(const[b,t]of Object.entries(e))void 0===M[b]&&(M[b]=t);return M}}},6025:(e,M,b)=>{const{validate:t}=b(2831);function p(e){if("string"!=typeof e&&!(e instanceof String))throw new Error("Value is not of type String");return":"===e[1]?e.substring(2):e}function o(e,M=null){let b;if(M){if(void 0===e[M])throw new Error(`Entity does not have tag ${M}`);if("r:"!==e[M].substring(0,2))throw new Error(`Entity tag ${M} is not a reference tag`);b=p(e[M])}else{if(void 0===e.id)throw new Error("No id present on the entity");b=p(e.id)}return b.includes(" ")?b.substring(0,b.indexOf(" ")):b}e.exports={removePrefix:p,getReadableName:function(e){return void 0!==e.fqname?p(e.fqname):o(e)},getId:o,toHaystack:function e(M,b){switch(b){case"Str":return`s:${M}`;case"Ref":return`r:${M}`;case"Number":return`n:${M}`;case"Marker":return"m:";case"Coord":return`c:${M}`;case"Time":return`h:${M}`;case"Date":return`d:${M}`;case"DateTime":return`t:${M}`;case"Zero":return"z:";case"Bool":return`${M}`;case"Uri":return`u:${M}`;case"List":return M.substring(1,M.length-1).split(",").map((e=>e.trim())).map((M=>t(M)?e(M,"Ref"):e(M,"Str")));default:throw new Error(`Unknown kind ${b} for value ${M}`)}}}},4740:e=>{class M{#o;#z;constructor(e={}){this.#o=e,this.#z=0===Object.keys(e).length?0:M.calculateSize(e)}static calculateSize(e){let M=0;for(const[b,t]of Object.entries(e))M+=Object.keys(t).length;return M}get payload(){return this.#o}get size(){return this.#z}add(e,M){for(const{ts:b,val:t}of M){if(void 0===b)throw new Error("Row in data missing 'ts' property");if(void 0===t)throw new Error("Row in data missing 'val' property");void 0===this.payload[b]&&(this.payload[b]={});let M=t;if("n:"===t.substring(0,2)&&t.includes(" ")){-1!==t.indexOf(" ")&&(M=t.substring(0,t.indexOf(" ")))}this.#o[b][e]=M,this.#z++}}reset(){this.#o={},this.#z=0}}e.exports=M},6312:e=>{e.exports={sleep:function(e){return new Promise((M=>setTimeout(M,e)))}}},3059:e=>{function M(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=M,M.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var M=Math.random(),b=Math.floor(M*this.jitter*e);e=1&Math.floor(10*M)?e+b:e-b}return 0|Math.min(e,this.max)},M.prototype.reset=function(){this.attempts=0},M.prototype.setMin=function(e){this.ms=e},M.prototype.setMax=function(e){this.max=e},M.prototype.setJitter=function(e){this.jitter=e}},3371:(e,M)=>{!function(e){"use strict";M.encode=function(M){var b,t=new Uint8Array(M),p=t.length,o="";for(b=0;b>2],o+=e[(3&t[b])<<4|t[b+1]>>4],o+=e[(15&t[b+1])<<2|t[b+2]>>6],o+=e[63&t[b+2]];return p%3==2?o=o.substring(0,o.length-1)+"=":p%3==1&&(o=o.substring(0,o.length-2)+"=="),o},M.decode=function(M){var b,t,p,o,z,n=.75*M.length,r=M.length,c=0;"="===M[M.length-1]&&(n--,"="===M[M.length-2]&&n--);var O=new ArrayBuffer(n),a=new Uint8Array(O);for(b=0;b>4,a[c++]=(15&p)<<4|o>>2,a[c++]=(3&o)<<6|63&z;return O}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},3118:e=>{var M=void 0!==M?M:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,b=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),t=b&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),p=M&&M.prototype.append&&M.prototype.getBlob;function o(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var M=e.buffer;if(e.byteLength!==M.byteLength){var b=new Uint8Array(e.byteLength);b.set(new Uint8Array(M,e.byteOffset,e.byteLength)),M=b.buffer}return M}return e}))}function z(e,b){b=b||{};var t=new M;return o(e).forEach((function(e){t.append(e)})),b.type?t.getBlob(b.type):t.getBlob()}function n(e,M){return new Blob(o(e),M||{})}"undefined"!=typeof Blob&&(z.prototype=Blob.prototype,n.prototype=Blob.prototype),e.exports=b?t?Blob:n:p?z:void 0},7926:(e,M,b)=>{"use strict";var t=b(5606),p=b(8928),o=b(537),z=b(7797),n=b(7970),r=p.Writable;function c(e,M){if(!(this instanceof c))return new c(e,M);(e=e||{}).objectMode=!0,r.call(this,e),this.opts=n({outputMode:"short",color:!0,colorFromLevel:{10:"brightBlack",20:"brightBlack",30:"green",40:"magenta",50:"red",60:"brightRed"}},e),this.out=M||t.stdout}e.exports=c,o.inherits(c,r),c.prototype._write=function(e,M,b){var t;try{t=JSON.parse(e),this.out.write(z(t,this.opts))}catch(M){this.out.write(e)}b()}},7797:(e,M,b)=>{"use strict";var t=b(537),p=t.format,o=b(4348),z=b(7970),n=b(1999),r=z(b(9703),n),c={long:1,json:2,inspect:3,simple:4,short:5,bunyan:6},O={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},a={},i={},s={};function A(e){return null!==e.v&&null!==e.level&&null!==e.name&&null!==e.hostname&&null!==e.pid&&null!==e.time&&null!==e.msg}function u(e){return" "+e.split(/\r?\n/).join("\n ")}function d(e,M){if(!e)return"";var b=r[M];return b?b(e):e}function q(e,M){return e}function l(e){switch(e){case 10:return"TRACE";case 20:return"DEBUG";case 30:return"INFO";case 40:return"WARN";case 50:return"ERROR";case 60:return"FATAL"}}Object.keys(O).forEach((function(e){var M=O[e];a[M]=e,i[M]=e.toUpperCase(),s[M]=(4===e.length?" ":"")+e.toUpperCase()})),e.exports=function(e,M){function b(M){var b="";if(M.header)b+=M.header.trimRight();else if(M.headers){M.statusCode&&(b+=p("HTTP/1.1 %s %s\n",M.statusCode,o.STATUS_CODES[M.statusCode]));var t=M.headers;b+=Object.keys(t).map((function(e){return e+": "+t[e]})).join("\n")}delete M.header,delete M.headers,delete M.statusCode,M.body&&(b+="\n\n"+("object"==typeof M.body?JSON.stringify(M.body,null,2):M.body),delete M.body),M.trailer&&(b+="\n"+M.trailer),delete M.trailer,b&&g.push(u(b)),Object.keys(M).forEach((function(b){e["res."+b]=M[b]}))}var z,n=!1,r=e.line,O=M.color?d:q;switch(isNaN(M.outputMode)?c[M.outputMode]:M.outputMode){case 5:n=!0;case 1:if(!A(e))return r+"\n";delete e.v,z=n&&"T"==e.time[10]?O(z=e.time.substr(11),"brightBlack"):O("["+e.time+"]","brightBlack"),delete e.time;var a=e.name;delete e.name,e.component&&(a+="/"+e.component),delete e.component,n||(a+="/"+e.pid),delete e.pid;var f=s[e.level]||"LVL"+e.level;if(M.color)f=O(f,(M.colorFromLevel||{10:"brightBlack",20:"brightBlack",30:"cyan",40:"magenta",50:"red",60:"inverse"})[e.level]);delete e.level;var W,h,m="",_="";e.src&&e.src.file&&(m=O(m=(W=e.src).func?p(" (%s:%d in %s)",W.file,W.line,W.func):p(" (%s:%d)",W.file,W.line),"green")),delete e.src;var L=e.hostname;delete e.hostname;var R,y=[],g=[];if(e.req_id&&y.push("req_id="+e.req_id),delete e.req_id,-1!==e.msg.indexOf("\n")?(R="",g.push(u(O(e.msg,"cyan")))):R=" "+O(e.msg,"cyan"),delete e.msg,e.req&&"object"==typeof e.req){var D=e.req;delete e.req,h=D.headers,W=p("%s %s HTTP/%s%s",D.method,D.url,D.httpVersion||"1.1",h?"\n"+Object.keys(h).map((function(e){return e+": "+h[e]})).join("\n"):""),delete D.url,delete D.method,delete D.httpVersion,delete D.headers,D.body&&(W+="\n\n"+("object"==typeof D.body?JSON.stringify(D.body,null,2):D.body),delete D.body),D.trailers&&Object.keys(D.trailers)>0&&(W+="\n"+Object.keys(D.trailers).map((function(e){return e+": "+D.trailers[e]})).join("\n")),delete D.trailers,g.push(u(W)),Object.keys(D).forEach((function(M){e["req."+M]=D[M]}))}if(e.client_req&&"object"==typeof e.client_req){var B=e.client_req;delete e.client_req,h=B.headers,W="",B.address&&(_="Host: "+B.address,B.port&&(_+=":"+B.port),_+="\n"),delete B.headers,delete B.address,delete B.port,W+=p("%s %s HTTP/%s\n%s%s",B.method,B.url,B.httpVersion||"1.1",_,h?Object.keys(h).map((function(e){return e+": "+h[e]})).join("\n"):""),delete B.method,delete B.url,delete B.httpVersion,B.body&&(W+="\n\n"+("object"==typeof B.body?JSON.stringify(B.body,null,2):B.body),delete B.body),Object.keys(B).forEach((function(M){e["client_req."+M]=B[M]})),g.push(u(W))}e.res&&"object"==typeof e.res&&(b(e.res),delete e.res),e.client_res&&"object"==typeof e.client_res&&(b(e.client_res),delete e.res),e.err&&e.err.stack&&(g.push(u(e.err.stack)),delete e.err);for(var N=Object.keys(e),v=0;v50?g.push(u(T+": "+w)):k||-1==w.indexOf(" ")&&0!==w.length?y.push(T+"="+w):y.push(T+"="+JSON.stringify(w))}return y=O(y.length?" ("+y.join(", ")+")":"","brightBlack"),g=O(g.length?g.join("\n --\n")+"\n":"","brightBlack"),n?p("%s %s %s:%s%s\n%s",z,f,a,R,y,g):p("%s %s: %s on %s%s:%s%s\n%s",z,f,a,L||"",m,R,y,g);case 3:return t.inspect(e,!1,1/0,!0)+"\n";case 6:return M.levelInString&&(e.level=l(e.level)),JSON.stringify(e,null,0)+"\n";case 2:return M.levelInString&&(e.level=l(e.level)),JSON.stringify(e,null,M.jsonIndent)+"\n";case 4:return A(e)?p("%s - %s\n",i[e.level]||"LVL"+e.level,e.msg):r+"\n";default:throw new Error("unknown output mode: "+M.outputMode)}}},5667:(e,M,b)=>{var t,p,o,z,n=b(5606),r=0,c=function(e){["XXX: "+e].concat(Array.prototype.slice.call(arguments,1))};c=function(){};if(void 0!==n&&n.versions&&(n.versions.nw?t="nw":n.versions.node&&(t="node")),t||"undefined"==typeof window||window.window!==window||(t="browser"),!t)throw new Error("unknown runtime environment");if("browser"===t)p={hostname:function(){return window.location.host}},o={},z=null;else{p=b(4234),o=b(2947);try{z=b(7093)}catch(e){z=null}}var O=b(537),a=b(9666),i=b(7007).EventEmitter,s=b(9428);try{var A=b(1401)}catch(e){A=null}n.env.BUNYAN_TEST_NO_SAFE_JSON_STRINGIFY&&(A=null);try{var u=b(6655)}catch(e){u=null}try{var d=b(1884)}catch(e){d=null}function q(e){if(null==e)return e;if(Array.isArray(e))return e.slice();if("object"==typeof e){var M={};return Object.keys(e).forEach((function(b){M[b]=e[b]})),M}return e}var l=O.format;if(!l){var f=O.inspect,W=/%[sdj%]/g;l=function(e){if("string"!=typeof e){for(var M=[],b=0;b=p)return e;switch(e){case"%s":return String(t[b++]);case"%d":return Number(t[b++]);case"%j":return j(t[b++]);case"%%":return"%";default:return e}})),z=t[b];b=0,l('rotating-file stream "count" is not >= 0: %j in %j',this.count,this)),e.period){var M={hourly:"1h",daily:"1d",weekly:"1w",monthly:"1m",yearly:"1y"}[e.period]||e.period,b=/^([1-9][0-9]*)([hdwmy]|ms)$/.exec(M);if(!b)throw new Error(l('invalid period: "%s"',e.period));this.periodNum=Number(b[1]),this.periodScope=b[2]}else this.periodNum=1,this.periodScope="d";var t=null;try{t=o.statSync(this.path).mtime.getTime()}catch(e){}var p=!1;t&&(t call rotate()"),this.rotate()):this._setupNextRot()},O.inherits(F,i),F.prototype._debug=function(){return!1},F.prototype._setupNextRot=function(){this.rotAt=this._calcRotTime(1),this._setRotationTimer()},F.prototype._setRotationTimer=function(){var e=this,M=this.rotAt-Date.now(),b=2147483647;M>b&&(M=b),this.timeout=setTimeout((function(){e._debug("_setRotationTimer timeout -> call rotate()"),e.rotate()}),M),"function"==typeof this.timeout.unref&&this.timeout.unref()},F.prototype._calcRotTime=function(e){this._debug("_calcRotTime: %s%s",this.periodNum,this.periodScope);var M,b=new Date;switch(this._debug(" now local: %s",b),this._debug(" now utc: %s",b.toISOString()),this.periodScope){case"ms":M=this.rotAt?this.rotAt+this.periodNum*e:Date.now()+this.periodNum*e;break;case"h":M=this.rotAt?this.rotAt+60*this.periodNum*60*1e3*e:Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate(),b.getUTCHours()+e);break;case"d":M=this.rotAt?this.rotAt+24*this.periodNum*60*60*1e3*e:Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()+e);break;case"w":if(this.rotAt)M=this.rotAt+7*this.periodNum*24*60*60*1e3*e;else{var t=7-b.getUTCDay();e<1&&(t=-b.getUTCDay()),(e>1||e<-1)&&(t+=7*e),M=Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()+t)}break;case"m":M=this.rotAt?Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+this.periodNum*e,1):Date.UTC(b.getUTCFullYear(),b.getUTCMonth()+e,1);break;case"y":M=this.rotAt?Date.UTC(b.getUTCFullYear()+this.periodNum*e,0,1):Date.UTC(b.getUTCFullYear()+e,0,1);break;default:a.fail(l('invalid period scope: "%s"',this.periodScope))}if(this._debug()){this._debug(" **rotAt**: %s (utc: %s)",M,new Date(M).toUTCString());var p=Date.now();this._debug(" now: %s (%sms == %smin == %sh to go)",p,M-p,(M-p)/1e3/60,(M-p)/1e3/60/60)}return M},F.prototype.rotate=function(){var e=this;if(e.rotAt&&e.rotAt>Date.now())return e._setRotationTimer();if(this._debug("rotate"),e.rotating)throw new TypeError("cannot start a rotation when already rotating");function M(){if(0===e.count||p<0)return b();var t=e.path,z=e.path+"."+String(p);p>0&&(t+="."+String(p-1)),p-=1,o.exists(t,(function(p){p?(e._debug(" mv %s %s",t,z),u(t,z,(function(t){t?(e.emit("error",t),b()):M()}))):M()}))}function b(){e._debug(" open %s",e.path),e.stream=o.createWriteStream(e.path,{flags:"a",encoding:"utf8"});for(var M=e.rotQueue,b=M.length,t=0;tthis.limit&&this.records.shift(),!0},x.prototype.end=function(){arguments.length>0&&this.write.apply(this,Array.prototype.slice.call(arguments)),this.writable=!1},x.prototype.destroy=function(){this.writable=!1,this.emit("close")},x.prototype.destroySoon=function(){this.destroy()},e.exports=k,e.exports.TRACE=10,e.exports.DEBUG=20,e.exports.INFO=y,e.exports.WARN=g,e.exports.ERROR=D,e.exports.FATAL=60,e.exports.resolveLevel=w,e.exports.levelFromName=B,e.exports.nameFromLevel=N,e.exports.VERSION="1.8.15",e.exports.LOG_VERSION=r,e.exports.createLogger=function(e){return new k(e)},e.exports.RingBuffer=x,e.exports.RotatingFileStream=F,e.exports.safeCycles=C},8075:(e,M,b)=>{"use strict";var t=b(453),p=b(487),o=p(t("String.prototype.indexOf"));e.exports=function(e,M){var b=t(e,!!M);return"function"==typeof b&&o(e,".prototype.")>-1?p(b):b}},487:(e,M,b)=>{"use strict";var t=b(6743),p=b(453),o=b(6897),z=b(9675),n=p("%Function.prototype.apply%"),r=p("%Function.prototype.call%"),c=p("%Reflect.apply%",!0)||t.call(r,n),O=b(655),a=p("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new z("a function is required");var M=c(t,r,arguments);return o(M,1+a(0,e.length-(arguments.length-1)),!0)};var i=function(){return c(t,n,arguments)};O?O(e.exports,"apply",{value:i}):e.exports.apply=i},7705:(e,M,b)=>{const t=b(1651),p=b(2390),o=b(2796),z=b(6561),n=b(8376),r=b(2752),c=b(624);e.exports={Bar:t,SingleBar:t,MultiBar:p,Presets:o,Format:{Formatter:z,BarFormat:r,ValueFormat:n,TimeFormat:c}}},9583:e=>{e.exports=class{constructor(e,M,b){this.etaBufferLength=e||100,this.valueBuffer=[b],this.timeBuffer=[M],this.eta="0"}update(e,M,b){this.valueBuffer.push(M),this.timeBuffer.push(e),this.calculate(b-M)}getTime(){return this.eta}calculate(e){const M=this.valueBuffer.length,b=Math.min(this.etaBufferLength,M),t=(this.valueBuffer[M-1]-this.valueBuffer[M-b])/(this.timeBuffer[M-1]-this.timeBuffer[M-b]);this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);const p=Math.ceil(e/t/1e3);isNaN(p)?this.eta="NULL":isFinite(p)?this.eta=p>1e7?"INF":p<0?0:p:this.eta="INF"}}},2752:e=>{e.exports=function(e,M){const b=Math.round(e*M.barsize),t=M.barsize-b;return M.barCompleteString.substr(0,b)+M.barGlue+M.barIncompleteString.substr(0,t)}},624:e=>{e.exports=function(e,M,b){function t(e){return b?b*Math.round(e/b):e}function p(e){return(M.autopaddingChar+e).slice(-2)}return e>3600?p(Math.floor(e/3600))+"h"+p(t(e%3600/60))+"m":e>60?p(Math.floor(e/60))+"m"+p(t(e%60))+"s":e>10?p(t(e))+"s":p(e)+"s"}},8376:e=>{e.exports=function(e,M,b){if(!0!==M.autopadding)return e;return"percentage"===b?(t=e,p=3,(M.autopaddingChar+t).slice(-p)):e;var t,p}},6561:(e,M,b)=>{const t=b(7513),p=b(8376),o=b(2752),z=b(624);e.exports=function(e,M,b){let n=e.format;const r=e.formatTime||z,c=e.formatValue||p,O=e.formatBar||o,a=Math.floor(100*M.progress)+"",i=M.stopTime||Date.now(),s=Math.round((i-M.startTime)/1e3),A=Object.assign({},b,{bar:O(M.progress,e),percentage:c(a,e,"percentage"),total:c(M.total,e,"total"),value:c(M.value,e,"value"),eta:c(M.eta,e,"eta"),eta_formatted:r(M.eta,e,5),duration:c(s,e,"duration"),duration_formatted:r(s,e,1)});n=n.replace(/\{(\w+)\}/g,(function(e,M){return void 0!==A[M]?A[M]:e}));const u=Math.max(0,M.maxWidth-t(n)-2),d=Math.floor(u/2);switch(e.align){case"right":n=u>0?" ".repeat(u)+n:n;break;case"center":n=d>0?" ".repeat(d)+n:n}return n}},3134:(e,M,b)=>{const t=b(9583),p=b(2247),o=b(6561),z=b(6201),n=b(7007);e.exports=class extends n{constructor(e){super(),this.options=z.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new p(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new t(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter="function"==typeof this.options.format?this.options.format:o}render(e=!1){const M={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();const b=this.formatter(this.options,M,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=b)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(b),this.terminal.clearRight(),this.lastDrawnString=b,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(e,M,b){this.value=M||0,this.total=void 0!==e&&e>=0?e:100,this.startValue=M||0,this.payload=b||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new t(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",e,M)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,M={}){"number"==typeof e&&(this.value=e,this.eta.update(Date.now(),e,this.total));const b=("object"==typeof e?e:M)||{};this.emit("update",this.total,this.value);for(const e in b)this.payload[e]=b[e];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,M={}){"object"==typeof e?this.update(this.value+1,e):this.update(this.value+e,M)}getTotal(){return this.total}setTotal(e){void 0!==e&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}},2390:(e,M,b)=>{var t=b(5606);const p=b(2247),o=b(3134),z=b(6201),n=b(7007);e.exports=class extends n{constructor(e,M){super(),this.bars=[],this.options=z.parse(e,M),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new p(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,M,b,p={}){const z=new o(Object.assign({},this.options,{terminal:this.terminal},p));return this.bars.push(z),!1===this.options.noTTYOutput&&!1===this.terminal.isTTY()||(null===this.sigintCallback&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),t.once("SIGINT",this.sigintCallback),t.once("SIGTERM",this.sigintCallback)),this.isActive||(!0===this.options.hideCursor&&this.terminal.cursor(!1),!1===this.options.linewrap&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,z.start(e,M,b),this.emit("start")),z}remove(e){const M=this.bars.indexOf(e);return!(M<0)&&(this.bars.splice(M,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find((e=>e.isActive))&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(t.removeListener("SIGINT",this.sigintCallback),t.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,!0===this.options.hideCursor&&this.terminal.cursor(!0),!1===this.options.linewrap&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}}},6201:(e,M,b)=>{var t=b(5606);function p(e,M){return null==e?M:e}e.exports={parse:function(e,M){const b={},o=Object.assign({},M,e);return b.throttleTime=1e3/p(o.fps,10),b.stream=p(o.stream,t.stderr),b.terminal=p(o.terminal,null),b.clearOnComplete=p(o.clearOnComplete,!1),b.stopOnComplete=p(o.stopOnComplete,!1),b.barsize=p(o.barsize,40),b.align=p(o.align,"left"),b.hideCursor=p(o.hideCursor,!1),b.linewrap=p(o.linewrap,!1),b.barGlue=p(o.barGlue,""),b.barCompleteChar=p(o.barCompleteChar,"="),b.barIncompleteChar=p(o.barIncompleteChar,"-"),b.format=p(o.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),b.formatTime=p(o.formatTime,null),b.formatValue=p(o.formatValue,null),b.formatBar=p(o.formatBar,null),b.etaBufferLength=p(o.etaBuffer,10),b.etaAsynchronousUpdate=p(o.etaAsynchronousUpdate,!1),b.progressCalculationRelative=p(o.progressCalculationRelative,!1),b.synchronousUpdate=p(o.synchronousUpdate,!0),b.noTTYOutput=p(o.noTTYOutput,!1),b.notTTYSchedule=p(o.notTTYSchedule,2e3),b.emptyOnZero=p(o.emptyOnZero,!1),b.forceRedraw=p(o.forceRedraw,!1),b.autopadding=p(o.autopadding,!1),b.gracefulExit=p(o.gracefulExit,!1),b},assignDerivedOptions:function(e){return e.barCompleteString=e.barCompleteChar.repeat(e.barsize+1),e.barIncompleteString=e.barIncompleteChar.repeat(e.barsize+1),e.autopaddingChar=e.autopadding?p(e.autopaddingChar," "):"",e}}},1651:(e,M,b)=>{var t=b(5606);const p=b(3134),o=b(6201);e.exports=class extends p{constructor(e,M){super(o.parse(e,M)),this.timer=null,this.options.noTTYOutput&&!1===this.terminal.isTTY()&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&!1===this.terminal.isTTY()&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,M){this.timer&&(super.update(e,M),this.options.synchronousUpdate&&this.lastRedraw+2*this.options.throttleTime{const t=b(2561);e.exports=class{constructor(e){this.stream=e,this.linewrap=!0,this.dy=0}cursorSave(){this.stream.isTTY&&this.stream.write("\x1b7")}cursorRestore(){this.stream.isTTY&&this.stream.write("\x1b8")}cursor(e){this.stream.isTTY&&(e?this.stream.write("\x1b[?25h"):this.stream.write("\x1b[?25l"))}cursorTo(e=null,M=null){this.stream.isTTY&&t.cursorTo(this.stream,e,M)}cursorRelative(e=null,M=null){this.stream.isTTY&&(this.dy=this.dy+M,t.moveCursor(this.stream,e,M))}cursorRelativeReset(){this.stream.isTTY&&(t.moveCursor(this.stream,0,-this.dy),t.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&t.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&t.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&t.clearScreenDown(this.stream)}newline(){this.stream.write("\n"),this.dy++}write(e,M=!1){!0===this.linewrap&&!1===M?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("\x1b[?7h"):this.stream.write("\x1b[?7l"))}isTTY(){return!0===this.stream.isTTY}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}}},2796:(e,M,b)=>{const t=b(3717),p=b(141),o=b(8794),z=b(4048);e.exports={legacy:t,shades_classic:p,shades_grey:o,rect:z}},3717:e=>{e.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}},4048:e=>{e.exports={format:" {bar}\u25a0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25a0",barIncompleteChar:" "}},141:e=>{e.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}},8794:e=>{e.exports={format:" \x1b[90m{bar}\x1b[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}},8144:e=>{var M=[].slice;e.exports=function(e,b){if("string"==typeof b&&(b=e[b]),"function"!=typeof b)throw new Error("bind() requires a function");var t=M.call(arguments,2);return function(){return b.apply(e,t.concat(M.call(arguments)))}}},5971:e=>{function M(e){if(e)return function(e){for(var b in M.prototype)e[b]=M.prototype[b];return e}(e)}e.exports=M,M.prototype.on=M.prototype.addEventListener=function(e,M){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(M),this},M.prototype.once=function(e,M){function b(){this.off(e,b),M.apply(this,arguments)}return b.fn=M,this.on(e,b),this},M.prototype.off=M.prototype.removeListener=M.prototype.removeAllListeners=M.prototype.removeEventListener=function(e,M){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var b,t=this._callbacks["$"+e];if(!t)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var p=0;p{e.exports=function(e,M){var b=function(){};b.prototype=M.prototype,e.prototype=new b,e.prototype.constructor=e}},41:(e,M,b)=>{"use strict";var t=b(655),p=b(8068),o=b(9675),z=b(5795);e.exports=function(e,M,b){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof M&&"symbol"!=typeof M)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,O=arguments.length>6&&arguments[6],a=!!z&&z(e,M);if(t)t(e,M,{configurable:null===c&&a?a.configurable:!c,enumerable:null===n&&a?a.enumerable:!n,value:b,writable:null===r&&a?a.writable:!r});else{if(!O&&(n||r||c))throw new p("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[M]=b}}},5752:e=>{"use strict";e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\u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83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}},104:e=>{e.exports="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},3357:(e,M,b)=>{e.exports=b(7292),e.exports.parser=b(3401)},7292:(e,M,b)=>{var t=b(8520),p=b(5971),o=b(6617)("engine.io-client:socket"),z=b(6938),n=b(3401),r=b(4258),c=b(9140);function O(e,M){if(!(this instanceof O))return new O(e,M);M=M||{},e&&"object"==typeof e&&(M=e,e=null),e?(e=r(e),M.hostname=e.host,M.secure="https"===e.protocol||"wss"===e.protocol,M.port=e.port,e.query&&(M.query=e.query)):M.host&&(M.hostname=r(M.host).host),this.secure=null!=M.secure?M.secure:"undefined"!=typeof location&&"https:"===location.protocol,M.hostname&&!M.port&&(M.port=this.secure?"443":"80"),this.agent=M.agent||!1,this.hostname=M.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=M.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=M.query||{},"string"==typeof this.query&&(this.query=c.decode(this.query)),this.upgrade=!1!==M.upgrade,this.path=(M.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!M.forceJSONP,this.jsonp=!1!==M.jsonp,this.forceBase64=!!M.forceBase64,this.enablesXDR=!!M.enablesXDR,this.withCredentials=!1!==M.withCredentials,this.timestampParam=M.timestampParam||"t",this.timestampRequests=M.timestampRequests,this.transports=M.transports||["polling","websocket"],this.transportOptions=M.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=M.policyPort||843,this.rememberUpgrade=M.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=M.onlyBinaryUpgrades,this.perMessageDeflate=!1!==M.perMessageDeflate&&(M.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=M.pfx||void 0,this.key=M.key||void 0,this.passphrase=M.passphrase||void 0,this.cert=M.cert||void 0,this.ca=M.ca||void 0,this.ciphers=M.ciphers||void 0,this.rejectUnauthorized=void 0===M.rejectUnauthorized||M.rejectUnauthorized,this.forceNode=!!M.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(M.extraHeaders&&Object.keys(M.extraHeaders).length>0&&(this.extraHeaders=M.extraHeaders),M.localAddress&&(this.localAddress=M.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}e.exports=O,O.priorWebsocketSuccess=!1,p(O.prototype),O.protocol=n.protocol,O.Socket=O,O.Transport=b(2672),O.transports=b(8520),O.parser=b(3401),O.prototype.createTransport=function(e){o('creating transport "%s"',e);var M=function(e){var M={};for(var b in e)e.hasOwnProperty(b)&&(M[b]=e[b]);return M}(this.query);M.EIO=n.protocol,M.transport=e;var b=this.transportOptions[e]||{};return this.id&&(M.sid=this.id),new t[e]({query:M,socket:this,agent:b.agent||this.agent,hostname:b.hostname||this.hostname,port:b.port||this.port,secure:b.secure||this.secure,path:b.path||this.path,forceJSONP:b.forceJSONP||this.forceJSONP,jsonp:b.jsonp||this.jsonp,forceBase64:b.forceBase64||this.forceBase64,enablesXDR:b.enablesXDR||this.enablesXDR,withCredentials:b.withCredentials||this.withCredentials,timestampRequests:b.timestampRequests||this.timestampRequests,timestampParam:b.timestampParam||this.timestampParam,policyPort:b.policyPort||this.policyPort,pfx:b.pfx||this.pfx,key:b.key||this.key,passphrase:b.passphrase||this.passphrase,cert:b.cert||this.cert,ca:b.ca||this.ca,ciphers:b.ciphers||this.ciphers,rejectUnauthorized:b.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:b.perMessageDeflate||this.perMessageDeflate,extraHeaders:b.extraHeaders||this.extraHeaders,forceNode:b.forceNode||this.forceNode,localAddress:b.localAddress||this.localAddress,requestTimeout:b.requestTimeout||this.requestTimeout,protocols:b.protocols||void 0,isReactNative:this.isReactNative})},O.prototype.open=function(){var e;if(this.rememberUpgrade&&O.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var M=this;return void setTimeout((function(){M.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},O.prototype.setTransport=function(e){o("setting transport %s",e.name);var M=this;this.transport&&(o("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){M.onDrain()})).on("packet",(function(e){M.onPacket(e)})).on("error",(function(e){M.onError(e)})).on("close",(function(){M.onClose("transport close")}))},O.prototype.probe=function(e){o('probing transport "%s"',e);var M=this.createTransport(e,{probe:1}),b=!1,t=this;function p(){if(t.onlyBinaryUpgrades){var p=!this.supportsBinary&&t.transport.supportsBinary;b=b||p}b||(o('probe transport "%s" opened',e),M.send([{type:"ping",data:"probe"}]),M.once("packet",(function(p){if(!b)if("pong"===p.type&&"probe"===p.data){if(o('probe transport "%s" pong',e),t.upgrading=!0,t.emit("upgrading",M),!M)return;O.priorWebsocketSuccess="websocket"===M.name,o('pausing current transport "%s"',t.transport.name),t.transport.pause((function(){b||"closed"!==t.readyState&&(o("changing transport and sending upgrade packet"),i(),t.setTransport(M),M.send([{type:"upgrade"}]),t.emit("upgrade",M),M=null,t.upgrading=!1,t.flush())}))}else{o('probe transport "%s" failed',e);var z=new Error("probe error");z.transport=M.name,t.emit("upgradeError",z)}})))}function z(){b||(b=!0,i(),M.close(),M=null)}function n(b){var p=new Error("probe error: "+b);p.transport=M.name,z(),o('probe transport "%s" failed because of error: %s',e,b),t.emit("upgradeError",p)}function r(){n("transport closed")}function c(){n("socket closed")}function a(e){M&&e.name!==M.name&&(o('"%s" works - aborting "%s"',e.name,M.name),z())}function i(){M.removeListener("open",p),M.removeListener("error",n),M.removeListener("close",r),t.removeListener("close",c),t.removeListener("upgrading",a)}O.priorWebsocketSuccess=!1,M.once("open",p),M.once("error",n),M.once("close",r),this.once("close",c),this.once("upgrading",a),M.open()},O.prototype.onOpen=function(){if(o("socket open"),this.readyState="open",O.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){o("starting upgrade probes");for(var e=0,M=this.upgrades.length;e{var t=b(3401),p=b(5971);function o(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.withCredentials=e.withCredentials,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}e.exports=o,p(o.prototype),o.prototype.onError=function(e,M){var b=new Error(e);return b.type="TransportError",b.description=M,this.emit("error",b),this},o.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},o.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},o.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},o.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},o.prototype.onData=function(e){var M=t.decodePacket(e,this.socket.binaryType);this.onPacket(M)},o.prototype.onPacket=function(e){this.emit("packet",e)},o.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},8520:(e,M,b)=>{var t=b(553),p=b(9332),o=b(2252),z=b(6855);M.polling=function(e){var M=!1,b=!1,z=!1!==e.jsonp;if("undefined"!=typeof location){var n="https:"===location.protocol,r=location.port;r||(r=n?443:80),M=e.hostname!==location.hostname||r!==e.port,b=e.secure!==n}if(e.xdomain=M,e.xscheme=b,"open"in new t(e)&&!e.forceJSONP)return new p(e);if(!z)throw new Error("JSONP disabled");return new o(e)},M.websocket=z},2252:(e,M,b)=>{var t=b(5911),p=b(2370),o=b(104);e.exports=O;var z,n=/\n/g,r=/\\n/g;function c(){}function O(e){t.call(this,e),this.query=this.query||{},z||(z=o.___eio=o.___eio||[]),this.index=z.length;var M=this;z.push((function(e){M.onData(e)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){M.script&&(M.script.onerror=c)}),!1)}p(O,t),O.prototype.supportsBinary=!1,O.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),t.prototype.doClose.call(this)},O.prototype.doPoll=function(){var e=this,M=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),M.async=!0,M.src=this.uri(),M.onerror=function(M){e.onError("jsonp poll error",M)};var b=document.getElementsByTagName("script")[0];b?b.parentNode.insertBefore(M,b):(document.head||document.body).appendChild(M),this.script=M,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},O.prototype.doWrite=function(e,M){var b=this;if(!this.form){var t,p=document.createElement("form"),o=document.createElement("textarea"),z=this.iframeId="eio_iframe_"+this.index;p.className="socketio",p.style.position="absolute",p.style.top="-1000px",p.style.left="-1000px",p.target=z,p.method="POST",p.setAttribute("accept-charset","utf-8"),o.name="d",p.appendChild(o),document.body.appendChild(p),this.form=p,this.area=o}function c(){O(),M()}function O(){if(b.iframe)try{b.form.removeChild(b.iframe)}catch(e){b.onError("jsonp polling iframe removal error",e)}try{var e='