Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@青豆@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoXCJoaWtlcjovL3BhZ2UvbWFpblwiKSkucnVsZSk7XG5sZXQgdHlwZSA9IGdldFBhcmFtKCd0eXBlJywgJycpLFxuICAgIGlkID0gZ2V0UGFyYW0oJ2lkJywgJycpLFxuICAgIHRpdGxlID0gZ2V0UGFyYW0oJ3RpdGxlJywgJycpO1xubGV0IHJlcyA9IGdldERvdWJhblJlcyhcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvXCIgKyB0eXBlICsgXCIvXCIgKyBpZCk7XG5sZXQgdXBkYXRlID0gXCJcIjtcbmlmICh0aXRsZSA9PSAnJykge1xuICAgIGxldCBsZW5ndGggPSByZXMudmVuZG9ycy5sZW5ndGg7XG4gICAgdXBkYXRlICs9IGxlbmd0aCA+IDAgPyAn5YWxJyArIGxlbmd0aCArICfkuKrniYfmupAnIDogJ+aaguaXoOeJh+a6kCc7XG4gICAgaWYgKGxlbmd0aCA+IDApIHtcbiAgICAgICAgbGV0IGUgPSByZXMudmVuZG9yc1swXTtcbiAgICAgICAgdXBkYXRlICs9IGUuZXBpc29kZXNfaW5mbyA/IFwifFwiICsgZS5lcGlzb2Rlc19pbmZvIDogXCJcIjtcbiAgICB9XG59IGVsc2Uge1xuICAgIGZvciAobGV0IGUgb2YgcmVzLnZlbmRvcnMpIHtcbiAgICAgICAgaWYgKGUudGl0bGUgPT0gdGl0bGUpIHtcbiAgICAgICAgICAgIHVwZGF0ZSArPSBlLmVwaXNvZGVzX2luZm8gPyBlLmVwaXNvZGVzX2luZm8gOiBcIlwiO1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG59XG5zZXRSZXN1bHQodXBkYXRlKTsiLCJ0aXRsZSI6Iumdk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moQga2V5IOWAvO+8jOavlOWmguaIkeimgeaLvyBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdz77yMY29uZmlnS2V5IOWwseS8oCBcXFwiZGV0YWlsc1ZpZXdDb25maWdzXFxcIlxcbiAqIEBwYXJhbSBwYXJhbXMg57yW6L6R55WM6Z2i55qE6YWN572uXFxuICpcXG4gKiDjgJBwYXJhbXPlr7nosaHmlbDmja7npLrkvovjgJFcXG4gKiB7XFxuICAgICAgICBrZXk6IFxcXCJpbnB1dF9uYW1lXFxcIixcXG4gICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXlkI3np7BcXFwiLFxcbiAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgIGRhdGE6IHtcXG4gICAgICAgICAgICBjb25maWc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXovpPlhaXphY3nva5cXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgIH1cXG4gICAgfVxcbiAqL1xcbmZ1bmN0aW9uIG1vZGVFZGl0UGFnZShkLCBjb25maWdLZXksIHBhcmFtcykge1xcbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgY2xlYXJNeVZhcihwYXJhbXMua2V5KVxcbiAgICAgICAgbGV0IGRhdGFzID0gcGFyYW1zLmRhdGE7XFxuICAgICAgICBsZXQgZGF0YUtleXMgPSBPYmplY3Qua2V5cyhkYXRhcyk7XFxuICAgICAgICBmb3IgKGxldCBpIGluIGRhdGFLZXlzKSB7XFxuICAgICAgICAgICAgbGV0IGRhdGFLZXkgPSBkYXRhS2V5c1tpXVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoZGF0YXNbZGF0YUtleV0ua2V5KVx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gICAgICAgICAgICAgICAgaGVpZ2h0OiA1LFxcbiAgICAgICAgICAgICAgICBoaWdobGlnaHQ6IHRydWUsXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAncHV0TXlWYXIoXFxcIicgKyBkYXRhLmtleSArICdcXFwiLCBpbnB1dCknXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfkv53lrZgnLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGNvbmZpZ0tleSwgcGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICBsZXQgbmFtZSA9IGdldE15VmFyKHBhcmFtcy5rZXksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICBpZihuYW1lID09ICfpu5jorqQnKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6YWN572u5peg5rOV57yW6L6RJ1xcbiAgICAgICAgICAgIGNvbmZpZ1tjb25maWdLZXldLnVzZSA9IG5hbWVcXG4gICAgICAgICAgICBpZiAoIWNvbmZpZ1tjb25maWdLZXldW25hbWVdKSBjb25maWdbY29uZmlnS2V5XVtuYW1lXSA9IHt9XFxuICAgICAgICAgICAgbGV0IGRhdGFzID0gcGFyYW1zLmRhdGE7XFxuICAgICAgICAgICAgbGV0IGRhdGFLZXlzID0gT2JqZWN0LmtleXMoZGF0YXMpO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gZGF0YUtleXMpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGFLZXkgPSBkYXRhS2V5c1tpXVxcbiAgICAgICAgICAgICAgICBsZXQgZGF0YSA9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xuICAgICAgICBkYXRhOiB7XFxuICAgICAgICAgICAgY29uZmlnOiB7XFxuICAgICAgICAgICAgICAgIGtleTogXFxcImlucHV0X2NvZGVcXFwiLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl6YWN572u5Luj56CBXFxcIixcXG4gICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSlcXG59XFxuXFxuLy/oh6rlrprkuYnor6bmg4XpobXpnaIt6YWN572u57yW6L6R6aG16Z2iXFxuZnVuY3Rpb24gZGV0YWlsVmlld01vZGVFZGl0UGFnZShkKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJzxmb250IGNvbG9yPVxcXCIjODA4MDgwXFxcIj4nICsgJ+OAkOWGhee9ruWPmOmHj+OAkScgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO2lkOiDniYfljZVpZCcgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO3R5cGU6IOeJh+WNleexu+WeiycgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO3RpdGxlOiDniYfljZXmoIfpopgnICsgJzwvZm9udD4nLFxcbiAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgIH0pXFxuICAgIG1vZGVFZGl0UGFnZShkLCBcXFwiZGV0YWlsc1ZpZXdDb25maWdzXFxcIiwge1xcbiAgICAgICAga2V5OiBcXFwiaW5wdXRfbmFtZVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5ZCN56ewXFxcIixcXG4gICAgICAgIC8vIHR5cGU6ICdpbnB1dCdcXG4gICAgICAgIGRhdGE6IHtcXG4gICAgICAgICAgICBjb25maWc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXphY3nva7ku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBzZXR0aW5nOiB7XFxuICAgICAgICAgICAgICAgIGtleTogXFxcImlucHV0X3NldHRpbmdfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXorr7nva7pobXpnaLku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5cXG4vL+iHquWumuS5ieino+aekC3nvJbovpHpobXpnaJcXG5mdW5jdGlvbiBhbmFseXNpc01vZGVFZGl0UGFnZShkKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJzxmb250IGNvbG9yPVxcXCIjODA4MDgwXFxcIj4nICsgJ+OAkOino+aekOS7o+eggeWGhee9ruWPmOmHj+OAkScgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO2lucHV0OiDop4bpopHpk77mjqUnICsgJzwvZm9udD4nLFxcbiAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgIH0pXFxuICAgIG1vZGVFZGl0UGFnZShkLCBcXFwiYW5hbHlzaXNDb25maWdzXFxcIiwge1xcbiAgICAgICAga2V5OiBcXFwiaW5wdXRfbmFtZVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5ZCN56ewXFxcIixcXG4gICAgICAgIC8vIHR5cGU6ICdpbnB1dCdcXG4gICAgICAgIGRhdGE6IHtcXG4gICAgICAgICAgICBjb25maWc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXop6PmnpDku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBrZXk6ICdpbnB1dF9leHRyYScsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICfor7fovpPlhaVleHRyYeWxnuaAp+WAvCcsXFxuICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYSdcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHNldHRpbmc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeiuvue9rumhtemdouS7o+eggVxcXCIsXFxuICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0pXFxufVxcblxcbmxldCBkID0gW107XFxubGV0IHZpZXcgPSBnZXRQYXJhbShcXFwidmlld1xcXCIsXFxcIlxcXCIpO1xcbmlmKHZpZXc9PVxcXCJhbmFseXNpc01vZGVFZGl0UGFnZVxcXCIpe1xcbiAgICBzZXRQYWdlVGl0bGUoXFxcIuiHquWumuS5ieino+aekOe8lui+kVxcXCIpXFxuICAgIGFuYWx5c2lzTW9kZUVkaXRQYWdlKGQpO1xcbn1lbHNlIGlmKHZpZXc9PVxcXCJkZXRhaWxWaWV3TW9kZUVkaXRQYWdlXFxcIil7XFxuICAgIHNldFBhZ2VUaXRsZShcXFwi6Ieq5a6a5LmJ6K+m5oOF6aG157yW6L6RXFxcIilcXG4gICAgZGV0YWlsVmlld01vZGVFZGl0UGFnZShkKTtcXG59ZWxzZSBpZih2aWV3PT1cXFwiaG9tZVBhZ2VNb2RlRWRpdFBhZ2VcXFwiKXtcXG4gICAgc2V0UGFnZVRpdGxlKFxcXCLoh6rlrprkuYnpppbpobXnvJbovpFcXFwiKVxcbiAgICBob21lUGFnZU1vZGVFZ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iAgICAgICAgICAgIHNldEl0ZW0oJ3VwZGF0ZScsIFN0cmluZyh2ZXJzaW9uKSk7XFxyXFxuICAgICAgICAgICAgY29uZmlybSh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5pys5qyh5pu05paw5YaF5a65JyxcXHJcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ+aQnOe0oue7k+aenOaYvuekuuW5tOS7vScsXFxyXFxuICAgICAgICAgICAgICAgIGNvbmZpcm06ICcnLFxcclxcbiAgICAgICAgICAgICAgICBjYW5jZWw6ICcnXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfVxcclxcbiAgICBhZGRMaXN0ZW5lcihcXFwib25DbG9zZVxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgY2xlYXJNeVZhcihcXFwicWRiX2NvbmZpZ1xcXCIpO1xcclxcbiAgICB9KSlcXHJcXG4gICAgbGV0IGhvbWVQYWdlQ29uZmlncyA9IGdldENvbmZpZygnaG9tZVBhZ2VDb25maWdzJyk7XFxyXFxuICAgIGxldCBob21lUGFnZUNvbmZpZyA9IGhvbWVQYWdlQ29uZmlnc1tob21lUGFnZUNvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgIGlmIChob21lUGFnZUNvbmZpZy5zdGFydHNXaXRoKFxcXCIoXFxcIikpIHtcXHJcXG4gICAgICAgIGV2YWwoJ2QgPSAnICsgaG9tZVBhZ2VDb25maWcpXFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICBldmFsKCdkID0gJyArICcoKCkgPT4geycgKyBob21lUGFnZUNvbmZpZyArICd9KSgpJylcXHJcXG4gICAgfVxcclxcbiAgICBzZXRSZXN1bHQoZCk7XFxyXFxufVxcclxcblxcclxcbi8v5rW36ZiU5pCc57SiXFxyXFxuZnVuY3Rpb24gc2VhcmNoKCkge1xcclxcbiAgICBsZXQgd2QgPSBNWV9VUkwuc3BsaXQoXF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xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gXFxcImNvbGxlY3Rpb25cXFwiIHx8IHR5cGUgPT0gXFxcImNoYXJ0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViamVjdENvbGxlY3Rpb25MaXN0KE1ZX1BBR0UsIDUwLCBpZCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBlLnRhcmdldF90eXBlLCBlLmlkKSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXJfdXJsXFxyXFxuICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0gZWxzZSBpZiAoZGF0YS50YXJnZXRfdHlwZSA9PSAnY2hhcnQnKSB7XFxyXFxuICAgICAgICAgICAgbGV0IGUgPSBkYXRhLnRhcmdldDtcXHJcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8kcGFnZXtmeXBhZ2V9I25vSGlzdG9yeSMnKVxcclxcbiAgICAgICAgICAgICAgICAgICAgLnJ1bGUoKHR5cGUsIGlkKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gXFxcImNvbGxlY3Rpb25cXFwiIHx8IHR5cGUgPT0gXFxcImNoYXJ0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJqZWN0Q29sbGVjdGlvbkxpc3QoTVlfUEFHRSwgNTAsIGlkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCBkYXRhLnRhcmdldF90eXBlLCBlLmlkKSxcXHJcXG4gICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5jb3Zlcl91cmxcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICBsZXQgdHlwZSA9IGRhdGEudGFyZ2V0X3R5cGUsXFxyXFxuICAgICAgICAgICAgICAgIGlkID0gZGF0YS50YXJnZXQuaWQsXFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlID0gZGF0YS50YXJnZXQudGl0bGUsXFxuICAgICAgICAgICAgICAgIHllYXIgPSBkYXRhLnRhcmdldC55ZWFyO1xcclxcbiAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZClcXHJcXG4gICAgICAgICAgICAgICAgICAgIC5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArICh5ZWFyID8gJygnK3llYXIrJyknIDogJycpLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGRhdGEudGFyZ2V0LmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZGF0YS50YXJnZXQuY292ZXJfdXJsLFxcclxcbiAgICAgICAgICAgICAgICBkZXNjOiBkYXRhLnR5cGVfbmFtZSxcXHJcXG4gICAgICAgICAgICAgICAgY29udGVudDogZGF0YS50YXJnZXQuY2FyZF9zdWJ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+PC9zbWFsbD48YnIvPic7XFxyXFxuXFxyXFxuICAgIGxldCBzdGFyQ29sb3IgPSBnZXRDb25maWcoJ3N0YXJDb2xvcicpO1xcclxcbiAgICBpZiAoaS5zdGF0cy5sZW5ndGggPT0gMCkge1xcclxcbiAgICAgICAgaS5zdGF0cyA9IFswLCAwLCAwLCAwLCAwXTtcXHJcXG4gICAgfVxcclxcbiAgICBpLnN0YXRzLnJldmVyc2UoKS5mb3JFYWNoKCgodmFsdWUsIGluZGV4KSA9PiB7XFxyXFxuICAgICAgICByICs9ICc8Zm9udCBjb2xvcj0nICsgc3RhckNvbG9yICsgJz4nICsgW1xcXCLimIXimIXimIXimIXimIVcXFwiLCBcXFwi4piF4piF4piF4piF4piGXFxcIiwgXFxcIuKYheKYheKYheKYhuKYhlxcXCIsIFxcXCLimIXimIXimIbimIbimIZcXFwiLCBcXFwi4piF4piG4piG4piG4piGXFxcIl1baW5kZXhdICsgXFxcIjwvZm9udD4mbmJzcDtcXFwiO1xcclxcblxcclxcbiAgICAgICAgciArPSBmdW5jdGlvbihlKSB7XFxyXFxuICAgICAgICAgICAgbGV0IHQxID0gJyc7XFxyXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBlOyBpKyspIHQxICs9IFxcXCLilodcXFwiO1xcclxcbiAgICAgICAgICAgIGxldCB0MiA9ICcnO1xcclxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMTAgLSBlOyBpKyspIHQyICs9IFxcXCLilodcXFwiO1xcclxcbiAgICAgICAgICAgIHJldHVybiB0MS5mb250Y29sb3IoJyNmZmFjMmQnKSArIHQyLmZvbnRjb2xvcignI2U1ZTFlNCcpO1xcclxcbiAgICAgICAgfSgoMTAgKiB2YWx1ZSkudG9GaXhlZCgwKSk7XFxyXFxuXFxyXFxuICAgICAgICByICs9ICcmbmJzcDs8c21hbGw+PGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPicgKyAoMTAwICogdmFsdWUpXFx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xcclxcbiAgICB9IGVsc2V7XFxyXFxuICAgICAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgICAgICBkYXRhOiBbe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogcjIsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgICAgIH1dXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxufVxcclxcblxcclxcbi8v5aWW6aG56K+m5oOF6aG16Z2iXFxyXFxuZnVuY3Rpb24gYXdhcmRWaWV3KGlkLCBuYW1lKSB7XFxyXFxuICAgIHNldFBhZ2VUaXRsZShuYW1lKTtcXHJcXG4gICAgbGV0IHMgPSBnZXREb3ViYW5SZXMoXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvY2VyZW1vbnkvXFxcIiArIGlkKTtcXHJcXG4gICAgbGV0IGEgPSBbXTtcXHJcXG4gICAgYS5wdXNoKHtcXHJcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIChzLnRpdGxlICsgJygnICsgcy55ZWFyICsgJyknKS5iaWcoKS5ib2xkKCksXFxyXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxyXFxuICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9KVxcclxcbiAgICBzLnBsYXlsaXN0cy5mb3JFYWNoKGUgPT4ge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogZS50aXRsZSxcXHJcXG4gICAgICAgICAgICBkZXNjOiAn5YWxJyArIGUuaXRlbXNfY291bnQgKyAn6YOoJyxcXHJcXG4gICAgICAgICAgICBpbWc6IGUuY292ZXJfdXJsICsgJ0BSZWZlcmVyPScgKyBlLmNvdmVyX3VybCxcXHJcXG4gIC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vmlrDpl7vlm77niYfvvJpcXFwiICsgci5uICsgXFxcIuW8oCZuYnNwO+eyieS4neWbvueJh++8mlxcXCIgKyByLmYgKyBcXFwi5bygPC9mb250Pjwvc21hbGw+XFxcIixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCI8YmlnPuWFsTxzdHJvbmc+IFxcXCIgKyByLnRvdGFsICsgXFxcIjwvc3Ryb25nPuW8oOa1t+aKpTwvYmlnPlxcXCIsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBsID0gYS5jb25jYXQobCk7XFxyXFxuICAgIH1cXHJcXG4gICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICBkYXRhOiBsXFxyXFxuICAgIH0pXFxyXFxufVxcclxcblxcclxcbi8v5ryU6IGM5Lq65ZGY6aG16Z2iXFxyXFxuZnVuY3Rpb24gY3JlZGl0cyh0eXBlLCBpZCkge1xcclxcbiAgICBsZXQgaSA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdHlwZSArIFxcXCIvXFxcIiArIGlkICsgXFxcIi9jcmVkaXRzXFxcIik7XFxyXFxuICAgIGxldCByID0gW107XFxyXFxuICAgIGkuY3JlZGl0cy5mb3JFYWNoKChlID0+IHtcXHJcXG4gICAgICAgIHIucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIGUuY2VsZWJyaXRpZXMuZm9yRWFjaCgoZSA9PiB7XFxyXFxuICAgICAgICAgICAgci5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUubmFtZSArIFxcXCJcXFxcblxcXCIgKyBlLmxhdGluX25hbWUsXFxyXFxuICAgICAgICAgICAgICAgIGRlc2M6IGUuY2hhcmFjdGVyLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGUuYXZhdGFyLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5hdmF0YXIubm9ybWFsLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjJykucnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgZWxlc3NhclZpZXcoZS51cmkuc3BsaXQoXFxcInN1YmplY3RfaWQ9XFxcIilbMV0sIGUuaWQsIGUubmFtZSk7XFxyXFxuICAgICAgICAgICAgICAgIH0sIGUpXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0pKVxcclxcbiAgICB9KSk7XFxyXFxuICAgIHNldEhvbWVSZXN1bHQoe1xcclxcbiAgICAgICAgZGF0YTogclxcclxcbiAgICB9KVxcclxcbn1cXHJcXG5cXHJcXG4vL+efreivhOmhtemdolxcclxcbmZ1bmN0aW9uIHNob3J0Q29tbWVudExpc3QodHlwZSwgaWQpIHtcXHJcXG4gICAgYWRkTGlzdGVuZXIoJ29uQ2xvc2UnLCBcXFwiY2xlYXJNeVZhcignc2hvcnRjb21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clxcbiAgICBsZXQgbCA9IFtdO1xcclxcbiAgICBsZXQgc3RhckNvbG9yID0gZ2V0Q29uZmlnKCdzdGFyQ29sb3InKTtcXHJcXG4gICAgci5yZXZpZXdzLmZvckVhY2goKGUgPT4ge1xcclxcbiAgICAgICAgbGV0IHQgPSBcXFwiXFxcIjtcXHJcXG4gICAgICAgIGlmIChlLnJhdGluZykge1xcclxcbiAgICAgICAgICAgIHQgPSBjb21wdXRlUmF0aW5nKGUucmF0aW5nLm1heCwgZS5yYXRpbmcudmFsdWUpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgbGV0IGkgPSBlLmNvbW1lbnRzX2NvdW50ID8gZS5jb21tZW50c19jb3VudCArIFxcXCLlm57lpI1cXFwiIDogXFxcIlxcXCIsXFxyXFxuICAgICAgICAgICAgciA9IGUudXNlZnVsX2NvdW50ID8gZS51c2VmdWxfY291bnQgKyBcXFwi5pyJ55SoXFxcIiA6IFxcXCJcXFwiLFxcclxcbiAgICAgICAgICAgIG8gPSBlLnJlc2hhcmVzX2NvdW50ID8gZS5yZXNoYXJlc19jb3VudCArIFxcXCLovazlj5FcXFwiIDogXFxcIlxcXCI7XFxyXFxuXFxyXFxuICAgICAgICByID0gaSAmJiByID8gXFxcIuKAolxcXCIgKyByIDogcjtcXHJcXG4gICAgICAgIG8gPSAoaSB8fCByKSAmJiBvID8gXFxcIuKAolxcXCIgKyBvIDogbztcXHJcXG4gICAgICAgIGwucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IGUudXNlci5uYW1lLFxcclxcbiAgICAgICAgICAgIGltZzogZS51c2VyLmF2YXRhcixcXHJcXG4gICAgICAgICAgICB1cmw6IGUudXNlci51cmwsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIjxzdHJvbmc+XFxcIiAr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yXFxuICAgICAgICByLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6aKE5ZGKXFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG4gICAgaWYgKGwubGVuZ3RoID4gMCkge1xcclxcbiAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIueJh+autVxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuICAgIGlmIChvLmxlbmd0aCA+IDApIHtcXHJcXG4gICAgICAgIG8udW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLoirHnta5cXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgIGRhdGE6IHIuY29uY2F0KGwpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdChvKVxcclxcbiAgICB9KVxcclxcbn1cXHJcXG5cXHJcXG4vL+inhumikeivhOiuuumhtemdolxcclxcbmZ1bmN0aW9uIHZpZGVvQ29tbWVudCh0eXBlLCBpZCkge1xcclxcbiAgICBsZXQgaSA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdHlwZSArIFxcXCIvXFxcIiArIGlkICsgXFxcIi92aWRlb3NcXFwiKS52aWRlb3M7XFxyXFxuICAgIGkuZm9yRWFjaCgoZSA9PiB7XFxyXFxuICAgICAgICBlLmNvbF90eXBlID0gXFxcIm1vdmllXzJcXFwiLCBlLmRlc2MgPSBl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bWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGUuc3ViamVjdC5jb3Zlci5ub3JtYWwudXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLnN1YmplY3QuY292ZXIubm9ybWFsLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgZGVzYzogcmF0aW5nLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmFcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgLyphLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAn5p+l55yL5pu05aSaJyxcXHJcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2pva2VyLXR4LmNvZGluZy5uZXQvcC9oaWtlcmltZy9kL2hpa2VyL2dpdC9yYXcvbWFzdGVyL2ltZy9tb3JlX3Zlci5wbmc/ZG93bmxvYWQ9ZmFsc2UnLFxcclxcbiAgICAgICAgICAgIG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ICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBlbGVzc2FyUGhvdG9zKHBpZCk7XFxyXFxuICAgICAgICAgICAgfSwgcGlkKSxcXHJcXG4gICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9KVxcclxcblxcclxcbiAgICAgICAgbGV0IHBsZW5ndGggPSBlMy5waG90b3MubGVuZ3RoIDw9IDIgPyBlMy5waG90b3MubGVuZ3RoIDogMjtcXHJcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGxlbmd0aDsgaSsrKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgLy90aXRsZTogZTMucGhvdG9zWzBdLmRlc2NyaXB0aW9uLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzInLFxcclxcbiAgICAgICAgICAgICAgICBkZXNjOiAnMCcsXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZTMucGhvdG9zW2ldLmltYWdlLm5vcm1hbC51cmwgKyAnQFJlZmVyZXI9JyArIGUzLnBob3Rvc1tpXS5pbWFnZS5ub3JtYWwudXJsLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IGUzLnBob3Rvc1tpXS5pbWFnZS5ub3JtYWwudXJsICsgJ0BSZWZlcmVyPScgKyBlMy5waG90b3NbaV0uaW1hZ2Uubm9ybWFsLnVybFxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuXFxyXFxuICAgICAgICAvKmEucHVzaCh7XFxyXFxuICAgICAgICAgICAgLy90aXRsZTogJ+afpeeci+abtOWkmicsXFxyXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly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5mb3JFYWNoKHQgPT4ge1xcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogKHQueWVhcitcXFwiXFxcIikuYm9sZCgpLmJpZygpLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcclxcbiAgICAgICAgfSlcXHJcXG5cXHJcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdC5tb2R1bGVzLmxlbmd0aDsgaSsrKSB7XFxyXFxuICAgICAgICAgICAgbGV0IGUgPSB0Lm1vZHVsZXNbaV07XFxyXFxuICAgICAgICAgICAgaWYgKCFlLmNlcmVtb255IHx8ICFlLmNhdGVnb3J5KSB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCByYXRpbmcgPSBcXFwiXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGUuZXh0cmEucmF0aW5nX2dyb3VwLnJhdGluZykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmF0aW5nID0gY29tcHV0ZVJhdGluZyhlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcubWF4LCBlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUpICsgXFxcIiBcXFwiICsgZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLnZhbHVlICsgXFxcIuWIhlxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBlLnN1YnR5cGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICBpZCA9IGUuaWQsXFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBsLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyLm5vcm1hbC51cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXIubm9ybWFsLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHJhdGluZyArICdcXFxcbicgKyBlLmV4dHJhLnNob3J0X2luZm8sXFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhXFxyXFxuICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBlLmNlcmVtb255LnRpdGxlLmJvbGQoKSArICc8c21hbGw+KDxhIGhyZWY9XFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5I0BydWxlPWpzOmV2YWwoSlNPTi5wYXJzZShmZXRjaChgaGlrZXI6Ly9wYWdlL21haW5gKSkucnVsZSk7YXdhcmRWaWV3KGAnICsgZS5jZXJlbW9ueS5pZCArICdgLGAnICsgZS5jZXJlbW9ueS50aXRsZSArICdgKTtcXFwiPuafpeeci+ivpuaDhTwvYT4pPC9zbWFsbD4nICsgJzxici8+JyArIChlLmNhdGVnb3J5LnRpdGxlICsgKGUuaXNfd29uID8gJycgOiAnKOaPkOWQjSknKSkuc21hbGwoKSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcclxcbiAgICAgICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcclxcbiAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IF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ICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUgKyB5ZWFyLFxcclxcbiAgICAgICAgICAgIGltZzogZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuc3ViamVjdC5jb3Zlci5ub3JtYWwudXJsLFxcclxcbiAgICAgICAgICAgIGRlc2M6IGUucm9sZXMuam9pbihcXFwi4oCiXFxcIikgKyBcXFwiXFxcXG5cXFwiICsgcmF0aW5nICsgJ1xcXFxuJyArIGUuc3ViamVjdC5leHRyYS5zaG9ydF9pbmZvLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLFxcclxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KSlcXHJcXG5cXHJcXG4gICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcclxcbiAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IFxcXCI8YmlnPuWFsTxzdHJvbmc+IFxcXCIgKyBpLnRvdGFsICsgXFxcIiA8L3N0cm9uZz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WV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcclxcbiAgICAgICAgICAgIGltZzogZS5waWMgPyBlLnBpYy5ub3JtYWwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUucGljLm5vcm1hbCA6IGUuY292ZXIudXJsICsgJ0BSZWZlcmVyPScgKyBlLmNvdmVyLnVybCxcXHJcXG4gICAgICAgICAgICBkZXNjOiBlLm51bGxfcmF0aW5nX3JlYXNvbiB8fCBlLnJhdGluZy52YWx1ZVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9KSk7XFxyXFxuXFxyXFxuICAgIHNldEhvbWVSZXN1bHQoe1xcclxcbiAgICAgICAgZGF0YTogaVxcclxcbiAgICB9KVxcclxcbn1cXHJcXG5cXHJcXG4vL+W9seeJh+ivpuaDhemhtemdolxcclxcbmZ1bmN0aW9uIGRldGFpbHNWaWV3KHR5cGUsIGlkKSB7XFxyXFxuICAgIGxldCBpID0gZ2V0RG91YmFuUmVzKFxcXCJodHRwczovL2Zyb2RvLmRvdWJhbi5jb20vYXBpL3YyL1xcXCIgKyB0eXBlICsgXFxcIi9cXFwiICsgaWQpO1xcclxcbiAgICBzZXRQYWdlVGl0bGUoaS50aXRsZSk7XFxyXFxuICAgIGxldCBpbmZvID0gXFxc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I25vSGlzdG9yeSMnKS5ydWxlKCh0KSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgdHJhaWxlcnModFswXSwgdFsxXSk7XFxyXFxuICAgICAgICAgICAgfSwgW2kuc3VidHlwZSwgaS5pZF0pLFxcclxcbiAgICAgICAgfSk7XFxyXFxuICAgIH1cXHJcXG4gICAgaWYgKGkudmlkZW8pIHtcXHJcXG4gICAgICAgIHZpZGVvUmVsYXRlZEl0ZW1zLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPGJpZz48c3Ryb25nPuinhumikeivhOiuujwvc3Ryb25nPjwvYmlnPlxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXHJcXG4gICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXHJcXG4gICAgICAgICAgICB9LFxcclxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIHZpZGVvUmVsYXRlZEl0ZW1zLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBpLnZpZGVvLnRpdGxlLFxcclxcbiAgICAgICAgICAgIGltZzogaS52aWRlby5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGkudmlkZW8uY292ZXJfdXJsLFxcclxcbiAgICAgICAgICAgIHVybDogaS52aWRlby52aWRlb191cmwsXFxyXFxuICAgICAgICAgICAgZGVzYzogaS52aWRlby5hdXRob3IubmFtZSArIFxcXCLigKJcXFwiICsgaS52aWRlby5jcmVhdGVfdGltZSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlw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FxyXFxuICAgICAgICBpZiAoZXh0cmFDb25maWcuc3RhcnRzV2l0aCgneycpKSBldmFsKCdleHRyYT0nICsgZXh0cmFDb25maWcpO1xcclxcbiAgICB9IGNhdGNoIChlKSB7fVxcclxcbiAgICBsZXQgdmlkZW9JdGVtcyA9IFtdO1xcclxcbiAgICB2aWRlb1VybHNNb2R1bGUodmlkZW9JdGVtcywgdHlwZSwgaWQsIFsnaWNvbl8yJywgJ2ljb25fc21hbGxfNCddLCBwYXJzZVZpZGVvVXJsTGF6eSwgaSwgZXh0cmEpO1xcclxcbiAgICBpZiAodmlkZW9JdGVtcy5sZW5ndGggPiAwKSB7XFxyXFxuICAgICAgICB2aWRlb0l0ZW1zLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPGJpZz48c3Ryb25nPuWcqOe6v+inguecizwvc3Ryb25nPjwvYmlnPlxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXHJcXG4gICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXHJcXG4gICAgICAgICAgICB9LFxcclxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgdmlkZW9JdGVtcy51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiaWc+PHN0cm9uZz7lsJrml6DniYfmupA8L3N0cm9uZz48L2JpZz5cXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICA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pZz7lv6vpgJ/mkJzntKI8L2JpZz48L3N0cm9uZz4nLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgICAgIH0sXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAvKnF1aWNrU2VhcmNoSXRlbXMudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXHJcXG4gICAgICAgICAgICB9KSovXFxyXFxuICAgIH1cXHJcXG5cXHJcXG4gICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICBkYXRhOiBpbmZvSXRlbXMuY29uY2F0KHJhdGluZ0l0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQocmVsYXRlZEl0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHF1aWNrU2VhcmNoSXRlbXMpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC5jb25jYXQodmlkZW9JdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh2aWRlb1JlbGF0ZWRJdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgLmNvbmNhdChpbnRyb0l0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYTp7XFxyXFxuICAgICAgICAgICAgICAgICAgaWQ6ICdyZWNvbW1lbmRhdGlvbnMnXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxzbWFsbD48Zm9udCBjb2xvcj0jODcxZjc4PuS7peS4iuaVsOaNruadpea6kOS6juixhueTo++8jOWmguaCqOWWnOasou+8jOivt+S4i+i9veWumOaWuWFwcDwvZm9udD48L3NtYWxsPicsXFxyXFxuICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ08c21hbGw+PGZvbnQgY29sb3I9I2YyMGMwMD7mraTop4TliJnku4XpmZDlrabkuaDkuqTmtYHkvb/nlKjvvIzor7fkuo7lr7zlhaXlkI4yNOWwj+aXtuWGheWIoOmZpO+8jOS7u+S9lee7hOe7h+aIluS4quS6uuS4jeW+l+S7peS7u+S9leaWueW8j+aWueazleS8oOaSreatpOinhOWImeeahOaVtOS9k+aIlumDqOWIhu+8gTwvZm9udD48L3NtYWxsPicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vbW92aWUuZG91YmFuLmNvbS9zdWJqZWN0LycgKyBpZCArICcvJyxcXHJcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgfSlcXHJcXG4gICAgYmUoW3tcXHJcXG4gICAgICAgIGZ1bmM6IGZ1bmN0aW9uKG9iail7XFxyXFxuICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgIGxldCByZXMgPSBnZXREb3ViYW5SZXMob2JqLnVybCk7XFxyXFxuICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgbGV0IGRldGFpbHNWaWV3Q29uZmlncyA9IGdldENvbmZpZygnZGV0YWlsc1ZpZXdDb25maWdzJyk7XFxyXFxuICAgICAgICAgICAgbGV0IGwgPSBbcmVzWzBdLHJlc1sxXSxyZXNbMl1dO1xcclxcbiAgICAgICAgICAgIGxldCBpID0gbC5tYXAoKGUgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGUudHlwZSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gZS5pZCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gZS50aXRsZTtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNpbW1lcnNpdmVUaGVtZSNcXFwiICsgJz90eXBlPScgKyB0eXBlICsgJyZpZD0nICsgaWQpLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhLFxcclxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLnBpYyA/IGUucGljLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5waWMubm9ybWFsIDogZS5jb3Zlci51cmwgKyAnQFJlZmVyZXI9JyArIGUuY292ZXIudXJsLFxcclxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZS5udWxsX3JhdGluZ19yZWFzb24gfHwgZS5yYXRpbmcudmFsdWVcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0pKTtcXHJcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIGlbMl0pO1xcclxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncmVjb21tZW5kYXRpb25zJywgaVsxXSk7XFxyXFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCdyZWNvbW1lbmRhdGlvbnMnLCBpWzBdKTtcXHJcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08YmlnPjxzdHJvbmc+55u45YWz5o6o6I2QPC9zdHJvbmc+PC9iaWc+XFxcIixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyNub0hpc3RvcnkjJykucnVsZSgodCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmVjb21tZW5kYXRpb25zKHRbMF0sIHRbMV0pO1xcclxcbiAgICAgICAgICAgICAgICB9LCBbb2JqLnR5cGUsIG9iai5pZF0pLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ3JlY29tbWVuZGF0aW9ucycse2NvbF90eXBlOiA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gPC9mb250PjwvYj4nIDogaSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignZmluZExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAuaXRlbSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJmaW5kTGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIGl0ZW1zW2ldKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IHBsYXlhYmxlID0ge1xcclxcbiAgICAgICAg5YWo6YOo5b2x54mHOiAnMCcsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICcxJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcGxheWFibGUpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucGxheWFibGUgPT0gcGxheWFibGVbcl0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHIgKyAnIDwvZm9udD48L2I+JyA6IHIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gIC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Q29uZmlncycpO1xcclxcbiAgICBsZXQgaSA9IGwubWFwKChlID0+IHtcXHJcXG4gICAgICAgIGxldCB0eXBlID0gZS50eXBlLFxcclxcbiAgICAgICAgICAgIGlkID0gZS5pZCxcXHJcXG4gICAgICAgICAgICB0aXRsZSA9IGUuc3VidGl0bGUgfHwgZS50aXRsZTtcXHJcXG4gICAgICAgIGxldCBiYXNlVXJsID0gZS50eXBlID09PSBcXFwicGxheWxpc3RcXFwiID8gJ2hpa2VyOi8vZW1wdHkvJHBhZ2V7ZnlwYWdlfScgOiAnaGlrZXI6Ly9lbXB0eSNpbW1lcnNpdmVUaGVtZSMnO1xcclxcbiAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChiYXNlVXJsICsgXFxcIiNub0hpc3RvcnkjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxz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WE/YXJlYT3ml6XmnKwnXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAg55S16KeG5YmnOiB7XFxyXFxuICAgICAgICAgICAg54Ot5pKt55S16KeG5YmnOiAndHZfaG90JyxcXHJcXG4gICAgICAgICAgICDng63mkq3lm73kuqfliac6ICd0dl9kb21lc3RpYycsXFxyXFxuICAgICAgICAgICAg54Ot5pKt5qyn576O5YmnOiAndHZfYW1lcmljYW4nLFxcclxcbiAgICAgICAgICAgIOeDreaSreaXpeWJpzogJ3R2X2phcGFuZXNlJyxcXHJcXG4gICAgICAgICAgICDng63mkq3pn6nliac6ICd0dl9rb3JlYW4nLFxcclxcbiAgICAgICAgICAgIOeDreaSreWKqOeUuzogJ3R2X2FuaW1hdGlvbidcXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICDnu7zoibo6IHtcXHJcXG4gICAgICAgICAgICDng63mkq3nu7zoibo6ICdzaG93X2hvdCcsXFxyXFxuICAgICAgICAgICAg5Zu95YaF57u86Im6OiAnc2hvd19kb21lc3RpYycsXFxyXFxuICAgICAgICAgICAg5Zu95aSW57u86Im6OiAnc2hvd19mb3JlaWduJ1xcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGZvciAobGV0IGogaW4gaXRlbXNbaV0pIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5pdGVtID09IGl0ZW1zW2ldW2pdID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBqICsgJyA8L2ZvbnQ+PC9iPicgOiBqLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2hvdExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLml0ZW0gPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2hvdExpc3QnLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBpdGVtc1tpXVtqXSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBsZXQgc29ydCA9IHtcXHJcXG4gICAgICAgIOeDreW6puaOkuW6jzogJ3JlY29tbWVuZCcsXFxyXFxuICAgICAgICDml7bpl7TmjpLluo86ICd0aW1lJyxcXHJcXG4gICAgICAgIOivhOWIhuaOkuW6jzogJ3JhbmsnXFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgciBpbiBzb3J0KSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0ZW1wLnNvcnQgPT0gc29ydFtyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignaG90TGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC5zb3J0ID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhvdExpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICB9LCBzb3J0W3JdKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IHBsYXlhYmxlID0ge1xcclxcbiAgICAgICAg5YWo6YOo5b2x54mHOiAnMCcsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICcxJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcGxheWFibGUpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucGxheWFibGUgPT0gcGxheWFibGVbcl0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHIgKyAnIDwvZm9udD48L2I+JyA6IHIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOiAvL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04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Jyk7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJob3RMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgbCA9IFtdO1xcclxcbiAgICBpZiAodGVtcC5pdGVtLmluZGV4T2YoJz8nKSAhPSAtMSkge1xcclxcbiAgICAgICAgbGV0IHMgPSBnZXREb3ViYW5SZXMoXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvbW92aWUvXFxcIiArIHRlbXAuaXRlbSArICcmcGxheWFibGU9JyArIHRlbXAucGxheWFibGUgKyAnJnNvcnQ9JyArIHRlbXAuc29ydCArICcmc2NvcmVfcmFuZ2U9JyArIHRlbXAuc2NvcmUgKyAocGFnZSA/IFxcXCImc3RhcnQ9XFxcIiArIChwYWdlIC0gMSkgKiBjb3VudCArIFxcXCImY291bnQ9XFxcIiArIGNvdW50IDogXFxcIiZzdGFydD0wJmNvdW50PTMwXFxcIikgKyAnJmxvY19pZD0xMDgyODgnKTtcXHJcXG4gICAgICAgIGwgPSBzLml0ZW1zO1xcclxcbiAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgbGV0IHMgPSBnZXREb3ViYW5SZXMoXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvc3ViamVjdF9jb2xsZWN0aW9uL1xcXCIgKyB0ZW1wLml0ZW0gKyAnL2l0ZW1zJyArICc/cGxheWFibGU9JyArIHRlbXAucGxheWFibGUg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AgICB0aXRsZSA9IGl0ZW1zW2l0ZW1dW2ldO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICBsZXQgdXJsID0gJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRleHQsaXRlbSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBbaXRlbV0gPSB0ZXh0LmluZGV4T2YoXFxcIuWFqOmDqFxcXCIpICE9IC0xID8gXFxcIlxcXCIgOiB0ZXh0O1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCBpdGVtc1tpdGVtXVtpXSwgaXRlbSk7XFxyXFxuICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgaWYoaXRlbXNbaXRlbV1baV0gPT0gXFxcIuiHquWumuS5ieW5tOS7vVxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICBpZih0ZW1wLnllYXIgPT0gXFxcIuiHquWumuS5ieW5tOS7vVxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ5bm05Lu9OicgKyB0ZW1wLmN1c3RvbVllYXIgKyAnIDwvZm9udD48L2I+JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbVllYXIsICfnm7TmjqXovpPlhaXlhbfkvZPlubTku70s5L6L5aaCMjAwMCcpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID09IDQpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY3VzdG9tWWVhciA9IGlucHV0O1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAueWVhciA9IFxcXCLoh6rlrprkuYnlubTku71cXFwiO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgICAgICB9ZWxzZSBpZihpdGVtc1tpdGVtXVtpXSA9PSBcXFwi6Ieq5a6a5LmJ5Zyw5Yy6XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgIGlmKHRlbXAubG9jYWwgPT0gXFxcIuiHquWumuS5ieWcsOWMulxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ5Zyw5Yy6OicgKyB0ZW1wLmN1c3RvbUxvY2FsICsgJyA8L2ZvbnQ+PC9iPic7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21Mb2NhbCwgJ+ebtOaOpei+k+WFpeWFt+S9k+WcsOWMuizkvovlpoLkuK3lm73lpKfpmYYnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCA+IDApe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY3VzdG9tTG9jYWwgPSBpbnB1dDtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmxvY2FsID0gXFxcIuiHquWumuS5ieWcsOWMulxcXCI7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNsYXNzbGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0pO1xcclxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXCLoh6rlrprkuYnnsbvlnotcXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgaWYodGVtcC50eXBlID09IFxcXCLoh6rlrprkuYnnsbvlnotcXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieexu+WeizonICsgdGVtcC5jdXN0b21UeXBlICsgJyA8L2ZvbnQ+PC9iPic7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21UeXBlLCAn55u05o6l6L6T5YWl5YW35L2T57G75Z6LLOS+i+WmguWJp+aDhScpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID4gMCl7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21UeXBlID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC50eXBlID0gXFxcIuiHquWumuS5ieexu+Wei1xcXCI7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNsYXNzbGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0pO1xcclxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXCLoh6rlrprkuYnmoIfnrb5cXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgaWYodGVtcC5jbGFzcyA9PSBcXFwi6Ieq5a6a5LmJ5qCH562+XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7oh6rlrprkuYnmoIfnrb46JyArIHRlbXAuY3VzdG9tQ2xhc3MgKyAnIDwvZm9udD48L2I+JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbUNsYXNzLCAn55u05o6l6L6T5YWl5YW35L2T5qCH562+LOS+i+Wmgue7j+WFuFxcXFxu5Y+v5YaZ5aSa5Liq5qCH562+LOS9v+eUqFxcXCLoi7HmlofpgJflj7dcXFwi5YiG6ZqUJykuaW5wdXQoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbUNsYXNzID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jbGFzcyA9IFxcXCLoh6rlrprkuYnmoIfnrb5cXFwiO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGxldCByYW5rID0ge1xcclxcbiAgICAgICAg6buY6K6k5o6S5bqPOiBcXFwiVVxcXCIsXFxyXFxuICAgICAgICDng63luqY6IFxcXCJUXFxcIixcXHJcXG4gICAgICAgIOivhOWIhjogXFxcIlNcXFwiLFxcclxcbiAgICAgICAg5pe26Ze0OiBcXFwiUlxcXCJcXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCByIGluIHJhbmspIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucmFuayA9PT0gcmFua1tyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHV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Q9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcclxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhLFxcclxcbiAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXJfdXJsLFxcclxcbiAgICAgICAgICAgIGRlc2M6IGUubnVsbF9yYXRpbmdfcmVhc29uIHx8IGUucmF0aW5nLnZhbHVlXFxyXFxuICAgICAgICB9XFxyXFxuICAgIH0pKTtcXHJcXG5cXHJcXG4gICAgcmV0dXJuIHBhZ2UgPiAxID8gaSA6IGEuY29uY2F0KGkpO1xcclxcbn1cXHJcXG5cXHJcXG4vL+eJh+WNlVxcclxcbmZ1bmN0aW9uIHBsYXlMaXN0KHBhZ2UsIGNvdW50KSB7XFxyXFxuICAgIGlmICghZ2V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FwiLFxcclxcbiAgICAgICAgICAgIOWNjuivrTogXFxcImNoaW5lc2VcXFwiLFxcclxcbiAgICAgICAgICAgIOasp+e+jjogXFxcIndlc3Rlcm5cXFwiLFxcclxcbiAgICAgICAgICAgIOaXpeacrDogXFxcImphcGFuZXNlXFxcIixcXHJcXG4gICAgICAgICAgICDpn6nlm706IFxcXCJrb3JlYVxcXCIsXFxyXFxuICAgICAgICAgICAg5Zac5YmnOiBcXFwiY29tZWR5XFxcIixcXHJcXG4gICAgICAgICAgICDliqjkvZw6IFxcXCJhY3Rpb25cXFwiLFxcclxcbiAgICAgICAgICAgIOeIseaDhTogXFxcImxvdmVcXFwiLFxcclxcbiAgICAgICAgICAgIOenkeW5uzogXFxcInNjaWVuY2VfZmljdGlvblxcXCIsXFxyXFxuICAgICAgICAgICAg5Yqo55S7OiBcXFwiY2FydG9vblxcXCIsXFxyXFxuICAgICAgICAgICAg5oKs55aROiBcXFwibXlzdGVyeVxcXCIsXFxyXFxuICAgICAgICAgICAg5oOK5oKaOiBcXFwicGFuaWNcXFwiLFxcclxcbiAgICAgICAgICAgIOaBkOaAljogXFxcImhvcnJpYmxlXFxcIixcXHJcXG4gICAgICAgICAgICDniq/nvao6IFxcXCJjcmltaW5hbFxcXCIsXFxyXFxuICAgICAgICAgICAg5ZCM5oCnOiBcXFwibGdidFxcXCIsXFxyXFxuICAgICAgICAgICAg5oiY5LqJOiBcXFwid2FyXFxcIixcXHJcXG4gICAgICAgICAgICDlpYflubs6IFxcXCJmYW50YXN5XFxcIixcXHJcXG4gICAgICAgICAgICBcXFwiXFxcXHU2MGM1XFxcXHU4MjcyXFxcIjogXFxcImVyb3RpY2FcXFwiLFxcclxcbiAgICAgICAgICAgIOmfs+S5kDogXFxcIm11c2ljXFxcIixcXHJcXG4gICAgICAgICAgICDnuqrlvZXniYc6IFxcXCJkb2N1bWVudGFyeVxcXCIsXFxyXFxuICAgICAgICAgICAg5rK75oSIOiBcXFwiY3VyZVxcXCIsXFxyXFxuICAgICAgICAgICAg6Im65pyvOiBcXFwiYXJ0XFxcIixcXHJcXG4gICAgICAgICAgICDpu5HoibLlub3pu5g6IFxcXCJkYXJrX2h1bW9yXFxcIixcXHJcXG4gICAgICAgICAgICDpnZLmmKU6IFxcXCJ5b3V0aFxcXCIsXFxyXFxuICAgICAgICAgICAg5aWz5oCnOiBcXFwiZmVtYWxlXFxcIixcXHJcXG4gICAgICAgICAgICDnnJ/lrp7kuovku7bmlLnnvJY6IFxcXCJyZWFsX2V2ZW50XFxcIixcXHJcXG4gICAgICAgICAgICDmmrTlips6IFxcXCJ2aW9sZW5jZVxcXCIsXFxyXFxuICAgICAgICAgICAg6buR55m9OiBcXFwiYmxhY2tfd2hpdGVcXFwiLFxcclxcbiAgICAgICAgICAgIOe+jumjnzogXFxcImZvb2RcXFwiLFxcclxcbiAgICAgICAgICAgIOaXheihjDogXFxcInRyYXZlbFxcXCIsXFxyXFxuICAgICAgICAgICAg5YS/56ulOiBcXFwiY2hpbGRcXFwiLFxcclxcbiAgICAgICAgICAgIOS6uuaApzogXFxcImh1bWFuaXR5XFxcIixcXHJcXG4gICAgICAgICAgICDlrrbluq06IFxcXCJmYW1pbHlcXFwiLFxcclxcbiAgICAgICAgICAgIOaWh+iJujogXFxcImxpdGVyYXJ5X2FydFxcXCIsXFxyXFxuICAgICAgICAgICAg5bCP6K+05pS557yWOiBcXFwibm92ZWxcXFwiLFxcclxcbiAgICAgICAgICAgIOaEn+S6ujogXFxcIm1vdmluZ1xcXCIsXFxyXFxuICAgICAgICAgICAg5Yqx5b+XOiBcXFwiaW5zcGlyYXRpb25cXFwiXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgc3VidHlwZToge1xcclxcbiAgICAgICAgICAgIOWFqOmDqDogXFxcIlxcXCIsXFxyXFxuICAgICAgICAgICAg55S15b2xOiBcXFwibW92aWVcXFwiLFxcclxcbiAgICAgICAgICAgIOeUteinhuWJpzogXFxcInR2XFxcIlxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGZvciAobGV0IGogaW4gaXRlbXNbaV0pIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcFtpXSA9PT0gaXRlbXNbaV1bal0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGogKyAnIDwvZm9udD48L2I+JyA6IGosXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcigncGxheWxpc3QnLCAne1xcXCJzdWJ0eXBlXFxcIjpcXFwiXFxcIixcXFwidHlwZVxcXCI6XFxcImFsbFxcXCJ9JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGVtcFt0WzBdXSA9IHRbMV07XFxyXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicGxheWxpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBbaSwgaXRlbXNbaV1bal1dKVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXF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kb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBzdWJqZWN0Q29sbGVjdGlvbkxpc3QoTVlfUEFHRSwgNTAsIGlkKTtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0sIGUudHlwZSwgZS5pZCksXFxyXFxuICAgICAgICAgICAgaW1nOiBlLmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5jb3Zlcl91cmwsXFxyXFxuICAgICAgICAgICAgZGVzYzogXFxcIuWFsVxcXCIgKyBlLnRvdGFsICsgXFxcIumDqFxcXCJcXHJcXG4gICAgICAgIH0pKSk7XFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICBpID0gbC5tYXAoKGUgPT4gKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogJycgLyon4oCc4oCc4oCd4oCdJyArIGUubWVkaXVtX25hbWUgKyAnXFxcXG4nICsgZ2V0U3Ryb25nVGV4dChlLnRpdGxlKSovICxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzInLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8kcGFnZXtmeXBhZ2V9I25vSGlzdG9yeSMnKS5ydWxlKCh0eXBlLCBpZCwgc3RpdGxlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZShzdGl0bGUpO1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAg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An4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnJhbmsgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY29taW5nXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSwgcmFua1tpXSlcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG4gICAgbGV0IGxvY2FsID0ge1xcclxcbiAgICAgICAg5Zu95YaFOiAnZG9tZXN0aWMnLFxcclxcbiAgICAgICAg5YWo55CDOiAnaW50ZXJuYXRpb25hbCdcXHJcXG4gICAgfVxcclxcbiAgICBpZiAodGVtcC50eXBlID09ICdtb3ZpZScpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICBmb3IgKGxldCBpIGluIGxvY2FsKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAubG9jYWwgPT09IGxvY2FsW2ldID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udC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B1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgZm9yIChsZXQgaSBpbiBhcmVhKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAuYXJlYSA9PT0gYXJlYVtpXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaSArICcgPC9mb250PjwvYj4nIDogaSxcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjb21pbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLmFyZWEgPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNvbWluZ1xcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgIH0sIGFyZWFbaV0pXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfVxcclxcbiAgICBsZXQgZmlsdGVyID0ge1xcclxcbiAgICAgICAg5YWo6YOoOiAnJyxcXHJcXG4gICAgICAgIOWbveS6p+WJpzogJyZ0eXBlX2ZpbHRlcj10dl9kb21lc3RpYycsXFxyXFxuICAgICAgICDmrKfnvo7liac6ICcmdHlwZV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ICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUgKyBcXFwi77yIXFxcIiArIGUueWVhciArIFxcXCLvvIlcXFwiLFxcclxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhLFxcclxcbiAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiAr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1xcclxcbiAgICAgICAgfSxcXHJcXG4gICAgICAgIOeUteinhuWJpzoge1xcclxcbiAgICAgICAgICAgIOWunuaXtueDremXqOWJp+mbhjogJ3R2X3JlYWxfdGltZV9ob3Rlc3QnLFxcclxcbiAgICAgICAgICAgIOWNjuivreWPo+eikeWJp+mbhjogJ3R2X2NoaW5lc2VfYmVzdF93ZWVrbHknLFxcclxcbiAgICAgICAgICAgIOWFqOeQg+WPo+eikeWJp+mbhjogJ3R2X2dsb2JhbF9iZXN0X3dlZWtseSdcXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICDnu7zoibo6IHtcXHJcXG4gICAgICAgICAgICDlm73lhoXlj6PnopHnu7zoibo6ICdzaG93X2NoaW5lc2VfYmVzdF93ZWVrbHknLFxcclxcbiAgICAgICAgICAgIOWbveWkluWPo+eikee7vOiJujogJ3Nob3dfZ2xvYmFsX2Jlc3Rfd2Vla2x5J1xcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGZvciAobGV0IGogaW4gaXRlbXNbaV0pIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5pdGVtID09IGl0ZW1zW2ldW2pdID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBqICsgJyA8L2ZvbnQ+PC9iPicgOiBqLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ3JhbmtpbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLml0ZW0gPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInJhbmtpbmdcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBpdGVtc1tpXVtqXSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IGkgPSBbXTtcXHJcXG4gICAgbGV0IHBsYXlhYmxlID0ge1xcclxcbiAgICAgICAg5YWo6YOo5b2x54mHOiAnMCcsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICcxJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcGxheWFibGUpIHtcXHJcXG4gICAgICAgIGkucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucGxheWFibGUgPT0gcGxheWFibGVbcl0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHIgKyAnIDwvZm9udD48L2I+JyA6IHIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOiAvL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xc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XFxyXFxuICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxyXFxuICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmEsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLnBpYy5ub3JtYWwgKyBcXFwiQFJlZmVyZXI9XFxc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BsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmEsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLmNvbnRlbnQuc3ViamVjdC5waWMubm9ybWFsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLmNvbnRlbnQuc3ViamVjdC5waWMubm9ybWFsLFxcclxcbiAgICAgICAgICAgIGRlc2M6IGUuY29udGVudC5zdWJqZWN0LmNhcmRfc3VidGl0bGUuc3BsaXQoXFxcIi9cXFwiKS5maWx0ZXIoKChlLCB0KSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0IDwgMykgcmV0dXJuIGVcXHJcXG4gICAgICAgICAgICB9KSkuam9pbihcXFwiLFxcXCIpICsgXFxcIlxcXFxuXFxcIiArIChlLmNvbnRlbnQuc3ViamVjdC5yYXRpbmcgPyBjb21wdXRlUmF0aW5nKGUuY29udGVudC5zdWJqZWN0LnJhdGluZy5tYXgsIGUuY29udGVudC5zdWJqZWN0LnJhdGluZy52YWx1ZSkgKyBcXFwiIFxcXCIgKyBlLmNvbnRlbnQuc3ViamVjdC5yYXRpbmcudmFsdWUudG9GaXhlZCgxKSArIFxcXCLliIZcXFwiIDogXFxcIuaaguaXoOivhOWIhlxcXCIpXFxyXFxuICAg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WzBdIHx8IFxcXCJpY29uXzJcXFwiLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHk/aWQ9JyArIGlkICsgJyZ0eXBlPScgKyB0eXBlICsgJyZ0aXRsZT0nICsgZS50aXRsZSkucnVsZSgocmVzLCBpZCwgZSwgbGF6eSwgZXh0cmEpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHJlcy50aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWMgPSByZXMucGljLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgcmVzLnBpYy5ub3JtYWw7XFxyXFxuICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUoZS50aXRsZSArICctJyArIHRpdGxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVBpY1VybChwaWMpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmxzID0gZ2V0VHZVcmxzKGlkLCBlLmlkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxhenkgPSAkKFxcXCJcXFwiKS5sYXp5UnVsZShsYXp5ID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0VXJsID0gXFxcInRvYXN0Oi8v6Kej5p6Q5aSx6LSlXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXCIoXFxcIikpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyBsYXp5KVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0VXJsID0gJyArICcoKCkgPT4geycgKyBsYXp5ICsgJ30pKCknKVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0VXJsXFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCBsYXp5KVxcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YodXJscykgPT0gXFxcIm9iamVjdFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdXJscy5sZW5ndGg7IGkrKykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnrKwnICsgKGkgKyAxKSArICfpm4YnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzQnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBsYXp5ID8gdXJsc1tpXSArIGxhenkgOiB1cmxzW2ldLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJhXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mKHVybHMpID09IFxcXCJzdHJpbmdcXFwiICYmIHVybHMgPT0gJ+iiq+WwgWlwJykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBydWxlID0gSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvcmVsZWFzZUlQP3J1bGU96Z2S6LGGXFxcIikpXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ydWxlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwocnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZih1cmxzKSA9PSAnc3RyaW5nJyAmJiB1cmxzID09ICfmsqHmnInmlLblvZUnKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+ixhueTo+ayoeacieaUtuW9leatpOinhumikea6kOeahOivpue7huS/oeaBrycsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICfngrnmiJHlj6/ku6Xljrvop4bpopHmupDnvZHnq5nnnIvnnIsnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGUudXJsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0sIHJlcywgaWQsIGUsIGxhenksIGV4dHJhKVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdtb3ZpZScpIHtcXHJcXG4gICAgICAgICAgICBsZXQgbUxhenkgPSAkKFxcXCJcXFwiKS5sYXp5UnVsZShsYXp5ID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdFVybCA9IFxcXCJ0b2FzdDovL+ino+aekOWksei0pVxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXCIoXFxcIikpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgbGF6eSlcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0VXJsID0gJyArICcoKCkgPT4geycgKyBsYXp5ICsgJ30pKCknKVxcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHRVcmxcXHJcXG4gICAgICAgICAgICB9LCBsYXp5KVxcclxcbiAgICAgICAgICAgIGQucHVzaCh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBlLnRpdGxlICsgKGUuZXBpc29kZXNfaW5mbyA/IFxcXCLigKJcXFwiICsgZS5lcGlzb2Rlc19pbmZvIDogXFxcIlxcXCIpLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6I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kZXMoXFxcIndpbmRvdy5sb2NhdGlvbi5ocmVmXFxcIikgJiYgaHRtbC5pbmNsdWRlcyhcXFwic2VjLmRvdWJhblxcXCIpKSkge1xcclxcbiAgICAgICAgcmV0dXJuICfooqvlsIFpcCc7XFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICBsZXQgcyA9IHtcXHJcXG4gICAgICAgICAgICBxcTogMSxcXHJcXG4gICAgICAgICAgICB5b3VrdTogMyxcXHJcXG4gICAgICAgICAgICBsZXR2OiA2LFxcclxcbiAgICAgICAgICAgIG1ndHY6IDcsXFxyXFxuICAgICAgICAgICAgYmlsaWJpbGk6IDgsXFxyXFxuICAgICAgICAgICAgaXFpeWk6IDksXFxyXFxuICAgICAgICAgICAgY250djogMTIsXFxyXFxuICAgICAgICAgICAgY2N0djY6IDEzLFxcclxcbiAgICAgICAgICAgIG1pZ3V2aWRlbzogMTUsXFxyXFxuICAgICAgICAgICAgeGlndWE6IDE3LFxcclxcbiAgICAgICAgICAgIGFjZnVuOiAxOCxcXHJcXG4gICAgICAgICAgICBtYWlkdWlkdWk6IDE5XFxyXFxuICAgICAgICB9O1xcclxcbiAgICAgICAgbGV0IG51bSA9IHNbdWlkXTtcXHJcXG5cXHJcXG4gICAgICAgIHZhciBzb3VyY2VzID0ge307XFxyXFxuICAgICAgICBsZXQgc2wgPSBodG1sLm1hdGNoKC9zb3VyY2VzXFxcXFtbMS05XXsxLDJ9XFxcXF1bXFxcXHNcXFxcU10qP1xcXFxdL2cpO1xcclxcbiAgICAgICAgaWYgKHNsKSB7XFxyXFxuICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBzbCkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKHNsW2ldKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIGxldCBzY3JpcHRfbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJ2JvZHkmJnNjcmlwdFtzcmNdJyk7XFxyXFxuICAgICAgICAgICAgbGV0IHNvdXJjZXNfdXJsID0gXFxcIlxcXCI7XFxyXFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBzY3JpcHRfbGlzdCkge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gcGFyc2VEb21Gb3JIdG1sKHNjcmlwdF9saXN0W2ldLCAnc2NyaXB0JiZzcmMnKTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5pbmRleE9mKCdtaXhlZF9zdGF0aWMnKSAhPT0gLTEpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHNvdXJjZXNfdXJsID0gdXJsO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIGxldCBzb3VyY2VzX2xpc3QgPSByZXF1ZXN0KHNvdXJjZXNfdXJsKS5tYXRjaCgvc291cmNlc1xcXFxbWzEtOV17MSwyfVxcXFxdW1xcXFxzXFxcXFNdKj9cXFxcXS9nKTtcXHJcXG4gICAgICAgICAgICBmb3IgKHZhciBpIGluIHNvdXJjZXNfbGlzdCkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKHNvdXJjZXNfbGlzdFtpXSk7XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfVxcclxcblxcclxcbiAgICAgICAgbGV0IHJlbiA9IHNvdXJjZXNbbnVtXTtcXHJcXG4gICAgICAgIGlmIChyZW4gJiYgcmVuLmxlbmd0aCA+IDApIHtcXHJcXG4gICAgICAgICAgICAvKnZhciByID0gcmVuLm1hcChlID0+IHVuZXNjYXBlKGUucGxheV9saW5rLnJlcGxhY2UoLyhodHRwc3xodHRwKTpcXFxcL1xcXFwvd3d3LmRvdWJhbi5jb21cXFxcL2xpbmsyXFxcXC9cXFxcP3VybD0vLCAnJylcXHJcXG4gICAgICAgICAgICAgICAgLnNwbGl0KCc7JylbMF0uc3BsaXQoJy5odG1sJylbMF0gK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xcIiA6IGNvbmZpZ0tleSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKGNvbmZpZ0tleSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxuICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzLnVzZSA9PT0gY29uZmlnS2V5KSB7XFxuICAgICAgICAgICAgICAgICAgICAvL3B1dE15VmFyKFxcXCJpbnB1dF9jb25maWdfdHlwZVxcXCIsICflvbHniYfor6bmg4XpobXpnaLphY3nva4nKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X25hbWVcXFwiLCBjb25maWdLZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X2NvZGVcXFwiLCBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzW2NvbmZpZ0tleV0uY29uZmlnKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9zZXR0aW5nX2NvZGVcXFwiLCBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzW2NvbmZpZ0tleV0uc2V0dGluZyB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9zZXR0aW5nLWVkaXRvcj9ydWxlPemdkuixhiZ2aWV3PWRldGFpbFZpZXdNb2RlRWRpdFBhZ2UnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3MudXNlID0gY29uZmlnS2V5XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmiJDlip8nXFxuICAgICAgICAgICAgfSwgY29uZmlnS2V5KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4p6VJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL3NldHRpbmctZWRpdG9yP3J1bGU96Z2S6LGGJnZpZXc9ZGV0YWlsVmlld01vZGVFZGl0UGFnZSdcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KelicsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhkZXRhaWxzVmlld0NvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyAmJiBjb25maWdLZXkgIT09ICfpu5jorqQnKSwgMilcXG4gICAgICAgICAgICAuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzLnVzZSkgcmV0dXJuICd0b2FzdDovL+ivpemFjee9ruato+WcqOS9v+eUqO+8jOaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJ+ehruiupOWIoOmZpFxcXCInICsgaW5wdXQgKyAnXFxcIu+8nycpLmNvbmZpcm0oKGNvbmZpZywgY29uZmlnS2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLmRldGFpbHNWaWV3Q29uZmlnc1tjb25maWdLZXldXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXG4gICAgICAgICAgICAgICAgfSwgY29uZmlnLCBpbnB1dClcXG4gICAgICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5OdJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKE9iamVjdC5rZXlzKGRldGFpbHNWaWV3Q29uZmlncykuZmlsdGVyKGNvbmZpZ0tleSA9PiBjb25maWdLZXkgIT09ICd1c2UnKSwgMikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAvLyBpZiAoaW5wdXQgPT09ICfpu5jorqQnKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6YWN572u5peg5rOV57yW6L6R77yBJ1xcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcIml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Q29uZmlncykpIHtcXG4gICAgICAgIGlmIChjb25maWdLZXkgPT09ICd1c2UnKSBjb250aW51ZTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGNvbmZpZ0tleSA9PT0gaG9tZVBhZ2VDb25maWdzLnVzZSA/IFxcXCLigJzigJxcXFwiICsgY29uZmlnS2V5ICsgXFxcIuKAneKAnVxcXCIgOiBjb25maWdLZXksXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShjb25maWdLZXkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmhvbWVQYWdlQ29uZmlncy51c2UgPT09IGNvbmZpZ0tleSkge1xcbiAgICAgICAgICAgICAgICAgICAgLy9wdXRNeVZhcihcXFwiaW5wdXRfY29uZmlnX3R5cGVcXFwiLCAn6aaW6aG16YWN572uJylcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9uYW1lXFxcIiwgY29uZmlnS2V5KTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9jb2RlXFxcIiwgY29uZmlnLmhvbWVQYWdlQ29uZmlnc1tjb25maWdLZXldLmNvbmZpZyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9zZXR0aW5nLWVkaXRvcj9ydWxlPemdkuixhiZ2aWV3PWhvbWVQYWdlTW9kZUVkaXRQYWdlJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjb25maWcuaG9tZVBhZ2VDb25maWdzLnVzZSA9IGNvbmZpZ0tleVxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYX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nKSkucnVsZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuIENvbmZpZ1Rvb2wudG9DbGlwYm9hcmQoQ29uZmlnVG9vbC5leHBvcnQoc2VsZWN0Q29uZmlnLm5hbWUsIHNlbGVjdENvbmZpZywgXFxcIummlumhtemFjee9rlxcXCIsIGlucHV0KSlcXG4gICAgICAgICAgICB9LCBzZWxlY3RDb25maWcpXFxuICAgICAgICB9KVxcbiAgICB9KVxcbn1cXG5cXG4vLyDop6PmnpDphY3nva7mqKHlnZdcXG5mdW5jdGlvbiBhbmFseXNpc01vZGVNb2R1bGUoZCwgYW5hbHlzaXNDb25maWdzKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+iHquWumuS5ieino+aekOaPkuS7ticuYm9sZCgpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxuICAgIH0pXFxuICAgIGZvciAobGV0IGNvbmZpZ0tleSBvZiBPYmplY3Qua2V5cyhhbmFseXNpc0NvbmZpZ3MpKSB7XFxuICAgICAgICBpZiAoY29uZmlnS2V5ID09PSAndXNlJykgY29udGludWU7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBjb25maWdLZXkgPT09IGFuYWx5c2lzQ29uZmlncy51c2UgPyBcXFwi4oCc4oCcXFxcIiArIGNvbmZpZ0tleSArIFxcXCLigJ3igJ1cXFwiIDogY29uZmlnS2V5LFxcbiAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoY29uZmlnS2V5ID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5hbmFseXNpc0NvbmZpZ3MudXNlID09PSBjb25maWdLZXkpIHtcXG4gICAg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AgICByZXR1cm4gJCgn56Gu6K6k5Yig6ZmkXFxcIicgKyBpbnB1dCArICdcXFwi77yfJykuY29uZmlybSgoY29uZmlnLCBjb25maWdLZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV1cXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIoOmZpCcgKyBjb25maWdLZXkgKyAn5oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/Cfk50nLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICQoT2JqZWN0LmtleXMoYW5hbHlzaXNDb25maWdzKS5maWx0ZXIoY29uZmlnS2V5ID0+IGNvbmZpZ0tleSAhPT0gJ3VzZScpLCAyKVxcbiAgICAgICAgICAgIC5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAvLyBpZiAoaW5wdXQgPT09ICfkuI3op6PmnpAnICYmIGlucHV0ID09PSAn5pat5o+SJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOino+aekOaXoOazlee8lui+ke+8gSdcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgICAgIGxldCBjb25maWdLZXkgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcIml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o/lkI1AQOWbvueJh+mTvuaOpScsICfmoLnmja7mj5DnpLrovpPlhaXlsLHlpb3kuoZcXFxcbuWwj+eoi+W6j+WQjeS4uuepuuWImeS4uua1t+mYlOaQnOe0oicpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC5zcGxpdCgnQEAnKTtcXG4gICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggIT0gMyB8fCBpbnB1dFswXSA9PT0gXFxcIlxcXCIpIHJldHVybiBcXFwidG9hc3Q6Ly/moLzlvI/kuI3lr7nvvIzmjInmoLzlvI/ovpPlhaUhXFxcIjtcXG4gICAgICAgICAgICBpZiAoY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5pbmRleE9mKGlucHV0WzBdKSA9PSAtMSkgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5wdXNoKGlucHV0WzBdKTtcXG4gICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW2lucHV0WzBdXSA9IHtcXG4gICAgICAgICAgICAgICAgbmFtZTogaW5wdXRbMV0sXFxuICAgICAgICAgICAgICAgIHBpYzogaW5wdXRbMl1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a3u+WKoOaIkOWKnyc7XFxuICAgICAgICB9KVxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4p6WJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKHF1aWNrU2VhcmNoQ29uZmlncy5vcmRlciwgMikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgIHJldHVybiAkKCfnoa7orqTliKDpmaRcXFwiJyArIGlucHV0ICsgJ1xcXCLvvJ8nKS5jb25maXJtKChjb25maWcsIGNvbmZpZ0tleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmluZGV4T2YoY29uZmlnS2V5KTtcXG4gICAgICAgICAgICAgICAgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5zcGxpY2UoaW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlnc1tjb25maWdLZXldXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXG4gICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+TnScsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChxdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIsIDIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgbGV0IHF1aWNrU2VhcmNoQ29uZmlncyA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3M7XFxuICAgICAgICAgICAgbGV0IGR0ZXh0ID0gaW5wdXQgKyAnQEAnICsgcXVpY2tTZWFyY2hDb25maWdzW2lucHV0XS5uYW1lICsgJ0BAJyArIHF1aWNrU2VhcmNoQ29uZmlnc1tpbnB1dF0ucGljO1xcbiAgICAgICAgICAgIHJldHVybiAkKGR0ZXh0LCAn6K+35L+u5pS5JykuaW5wdXQoKGNvbmZpZywgcmF3KSA9PiB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQuc3BsaXQoJ0BAJyk7XFxuICAgICAgICAgICAgICAgIGlmIChyYXcgIT0gaW5wdXRbMF0pIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIuaW5kZXhPZihyYXcpO1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlcltpbmRleF0gPSBpbnB1dFswXTtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW3Jhd107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIuaW5kZXhPZihpbnB1dFswXSkgPT0gLTEpIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIucHVzaChpbnB1dFswXSk7XFxuICAgICAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3NbaW5wdXRbMF1dID0ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXRbMV0sXFxuICAgICAgICAgICAgICAgICAgICBwaWM6IGlucHV0WzJdXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJztcXG4gICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+UgScsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjJykucnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgYWRkTGlzdGVuZXIoJ29uQ2xvc2UnLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignanNvbicpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdvcCcpO1xcbiAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgIGlmIChnZXRNeVZhcignanNvbicpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcbiAgICAgICAgICAgICAgICBsZXQgcXVpY2tTZWFyY2hDb25maWdzID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncztcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2pzb24nLCBKU09OLnN0cmluZ2lmeShxdWlja1NlYXJjaENvbmZpZ3MpKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgbGV0IG9sZCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2pzb24nKSk7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+WIhuWIq+eCueWHu+S4pOmhueS7peS6pOaNoumhuuW6j1xcXFxu4oCY4oCY5o6S5bqP5a6M5q+V5ZCO54K55oiR5L+d5a2Y5o6S5bqPLOWQpuWImeaOkuW6j+S4jeeUn+aViOKAmeKAmScsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzID0gSlNPTi5wYXJzZShnZXRNeVZhcignanNvbicpKTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgb2xkLm9yZGVyLmZvckVhY2goKHZhbHVlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKCdvcCcpID09IHZhbHVlID8gdmFsdWUgKyAn4oCY4oCYKOW9k+WJjemAieS4rSnigJnigJknIDogdmFsdWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoa2V5LCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcCA9IGdldE15VmFyKCdvcCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcCA9PSAnJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignb3AnLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcCA9PSBrZXkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvbGQgPSBKU09OLnBhcnNlKGdldE15VmFyKCdqc29uJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3YSA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IG9sZC5tb2RlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXI6IG9sZC5vcmRlclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3BpbmRleCA9IG5ld2Eub3JkZXIuaW5kZXhPZihvcCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicyhvcGluZGV4IC0gaW5kZXgpID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXJbb3BpbmRleF0gPSBrZXk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyW2luZGV4XSA9IG9wO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9waW5kZXggPiBpbmRleCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2Uob3BpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShpbmRleCwgMCwgb3ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2Uob3BpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShpbmRleCAtIDEsIDAsIG9wKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLmZvckVhY2godmFsdWUgPT4gbmV3YVt2YWx1ZV0gPSBvbGRbdmFsdWVdKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanNvbicsIEpTT04uc3RyaW5naWZ5KG5ld2EpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIHZhbHVlLCBpbmRleClcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+Kame+4jycsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChxdWlja1NlYXJjaENvbmZpZ3NbJ21vZGUnXSB8fCBcXFwiXFxcIiwgJ+ivt+ato+ehrui+k+WFpee7hOS7tuagt+W8j1xcXFxu5bu66K6u5YC8OmZsZXhfYnV0dG9uIHNjcm9sbF9idXR0b24gaWNvbl9yb3VuZF9zbWFsbF80IGljb25fc21hbGxfNCcpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm1vZGUgPSBpbnB1dDtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/moLflvI/kv67mlLnmiJDlip8nXFxuICAgICAgICB9KVxcbiAgICB9KVxcbn1cXG5cXG4vL+iuvue9rumhtemdolxcbmZ1bmN0aW9uIHNldHRpbmdQYWdlKCkge1xcbiAgICBsZXQgY29uZiA9IGdldENvbmZpZygpO1xcbiAgICBsZXQgZCA9IFtdO1xcblxcbiAgICBsZXQgc3RhckNvbG9yID0gY29uZi5zdGFyQ29sb3IgfHwgJyNmZmFjMmQnO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ+iHquWumuS5ieaYn+aYn+minOiJsicuYm9sZCgpLFxcbiAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPScgKyBzdGFyQ29sb3IgKyAnPicgKyAn4piF4piF4piF4piF4piFPC9mb250PicsXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICB1cmw6ICQoc3RhckNvbG9yLCAn5Yir5b+Y5LqGIycpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgY29uZmlnLnN0YXJDb2xvciA9IGlucHV0O1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7mm7TmlLnlt7Lkv53lrZhcXFwiO1xcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgbGV0IGNob29zZUNvbG9yID0gY29uZi5jaG9vc2VDb2xvciB8fCAnI0ZBNzI5OCc7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAn6Ieq5a6a5LmJ6YCJ5Lit5qCH562+6aKc6ImyJy5ib2xkKCksXFxuICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9JyArIGNob29zZUNvbG9yICsgJz4nICsgJ+aIkeaYr+mihOiniOaViOaenDwvZm9udD4nLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgdXJsOiAkKGNob29zZUNvbG9yLCAn5Yir5b+Y5LqGIycpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgY29uZmlnLmNob29zZUNvbG9yID0gaW5wdXQ7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruabtOaUueW3suS/neWtmFxcXCI7XFxuICAgICAgICB9KVxcbiAgICB9KVxcblxcbiAgICBob21lUGFnZVNldHRpbmdNb2R1bGUoZCk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgIH0pXFxuXFxuICAgIHF1aWNrU2VhcmNoRElZTW9kdWxlKGQsIGNvbmYpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICB9KVxcblxcbiAgICBkZXRhaWxWaWV3U2V0dGluZ01vZHVsZShkKTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZSdcXG4gICAgfSlcXG5cXG4gICAgaWYgKHRydWUvKmdldEl0ZW0oJ3Bhc3N3b3JkJykgPT0gJ3RydWUnKi8pIHtcXG4gICAgICAgIGFuYWx5c2lzU2V0dGluZ01vZHVsZShkKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ+aBouWkjem7mOiupOiuvue9ricuYm9sZCgpLFxcbiAgICAgICAgZGVzYzogJ+mHjeeUnycsXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICB1cmw6ICQoWyfph43nva7mmJ/mmJ/popzoibInLCAn6YeN572u6YCJ5Lit5qCH562+6aKc6ImyJywgJ+mHjee9ruW/q+mAn+aQnOe0oicsICfph43nva7pppbpobXkuLrpu5jorqQnLCAn6YeN572u6K+m5oOF6aG1JyAsICfmuIXpmaTlhajpg6jorr7nva4nXSwgMSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a6KaBXFxcIiArIGlucHV0ICsgXFxcIu+8n1xcXCIpLmNvbmZpcm0oKHNlbCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgaXRlbSA9ICcnO1xcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHNlbCkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u5pif5pif6aKc6ImyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3N0YXJDb2xvcic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7pgInkuK3moIfnrb7popzoibInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnY2hvb3NlQ29sb3InO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u5b+r6YCf5pCc57SiJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3F1aWNrU2VhcmNoQ29uZmlncyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7pppbpobXkuLrpu5jorqQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnaG9tZVBhZ2VDb25maWdzJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruivpuaDhemhtSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdkZXRhaWxWaWV3Q29uZmlncyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfmuIXpmaTlhajpg6jorr7nva4nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnYWxsJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvLyBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3NldHRpbmdQYWdlJykpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdENvbmZpZ3MgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9kZWZhdWx0Q29uZmlnc1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoaXRlbSA9PSAnYWxsJykge1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGRlZmF1bHRDb25maWdzKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3slxcXCIgKyBzZWw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZihpdGVtID09IFxcXCJob21lUGFnZUNvbmZpZ3NcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKGZldGNoKGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ1tpdGVtXVtcXFwi6buY6K6kXFxcIl0gPSBkZWZhdWx0Q29uZmlnc1tpdGVtXVtcXFwi6buY6K6kXFxcIl07XFxuICAgICAgICAgICAgICAgICAgICBjb25maWdbaXRlbV0udXNlID0gXFxcIum7mOiupFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3slxcXCIgKyBzZWw7XFxuICAgICAgICAgICAgICAgIH1lbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKGZldGNoKGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ1tpdGVtXSA9IGRlZmF1bHRDb25maWdzW2l0ZW1dO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7JcXFwiICsgc2VsO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgaW5wdXQpXFxuICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBzZXRSZXN1bHQoZCk7XFxufVxcblxcbmxldCB2aWV3ID0gZ2V0UGFyYW0oXFxcInZpZXdcXFwiLFxcXCJcXFwiKTtcXG5pZih2aWV3PT1cXFwiXFxcIil7XFxuICAgIHNldFBhZ2VUaXRsZShcXFwi6K6+572uXFxcIilcXG4gICAgc2V0dGluZ1BhZ2UoKTtcXG59ZWxzZSBpZih2aWV3PT1cXFwiYW5hbHlzaXNTZXR0aW5nTW9kdWxlXFxcIil7XFxuICAgIGxldCBkID0gW107XFxuICAgIHNldFBhZ2VUaXRsZShcXFwi6Kej5p6Q6K6+572u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cXG4gICAgICAgIFxcXCLkuI3op6PmnpBcXFwiOiB7XFxyXFxuICAgICAgICAgICAgY29uZmlnOiAkLnRvU3RyaW5nKCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGlucHV0O1xcclxcbiAgICAgICAgICAgIH0pLFxcclxcbiAgICAgICAgICAgIHNldHRpbmc6ICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K+l5o+S5Lu25peg6K6+572u6aG16Z2iXFxcIjtcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfSxcXHJcXG4gICAgICAgIFxcXCLmlq3mj5JcXFwiOiB7XFxyXFxuICAgICAgICAgICAgY29uZmlnOiAkLnRvU3RyaW5nKCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IGZpbGUgPSBcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9EdWFuTmlhbi9NeVBhcnNlLmpzb25cXFwiO1xcclxcbiAgICAgICAgICAgICAgICBsZXQgb2xkZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoZmlsZSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoJ2pzb249JyArIGZldGNoKGZpbGUpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IGpzb24uc2V0dGluZ3MuY2o7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGpzVXJsKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKGlucHV0KTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmaWxlRXhpc3Qob2xkZmlsZSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IEpTT04ucGFyc2UoZmV0Y2gob2xkZmlsZSkpLmNqO1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShpbnB1dCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rKh5om+5Yiw5pat5o+S6YWN572u5paH5Lu2JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0pLFxcclxcbiAgICAgICAgICAgIHNldHRpbmc6ICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL0R1YW5OaWFuL015UGFyc2UuanNvblxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIGxldCBvbGRmaWxlID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChmaWxlKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgnanNvbj0nICsgZmV0Y2goZmlsZSkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0ganNvbi5zZXR0aW5ncy5jajtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRVcmw7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmlsZUV4aXN0KG9sZGZpbGUpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNVcmwgPSBKU09OLnBhcnNlKGZldGNoKG9sZGZpbGUpKS5jajtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YW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clxcbiAgICByZXR1cm4gY29uZmlnO1xcclxcbn1cXHJcXG5cXHJcXG4vL+iOt+WPlumFjee9rumhuVxcclxcbmZ1bmN0aW9uIGdldENvbmZpZyhuYW1lLCByb290Q29uZmlnKSB7XFxyXFxuICAgIGxldCBjb25maWcgPSByb290Q29uZmlnID8gcm9vdENvbmZpZyA6IEpTT04ucGFyc2UoZmV0Y2goZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcclxcbiAgICBpZiAobmFtZSkge1xcclxcbiAgICAgICAgaWYgKGNvbmZpZ1tuYW1lXSA9PSBudWxsKSB7XFxyXFxuICAgICAgICAgICAgY29uZmlnID0gaW5pdENvbmZpZ3MobmFtZSwgY29uZmlnKTtcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIHJldHVybiBjb25maWdbbmFtZV07XFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICByZXR1cm4gY29uZmlnO1xcclxcbiAgICB9XFxyXFxufVxcclxcblxcclxcbi8v57yW56CB5bel5YW357G7XFxyXFxubGV0IFppcFRvb2wgPSB7XFxyXFxuICAgIGRlcGVuZGVuY2U6ICdodHRwczovL3VucGtnLmNvbS9sei1zdHJpbmdAMS40LjQvbGlicy9sei1zdHJpbmcubWluLmpzJyxcXHJcXG4gICAgY29tcHJlc3M6IHtcXHJcXG4gICAgICAgIHNpemU6IHtcXHJcXG4gICAgICAgICAgICBrZXk6IFxcXCJ0ZXh0LWNvbXByZXNzLXNpemVcXFwiLFxcclxcbiAgICAgICAgICAgIHNldDogKG5ld1ZhbHVlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKHRoaXMua2V5LCBuZXdWYWx1ZS50b1N0cmluZygpKVxcclxcbiAgICAgICAgICAgIH0sXFxyXFxuICAgICAgICAgICAgZ2V0OiAoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUludChnZXRNeVZhcih0aGlzLmtleSwgXFxcIjBcXFwiKSlcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgZXhlYzogKGlucHV0KSA9PiB7XFxyXFxuICAgICAgICAgICAgZXZhbChyZXF1ZXN0KFppcFRvb2wuZGVwZW5kZW5jZSkpXFxyXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IExaU3RyaW5nLmNvbXByZXNzVG9FbmNvZGVkVVJJQ29tcG9uZW50KGlucHV0KVxcclxcbiAgICAgICAgICAgICAgICAvLyBaaXBUb29sLmNvbXByZXNzLnNpemUuc2V0KHJlc3VsdC5sZW5ndGggKiAyKVxcclxcbiAgICAgICAgICAgIHJldHVybiByZXN1bHRcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfSxcXHJcXG4gICAgZGVjb21wcmVzczoge1xcclxcbiAgICAgICAgc2l6ZToge1xcclxcbiAgICAgICAgICAgIGdldDogKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0TXlWYXIoXFxcInRleHQtZGVjb21wcmVzc1xcXCIsIFxcXCIwXFxcIilcXHJcXG4gICAgICAgICAgICAgICAgICAgIC5sZW5ndGhcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgZXhlYzogKGlucHV0KSA9PiB7XFxyXFxuICAgICAgICAgICAgZXZhbChyZXF1ZXN0KFppcFRvb2wuZGVwZW5kZW5jZSkpXFxyXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IExaU3RyaW5nLmRlY29tcHJlc3NGcm9tRW5jb2RlZFVSSUNvbXBvbmVudChpbnB1dClcXHJcXG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0XFxyXFxuICAgICAgICB9XFxyXFxuICAgIH1cXHJcXG59XFxyXFxuXFxyXFxuLy8g6YWN572u6aG55bel5YW357G7XFxyXFxubGV0IENvbmZpZ1Rvb2wgPSB7XFxyXFxuICAgIGVuY1R5cGVMaXN0OiBbJ0Jhc2U2NCc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OLnN0cmluZ2lmeShjb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgcmVzdWx0ID09PSBcXFwic3RyaW5nXFxcIikge1xcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IGNvbmZpZztcXHJcXG4gICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgdGhyb3cgXFxcIuWvvOWHuuaVsOaNruS4jeWQiOazlVxcXCJcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIHN3aXRjaCAoZW5jVHlwZSkge1xcclxcbiAgICAgICAgICAgIGNhc2UgJ0Jhc2U2NCc6XFxyXFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGJhc2U2NEVuY29kZShyZXN1bHQpO1xcclxcbiAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgICAgICBjYXNlICdaaXBwZXInOlxcclxcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBaaXBUb29sLmNvbXByZXNzLmV4ZWMocmVzdWx0KVxcclxcbiAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgICAgICBkZWZhdWx0IDpcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGdldEFwcFZlcnNpb24oKSA+IDIwNzApIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHN5bWJvbCA9IFxcXCLpnZLosYblj6Pku6Tvv6VcXFwiICsgcmVtYXJrICsgXFxcIu+/pVxcXCIgKyBuYW1lXFxyXFxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBzaGFyZVBhc3RlKENvbmZpZ1Rvb2wuZXhwb3J0KG5hbWUsIGNvbmZpZywgcmVtYXJrLCAnWmlwcGVyJyksZW5jVHlwZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgJ1xcXFxuXFxcXG4nICsgc3ltYm9sXFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35pu05paw6KeG55WM54mI5pys6IezIEMyMDcwIOS7peS4iidcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgICAgIHJlc3VsdCA9IHN5bWJvbCArIHJlc3VsdFxcclxcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcXHJcXG4gICAgfSxcXHJcXG4gICAgaW1wb3J0OiAoY29uZmlnQ29tbWFuZCkgPT4ge1xcclxcbiAgICAgICAgbGV0IHJlc3VsdCA9ICcnXFxyXFxuICAgICAgICBpZiAoY29uZmlnQ29tbWFuZC5zdGFydHNXaXRoKCfkupEnKSkge1xcclxcbiAgICAgICAgICAgIGlmIChnZXRBcHBWZXJzaW9uKCkgPiAyMDcwKSB7XFxyXFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGNvbmZpZ0NvbW1hbmQuc3BsaXQoJ+mdkuixhicpWzBdLnJlcGxhY2UoL1xcXFxcXFxcbi8sICcnKVxcclxcbiAgICAgICAgICAgICAgICBjb25maWdDb21tYW5kID0gcGFyc2VQYXN0ZShyZXN1bHQpXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+abtOaWsOinhueVjOeJiOacrOiHsyBDMjA3MCDku6XkuIonXFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgdHJ5IHtcXHJcXG4gICAgICAgICAgICBsZXQgcmVzdWx0U3BsaXRzID0gY29uZmlnQ29tbWFuZC5zcGxpdChcXFwi77+lXFxcIilcXHJcXG4gICAgICAgICAgICBsZXQgZW5jVHlwZSA9IHJlc3VsdFNwbGl0c1szXVxcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdFNwbGl0c1s0XVxcclxcbiAgICAgICAgICAgIHN3aXRjaCAoZW5jVHlwZSkge1xcclxcbiAgICAgICAgICAgICAgICBjYXNlICdCYXNlNjQnOlxcclxcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gYmFzZTY0RGVjb2RlKHJlc3VsdCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXHJcXG4gICAgICAgICAgICAgICAgY2FzZSAnWmlwcGVyJzpcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IFppcFRvb2wuZGVjb21wcmVzcy5leGVjKHJlc3VsdClcXHJcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxyXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxyXFxuICAgICAgICAgICAgbG9nKGUubWVzc2FnZSlcXHJcXG4gICAgICAgICAgICB0aHJvdyBcXFwi5a+85YWl5pWw5o2u5LiN5ZCI5rOVXFxcIlxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcXHJcXG4gICAgfVxcclxcbn1cIn1dIiwiaWNvbiI6Imh0dHBzOi8vZ2l0Y29kZS5uZXQvcXFfNDE4NDY3NTYvaGlrZXIvLS9yYXcvbWFzdGVyL2ltZy/pnZLosYYucG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment